Class | Fog::Compute::IBM::Real

In:

lib/fog/ibm/compute.rb
lib/fog/ibm/requests/compute/clone_image.rb
lib/fog/ibm/requests/compute/create_address.rb
lib/fog/ibm/requests/compute/create_image.rb
lib/fog/ibm/requests/compute/create_instance.rb
lib/fog/ibm/requests/compute/create_key.rb
lib/fog/ibm/requests/compute/delete_address.rb
lib/fog/ibm/requests/compute/delete_image.rb
lib/fog/ibm/requests/compute/delete_instance.rb
lib/fog/ibm/requests/compute/delete_key.rb
lib/fog/ibm/requests/compute/get_image.rb
lib/fog/ibm/requests/compute/get_image_agreement.rb
lib/fog/ibm/requests/compute/get_image_manifest.rb
lib/fog/ibm/requests/compute/get_instance.rb
lib/fog/ibm/requests/compute/get_instance_logs.rb
lib/fog/ibm/requests/compute/get_key.rb
lib/fog/ibm/requests/compute/get_location.rb
lib/fog/ibm/requests/compute/get_request.rb
lib/fog/ibm/requests/compute/list_address_offerings.rb
lib/fog/ibm/requests/compute/list_addresses.rb
lib/fog/ibm/requests/compute/list_images.rb
lib/fog/ibm/requests/compute/list_instances.rb
lib/fog/ibm/requests/compute/list_keys.rb
lib/fog/ibm/requests/compute/list_locations.rb
lib/fog/ibm/requests/compute/list_vlans.rb
lib/fog/ibm/requests/compute/modify_instance.rb
lib/fog/ibm/requests/compute/modify_key.rb

Parent: | Object

### Methods

clone_image create_address create_image create_instance create_key delete_address delete_image delete_instance delete_key get_image get_image_agreement get_image_manifest get_instance get_instance_logs get_key get_location get_request list_address_offerings list_addresses list_images list_instances list_keys list_locations list_vlans modify_instance modify_key new

### Public Class methods

new(options={})

### Public Instance methods

clone_image(image_id, name, description)

Clones image specified by image_id

#### Parameters

- image_id<~String> - id of image to be cloned
- name<~String> - name of new image
- description<~String> - description of new image

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘ImageID’<~String>: id of new image

create_address(location, offering_id, options={})

Requests a new static IP address to be created

#### Parameters

- location_id<~String> - id of location
- offering_id<~String> - id for offering
- vlan_id<~String> - id of vlan

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘location’<~String>: location of new address
    - ‘offeringId’<~String>: offering id of new address
    - ‘id’<~String>: id
    - ‘ip’<~String>: returns string of spaces (ip not yet allocated right after creation)
    - ‘state’<~Integer>: status of address (0 when new)

create_image(instance_id, name, description)

Requests an image to be created from an Instance

#### Parameters

- instance_id<~String> - id of instance to save
- name<~String> - name of image to be created
- description<~String> - description of image to be created

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘name’<~String>: name of new image
    - ‘createdTime’<~Integer>: epoch time at creation
    - ‘productCodes’<~Array>:
    - ‘id’<~String>: id of new image
    - ‘description’<~String>: description
    - ‘visibility’<~String>: visibility level ("PRIVATE", etc)
    - ‘state’<~Integer>: status of image

create_instance(name, image_id, instance_type, location, options={})

Requests a new Instance to be created.

#### Parameters

- name<~String> - The alias to use to reference this instance
- image_id<~String> - The id of the image to create this instance from
- instance_type<~String> - The instance type to use for this instance
- location<~String> - The id of the Location where this instance will be created
- options<~Hash>:
  - :key_name<~String> - The public key to use for accessing the created instance
  - :ip<~String> - The ID of a static IP address to associate with this instance
  - :volume_id<~String> - The ID of a storage volume to associate with this instance
  - :vlan_id<~String> - The ID of a Vlan offering to associate with this instance.
  - :secondary_ip<~String> - The ID of a static IP address to associate with this instance as secondary IP
  - :is_mini_ephermal<~Boolean> - Whether or not the instance should be provisioned with the root segment only
  - :configuration_data<~Hash> - Arbitrary name/value pairs defined by the image being created
  - :anti_collocation_instance<~String> - The ID of an existing anti-collocated instance.

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘name’<~String>: instance name
    - ‘location’<~String>: instance location id
    - ‘keyName’<~String>: instance assigned keypair
    - ‘primaryIP’<~Hash>: assigned ip address, type, and hostname
    - ‘productCodes’<~Array>: associated product codes
    - ‘requestId’<~String>:
    - ‘imageId’<~String>:
    - ‘launchTime’<~Integer>: epoch time in ms representing when the instance was launched

