Class | Fog::Compute::HP::Real

In:

lib/fog/hp/compute.rb
lib/fog/hp/requests/compute/allocate_address.rb
lib/fog/hp/requests/compute/associate_address.rb
lib/fog/hp/requests/compute/change_password_server.rb
lib/fog/hp/requests/compute/confirm_resized_server.rb
lib/fog/hp/requests/compute/create_image.rb
lib/fog/hp/requests/compute/create_key_pair.rb
lib/fog/hp/requests/compute/create_security_group.rb
lib/fog/hp/requests/compute/create_security_group_rule.rb
lib/fog/hp/requests/compute/create_server.rb
lib/fog/hp/requests/compute/delete_image.rb
lib/fog/hp/requests/compute/delete_key_pair.rb
lib/fog/hp/requests/compute/delete_security_group.rb
lib/fog/hp/requests/compute/delete_security_group_rule.rb
lib/fog/hp/requests/compute/delete_server.rb
lib/fog/hp/requests/compute/disassociate_address.rb
lib/fog/hp/requests/compute/get_address.rb
lib/fog/hp/requests/compute/get_flavor_details.rb
lib/fog/hp/requests/compute/get_image_details.rb
lib/fog/hp/requests/compute/get_security_group.rb
lib/fog/hp/requests/compute/get_server_details.rb
lib/fog/hp/requests/compute/list_addresses.rb
lib/fog/hp/requests/compute/list_flavors.rb
lib/fog/hp/requests/compute/list_flavors_detail.rb
lib/fog/hp/requests/compute/list_images.rb
lib/fog/hp/requests/compute/list_images_detail.rb
lib/fog/hp/requests/compute/list_key_pairs.rb
lib/fog/hp/requests/compute/list_security_groups.rb
lib/fog/hp/requests/compute/list_server_addresses.rb
lib/fog/hp/requests/compute/list_server_private_addresses.rb
lib/fog/hp/requests/compute/list_server_public_addresses.rb
lib/fog/hp/requests/compute/list_servers.rb
lib/fog/hp/requests/compute/list_servers_detail.rb
lib/fog/hp/requests/compute/reboot_server.rb
lib/fog/hp/requests/compute/rebuild_server.rb
lib/fog/hp/requests/compute/release_address.rb
lib/fog/hp/requests/compute/resize_server.rb
lib/fog/hp/requests/compute/revert_resized_server.rb
lib/fog/hp/requests/compute/server_action.rb
lib/fog/hp/requests/compute/update_server.rb

Parent: | Object

### Methods

allocate_address associate_address change_password_server confirm_resized_server create_image create_key_pair create_security_group create_security_group_rule create_server delete_image delete_key_pair delete_security_group delete_security_group_rule delete_server disassociate_address get_address get_flavor_details get_image_details get_security_group get_server_details list_addresses list_flavors list_flavors_detail list_images list_images_detail list_key_pairs list_security_groups list_server_addresses list_server_private_addresses list_server_public_addresses list_servers list_servers_detail new reboot_server rebuild_server release_address reload request resize_server revert_resized_server server_action update_server

### Public Class methods

new(options={})

### Public Instance methods

allocate_address()

Acquires a floating IP address

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘floating_ip’<~Hash> -
      - ‘id’<~Integer> - Id of the address
      - ‘ip’<~String> - Floating IP of the address
      - ‘instance_id’<~String> - Id of the associated server instance
      - ‘fixed_ip’<~String> - Fixed IP of the address

associate_address(server_id, ip_address)

Associate a floating IP address with existing server

#### Parameters

- server_id<~Integer> - Id of server to associate IP with
- ip_address<~String> - IP address to associate with the server

change_password_server(server_id, admin_password)
confirm_resized_server(server_id)

Confirm resizing

#### Parameters

- server_id<~Integer> - Id of server to confirm

create_image(server_id, name, metadata = {})

Create an image from an existing server

#### Parameters

- server_id<~Integer> - Id of server to create image from
- name<~String> - Name of the image
- metadata<~Hash> - A hash of metadata options
  - ‘ImageType’<~String> - type of the image i.e. Gold
  - ‘ImageVersion’<~String> - version of the image i.e. 2.0

#### Returns

Does not return a response body.

create_key_pair(key_name, public_key = nil)

Create a new keypair

#### Parameters

