def create_guest(self, capacity_id, test, guest_object):
        """Turns an empty Reserve Capacity into a real Virtual Guest

        :param int capacity_id: ID of the RESERVED_CAPACITY_GROUP to create this guest into
        :param bool test: True will use verifyOrder, False will use placeOrder
        :param dictionary guest_object:  Below is the minimum info you need to send in
            guest_object = {
            'domain': 'test.com',
            'hostname': 'A1538172419',
            'os_code': 'UBUNTU_LATEST_64',
            'primary_disk': '25',
            }

        """

        vs_manager = VSManager(self.client)
        mask = "mask[instances[id, billingItem[id, item[id,keyName]]], backendRouter[id, datacenter[name]]]"
        capacity = self.get_object(capacity_id, mask=mask)
        try:
            capacity_flavor = capacity['instances'][0]['billingItem']['item']['keyName']
            flavor = _flavor_string(capacity_flavor, guest_object['primary_disk'])
        except KeyError:
            raise SoftLayer.SoftLayerError("Unable to find capacity Flavor.")

        guest_object['flavor'] = flavor
        guest_object['datacenter'] = capacity['backendRouter']['datacenter']['name']

        # Reserved capacity only supports SAN as of 20181008
        guest_object['local_disk'] = False
        template = vs_manager.verify_create_instance(**guest_object)
        template['reservedCapacityId'] = capacity_id
        if guest_object.get('ipv6'):
            ipv6_price = self.ordering_manager.get_price_id_list('PUBLIC_CLOUD_SERVER', ['1_IPV6_ADDRESS'])
            template['prices'].append({'id': ipv6_price[0]})

        if test:
            result = self.client.call('Product_Order', 'verifyOrder', template)
        else:
            result = self.client.call('Product_Order', 'placeOrder', template)

        return result
def create_guest ( self , capacity_id , test , guest_object ) : vs_manager = VSManager ( self . client ) mask = "mask[instances[id, billingItem[id, item[id,keyName]]], backendRouter[id, datacenter[name]]]" capacity = self . get_object ( capacity_id , mask = mask ) try : capacity_flavor = capacity [ 'instances' ] [ 0 ] [ 'billingItem' ] [ 'item' ] [ 'keyName' ] flavor = _flavor_string ( capacity_flavor , guest_object [ 'primary_disk' ] ) except KeyError : raise SoftLayer . SoftLayerError ( "Unable to find capacity Flavor." ) guest_object [ 'flavor' ] = flavor guest_object [ 'datacenter' ] = capacity [ 'backendRouter' ] [ 'datacenter' ] [ 'name' ] guest_object [ 'local_disk' ] = False template = vs_manager . verify_create_instance ( ** guest_object ) template [ 'reservedCapacityId' ] = capacity_id if guest_object . get ( 'ipv6' ) : ipv6_price = self . ordering_manager . get_price_id_list ( 'PUBLIC_CLOUD_SERVER' , [ '1_IPV6_ADDRESS' ] ) template [ 'prices' ] . append ( { 'id' : ipv6_price [ 0 ] } ) if test : result = self . client . call ( 'Product_Order' , 'verifyOrder' , template ) else : result = self . client . call ( 'Product_Order' , 'placeOrder' , template ) return result
Turns an empty Reserve Capacity into a real Virtual Guest

        :param int capacity_id: ID of the RESERVED_CAPACITY_GROUP to create this guest into
        :param bool test: True will use verifyOrder, False will use placeOrder
        :param dictionary guest_object:  Below is the minimum info you need to send in
            guest_object = {
            'domain': 'test.com',
            'hostname': 'A1538172419',
            'os_code': 'UBUNTU_LATEST_64',
            'primary_disk': '25',
            }