create_key(name, public_key=nil)

Requests a new keypair to be created

#### Parameters

- name<~String> - name to give new key

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘keyName’<~String>: name of new key
    - ‘lastModifiedTime’<~Integer>: epoch time of last modification
    - ‘default’<~Bool>: is default?
    - ‘instanceIds’<~Array>: id‘s of instances using key (should be empty upon creation)
    - ‘keyMaterial’<~String>: private key contents

delete_address(address_id)

Deletes the Address that the authenticated user manages with the specified :address_id

#### Parameters

- address_id<~String> - Id of address

#### Returns

- response<~Excon::Response>:
  - body<~Hash>: *’success’<~Bool>: true or false for success

delete_image(image_id)

Deletes the image that the authenticated user manages with the specified :image_id

#### Parameters

- image_id<~String> - Id of image

#### Returns

- response<~Excon::Response>:
  - body<~Hash>: *’success’<~Bool>: true or false for success

delete_instance(instance_id)

Deletes the Instance that the authenticated user manages with the specified :instance_id

#### Parameters

- instance_id<~String> - Id of instance

#### Returns

- response<~Excon::Response>:
  - body<~Hash>: *’success’<~Bool>: true or false for success

delete_key(key_name)

Deletes the key specified with key_name

#### Parameters

- key_name<~String> - name of key to be deleted

#### Returns

- response<~Excon::Response>:
  - body<~Hash>: *’success’<~Bool>: true or false for success

get_image(image_id)

Returns details of image specified by id

#### Parameters

‘image_id’<~String>: id of desired image

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘name’<~String>: image name
    - ‘location’<~String>: instance location id
    - ‘createdTime’<~Integer>: time created in epoch time
    - ‘supportedInstanceTypes’<~Array>: list of prices per image
      - ‘pricePerQuantity’<~Integer>:
      - ‘effectiveDate’<~Fixnum>:
      - ‘rate’<~Float>: price per unit
      - ‘countryCode’<~String>:
      - ‘unitOfMeasure’<~String>: unit of measurement
      - ‘currencyCode’<~String>: currency billed in
    - ‘productCodes’<~Array>:
    - ‘id’<~String>:
    - ‘documentation’<~String>: link to documentation for image
    - ‘manifest’<~String>: link to xml manifest file
    - ‘description’<~String>: text description of image
    - ‘visibility’<~String>: status of visibilty of image. known values so far are "PUBLIC" and "PRIVATE"
    - ‘platform’<~String>: operating system
    - ‘architecture’<~String>: architecture supported by image
    - ‘documentation’<~String>: link to documentation for image
    - ‘owner’<~String>: owner of image
    - ‘state’<~Integer>: state of availability of image

get_image_agreement(image_id)

Returns license agreement of image specified by id

#### Parameters

‘image_id’<~String>: id of desired image

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘text’<~String>: text of license
    - ‘id’<~String>: id of image
    - ‘attachments’<~Array>: Additional agreements attached to image
      - ‘label’<~String>: description of attachment
      - ‘url’<~String>: url to retrieve attachment
      - ‘type’<~Integer>: type of attachment

get_image_manifest(image_id)

Returns manifest of image specified by id

#### Parameters

‘image_id’<~String>: id of desired image

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘manifest’<~String>: manifest of image in xml

get_instance(instance_id)

Returns the Instance that the authenticated user manages with the specified :instance_id

#### Parameters

- instance_id<~String> - Id of instance

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘name’<~String>: instance name
    - ‘location’<~String>: instance location id
    - ‘keyName’<~String>: instance assigned keypair
    - ‘primaryIP’<~Hash>: assigned ip address, type, and hostname
    - ‘productCodes’<~Array>: associated product codes
    - ‘requestId’<~String>:
    - ‘imageId’<~String>:
    - ‘launchTime’<~Integer>: UNIX time integer representing when the instance was launched
    - ‘id’<~String>: instance id
    - ‘volumes’<~Array>:
    - ‘isMiniEphemeral’<~Boolean>: minimal local storage
    - ‘instanceType’<~String>: instance type
    - ‘diskSize’<~String>: instance disk size
    - ‘requestName’<~String>: instance request name
    - ‘secondaryIP’<~Array>: additional IP Addresses associated with this instance
    - ‘status’<~Integer>: instance status flag
    - ‘software’<~Array>: Software associated with this instance
      - ‘application’<~Hash>: Application name, type, and version (primarily OS information)
    - ‘expirationTime’<~Integer>: UNIX timestamp representing when the instance expires
    - ‘owner’<~String>: instance owner