- key_name<~String> - Name of the keypair
- public_key<~String> - The public key for the keypair

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘keypair’<~Hash> - The keypair data
      - ‘public_key’<~String> - The public key for the keypair
      - ‘private_key’<~String> - The private key for the keypair
      - ‘user_id’<~String> - The user id
      - ‘fingerprint’<~String> - SHA-1 digest of DER encoded private key
      - ‘name’<~String> - Name of key

Openstack API Reference

create_security_group(name, description)

Create a new security group

#### Parameters

- ‘name’<~String> - name of the security group
- ‘description’<~String> - description of the security group

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
  - ‘security_group’<~Array>:
    - ‘rules’<~Array>: - array of security group rules
      - ‘id’<~Integer> - id of the security group rule
      - ‘from_port’<~Integer> - start port for rule i.e. 22 (or -1 for ICMP wildcard)
      - ‘to_port’<~Integer> - end port for rule i.e. 22 (or -1 for ICMP wildcard)
      - ‘ip_protocol’<~String> - ip protocol for rule, must be in [‘tcp’, ‘udp’, ‘icmp’]
      - ‘group’<~Hash>:

             * Undefined

      - ‘parent_group_id’<~Integer> - parent group id
      - ‘ip_range’<~Hash>:
        - ‘cidr’<~String> - ip range address i.e. ‘0.0.0.0/0‘
    - ‘id’<~Integer> - id of the security group
    - ‘name’<~String> - name of the security group
    - ‘description’<~String> - description of the security group
    - ‘tenant_id’<~String> - tenant id of the user

Openstack API Reference

create_security_group_rule(parent_group_id, ip_protocol, from_port, to_port, cidr, group_id=nil)

Create a new security group rule and attach it to a security group

#### Parameters

      * 'parent_group_id'<~Integer> - id of the parent security group
      * 'ip_protocol'<~String> - ip protocol for rule, must be in ['tcp', 'udp', 'icmp']
      * 'from_port'<~Integer> - start port for rule i.e. 22 (or -1 for ICMP wildcard)
      * 'to_port'<~Integer> - end port for rule i.e. 22 (or -1 for ICMP wildcard)
      * 'cidr'<~String> - ip range address i.e. '0.0.0.0/0'
      * 'group_id'<~Integer> - id of the security group to which this rule applies

#### Returns

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

Openstack API Reference

create_server(name, flavor_id, image_id, options = {})

Create a new server

#### Parameters

- name<~String> - Name of server
- flavor_id<~Integer> - Id of flavor for server
- image_id<~Integer> - Id of image for server
- options<~Hash>:
  - ‘metadata’<~Hash> - Up to 5 key value pairs containing 255 bytes of info
  - ‘min_count’<~Integer> - Number of servers to create. Defaults to 1.
  - ‘max_count’<~Integer> - Max. number of servers to create. Defaults to being equal to min_count.
  - ‘key_name’<~String> - Name of keypair to be used
  - ‘security_groups’<~Array> - one or more security groups to be used
  - ‘availability_zone’<~String> - the availability zone to be used
  - ‘personality’<~Array>: Up to 5 files to customize server
    - file<~Hash>:
      - ‘contents’<~String> - Contents of file (10kb total of contents)
      - ‘path’<~String> - Path to file (255 bytes total of path strings)
  - ‘accessIPv4’<~String> - IPv4 IP address
  - ‘accessIPv6’<~String> - IPv6 IP address

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
  - ‘server’<~Hash>:
    - ‘addresses’<~Hash>:
      - ‘public’<~Array> - public address strings
      - ‘private’<~Array> - private address strings
    - ‘adminPass’<~String> - Admin password for server
    - ‘flavorId’<~Integer> - Id of servers current flavor
    - ‘hostId’<~String>
    - ‘id’<~Integer> - Id of server
    - ‘imageId’<~Integer> - Id of image used to boot server
    - ‘metadata’<~Hash> - metadata
    - ‘name’<~String> - Name of server
    - ‘progress’<~Integer> - Progress through current status
    - ‘status’<~String> - Current server status

delete_image(image_id)

Delete an image

#### Parameters

- image_id<~Integer> - Id of image to delete

delete_key_pair(key_name)

Delete a keypair

#### Parameters

- key_name<~String> - Name of the keypair to delete

delete_security_group(security_group_id)

Delete a security group

#### Parameters

- id<~Integer> - Id of the security group to delete

