Package org.nimbustools.messaging.gt4_0_elastic.generated.v2010_08_31

Examples of org.nimbustools.messaging.gt4_0_elastic.generated.v2010_08_31.LaunchSpecificationResponseType


        final byte[] bytes = Base64.decode(publicKeyMaterial.getBytes());
        final String keyMaterial = new String(bytes);

        this.sshKeys.newKey(ownerID, keyName, keyMaterial, FAKE_FINGERPRINT);

        final ImportKeyPairResponseType resp =
                new ImportKeyPairResponseType(FAKE_FINGERPRINT, keyName, null);

        logger.info("SSH key registered, name='" + keyName +
                "', owner ID='" + ownerID + "'");

        return resp;
View Full Code Here


            throw new IllegalArgumentException("req may not be null");
        }

        final List<String> elasticIDs = new LinkedList<String>();

        final InstanceIdSetType tiitSet = req.getInstancesSet();
        if (tiitSet != null) {

            final InstanceIdType[] tiits = tiitSet.getItem();

            if (tiits == null || tiits.length == 0) {
                return EMPTY_STRING_ARRAY; // *** EARLY RETURN ***
            }

View Full Code Here

            if (tiits == null || tiits.length == 0) {
                return EMPTY_STRING_ARRAY; // *** EARLY RETURN ***
            }

            for (int i = 0; i < tiits.length; i++) {
                final InstanceIdType tiit = tiits[i];
                if (tiit != null) {
                    final String idUntrimmed = tiit.getInstanceId();
                    if (idUntrimmed != null) {
                        final String id = idUntrimmed.trim();
                        if (id != null && id.length() > 0) {
                            elasticIDs.add(id);
                        }
View Full Code Here

        final InstanceStateChangeType[] tirits =
                retList.toArray(
                            new InstanceStateChangeType[retList.size()]);

        final InstanceStateChangeSetType tirtSet =
                                new InstanceStateChangeSetType();
        tirtSet.setItem(tirits);
        final TerminateInstancesResponseType tirt =
                                new TerminateInstancesResponseType();
        tirt.setInstancesSet(tirtSet);
        return tirt;
    }
View Full Code Here

            if (currentStates[i] == null) {
                continue;
            }
           
            retList.add(
                    new InstanceStateChangeType(currentStates[i],
                                                elasticInstIDs[i],
                                                newStates[i]));
        }

View Full Code Here

                if (vm != null) {
                    final State state = vm.getState();
                    if (state != null) {
                        final String mgrState = state.getState();
                        final InstanceStateType ist = new InstanceStateType();
                        ist.setName(StateMap.managerStringToElasticString(mgrState));
                        ist.setCode(StateMap.managerStringToElasticInt(mgrState));
                        currentStates[i] = ist;
                    }
                }

            } catch (DoesNotExistException e) {
                currentStates[i] = null;
            } catch (ManageException e) {
                currentStates[i] = null;
                logger.error(e.getMessage());
            }
        }

        for (int i = 0; i < managerInstances.length; i++) {

            if (currentStates[i] == null) {
                continue;
            }

            final String mgrID = managerInstances[i];
            try {
                manager.trash(mgrID, Manager.INSTANCE, caller);
            } catch (DoesNotExistException e) {
                // do nothing, already accomplished
            } catch (ManageException e) {
                if (logger.isDebugEnabled()) {
                    logger.error(e.getMessage(), e);
                } else {
                    logger.error(e.getMessage());
                }
            }
        }


        final InstanceStateType terminated = new InstanceStateType();
        terminated.setCode(StateMap.STATE_TERMINATED.intValue());
        terminated.setName(StateMap.STATE_TERMINATED_STR);

        final InstanceStateType[] newStates =
                        new InstanceStateType[managerInstances.length];

        for (int i = 0; i < managerInstances.length; i++) {

            if (currentStates[i] == null) {
                continue;
            }

            final String mgrInstanceID = managerInstances[i];

            try {
                final VM vm = manager.getInstance(mgrInstanceID);

                if (vm != null) {
                    final State state = vm.getState();
                    if (state != null) {
                        final String mgrState = state.getState();
                        final InstanceStateType ist = new InstanceStateType();
                        ist.setName(StateMap.managerStringToElasticString(mgrState));
                        ist.setCode(StateMap.managerStringToElasticInt(mgrState));
                        newStates[i] = ist;
                    }
                }

            } catch (DoesNotExistException e) {
View Full Code Here

            ArrayList<InstanceTypeSetItemType> itsit = new ArrayList<InstanceTypeSetItemType>();           
           
            for (Entry<String,List<String>> entrySet : form.entrySet()) {
                List<String> instanceType = entrySet.getValue();
                if(entrySet.getKey().startsWith(INSTANCE_TYPE_VAR) && instanceType.size() == 1) {
                    InstanceTypeSetItemType instType = new InstanceTypeSetItemType();
                    instType.setInstanceType(instanceType.get(0));
                    itsit.add(instType);                  
                }
            }
           
            InstanceTypeSetType instanceTypeSet = new InstanceTypeSetType();
View Full Code Here

                    instType.setInstanceType(instanceType.get(0));
                    itsit.add(instType);                  
                }
            }
           
            InstanceTypeSetType instanceTypeSet = new InstanceTypeSetType();
            instanceTypeSet.setItem(itsit.toArray(new InstanceTypeSetItemType[0]));
           
            request.setInstanceTypeSet(instanceTypeSet);
        }

        try {
View Full Code Here

        // only including parameters that are actually used right now

        assureRequiredParameter("LaunchSpecification.ImageId", imageId);
        assureRequiredParameter("SpotPrice", spotPrice);       
       
        final LaunchSpecificationRequestType launchSpec = new LaunchSpecificationRequestType();
       
        launchSpec.setImageId(imageId);
        launchSpec.setKeyName(keyName);
        if (userData != null) {
            final UserDataType data = new UserDataType();
            data.setData(userData);
            launchSpec.setUserData(data);
        }
        launchSpec.setInstanceType(instanceType);

        final RequestSpotInstancesType request = new RequestSpotInstancesType();
        request.setInstanceCount(new BigInteger(instanceCount));
        request.setSpotPrice(spotPrice);
        request.setLaunchSpecification(launchSpec);
View Full Code Here

                instID = this.ids.newInstanceID(vmId, resID, result.getSshKeyName());
            }
            logger.info("id-" + vmId + "='" + instID + "'.");                  
        }
       
        LaunchSpecificationResponseType launchSpec = getLaunchSpec(result);
        String type = result.isPersistent()? PERSISTENT : ONE_TIME;
       
        SpotInstanceRequestSetItemType sirsi = new SpotInstanceRequestSetItemType();

        sirsi.setLaunchSpecification(launchSpec);
View Full Code Here

TOP

Related Classes of org.nimbustools.messaging.gt4_0_elastic.generated.v2010_08_31.LaunchSpecificationResponseType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.