get_instance_logs(instance_id, start_index=nil)

Get an instance‘s logs

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - logs<~Array>:

TODO: docs

get_key(key_name)

Returns details of key by name specified

#### Parameters

‘key_name’<~String>: name of key to request

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘keyName’<~String>: Name of key
    - ‘lastModifiedTime’<~Integer>: epoch time of last modification
    - ‘default’<~Bool>: bool if key is default for user
    - ‘instanceIds’<~Array>: list of instances associated with key
    - ‘keyMaterial’<~String>: public key

get_location(location_id)

Get a location

#### Parameters

- location_id<~String> - Id of location

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘name’<~String>: location name
    - ‘location’<~String>:
    - ‘capabilities’<~Array>:
      - ‘oss.storage.format’<~Hash>:
        - ‘entries’<~Array>: list of supported volume formats
        - ‘oss.instance.spec.i386’<~Array>: unsure.. returns empty array
        - ‘oss.instance.spec.x86_64’<~Array>: unsure.. returns empty array
        - ‘oss.storage.availabilityarea’<~Array>: availability area unsupported
    - ‘id’<~String>: id of location
    - ‘description’<~String>: description including geographic location
    - ‘state’<~String>: state of datacenter

get_request(request_id)

Returns list of instances created with request specified by request_id

#### Parameters

- request_id<~String> - Id of request

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
  - instances<~Array>: array of instances created with request
    - ‘name’<~String>: instance name
    - ‘location’<~String>: instance location id
    - ‘keyName’<~String>: instance assigned keypair
    - ‘primaryIP’<~Hash>: assigned ip address, type, and hostname
    - ‘productCodes’<~Array>: associated product codes
    - ‘requestId’<~String>:
    - ‘imageId’<~String>:
    - ‘launchTime’<~Integer>: UNIX time integer representing when the instance was launched
    - ‘id’<~String>: instance id
    - ‘volumes’<~Array>:
    - ‘isMiniEphemeral’<~Boolean>: minimal local storage
    - ‘instanceType’<~String>: instance type
    - ‘diskSize’<~String>: instance disk size
    - ‘requestName’<~String>: instance request name
    - ‘secondaryIP’<~Array>: additional IP Addresses associated with this instance
    - ‘status’<~Integer>: instance status flag
    - ‘software’<~Array>: Software associated with this instance
      - ‘application’<~Hash>: Application name, type, and version (primarily OS information)
    - ‘expirationTime’<~Integer>: UNIX timestamp representing when the instance expires
    - ‘owner’<~String>: instance owner

list_address_offerings()

Returns the offerings of static address types/pricing for the authenticated user

#### Parameters

No parameters

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘addresses’<~Array>: list of address offerings
      - ‘price’<~Hash>: pricing info for specific address offering
      - ‘price’<~Hash>: hash containing pricing information
        - ‘pricePerQuantity’<~Integer>:
        - ‘effectiveDate’<~Integer>: starting date price is effective
        - ‘rate’<~Float>: rate per unit
        - ‘countryCode’<~String>:
        - ‘unitOfMeasure’<~String>:
        - ‘currencyCode’<~String>: currency used
      - ‘location’<~String>: datacenter location string
      - ‘ipType’<~Integer>: type of ip address
      - ‘id’<~String>: id of offering

list_addresses()

Returns the list of static IP addresses for current user

#### Parameters

No parameters

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘addresses’<~Array>: list of addresses
      - ‘location’<~String>: location of address
      - ‘mode’<~Integer>:
      - ‘offeringId’<~String>: offering ID
      - ‘id’<~String>: id
      - ‘type’<~Integer>: TODO unsure
      - ‘ip’<~String>: IP address.. with space at the end
      - ‘hostname’<~String>: seems to be same as ip
      - ‘state’<~Integer>: state of address

list_images()

Returns the list of Images available to be provisioned on the IBM DeveloperCloud.

#### Parameters

No parameters

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘images’<~Array>: list of images
      - ‘name’<~String>: image name
      - ‘location’<~String>: instance location id
      - ‘createdTime’<~Integer>: time created in epoch time
      - ‘supportedInstanceTypes’<~Array>: list of prices per image
        - ‘pricePerQuantity’<~Integer>:
        - ‘effectiveDate’<~Fixnum>:
        - ‘rate’<~Float>: price per unit
        - ‘countryCode’<~String>:
        - ‘unitOfMeasure’<~String>: unit of measurement
        - ‘currencyCode’<~String>: currency billed in
      - ‘productCodes’<~Array>:
      - ‘id’<~String>:
      - ‘documentation’<~String>: link to documentation for image
      - ‘manifest’<~String>: link to xml manifest file
      - ‘description’<~String>: text description of image
      - ‘visibility’<~String>: status of visibilty of image. known values so far are "PUBLIC" and "PRIVATE"
      - ‘platform’<~String>: operating system
      - ‘architecture’<~String>: architecture supported by image
      - ‘documentation’<~String>: link to documentation for image
      - ‘owner’<~String>: owner of image
      - ‘state’<~Integer>: state of availability of image