Openstack API Reference

delete_security_group_rule(security_group_rule_id)

Delete a security group rule

#### Parameters

- id<~Integer> - id of the security group rule to delete

Openstack API Reference

delete_server(server_id)

Delete an existing server

#### Parameters

- id<~Integer> - Id of server to delete

disassociate_address(server_id, ip_address)

Disassociate a floating IP address with existing server

#### Parameters

- server_id<~Integer> - Id of server to associate IP with
- ip_address<~String> - IP address to associate with the server

get_address(address_id)

Get details about an existing floating IP address

#### Parameters

- ‘address_id’<~Integer> - Id of floating IP address get details for

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘floating_ip’<~Hash> -
      - ‘id’<~Integer> - Id of the address
      - ‘ip’<~String> - Floating IP of the address
      - ‘instance_id’<~String> - Id of the associated server instance
      - ‘fixed_ip’<~String> - Fixed IP of the address

get_flavor_details(flavor_id)

Get details for flavor by id

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘id’<~Integer> - Id of the flavor
    - ‘name’<~String> - Name of the flavor
    - ‘ram’<~Integer> - Amount of ram for the flavor
    - ‘disk’<~Integer> - Amount of diskspace for the flavor

get_image_details(image_id)

Get details for image by id

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘id’<~Integer> - Id of the image
    - ‘name’<~String> - Name of the image
    - ‘serverId’<~Integer> - Id of server image was created from
    - ‘status’<~Integer> - Status of image
    - ‘updated’<~String> - Timestamp of last update

get_security_group(security_group_id)

Get details about a security group

#### Parameters

- ‘security_group_id’<~Integer> - Id of security group to get details for

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
  - ‘security_group’<~Array>:
    - ‘rules’<~Array>: - array of security group rules
      - ‘id’<~Integer> - id of the security group rule
      - ‘from_port’<~Integer> - start port for rule i.e. 22 (or -1 for ICMP wildcard)
      - ‘to_port’<~Integer> - end port for rule i.e. 22 (or -1 for ICMP wildcard)
      - ‘ip_protocol’<~String> - ip protocol for rule, must be in [‘tcp’, ‘udp’, ‘icmp’]
      - ‘group’<~Hash>:

             * Undefined

      - ‘parent_group_id’<~Integer> - parent group id
      - ‘ip_range’<~Hash>:
        - ‘cidr’<~String> - ip range address i.e. ‘0.0.0.0/0‘
    - ‘id’<~Integer> - id of the security group
    - ‘name’<~String> - name of the security group
    - ‘description’<~String> - description of the security group
    - ‘tenant_id’<~String> - tenant id of the user

Openstack API Reference

get_server_details(server_id)

Get details about a server

#### Parameters

- server_id<~Integer> - Id of server to get details for

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
  - ‘server’<~Hash>:
    - ‘addresses’<~Hash>:
      - ‘public’<~Array> - public address strings
      - ‘private’<~Array> - private address strings
    - ‘flavorId’<~Integer> - Id of servers current flavor
    - ‘hostId’<~String>
    - ‘id’<~Integer> - Id of server
    - ‘imageId’<~Integer> - Id of image used to boot server
    - ‘metadata’<~Hash> - metadata
    - ‘name<~String> - Name of server
    - ‘progress’<~Integer> - Progress through current status
    - ‘status’<~String> - Current server status

list_addresses()

List all floating IP addresses

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘floating_ips’<~Array> -
      - ‘id’<~Integer> - Id of the address
      - ‘ip’<~String> - Floating IP of the address
      - ‘instance_id’<~String> - Id of the associated server instance
      - ‘fixed_ip’<~String> - Fixed IP of the address

list_flavors()

List all flavors (IDs and names only)

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘id’<~Integer> - Id of the flavor
    - ‘name’<~String> - Name of the flavor

list_flavors_detail()

List all flavors

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘id’<~Integer> - Id of the flavor
    - ‘name’<~String> - Name of the flavor
    - ‘ram’<~Integer> - Amount of ram for the flavor
    - ‘disk’<~Integer> - Amount of diskspace for the flavor

list_images()

List all images (IDs and names only)

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘id’<~Integer> - Id of the image
    - ‘name’<~String> - Name of the image

list_images_detail()