list_instances()

Returns list of instances that the authenticated user manages.

#### Parameters

No parameters

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘instances’<~Array>: list of instances
      - ‘name’<~String>: instance name
      - ‘location’<~String>: instance location id
      - ‘keyName’<~String>: instance assigned keypair
      - ‘primaryIP’<~Hash>: assigned ip address, type, and hostname
      - ‘productCodes’<~Array>: associated product codes
      - ‘requestId’<~String>:
      - ‘imageId’<~String>:
      - ‘launchTime’<~Integer>: UNIX time integer representing when the instance was launched
      - ‘id’<~String>: instance id
      - ‘volumes’<~Array>:
      - ‘isMiniEphemeral’<~Boolean>: minimal local storage
      - ‘instanceType’<~String>: instance type
      - ‘diskSize’<~String>: instance disk size
      - ‘requestName’<~String>: instance request name
      - ‘secondaryIP’<~Array>: additional IP Addresses associated with this instance
      - ‘status’<~Integer>: instance status flag
      - ‘software’<~Array>: Software associated with this instance
        - ‘application’<~Hash>: Application name, type, and version (primarily OS information)
      - ‘expirationTime’<~Integer>: UNIX timestamp representing when the instance expires
      - ‘owner’<~String>: instance owner

list_keys()

Returns list of instances that the authenticated user manages.

#### Parameters

No parameters

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘instances’<~Array>: list of instances
      - ‘name’<~String>: instance name
      - ‘location’<~String>: instance location id
      - ‘keyName’<~String>: instance assigned keypair
      - ‘primaryIP’<~Hash>: assigned ip address, type, and hostname
      - ‘productCodes’<~Array>: associated product codes
      - ‘requestId’<~String>:
      - ‘imageId’<~String>:
      - ‘launchTime’<~Integer>: UNIX time integer representing when the instance was launched
      - ‘id’<~String>: instance id
      - ‘volumes’<~Array>:
      - ‘isMiniEphemeral’<~Boolean>: minimal local storage
      - ‘instanceType’<~String>: instance type
      - ‘diskSize’<~String>: instance disk size
      - ‘requestName’<~String>: instance request name
      - ‘secondaryIP’<~Array>: additional IP Addresses associated with this instance
      - ‘status’<~Integer>: instance status flag
      - ‘software’<~Array>: Software associated with this instance
        - ‘application’<~Hash>: Application name, type, and version (primarily OS information)
      - ‘expirationTime’<~Integer>: UNIX timestamp representing when the instance expires
      - ‘owner’<~String>: instance owner

list_locations()

Returns the list of Images available to be provisioned on the IBM DeveloperCloud.

#### Parameters

No parameters

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘locations’<~Array>: list of locations

list_vlans()

Returns the vlan offerings for user

#### Parameters

No parameters

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘addresses’<~Array>: list of addresses
      - ‘location’<~String>: location of address
      - ‘mode’<~Integer>:
      - ‘offeringId’<~String>: offering ID
      - ‘id’<~String>: id
      - ‘type’<~Integer>: TODO unsure
      - ‘ip’<~String>: IP address.. with space at the end
      - ‘hostname’<~String>: seems to be same as ip
      - ‘state’<~Integer>: state of address

modify_instance(instance_id, options={})

Modify an instance

#### Parameters

- instance_id<~String> - id of instance to rename
- params<~Hash> - depends on type of request

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘success’<~Bool>:

OR

- response<~Excon::Response>:
  - body<~Hash>: ????
    - ‘expirationTime’<~Integer>: new expiration time of instance (epoch)

     Note: The feature of dynamically attaching or detaching storage is only
     supported by data centers where the KVM host version is RHEL 6.1. If the
     feature is not supported by the data center, you will get an exception like
     "Unsupported exception. Dynamic features are not supported on the KVM
     Host".

modify_key(key_name, params={})

Modify a key

#### Parameters

- key_name<~String> - name of key to be modified
- params<~Hash> - depends on type of request

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘success’<~Bool>: success status of update request

[Validate]