List all images

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘id’<~Integer> - Id of the image
    - ‘name’<~String> - Name of the image
    - ‘updated’<~String> - Last update timestamp for image
    - ‘created’<~String> - Creation timestamp for image
    - ‘status’<~String> - Status of image

list_key_pairs()

List all key pairs

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘keypairs’<~Array>:
      - ‘keypair’<~Hash>:
        - ‘public_key’<~String> - Public portion of the key
        - ‘name’<~String> - Name of the key
        - ‘fingerprint’<~String> - Fingerprint of the key

Openstack API Reference

list_security_groups()

List all security groups

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
  - ‘security_groups’<~Array>:
    - ‘rules’<~Array>: - array of security group rules
      - ‘id’<~Integer> - id of the security group rule
      - ‘from_port’<~Integer> - start port for rule i.e. 22 (or -1 for ICMP wildcard)
      - ‘to_port’<~Integer> - end port for rule i.e. 22 (or -1 for ICMP wildcard)
      - ‘ip_protocol’<~String> - ip protocol for rule, must be in [‘tcp’, ‘udp’, ‘icmp’]
      - ‘group’<~Hash>:

             * Undefined

      - ‘parent_group_id’<~Integer> - parent group id
      - ‘ip_range’<~Hash>:
        - ‘cidr’<~String> - ip range address i.e. ‘0.0.0.0/0‘
    - ‘id’<~Integer> - id of the security group
    - ‘name’<~String> - name of the security group
    - ‘description’<~String> - description of the security group
    - ‘tenant_id’<~String> - tenant id of the user

Openstack API Reference

list_server_addresses(server_id)

List all server addresses

#### Parameters

- server_id<~Integer> - Id of server to list addresses for

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
  - ‘addresses’<~Hash>:
    - ‘novanet_7’:<~Array> - The network name can change based on setup

list_server_private_addresses(server_id, network_name)

List private server addresses

#### Parameters

- server_id<~Integer> - Id of server to list addresses for
- network_name<~String> - The name of the network name i.e. public, private or custom name

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘private’<~Array> - Private ip addresses

list_server_public_addresses(server_id, network_name)

List public server addresses

#### Parameters

- server_id<~Integer> - Id of server to list addresses for
- network_name<~String> - The name of the network name i.e. public, private or custom name

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘public’<~Array> - Public ip addresses

list_servers()

List all servers (IDs and names only)

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
  - ‘servers’<~Array>:
    - ‘id’<~Integer> - Id of server
    - ‘name<~String> - Name of server

list_servers_detail()

List all servers details

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
  - ‘servers’<~Array>:
    - ‘id’<~Integer> - Id of server
    - ‘name<~String> - Name of server
    - ‘imageId’<~Integer> - Id of image used to boot server
    - ‘flavorId’<~Integer> - Id of servers current flavor
    - ‘hostId’<~String>
    - ‘status’<~String> - Current server status
    - ‘progress’<~Integer> - Progress through current status
    - ‘addresses’<~Hash>:
      - ‘public’<~Array> - public address strings
      - ‘private’<~Array> - private address strings
    - ‘metadata’<~Hash> - metadata

reboot_server(server_id, type = 'SOFT')

Reboot an existing server

#### Parameters

- server_id<~Integer> - Id of server to reboot
- type<~String> - Type of reboot, must be in [‘HARD’, ‘SOFT’]

rebuild_server(server_id, image_ref, name, admin_pass=nil, metadata=nil, personality=nil)
release_address(address_id)

Release an existing floating IP address

#### Parameters

- id<~Integer> - Id of floating IP address to delete

reload()
request(params, parse_json = true, &block)
resize_server(server_id, flavor_id)

Reboot an existing server

#### Parameters

- server_id<~Integer> - Id of server to resize
- size<~String> - new size. call list_flavors to get available flavors

revert_resized_server(server_id)

Revert resizing

#### Parameters

- server_id<~Integer> - Id of server to revert

server_action(server_id, body, expects=202)

Server actions for an existing server

#### Parameters

- server_id<~Integer> - Id of server to reboot
- body<~.to_json object> - Body of the request, describes the action (see reboot_server as an example)
- expect<~Integer> - expected return, 202 except for confirm resize (204)

update_server(server_id, options = {})

Update an existing server

#### Parameters

# server_id<~Integer> - Id of server to update

- options<~Hash>:
  - adminPass<~String> - New admin password for server
  - name<~String> - New name for server

[Validate]