class Fog::Cosmic::Compute::Real

Public Class Methods

new(options={}) click to toggle source
# File lib/fog/cosmic/compute.rb, line 411
def initialize(options={})
  @cosmic_api_key           = options[:cosmic_api_key]
  @cosmic_secret_access_key = options[:cosmic_secret_access_key]
  @cosmic_session_id        = options[:cosmic_session_id]
  @cosmic_session_key       = options[:cosmic_session_key]
  @cosmic_project_id        = options[:cosmic_project_id]
  @host                         = options[:cosmic_host]
  @path                         = options[:cosmic_path]    || '/client/api'
  @port                         = options[:cosmic_port]    || 443
  @scheme                       = options[:cosmic_scheme]  || 'https'
  @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", options[:cosmic_persistent], {:ssl_verify_peer => false})
end

Public Instance Methods

activate_project(*args) click to toggle source

Activates a project

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/activate_project.rb, line 9
def activate_project(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'activateProject') 
  else
    options.merge!('command' => 'activateProject', 
    'id' => args[0])
  end
  request(options)
end
add_account_to_project(*args) click to toggle source

Adds acoount to a project

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/add_account_to_project.rb, line 9
def add_account_to_project(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'addAccountToProject') 
  else
    options.merge!('command' => 'addAccountToProject', 
    'projectid' => args[0])
  end
  request(options)
end
add_cluster(*args) click to toggle source

Adds a new cluster

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/add_cluster.rb, line 9
def add_cluster(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'addCluster') 
  else
    options.merge!('command' => 'addCluster', 
    'clustertype' => args[0], 
    'hypervisor' => args[1], 
    'clustername' => args[2], 
    'podid' => args[3], 
    'zoneid' => args[4])
  end
  request(options)
end
add_guest_os(*args) click to toggle source

Add a new guest OS type

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/add_guest_os.rb, line 9
def add_guest_os(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'addGuestOs') 
  else
    options.merge!('command' => 'addGuestOs', 
    'osdisplayname' => args[0], 
    'oscategoryid' => args[1])
  end
  request(options)
end
add_guest_os_mapping(*args) click to toggle source

Adds a guest OS name to hypervisor OS name mapping

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/add_guest_os_mapping.rb, line 9
def add_guest_os_mapping(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'addGuestOsMapping') 
  else
    options.merge!('command' => 'addGuestOsMapping', 
    'hypervisor' => args[0], 
    'osnameforhypervisor' => args[1], 
    'hypervisorversion' => args[2])
  end
  request(options)
end
add_host(*args) click to toggle source

Adds a new host.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/add_host.rb, line 9
def add_host(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'addHost') 
  else
    options.merge!('command' => 'addHost', 
    'url' => args[0], 
    'zoneid' => args[1], 
    'username' => args[2], 
    'password' => args[3], 
    'hypervisor' => args[4], 
    'podid' => args[5])
  end
  request(options)
end
add_image_store(*args) click to toggle source

Adds backup image store.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/add_image_store.rb, line 9
def add_image_store(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'addImageStore') 
  else
    options.merge!('command' => 'addImageStore', 
    'provider' => args[0])
  end
  request(options)
end
add_ip_to_nic(*args) click to toggle source

Assigns secondary IP to NIC

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/add_ip_to_nic.rb, line 9
def add_ip_to_nic(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'addIpToNic') 
  else
    options.merge!('command' => 'addIpToNic', 
    'nicid' => args[0])
  end
  request(options)
end
add_ldap_configuration(*args) click to toggle source

Add a new Ldap Configuration

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/add_ldap_configuration.rb, line 9
def add_ldap_configuration(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'addLdapConfiguration') 
  else
    options.merge!('command' => 'addLdapConfiguration', 
    'port' => args[0], 
    'hostname' => args[1])
  end
  request(options)
end
add_network_device(*args) click to toggle source

Adds a network device of one of the following types: ExternalDhcp, ExternalFirewall, ExternalLoadBalancer, PxeServer

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/add_network_device.rb, line 9
def add_network_device(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'addNetworkDevice') 
  else
    options.merge!('command' => 'addNetworkDevice')
  end
  request(options)
end
add_network_service_provider(*args) click to toggle source

Adds a network serviceProvider to a physical network

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/add_network_service_provider.rb, line 9
def add_network_service_provider(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'addNetworkServiceProvider') 
  else
    options.merge!('command' => 'addNetworkServiceProvider', 
    'name' => args[0], 
    'physicalnetworkid' => args[1])
  end
  request(options)
end
add_nic_to_virtual_machine(*args) click to toggle source

Adds VM to specified network by creating a NIC

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/add_nic_to_virtual_machine.rb, line 9
def add_nic_to_virtual_machine(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'addNicToVirtualMachine') 
  else
    options.merge!('command' => 'addNicToVirtualMachine', 
    'virtualmachineid' => args[0], 
    'networkid' => args[1])
  end
  request(options)
end
add_nicira_nvp_device(*args) click to toggle source

Adds a Nicira NVP device

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/add_nicira_nvp_device.rb, line 9
def add_nicira_nvp_device(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'addNiciraNvpDevice') 
  else
    options.merge!('command' => 'addNiciraNvpDevice', 
    'physicalnetworkid' => args[0], 
    'transportzoneuuid' => args[1], 
    'username' => args[2], 
    'password' => args[3], 
    'hostname' => args[4])
  end
  request(options)
end
add_region(*args) click to toggle source

Adds a Region

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/add_region.rb, line 9
def add_region(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'addRegion') 
  else
    options.merge!('command' => 'addRegion', 
    'id' => args[0], 
    'name' => args[1], 
    'endpoint' => args[2])
  end
  request(options)
end
add_resource_detail(*args) click to toggle source

Adds detail for the Resource.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/add_resource_detail.rb, line 9
def add_resource_detail(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'addResourceDetail') 
  else
    options.merge!('command' => 'addResourceDetail', 
    'resourcetype' => args[0], 
    'details' => args[1], 
    'resourceid' => args[2])
  end
  request(options)
end
add_secondary_storage(*args) click to toggle source

Adds secondary storage.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/add_secondary_storage.rb, line 9
def add_secondary_storage(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'addSecondaryStorage') 
  else
    options.merge!('command' => 'addSecondaryStorage', 
    'url' => args[0])
  end
  request(options)
end
add_traffic_type(*args) click to toggle source

Adds traffic type to a physical network

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/add_traffic_type.rb, line 9
def add_traffic_type(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'addTrafficType') 
  else
    options.merge!('command' => 'addTrafficType', 
    'traffictype' => args[0], 
    'physicalnetworkid' => args[1])
  end
  request(options)
end
add_vpn_user(*args) click to toggle source

Adds vpn users

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/add_vpn_user.rb, line 9
def add_vpn_user(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'addVpnUser') 
  else
    options.merge!('command' => 'addVpnUser', 
    'password' => args[0], 
    'username' => args[1])
  end
  request(options)
end
archive_alerts(*args) click to toggle source

Archive one or more alerts.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/archive_alerts.rb, line 9
def archive_alerts(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'archiveAlerts') 
  else
    options.merge!('command' => 'archiveAlerts')
  end
  request(options)
end
archive_events(*args) click to toggle source

Archive one or more events.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/archive_events.rb, line 9
def archive_events(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'archiveEvents') 
  else
    options.merge!('command' => 'archiveEvents')
  end
  request(options)
end
assign_cert_to_load_balancer(*args) click to toggle source

Assigns a certificate to a Load Balancer Rule

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/assign_cert_to_load_balancer.rb, line 9
def assign_cert_to_load_balancer(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'assignCertToLoadBalancer') 
  else
    options.merge!('command' => 'assignCertToLoadBalancer', 
    'lbruleid' => args[0], 
    'certid' => args[1])
  end
  request(options)
end
assign_to_load_balancer_rule(*args) click to toggle source

Assigns virtual machine or a list of virtual machines to a load balancer rule.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/assign_to_load_balancer_rule.rb, line 9
def assign_to_load_balancer_rule(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'assignToLoadBalancerRule') 
  else
    options.merge!('command' => 'assignToLoadBalancerRule', 
    'id' => args[0])
  end
  request(options)
end
assign_virtual_machine(*args) click to toggle source

Change ownership of a VM from one account to another. A root administrator can reassign a VM from any account to any other account in any domain. A domain administrator can reassign a VM to any account in the same domain.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/assign_virtual_machine.rb, line 9
def assign_virtual_machine(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'assignVirtualMachine') 
  else
    options.merge!('command' => 'assignVirtualMachine', 
    'account' => args[0], 
    'virtualmachineid' => args[1], 
    'domainid' => args[2])
  end
  request(options)
end
associate_ip_address(*args) click to toggle source

Acquires and associates a public IP to an account.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/associate_ip_address.rb, line 9
def associate_ip_address(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'associateIpAddress')
  else
    options.merge!('command' => 'associateIpAddress')
  end
  # add project id if we have one
  @cosmic_project_id ? options.merge!('projectid' => @cosmic_project_id) : nil
  request(options)
end
attach_iso(*args) click to toggle source

Attaches an ISO to a virtual machine.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/attach_iso.rb, line 9
def attach_iso(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'attachIso') 
  else
    options.merge!('command' => 'attachIso', 
    'virtualmachineid' => args[0], 
    'id' => args[1])
  end
  request(options)
end
attach_volume(*args) click to toggle source

Attaches a disk volume to a virtual machine.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/attach_volume.rb, line 9
def attach_volume(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'attachVolume') 
  else
    options.merge!('command' => 'attachVolume', 
    'virtualmachineid' => args[0], 
    'id' => args[1])
  end
  request(options)
end
cancel_host_maintenance(*args) click to toggle source

Cancels host maintenance.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/cancel_host_maintenance.rb, line 9
def cancel_host_maintenance(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'cancelHostMaintenance') 
  else
    options.merge!('command' => 'cancelHostMaintenance', 
    'id' => args[0])
  end
  request(options)
end
cancel_storage_maintenance(*args) click to toggle source

Cancels maintenance for primary storage

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/cancel_storage_maintenance.rb, line 9
def cancel_storage_maintenance(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'cancelStorageMaintenance') 
  else
    options.merge!('command' => 'cancelStorageMaintenance', 
    'id' => args[0])
  end
  request(options)
end
change_service_for_router(*args) click to toggle source

Upgrades domain router to a new service offering

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/change_service_for_router.rb, line 9
def change_service_for_router(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'changeServiceForRouter') 
  else
    options.merge!('command' => 'changeServiceForRouter', 
    'serviceofferingid' => args[0], 
    'id' => args[1])
  end
  request(options)
end
change_service_for_system_vm(*args) click to toggle source

Changes the service offering for a system vm (console proxy or secondary storage). The system vm must be in a “Stopped” state for this command to take effect.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/change_service_for_system_vm.rb, line 9
def change_service_for_system_vm(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'changeServiceForSystemVm') 
  else
    options.merge!('command' => 'changeServiceForSystemVm', 
    'id' => args[0], 
    'serviceofferingid' => args[1])
  end
  request(options)
end
change_service_for_virtual_machine(*args) click to toggle source

Changes the service offering for a virtual machine. The virtual machine must be in a “Stopped” state for this command to take effect.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/change_service_for_virtual_machine.rb, line 9
def change_service_for_virtual_machine(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'changeServiceForVirtualMachine') 
  else
    options.merge!('command' => 'changeServiceForVirtualMachine', 
    'serviceofferingid' => args[0], 
    'id' => args[1])
  end
  request(options)
end
clean_vmreservations(*args) click to toggle source

Cleanups VM reservations in the database.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/clean_vmreservations.rb, line 9
def clean_vmreservations(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'cleanVMReservations') 
  else
    options.merge!('command' => 'cleanVMReservations')
  end
  request(options)
end
configure_virtual_router_element(*args) click to toggle source

Configures a virtual router element.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/configure_virtual_router_element.rb, line 9
def configure_virtual_router_element(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'configureVirtualRouterElement') 
  else
    options.merge!('command' => 'configureVirtualRouterElement', 
    'id' => args[0], 
    'enabled' => args[1])
  end
  request(options)
end
copy_iso(*args) click to toggle source

Copies an iso from one zone to another.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/copy_iso.rb, line 9
def copy_iso(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'copyIso') 
  else
    options.merge!('command' => 'copyIso', 
    'destzoneid' => args[0], 
    'id' => args[1])
  end
  request(options)
end
copy_template(*args) click to toggle source

Copies a template from one zone to another.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/copy_template.rb, line 9
def copy_template(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'copyTemplate') 
  else
    options.merge!('command' => 'copyTemplate', 
    'id' => args[0], 
    'destzoneid' => args[1])
  end
  request(options)
end
create_account(*args) click to toggle source

Creates an account

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/create_account.rb, line 9
def create_account(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'createAccount') 
  else
    options.merge!('command' => 'createAccount', 
    'accounttype' => args[0], 
    'lastname' => args[1], 
    'email' => args[2], 
    'firstname' => args[3], 
    'username' => args[4], 
    'password' => args[5])
  end
  request(options)
end
create_affinity_group(*args) click to toggle source

Creates an affinity/anti-affinity group

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/create_affinity_group.rb, line 9
def create_affinity_group(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'createAffinityGroup') 
  else
    options.merge!('command' => 'createAffinityGroup', 
    'type' => args[0], 
    'name' => args[1])
  end
  request(options)
end
create_disk_offering(*args) click to toggle source

Creates a disk offering.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/create_disk_offering.rb, line 9
def create_disk_offering(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'createDiskOffering') 
  else
    options.merge!('command' => 'createDiskOffering', 
    'displaytext' => args[0], 
    'name' => args[1])
  end
  request(options)
end
create_domain(*args) click to toggle source

Creates a domain

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/create_domain.rb, line 9
def create_domain(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'createDomain') 
  else
    options.merge!('command' => 'createDomain', 
    'name' => args[0])
  end
  request(options)
end
create_egress_firewall_rule(*args) click to toggle source

Creates a egress firewall rule for a given network

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/create_egress_firewall_rule.rb, line 9
def create_egress_firewall_rule(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'createEgressFirewallRule')
  else
    options.merge!('command' => 'createEgressFirewallRule',
    'networkid' => args[0],
    'protocol' => args[1])
  end
  request(options)
end
create_firewall_rule(*args) click to toggle source

Creates a firewall rule for a given ip address

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/create_firewall_rule.rb, line 9
def create_firewall_rule(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'createFirewallRule')
  else
    options.merge!('command' => 'createFirewallRule',
    'ipaddressid' => args[0],
    'protocol' => args[1])
  end
  request(options)
end
create_instance_group(*args) click to toggle source

Creates a vm group

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/create_instance_group.rb, line 9
def create_instance_group(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'createInstanceGroup') 
  else
    options.merge!('command' => 'createInstanceGroup', 
    'name' => args[0])
  end
  request(options)
end
create_ip_forwarding_rule(*args) click to toggle source

Creates an ip forwarding rule

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/create_ip_forwarding_rule.rb, line 9
def create_ip_forwarding_rule(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'createIpForwardingRule') 
  else
    options.merge!('command' => 'createIpForwardingRule', 
    'ipaddressid' => args[0], 
    'protocol' => args[1], 
    'startport' => args[2])
  end
  request(options)
end
create_lb_health_check_policy(*args) click to toggle source

Creates a Load Balancer healthcheck policy

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/create_lb_health_check_policy.rb, line 9
def create_lb_health_check_policy(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'createLBHealthCheckPolicy') 
  else
    options.merge!('command' => 'createLBHealthCheckPolicy', 
    'lbruleid' => args[0])
  end
  request(options)
end
create_lb_stickiness_policy(*args) click to toggle source

Creates a Load Balancer stickiness policy

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/create_lb_stickiness_policy.rb, line 9
def create_lb_stickiness_policy(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'createLBStickinessPolicy') 
  else
    options.merge!('command' => 'createLBStickinessPolicy', 
    'methodname' => args[0], 
    'name' => args[1], 
    'lbruleid' => args[2])
  end
  request(options)
end
create_load_balancer_rule(*args) click to toggle source

Creates a load balancer rule

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/create_load_balancer_rule.rb, line 9
def create_load_balancer_rule(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'createLoadBalancerRule') 
  else
    options.merge!('command' => 'createLoadBalancerRule', 
    'name' => args[0], 
    'privateport' => args[1], 
    'algorithm' => args[2], 
    'publicport' => args[3])
  end
  request(options)
end
create_network(*args) click to toggle source

Creates a network

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/create_network.rb, line 9
def create_network(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'createNetwork')
  else
    options.merge!('command' => 'createNetwork',
    'displaytext' => args[0],
    'zoneid' => args[1],
    'name' => args[2],
    'networkofferingid' => args[3])
  end
  # add project id if we have one
  @cosmic_project_id ? options.merge!('projectid' => @cosmic_project_id) : nil
  request(options)
end
create_network_acl(*args) click to toggle source

Creates a ACL rule in the given network (the network has to belong to VPC)

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/create_network_acl.rb, line 9
def create_network_acl(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'createNetworkACL') 
  else
    options.merge!('command' => 'createNetworkACL', 
    'protocol' => args[0])
  end
  request(options)
end
create_network_acl_list(*args) click to toggle source

Creates a Network ACL for the given VPC

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/create_network_acl_list.rb, line 9
def create_network_acl_list(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'createNetworkACLList') 
  else
    options.merge!('command' => 'createNetworkACLList', 
    'name' => args[0], 
    'vpcid' => args[1])
  end
  request(options)
end
create_network_offering(*args) click to toggle source

Creates a network offering.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/create_network_offering.rb, line 9
def create_network_offering(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'createNetworkOffering')
  else
    options.merge!('command' => 'createNetworkOffering',
    'traffictype' => args[0],
    'guestiptype' => args[1],
    'name' => args[2],
    'supportedservices' => args[3],
    'displaytext' => args[4])
  end
  request(options)
end
create_physical_network(*args) click to toggle source

Creates a physical network

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/create_physical_network.rb, line 9
def create_physical_network(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'createPhysicalNetwork') 
  else
    options.merge!('command' => 'createPhysicalNetwork', 
    'name' => args[0], 
    'zoneid' => args[1])
  end
  request(options)
end
create_pod(*args) click to toggle source

Creates a new Pod.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/create_pod.rb, line 9
def create_pod(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'createPod') 
  else
    options.merge!('command' => 'createPod', 
    'netmask' => args[0], 
    'zoneid' => args[1], 
    'name' => args[2], 
    'gateway' => args[3], 
    'startip' => args[4])
  end
  request(options)
end
create_port_forwarding_rule(*args) click to toggle source

Creates a port forwarding rule

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/create_port_forwarding_rule.rb, line 9
def create_port_forwarding_rule(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'createPortForwardingRule')
  else
    options.merge!('command' => 'createPortForwardingRule',
    'virtualmachineid' => args[0],
    'protocol' => args[1],
    'privateport' => args[2],
    'ipaddressid' => args[3],
    'publicport' => args[4])
  end
  request(options)
end
create_private_gateway(*args) click to toggle source

Creates a private gateway

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/create_private_gateway.rb, line 9
def create_private_gateway(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'createPrivateGateway') 
  else
    options.merge!('command' => 'createPrivateGateway', 
    'ipaddress' => args[0], 
    'vlan' => args[1], 
    'netmask' => args[2], 
    'vpcid' => args[3], 
    'gateway' => args[4])
  end
  request(options)
end
create_project(*args) click to toggle source

Creates a project

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/create_project.rb, line 9
def create_project(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'createProject') 
  else
    options.merge!('command' => 'createProject', 
    'displaytext' => args[0], 
    'name' => args[1])
  end
  request(options)
end
create_remote_access_vpn(*args) click to toggle source

Creates a l2tp/ipsec remote access vpn

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/create_remote_access_vpn.rb, line 9
def create_remote_access_vpn(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'createRemoteAccessVpn') 
  else
    options.merge!('command' => 'createRemoteAccessVpn', 
    'publicipid' => args[0])
  end
  request(options)
end
create_secondary_staging_store(*args) click to toggle source

create secondary staging store.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/create_secondary_staging_store.rb, line 9
def create_secondary_staging_store(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'createSecondaryStagingStore') 
  else
    options.merge!('command' => 'createSecondaryStagingStore', 
    'url' => args[0])
  end
  request(options)
end
create_service_offering(*args) click to toggle source

Creates a service offering.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/create_service_offering.rb, line 9
def create_service_offering(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'createServiceOffering')
  else
    options.merge!('command' => 'createServiceOffering',
    'name' => args[0],
    'displaytext' => args[1])
  end
  request(options)
end
create_snapshot(*args) click to toggle source

Creates an instant snapshot of a volume.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/create_snapshot.rb, line 9
def create_snapshot(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'createSnapshot') 
  else
    options.merge!('command' => 'createSnapshot', 
    'volumeid' => args[0])
  end
  request(options)
end
create_ssh_key_pair(*args) click to toggle source

Create a new keypair and returns the private key

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/create_ssh_key_pair.rb, line 9
def create_ssh_key_pair(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'createSSHKeyPair')
  else
    options.merge!('command' => 'createSSHKeyPair',
    'name' => args[0])
  end
  # add project id if we have one
  @cosmic_project_id ? options.merge!('projectid' => @cosmic_project_id) : nil
  request(options)
end
create_static_route(*args) click to toggle source

Creates a static route

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/create_static_route.rb, line 9
def create_static_route(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'createStaticRoute') 
  else
    options.merge!('command' => 'createStaticRoute', 
    'gatewayid' => args[0], 
    'cidr' => args[1])
  end
  request(options)
end
create_storage_network_ip_range(*args) click to toggle source

Creates a Storage network IP range.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/create_storage_network_ip_range.rb, line 9
def create_storage_network_ip_range(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'createStorageNetworkIpRange') 
  else
    options.merge!('command' => 'createStorageNetworkIpRange', 
    'podid' => args[0], 
    'netmask' => args[1], 
    'gateway' => args[2], 
    'startip' => args[3])
  end
  request(options)
end
create_storage_pool(*args) click to toggle source

Creates a storage pool.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/create_storage_pool.rb, line 9
def create_storage_pool(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'createStoragePool') 
  else
    options.merge!('command' => 'createStoragePool', 
    'url' => args[0], 
    'name' => args[1], 
    'zoneid' => args[2])
  end
  request(options)
end
create_tags(*args) click to toggle source

Creates resource tag(s)

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/create_tags.rb, line 9
def create_tags(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'createTags') 
  else
    options.merge!('command' => 'createTags', 
    'tags' => args[0], 
    'resourcetype' => args[1], 
    'resourceids' => args[2])
  end
  request(options)
end
create_template(*args) click to toggle source

Creates a template of a virtual machine. The virtual machine must be in a STOPPED state. A template created from this command is automatically designated as a private template visible to the account that created it.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/create_template.rb, line 9
def create_template(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'createTemplate') 
  else
    options.merge!('command' => 'createTemplate', 
    'ostypeid' => args[0], 
    'name' => args[1], 
    'displaytext' => args[2])
  end
  request(options)
end
create_user(*args) click to toggle source

Creates a user for an account that already exists

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/create_user.rb, line 9
def create_user(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'createUser') 
  else
    options.merge!('command' => 'createUser', 
    'email' => args[0], 
    'username' => args[1], 
    'lastname' => args[2], 
    'password' => args[3], 
    'firstname' => args[4], 
    'account' => args[5])
  end
  request(options)
end
create_virtual_router_element(*args) click to toggle source

Create a virtual router element.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/create_virtual_router_element.rb, line 9
def create_virtual_router_element(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'createVirtualRouterElement') 
  else
    options.merge!('command' => 'createVirtualRouterElement', 
    'nspid' => args[0])
  end
  request(options)
end
create_vlan_ip_range(*args) click to toggle source

Creates a VLAN IP range.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/create_vlan_ip_range.rb, line 9
def create_vlan_ip_range(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'createVlanIpRange') 
  else
    options.merge!('command' => 'createVlanIpRange')
  end
  request(options)
end
create_vm_snapshot(*args) click to toggle source

Creates snapshot for a vm.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/create_vm_snapshot.rb, line 9
def create_vm_snapshot(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'createVMSnapshot') 
  else
    options.merge!('command' => 'createVMSnapshot', 
    'virtualmachineid' => args[0])
  end
  request(options)
end
create_volume(*args) click to toggle source

Creates a disk volume from a disk offering. This disk volume must still be attached to a virtual machine to make use of it.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/create_volume.rb, line 9
def create_volume(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'createVolume')
  else
    options.merge!('command' => 'createVolume',
    'name' => args[0])
  end
  # add project id if we have one
  @cosmic_project_id ? options.merge!('projectid' => @cosmic_project_id) : nil
  request(options)
end
create_vpc(*args) click to toggle source

Creates a VPC

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/create_vpc.rb, line 9
def create_vpc(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'createVPC') 
  else
    options.merge!('command' => 'createVPC', 
    'vpcofferingid' => args[0], 
    'zoneid' => args[1], 
    'name' => args[2], 
    'cidr' => args[3], 
    'displaytext' => args[4])
  end
  request(options)
end
create_vpcoffering(*args) click to toggle source

Creates VPC offering

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/create_vpcoffering.rb, line 9
def create_vpcoffering(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'createVPCOffering') 
  else
    options.merge!('command' => 'createVPCOffering', 
    'supportedservices' => args[0], 
    'name' => args[1], 
    'displaytext' => args[2])
  end
  request(options)
end
create_vpn_connection(*args) click to toggle source

Create site to site vpn connection

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/create_vpn_connection.rb, line 9
def create_vpn_connection(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'createVpnConnection') 
  else
    options.merge!('command' => 'createVpnConnection', 
    's2svpngatewayid' => args[0], 
    's2scustomergatewayid' => args[1])
  end
  request(options)
end
create_vpn_customer_gateway(*args) click to toggle source

Creates site to site vpn customer gateway

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/create_vpn_customer_gateway.rb, line 9
def create_vpn_customer_gateway(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'createVpnCustomerGateway') 
  else
    options.merge!('command' => 'createVpnCustomerGateway', 
    'esppolicy' => args[0], 
    'cidrlist' => args[1], 
    'ikepolicy' => args[2], 
    'gateway' => args[3], 
    'ipsecpsk' => args[4])
  end
  request(options)
end
create_vpn_gateway(*args) click to toggle source

Creates site to site vpn local gateway

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/create_vpn_gateway.rb, line 9
def create_vpn_gateway(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'createVpnGateway') 
  else
    options.merge!('command' => 'createVpnGateway', 
    'vpcid' => args[0])
  end
  request(options)
end
create_zone(*args) click to toggle source

Creates a Zone.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/create_zone.rb, line 9
def create_zone(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'createZone') 
  else
    options.merge!('command' => 'createZone', 
    'dns1' => args[0], 
    'internaldns1' => args[1], 
    'networktype' => args[2], 
    'name' => args[3])
  end
  request(options)
end
dedicate_cluster(*args) click to toggle source

Dedicate an existing cluster

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/dedicate_cluster.rb, line 9
def dedicate_cluster(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'dedicateCluster') 
  else
    options.merge!('command' => 'dedicateCluster', 
    'clusterid' => args[0], 
    'domainid' => args[1])
  end
  request(options)
end
dedicate_guest_vlan_range(*args) click to toggle source

Dedicates a guest vlan range to an account

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/dedicate_guest_vlan_range.rb, line 9
def dedicate_guest_vlan_range(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'dedicateGuestVlanRange') 
  else
    options.merge!('command' => 'dedicateGuestVlanRange', 
    'account' => args[0], 
    'domainid' => args[1], 
    'vlanrange' => args[2], 
    'physicalnetworkid' => args[3])
  end
  request(options)
end
dedicate_host(*args) click to toggle source

Dedicates a host.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/dedicate_host.rb, line 9
def dedicate_host(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'dedicateHost') 
  else
    options.merge!('command' => 'dedicateHost', 
    'hostid' => args[0], 
    'domainid' => args[1])
  end
  request(options)
end
dedicate_pod(*args) click to toggle source

Dedicates a Pod.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/dedicate_pod.rb, line 9
def dedicate_pod(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'dedicatePod') 
  else
    options.merge!('command' => 'dedicatePod', 
    'podid' => args[0], 
    'domainid' => args[1])
  end
  request(options)
end
dedicate_public_ip_range(*args) click to toggle source

Dedicates a Public IP range to an account

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/dedicate_public_ip_range.rb, line 9
def dedicate_public_ip_range(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'dedicatePublicIpRange') 
  else
    options.merge!('command' => 'dedicatePublicIpRange', 
    'domainid' => args[0], 
    'account' => args[1], 
    'id' => args[2])
  end
  request(options)
end
dedicate_zone(*args) click to toggle source

Dedicates a zones.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/dedicate_zone.rb, line 9
def dedicate_zone(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'dedicateZone') 
  else
    options.merge!('command' => 'dedicateZone', 
    'domainid' => args[0], 
    'zoneid' => args[1])
  end
  request(options)
end
delete_account(*args) click to toggle source

Deletes a account, and all users associated with this account

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_account.rb, line 9
def delete_account(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteAccount') 
  else
    options.merge!('command' => 'deleteAccount', 
    'id' => args[0])
  end
  request(options)
end
delete_account_from_project(*args) click to toggle source

Deletes account from the project

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_account_from_project.rb, line 9
def delete_account_from_project(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteAccountFromProject') 
  else
    options.merge!('command' => 'deleteAccountFromProject', 
    'projectid' => args[0], 
    'account' => args[1])
  end
  request(options)
end
delete_affinity_group(*args) click to toggle source

Deletes affinity group

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_affinity_group.rb, line 9
def delete_affinity_group(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteAffinityGroup') 
  else
    options.merge!('command' => 'deleteAffinityGroup')
  end
  request(options)
end
delete_alerts(*args) click to toggle source

Delete one or more alerts.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_alerts.rb, line 9
def delete_alerts(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteAlerts') 
  else
    options.merge!('command' => 'deleteAlerts')
  end
  request(options)
end
delete_cluster(*args) click to toggle source

Deletes a cluster.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_cluster.rb, line 9
def delete_cluster(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteCluster') 
  else
    options.merge!('command' => 'deleteCluster', 
    'id' => args[0])
  end
  request(options)
end
delete_disk_offering(*args) click to toggle source

Updates a disk offering.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_disk_offering.rb, line 9
def delete_disk_offering(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteDiskOffering') 
  else
    options.merge!('command' => 'deleteDiskOffering', 
    'id' => args[0])
  end
  request(options)
end
delete_domain(*args) click to toggle source

Deletes a specified domain

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_domain.rb, line 9
def delete_domain(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteDomain') 
  else
    options.merge!('command' => 'deleteDomain', 
    'id' => args[0])
  end
  request(options)
end
delete_egress_firewall_rule(*args) click to toggle source

Deletes an ggress firewall rule

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_egress_firewall_rule.rb, line 9
def delete_egress_firewall_rule(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteEgressFirewallRule')
  else
    options.merge!('command' => 'deleteEgressFirewallRule',
    'id' => args[0])
  end
  request(options)
end
delete_events(*args) click to toggle source

Delete one or more events.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_events.rb, line 9
def delete_events(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteEvents') 
  else
    options.merge!('command' => 'deleteEvents')
  end
  request(options)
end
delete_firewall_rule(*args) click to toggle source

Deletes a firewall rule

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_firewall_rule.rb, line 9
def delete_firewall_rule(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteFirewallRule')
  else
    options.merge!('command' => 'deleteFirewallRule',
    'id' => args[0])
  end
  request(options)
end
delete_host(*args) click to toggle source

Deletes a host.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_host.rb, line 9
def delete_host(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteHost') 
  else
    options.merge!('command' => 'deleteHost', 
    'id' => args[0])
  end
  request(options)
end
delete_image_store(*args) click to toggle source

Deletes an image store .

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_image_store.rb, line 9
def delete_image_store(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteImageStore') 
  else
    options.merge!('command' => 'deleteImageStore', 
    'id' => args[0])
  end
  request(options)
end
delete_instance_group(*args) click to toggle source

Deletes a vm group

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_instance_group.rb, line 9
def delete_instance_group(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteInstanceGroup') 
  else
    options.merge!('command' => 'deleteInstanceGroup', 
    'id' => args[0])
  end
  request(options)
end
delete_ip_forwarding_rule(*args) click to toggle source

Deletes an ip forwarding rule

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_ip_forwarding_rule.rb, line 9
def delete_ip_forwarding_rule(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteIpForwardingRule') 
  else
    options.merge!('command' => 'deleteIpForwardingRule', 
    'id' => args[0])
  end
  request(options)
end
delete_iso(*args) click to toggle source

Deletes an ISO file.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_iso.rb, line 9
def delete_iso(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteIso') 
  else
    options.merge!('command' => 'deleteIso', 
    'id' => args[0])
  end
  request(options)
end
delete_lb_health_check_policy(*args) click to toggle source

Deletes a load balancer HealthCheck policy.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_lb_health_check_policy.rb, line 9
def delete_lb_health_check_policy(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteLBHealthCheckPolicy') 
  else
    options.merge!('command' => 'deleteLBHealthCheckPolicy', 
    'id' => args[0])
  end
  request(options)
end
delete_lb_stickiness_policy(*args) click to toggle source

Deletes a LB stickiness policy.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_lb_stickiness_policy.rb, line 9
def delete_lb_stickiness_policy(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteLBStickinessPolicy') 
  else
    options.merge!('command' => 'deleteLBStickinessPolicy', 
    'id' => args[0])
  end
  request(options)
end
delete_ldap_configuration(*args) click to toggle source

Remove an Ldap Configuration

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_ldap_configuration.rb, line 9
def delete_ldap_configuration(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteLdapConfiguration') 
  else
    options.merge!('command' => 'deleteLdapConfiguration', 
    'hostname' => args[0])
  end
  request(options)
end
delete_load_balancer_rule(*args) click to toggle source

Deletes a load balancer rule.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_load_balancer_rule.rb, line 9
def delete_load_balancer_rule(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteLoadBalancerRule') 
  else
    options.merge!('command' => 'deleteLoadBalancerRule', 
    'id' => args[0])
  end
  request(options)
end
delete_network(*args) click to toggle source

Deletes a network

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_network.rb, line 9
def delete_network(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteNetwork') 
  else
    options.merge!('command' => 'deleteNetwork', 
    'id' => args[0])
  end
  request(options)
end
delete_network_acl(*args) click to toggle source

Deletes a Network ACL

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_network_acl.rb, line 9
def delete_network_acl(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteNetworkACL') 
  else
    options.merge!('command' => 'deleteNetworkACL', 
    'id' => args[0])
  end
  request(options)
end
delete_network_acl_list(*args) click to toggle source

Deletes a Network ACL

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_network_acl_list.rb, line 9
def delete_network_acl_list(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteNetworkACLList') 
  else
    options.merge!('command' => 'deleteNetworkACLList', 
    'id' => args[0])
  end
  request(options)
end
delete_network_device(*args) click to toggle source

Deletes network device.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_network_device.rb, line 9
def delete_network_device(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteNetworkDevice') 
  else
    options.merge!('command' => 'deleteNetworkDevice', 
    'id' => args[0])
  end
  request(options)
end
delete_network_offering(*args) click to toggle source

Deletes a network offering.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_network_offering.rb, line 9
def delete_network_offering(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteNetworkOffering')
  else
    options.merge!('command' => 'deleteNetworkOffering',
    'id' => args[0])
  end
  request(options)
end
delete_network_service_provider(*args) click to toggle source

Deletes a Network Service Provider.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_network_service_provider.rb, line 9
def delete_network_service_provider(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteNetworkServiceProvider') 
  else
    options.merge!('command' => 'deleteNetworkServiceProvider', 
    'id' => args[0])
  end
  request(options)
end
delete_nicira_nvp_device(*args) click to toggle source
delete a nicira nvp device

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_nicira_nvp_device.rb, line 9
def delete_nicira_nvp_device(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteNiciraNvpDevice') 
  else
    options.merge!('command' => 'deleteNiciraNvpDevice', 
    'nvpdeviceid' => args[0])
  end
  request(options)
end
delete_physical_network(*args) click to toggle source

Deletes a Physical Network.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_physical_network.rb, line 9
def delete_physical_network(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deletePhysicalNetwork') 
  else
    options.merge!('command' => 'deletePhysicalNetwork', 
    'id' => args[0])
  end
  request(options)
end
delete_pod(*args) click to toggle source

Deletes a Pod.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_pod.rb, line 9
def delete_pod(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deletePod') 
  else
    options.merge!('command' => 'deletePod', 
    'id' => args[0])
  end
  request(options)
end
delete_port_forwarding_rule(*args) click to toggle source

Deletes a port forwarding rule

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_port_forwarding_rule.rb, line 9
def delete_port_forwarding_rule(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deletePortForwardingRule') 
  else
    options.merge!('command' => 'deletePortForwardingRule', 
    'id' => args[0])
  end
  request(options)
end
delete_private_gateway(*args) click to toggle source

Deletes a Private gateway

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_private_gateway.rb, line 9
def delete_private_gateway(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deletePrivateGateway') 
  else
    options.merge!('command' => 'deletePrivateGateway', 
    'id' => args[0])
  end
  request(options)
end
delete_project(*args) click to toggle source

Deletes a project

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_project.rb, line 9
def delete_project(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteProject') 
  else
    options.merge!('command' => 'deleteProject', 
    'id' => args[0])
  end
  request(options)
end
delete_project_invitation(*args) click to toggle source

Accepts or declines project invitation

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_project_invitation.rb, line 9
def delete_project_invitation(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteProjectInvitation') 
  else
    options.merge!('command' => 'deleteProjectInvitation', 
    'id' => args[0])
  end
  request(options)
end
delete_remote_access_vpn(*args) click to toggle source

Destroys a l2tp/ipsec remote access vpn

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_remote_access_vpn.rb, line 9
def delete_remote_access_vpn(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteRemoteAccessVpn') 
  else
    options.merge!('command' => 'deleteRemoteAccessVpn', 
    'publicipid' => args[0])
  end
  request(options)
end
delete_secondary_staging_store(*args) click to toggle source

Deletes a secondary staging store .

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_secondary_staging_store.rb, line 9
def delete_secondary_staging_store(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteSecondaryStagingStore') 
  else
    options.merge!('command' => 'deleteSecondaryStagingStore', 
    'id' => args[0])
  end
  request(options)
end
delete_service_offering(*args) click to toggle source

Deletes a service offering.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_service_offering.rb, line 9
def delete_service_offering(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteServiceOffering')
  else
    options.merge!('command' => 'deleteServiceOffering',
    'id' => args[0])
  end
  request(options)
end
delete_snapshot(*args) click to toggle source

Deletes a snapshot of a disk volume.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_snapshot.rb, line 9
def delete_snapshot(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteSnapshot') 
  else
    options.merge!('command' => 'deleteSnapshot', 
    'id' => args[0])
  end
  request(options)
end
delete_ssh_key_pair(*args) click to toggle source

Deletes a keypair by name

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_ssh_key_pair.rb, line 9
def delete_ssh_key_pair(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteSSHKeyPair')
  else
    options.merge!('command' => 'deleteSSHKeyPair',
    'name' => args[0])
  end
  # add project id if we have one
  @cosmic_project_id ? options.merge!('projectid' => @cosmic_project_id) : nil
  request(options)
end
delete_ssl_cert(*args) click to toggle source

Delete a certificate from Cosmic

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_ssl_cert.rb, line 9
def delete_ssl_cert(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteSslCert') 
  else
    options.merge!('command' => 'deleteSslCert', 
    'id' => args[0])
  end
  request(options)
end
delete_static_route(*args) click to toggle source

Deletes a static route

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_static_route.rb, line 9
def delete_static_route(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteStaticRoute') 
  else
    options.merge!('command' => 'deleteStaticRoute', 
    'id' => args[0])
  end
  request(options)
end
delete_storage_network_ip_range(*args) click to toggle source

Deletes a storage network IP Range.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_storage_network_ip_range.rb, line 9
def delete_storage_network_ip_range(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteStorageNetworkIpRange') 
  else
    options.merge!('command' => 'deleteStorageNetworkIpRange', 
    'id' => args[0])
  end
  request(options)
end
delete_storage_pool(*args) click to toggle source

Deletes a storage pool.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_storage_pool.rb, line 9
def delete_storage_pool(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteStoragePool') 
  else
    options.merge!('command' => 'deleteStoragePool', 
    'id' => args[0])
  end
  request(options)
end
delete_tags(*args) click to toggle source

Deleting resource tag(s)

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_tags.rb, line 9
def delete_tags(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteTags') 
  else
    options.merge!('command' => 'deleteTags', 
    'resourceids' => args[0], 
    'resourcetype' => args[1])
  end
  request(options)
end
delete_template(*args) click to toggle source

Deletes a template from the system. All virtual machines using the deleted template will not be affected.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_template.rb, line 9
def delete_template(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteTemplate') 
  else
    options.merge!('command' => 'deleteTemplate', 
    'id' => args[0])
  end
  request(options)
end
delete_traffic_type(*args) click to toggle source

Deletes traffic type of a physical network

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_traffic_type.rb, line 9
def delete_traffic_type(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteTrafficType') 
  else
    options.merge!('command' => 'deleteTrafficType', 
    'id' => args[0])
  end
  request(options)
end
delete_user(*args) click to toggle source

Deletes a user for an account

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_user.rb, line 9
def delete_user(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteUser') 
  else
    options.merge!('command' => 'deleteUser', 
    'id' => args[0])
  end
  request(options)
end
delete_vlan_ip_range(*args) click to toggle source

Creates a VLAN IP range.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_vlan_ip_range.rb, line 9
def delete_vlan_ip_range(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteVlanIpRange') 
  else
    options.merge!('command' => 'deleteVlanIpRange', 
    'id' => args[0])
  end
  request(options)
end
delete_vm_snapshot(*args) click to toggle source

Deletes a vmsnapshot.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_vm_snapshot.rb, line 9
def delete_vm_snapshot(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteVMSnapshot') 
  else
    options.merge!('command' => 'deleteVMSnapshot', 
    'vmsnapshotid' => args[0])
  end
  request(options)
end
delete_volume(*args) click to toggle source

Deletes a detached disk volume.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_volume.rb, line 9
def delete_volume(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteVolume') 
  else
    options.merge!('command' => 'deleteVolume', 
    'id' => args[0])
  end
  request(options)
end
delete_vpc(*args) click to toggle source

Deletes a VPC

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_vpc.rb, line 9
def delete_vpc(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteVPC') 
  else
    options.merge!('command' => 'deleteVPC', 
    'id' => args[0])
  end
  request(options)
end
delete_vpcoffering(*args) click to toggle source

Deletes VPC offering

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_vpcoffering.rb, line 9
def delete_vpcoffering(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteVPCOffering') 
  else
    options.merge!('command' => 'deleteVPCOffering', 
    'id' => args[0])
  end
  request(options)
end
delete_vpn_connection(*args) click to toggle source

Delete site to site vpn connection

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_vpn_connection.rb, line 9
def delete_vpn_connection(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteVpnConnection') 
  else
    options.merge!('command' => 'deleteVpnConnection', 
    'id' => args[0])
  end
  request(options)
end
delete_vpn_customer_gateway(*args) click to toggle source

Delete site to site vpn customer gateway

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_vpn_customer_gateway.rb, line 9
def delete_vpn_customer_gateway(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteVpnCustomerGateway') 
  else
    options.merge!('command' => 'deleteVpnCustomerGateway', 
    'id' => args[0])
  end
  request(options)
end
delete_vpn_gateway(*args) click to toggle source

Delete site to site vpn gateway

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_vpn_gateway.rb, line 9
def delete_vpn_gateway(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteVpnGateway') 
  else
    options.merge!('command' => 'deleteVpnGateway', 
    'id' => args[0])
  end
  request(options)
end
delete_zone(*args) click to toggle source

Deletes a Zone.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/delete_zone.rb, line 9
def delete_zone(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deleteZone') 
  else
    options.merge!('command' => 'deleteZone', 
    'id' => args[0])
  end
  request(options)
end
deploy_virtual_machine(*args) click to toggle source

Creates and automatically starts a virtual machine based on a service offering, disk offering, and template.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/deploy_virtual_machine.rb, line 9
def deploy_virtual_machine(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'deployVirtualMachine')
  else
    options.merge!('command' => 'deployVirtualMachine',
    'templateid' => args[0],
    'zoneid' => args[1],
    'serviceofferingid' => args[2])
  end
  # add project id if we have one
  @cosmic_project_id ? options.merge!('projectid' => @cosmic_project_id) : nil
  request(options)
end
destroy_router(*args) click to toggle source

Destroys a router.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/destroy_router.rb, line 9
def destroy_router(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'destroyRouter') 
  else
    options.merge!('command' => 'destroyRouter', 
    'id' => args[0])
  end
  request(options)
end
destroy_system_vm(*args) click to toggle source

Destroyes a system virtual machine.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/destroy_system_vm.rb, line 9
def destroy_system_vm(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'destroySystemVm') 
  else
    options.merge!('command' => 'destroySystemVm', 
    'id' => args[0])
  end
  request(options)
end
destroy_virtual_machine(*args) click to toggle source

Destroys a virtual machine. Once destroyed, only the administrator can recover it.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/destroy_virtual_machine.rb, line 9
def destroy_virtual_machine(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'destroyVirtualMachine') 
  else
    options.merge!('command' => 'destroyVirtualMachine', 
    'id' => args[0])
  end
  request(options)
end
detach_iso(*args) click to toggle source

Detaches any ISO file (if any) currently attached to a virtual machine.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/detach_iso.rb, line 9
def detach_iso(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'detachIso') 
  else
    options.merge!('command' => 'detachIso', 
    'virtualmachineid' => args[0])
  end
  request(options)
end
detach_volume(*args) click to toggle source

Detaches a disk volume from a virtual machine.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/detach_volume.rb, line 9
def detach_volume(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'detachVolume') 
  else
    options.merge!('command' => 'detachVolume')
  end
  request(options)
end
disable_account(*args) click to toggle source

Disables an account

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/disable_account.rb, line 9
def disable_account(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'disableAccount') 
  else
    options.merge!('command' => 'disableAccount', 
    'lock' => args[0])
  end
  request(options)
end
disable_static_nat(*args) click to toggle source

Disables static rule for given ip address

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/disable_static_nat.rb, line 9
def disable_static_nat(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'disableStaticNat') 
  else
    options.merge!('command' => 'disableStaticNat', 
    'ipaddressid' => args[0])
  end
  request(options)
end
disable_user(*args) click to toggle source

Disables a user account

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/disable_user.rb, line 9
def disable_user(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'disableUser') 
  else
    options.merge!('command' => 'disableUser', 
    'id' => args[0])
  end
  request(options)
end
disassociate_ip_address(*args) click to toggle source

Disassociates an ip address from the account.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/disassociate_ip_address.rb, line 9
def disassociate_ip_address(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'disassociateIpAddress')
  else
    options.merge!('command' => 'disassociateIpAddress',
    'id' => args[0])
  end
  request(options)
end
enable_account(*args) click to toggle source

Enables an account

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/enable_account.rb, line 9
def enable_account(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'enableAccount') 
  else
    options.merge!('command' => 'enableAccount')
  end
  request(options)
end
enable_static_nat(*args) click to toggle source

Enables static nat for given ip address

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/enable_static_nat.rb, line 9
def enable_static_nat(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'enableStaticNat') 
  else
    options.merge!('command' => 'enableStaticNat', 
    'ipaddressid' => args[0], 
    'virtualmachineid' => args[1])
  end
  request(options)
end
enable_storage_maintenance(*args) click to toggle source

Puts storage pool into maintenance state

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/enable_storage_maintenance.rb, line 9
def enable_storage_maintenance(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'enableStorageMaintenance') 
  else
    options.merge!('command' => 'enableStorageMaintenance', 
    'id' => args[0])
  end
  request(options)
end
enable_user(*args) click to toggle source

Enables a user account

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/enable_user.rb, line 9
def enable_user(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'enableUser') 
  else
    options.merge!('command' => 'enableUser', 
    'id' => args[0])
  end
  request(options)
end
expunge_virtual_machine(*args) click to toggle source

Expunge a virtual machine. Once expunged, it cannot be recoverd.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/expunge_virtual_machine.rb, line 9
def expunge_virtual_machine(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'expungeVirtualMachine') 
  else
    options.merge!('command' => 'expungeVirtualMachine', 
    'id' => args[0])
  end
  request(options)
end
extract_iso(*args) click to toggle source

Extracts an ISO

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/extract_iso.rb, line 9
def extract_iso(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'extractIso') 
  else
    options.merge!('command' => 'extractIso', 
    'id' => args[0], 
    'mode' => args[1])
  end
  request(options)
end
extract_template(*args) click to toggle source

Extracts a template

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/extract_template.rb, line 9
def extract_template(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'extractTemplate') 
  else
    options.merge!('command' => 'extractTemplate', 
    'mode' => args[0], 
    'id' => args[1])
  end
  request(options)
end
extract_volume(*args) click to toggle source

Extracts volume

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/extract_volume.rb, line 9
def extract_volume(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'extractVolume') 
  else
    options.merge!('command' => 'extractVolume', 
    'mode' => args[0], 
    'id' => args[1], 
    'zoneid' => args[2])
  end
  request(options)
end
find_hosts_for_migration(*args) click to toggle source

Find hosts suitable for migrating a virtual machine.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/find_hosts_for_migration.rb, line 9
def find_hosts_for_migration(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'findHostsForMigration') 
  else
    options.merge!('command' => 'findHostsForMigration', 
    'virtualmachineid' => args[0])
  end
  request(options)
end
find_storage_pools_for_migration(*args) click to toggle source

Lists storage pools available for migration of a volume.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/find_storage_pools_for_migration.rb, line 9
def find_storage_pools_for_migration(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'findStoragePoolsForMigration') 
  else
    options.merge!('command' => 'findStoragePoolsForMigration', 
    'id' => args[0])
  end
  request(options)
end
generate_alert(*args) click to toggle source

Generates an alert

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/generate_alert.rb, line 9
def generate_alert(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'generateAlert') 
  else
    options.merge!('command' => 'generateAlert', 
    'description' => args[0], 
    'name' => args[1], 
    'type' => args[2])
  end
  request(options)
end
get_api_limit(*args) click to toggle source

Get API limit count for the caller

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/get_api_limit.rb, line 9
def get_api_limit(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'getApiLimit') 
  else
    options.merge!('command' => 'getApiLimit')
  end
  request(options)
end
get_cloud_identifier(*args) click to toggle source

Retrieves a cloud identifier.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/get_cloud_identifier.rb, line 9
def get_cloud_identifier(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'getCloudIdentifier') 
  else
    options.merge!('command' => 'getCloudIdentifier', 
    'userid' => args[0])
  end
  request(options)
end
get_user(*args) click to toggle source

Find user account by API key

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/get_user.rb, line 9
def get_user(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'getUser') 
  else
    options.merge!('command' => 'getUser', 
    'apikey' => args[0])
  end
  request(options)
end
get_virtual_machine_user_data(*args) click to toggle source

Returns user data associated with the VM

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/get_virtual_machine_user_data.rb, line 9
def get_virtual_machine_user_data(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'getVirtualMachineUserData') 
  else
    options.merge!('command' => 'getVirtualMachineUserData', 
    'virtualmachineid' => args[0])
  end
  request(options)
end
get_vm_password(*args) click to toggle source

Returns an encrypted password for the VM

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/get_vm_password.rb, line 9
def get_vm_password(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'getVMPassword') 
  else
    options.merge!('command' => 'getVMPassword', 
    'id' => args[0])
  end
  request(options)
end
import_ldap_users(*args) click to toggle source

Import LDAP users

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/import_ldap_users.rb, line 9
def import_ldap_users(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'importLdapUsers') 
  else
    options.merge!('command' => 'importLdapUsers', 
    'accounttype' => args[0])
  end
  request(options)
end
ldap_create_account(*args) click to toggle source

Creates an account from an LDAP user

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/ldap_create_account.rb, line 9
def ldap_create_account(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'ldapCreateAccount') 
  else
    options.merge!('command' => 'ldapCreateAccount', 
    'username' => args[0], 
    'accounttype' => args[1])
  end
  request(options)
end
list_accounts(*args) click to toggle source

Lists accounts and provides detailed account information for listed accounts

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_accounts.rb, line 9
def list_accounts(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listAccounts') 
  else
    options.merge!('command' => 'listAccounts')
  end
  request(options)
end
list_affinity_group_types(*args) click to toggle source

Lists affinity group types available

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_affinity_group_types.rb, line 9
def list_affinity_group_types(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listAffinityGroupTypes') 
  else
    options.merge!('command' => 'listAffinityGroupTypes')
  end
  request(options)
end
list_affinity_groups(*args) click to toggle source

Lists affinity groups

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_affinity_groups.rb, line 9
def list_affinity_groups(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listAffinityGroups') 
  else
    options.merge!('command' => 'listAffinityGroups')
  end
  request(options)
end
list_alerts(*args) click to toggle source

Lists all alerts.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_alerts.rb, line 9
def list_alerts(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listAlerts') 
  else
    options.merge!('command' => 'listAlerts')
  end
  request(options)
end
list_apis(*args) click to toggle source

lists all available apis on the server, provided by the Api Discovery plugin

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_apis.rb, line 9
def list_apis(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listApis') 
  else
    options.merge!('command' => 'listApis')
  end
  request(options)
end
list_async_jobs(*args) click to toggle source

Lists all pending asynchronous jobs for the account.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_async_jobs.rb, line 9
def list_async_jobs(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listAsyncJobs') 
  else
    options.merge!('command' => 'listAsyncJobs')
  end
  request(options)
end
list_capabilities(*args) click to toggle source

Lists capabilities

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_capabilities.rb, line 9
def list_capabilities(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listCapabilities') 
  else
    options.merge!('command' => 'listCapabilities')
  end
  request(options)
end
list_capacity(*args) click to toggle source

Lists all the system wide capacities.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_capacity.rb, line 9
def list_capacity(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listCapacity') 
  else
    options.merge!('command' => 'listCapacity')
  end
  request(options)
end
list_clusters(*args) click to toggle source

Lists clusters.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_clusters.rb, line 9
def list_clusters(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listClusters') 
  else
    options.merge!('command' => 'listClusters')
  end
  request(options)
end
list_configurations(*args) click to toggle source

Lists all configurations.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_configurations.rb, line 9
def list_configurations(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listConfigurations') 
  else
    options.merge!('command' => 'listConfigurations')
  end
  request(options)
end
list_dedicated_clusters(*args) click to toggle source

Lists dedicated clusters.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_dedicated_clusters.rb, line 9
def list_dedicated_clusters(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listDedicatedClusters') 
  else
    options.merge!('command' => 'listDedicatedClusters')
  end
  request(options)
end
list_dedicated_guest_vlan_ranges(*args) click to toggle source

Lists dedicated guest vlan ranges

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_dedicated_guest_vlan_ranges.rb, line 9
def list_dedicated_guest_vlan_ranges(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listDedicatedGuestVlanRanges') 
  else
    options.merge!('command' => 'listDedicatedGuestVlanRanges')
  end
  request(options)
end
list_dedicated_hosts(*args) click to toggle source

Lists dedicated hosts.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_dedicated_hosts.rb, line 9
def list_dedicated_hosts(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listDedicatedHosts') 
  else
    options.merge!('command' => 'listDedicatedHosts')
  end
  request(options)
end
list_dedicated_pods(*args) click to toggle source

Lists dedicated pods.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_dedicated_pods.rb, line 9
def list_dedicated_pods(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listDedicatedPods') 
  else
    options.merge!('command' => 'listDedicatedPods')
  end
  request(options)
end
list_dedicated_zones(*args) click to toggle source

List dedicated zones.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_dedicated_zones.rb, line 9
def list_dedicated_zones(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listDedicatedZones') 
  else
    options.merge!('command' => 'listDedicatedZones')
  end
  request(options)
end
list_deployment_planners(*args) click to toggle source

Lists all DeploymentPlanners available.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_deployment_planners.rb, line 9
def list_deployment_planners(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listDeploymentPlanners') 
  else
    options.merge!('command' => 'listDeploymentPlanners')
  end
  request(options)
end
list_disk_offerings(*args) click to toggle source

Lists all available disk offerings.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_disk_offerings.rb, line 9
def list_disk_offerings(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listDiskOfferings') 
  else
    options.merge!('command' => 'listDiskOfferings')
  end
  request(options)
end
list_domain_children(*args) click to toggle source

Lists all children domains belonging to a specified domain

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_domain_children.rb, line 9
def list_domain_children(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listDomainChildren') 
  else
    options.merge!('command' => 'listDomainChildren')
  end
  request(options)
end
list_domains(*args) click to toggle source

Lists domains and provides detailed information for listed domains

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_domains.rb, line 9
def list_domains(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listDomains') 
  else
    options.merge!('command' => 'listDomains')
  end
  request(options)
end
list_egress_firewall_rules(*args) click to toggle source

Lists all egress firewall rules for network id.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_egress_firewall_rules.rb, line 9
def list_egress_firewall_rules(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listEgressFirewallRules')
  else
    options.merge!('command' => 'listEgressFirewallRules')
  end

  # add project id if we have one
  @cosmic_project_id ? options.merge!('projectid' => @cosmic_project_id) : nil

  request(options)
end
list_event_types(*args) click to toggle source

List Event Types

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_event_types.rb, line 9
def list_event_types(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listEventTypes') 
  else
    options.merge!('command' => 'listEventTypes')
  end
  request(options)
end
list_events(*args) click to toggle source

A command to list events.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_events.rb, line 9
def list_events(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listEvents') 
  else
    options.merge!('command' => 'listEvents')
  end
  request(options)
end
list_firewall_rules(*args) click to toggle source

Lists all firewall rules for an IP address.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_firewall_rules.rb, line 9
def list_firewall_rules(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listFirewallRules')
  else
    options.merge!('command' => 'listFirewallRules')
  end

  # add project id if we have one
  @cosmic_project_id ? options.merge!('projectid' => @cosmic_project_id) : nil

  request(options)
end
list_guest_os_mapping(*args) click to toggle source

Lists all available OS mappings for given hypervisor

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_guest_os_mapping.rb, line 9
def list_guest_os_mapping(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listGuestOsMapping') 
  else
    options.merge!('command' => 'listGuestOsMapping')
  end
  request(options)
end
list_hosts(*args) click to toggle source

Lists hosts.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_hosts.rb, line 9
def list_hosts(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listHosts') 
  else
    options.merge!('command' => 'listHosts')
  end
  request(options)
end
list_hypervisor_capabilities(*args) click to toggle source

Lists all hypervisor capabilities.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_hypervisor_capabilities.rb, line 9
def list_hypervisor_capabilities(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listHypervisorCapabilities') 
  else
    options.merge!('command' => 'listHypervisorCapabilities')
  end
  request(options)
end
list_hypervisors(*args) click to toggle source

List hypervisors

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_hypervisors.rb, line 9
def list_hypervisors(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listHypervisors') 
  else
    options.merge!('command' => 'listHypervisors')
  end
  request(options)
end
list_image_stores(*args) click to toggle source

Lists image stores.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_image_stores.rb, line 9
def list_image_stores(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listImageStores') 
  else
    options.merge!('command' => 'listImageStores')
  end
  request(options)
end
list_instance_groups(*args) click to toggle source

Lists vm groups

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_instance_groups.rb, line 9
def list_instance_groups(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listInstanceGroups') 
  else
    options.merge!('command' => 'listInstanceGroups')
  end
  request(options)
end
list_ip_forwarding_rules(*args) click to toggle source

List the ip forwarding rules

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_ip_forwarding_rules.rb, line 9
def list_ip_forwarding_rules(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listIpForwardingRules') 
  else
    options.merge!('command' => 'listIpForwardingRules')
  end
  request(options)
end
list_iso_permissions(*args) click to toggle source

List iso visibility and all accounts that have permissions to view this iso.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_iso_permissions.rb, line 9
def list_iso_permissions(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listIsoPermissions') 
  else
    options.merge!('command' => 'listIsoPermissions', 
    'id' => args[0])
  end
  request(options)
end
list_isos(*args) click to toggle source

Lists all available ISO files.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_isos.rb, line 9
def list_isos(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listIsos') 
  else
    options.merge!('command' => 'listIsos')
  end
  request(options)
end
list_lb_health_check_policies(*args) click to toggle source

Lists load balancer HealthCheck policies.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_lb_health_check_policies.rb, line 9
def list_lb_health_check_policies(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listLBHealthCheckPolicies') 
  else
    options.merge!('command' => 'listLBHealthCheckPolicies')
  end
  request(options)
end
list_lb_stickiness_policies(*args) click to toggle source

Lists LBStickiness policies.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_lb_stickiness_policies.rb, line 9
def list_lb_stickiness_policies(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listLBStickinessPolicies') 
  else
    options.merge!('command' => 'listLBStickinessPolicies')
  end
  request(options)
end
list_ldap_configurations(*args) click to toggle source

Lists all LDAP configurations

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_ldap_configurations.rb, line 9
def list_ldap_configurations(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listLdapConfigurations') 
  else
    options.merge!('command' => 'listLdapConfigurations')
  end
  request(options)
end
list_ldap_users(*args) click to toggle source

Lists all LDAP Users

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_ldap_users.rb, line 9
def list_ldap_users(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listLdapUsers') 
  else
    options.merge!('command' => 'listLdapUsers')
  end
  request(options)
end
list_load_balancer_rule_instances(*args) click to toggle source

List all virtual machine instances that are assigned to a load balancer rule.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_load_balancer_rule_instances.rb, line 9
def list_load_balancer_rule_instances(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listLoadBalancerRuleInstances') 
  else
    options.merge!('command' => 'listLoadBalancerRuleInstances', 
    'id' => args[0])
  end
  request(options)
end
list_load_balancer_rules(*args) click to toggle source

Lists load balancer rules.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_load_balancer_rules.rb, line 9
def list_load_balancer_rules(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listLoadBalancerRules') 
  else
    options.merge!('command' => 'listLoadBalancerRules')
  end
  request(options)
end
list_network_acl_lists(*args) click to toggle source

Lists all network ACLs

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_network_acl_lists.rb, line 9
def list_network_acl_lists(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listNetworkACLLists') 
  else
    options.merge!('command' => 'listNetworkACLLists')
  end
  request(options)
end
list_network_acls(*args) click to toggle source

Lists all network ACL items

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_network_acls.rb, line 9
def list_network_acls(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listNetworkACLs') 
  else
    options.merge!('command' => 'listNetworkACLs')
  end
  request(options)
end
list_network_device(*args) click to toggle source

List network devices

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_network_device.rb, line 9
def list_network_device(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listNetworkDevice') 
  else
    options.merge!('command' => 'listNetworkDevice')
  end
  request(options)
end
list_network_isolation_methods(*args) click to toggle source

Lists supported methods of network isolation

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_network_isolation_methods.rb, line 9
def list_network_isolation_methods(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listNetworkIsolationMethods') 
  else
    options.merge!('command' => 'listNetworkIsolationMethods')
  end
  request(options)
end
list_network_offerings(*args) click to toggle source

Lists all available network offerings.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_network_offerings.rb, line 9
def list_network_offerings(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listNetworkOfferings')
  else
    options.merge!('command' => 'listNetworkOfferings')
  end
  request(options)
end
list_network_service_providers(*args) click to toggle source

Lists network serviceproviders for a given physical network.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_network_service_providers.rb, line 9
def list_network_service_providers(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listNetworkServiceProviders') 
  else
    options.merge!('command' => 'listNetworkServiceProviders')
  end
  request(options)
end
list_networks(*args) click to toggle source

Lists all available networks.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_networks.rb, line 9
def list_networks(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listNetworks')
  else
    options.merge!('command' => 'listNetworks')
  end

  # add project id if we have one
  @cosmic_project_id ? options.merge!('projectid' => @cosmic_project_id) : nil

  request(options)
end
list_nicira_nvp_device_networks(*args) click to toggle source

lists network that are using a nicira nvp device

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_nicira_nvp_device_networks.rb, line 9
def list_nicira_nvp_device_networks(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listNiciraNvpDeviceNetworks') 
  else
    options.merge!('command' => 'listNiciraNvpDeviceNetworks', 
    'nvpdeviceid' => args[0])
  end
  request(options)
end
list_nicira_nvp_devices(*args) click to toggle source

Lists Nicira NVP devices

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_nicira_nvp_devices.rb, line 9
def list_nicira_nvp_devices(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listNiciraNvpDevices') 
  else
    options.merge!('command' => 'listNiciraNvpDevices')
  end
  request(options)
end
list_nics(*args) click to toggle source

list the vm nics IP to NIC

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_nics.rb, line 9
def list_nics(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listNics') 
  else
    options.merge!('command' => 'listNics', 
    'virtualmachineid' => args[0])
  end
  request(options)
end
list_os_categories(*args) click to toggle source

Lists all supported OS categories for this cloud.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_os_categories.rb, line 9
def list_os_categories(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listOsCategories') 
  else
    options.merge!('command' => 'listOsCategories')
  end
  request(options)
end
list_os_types(*args) click to toggle source

Lists all supported OS types for this cloud.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_os_types.rb, line 9
def list_os_types(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listOsTypes') 
  else
    options.merge!('command' => 'listOsTypes')
  end
  request(options)
end
list_physical_networks(*args) click to toggle source

Lists physical networks

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_physical_networks.rb, line 9
def list_physical_networks(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listPhysicalNetworks') 
  else
    options.merge!('command' => 'listPhysicalNetworks')
  end
  request(options)
end
list_pods(*args) click to toggle source

Lists all Pods.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_pods.rb, line 9
def list_pods(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listPods') 
  else
    options.merge!('command' => 'listPods')
  end
  request(options)
end
list_port_forwarding_rules(*args) click to toggle source

Lists all port forwarding rules for an IP address.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_port_forwarding_rules.rb, line 9
def list_port_forwarding_rules(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listPortForwardingRules')
  else
    options.merge!('command' => 'listPortForwardingRules')
  end

  # add project id if we have one
  @cosmic_project_id ? options.merge!('projectid' => @cosmic_project_id) : nil

  request(options)
end
list_private_gateways(*args) click to toggle source

List private gateways

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_private_gateways.rb, line 9
def list_private_gateways(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listPrivateGateways') 
  else
    options.merge!('command' => 'listPrivateGateways')
  end
  request(options)
end
list_project_accounts(*args) click to toggle source

Lists project's accounts

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_project_accounts.rb, line 9
def list_project_accounts(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listProjectAccounts') 
  else
    options.merge!('command' => 'listProjectAccounts', 
    'projectid' => args[0])
  end
  request(options)
end
list_project_invitations(*args) click to toggle source

Lists projects and provides detailed information for listed projects

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_project_invitations.rb, line 9
def list_project_invitations(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listProjectInvitations') 
  else
    options.merge!('command' => 'listProjectInvitations')
  end
  request(options)
end
list_projects(*args) click to toggle source

Lists projects and provides detailed information for listed projects

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_projects.rb, line 9
def list_projects(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listProjects') 
  else
    options.merge!('command' => 'listProjects')
  end
  request(options)
end
list_public_ip_addresses(*args) click to toggle source

Lists all public ip addresses

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_public_ip_addresses.rb, line 9
def list_public_ip_addresses(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listPublicIpAddresses')
  else
    options.merge!('command' => 'listPublicIpAddresses')
  end

  # add project id if we have one
  @cosmic_project_id ? options.merge!('projectid' => @cosmic_project_id) : nil

  request(options)
end
list_regions(*args) click to toggle source

Lists Regions

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_regions.rb, line 9
def list_regions(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listRegions') 
  else
    options.merge!('command' => 'listRegions')
  end
  request(options)
end
list_remote_access_vpns(*args) click to toggle source

Lists remote access vpns

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_remote_access_vpns.rb, line 9
def list_remote_access_vpns(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listRemoteAccessVpns') 
  else
    options.merge!('command' => 'listRemoteAccessVpns')
  end
  request(options)
end
list_resource_details(*args) click to toggle source

List resource detail(s)

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_resource_details.rb, line 9
def list_resource_details(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listResourceDetails') 
  else
    options.merge!('command' => 'listResourceDetails', 
    'resourcetype' => args[0])
  end
  request(options)
end
list_resource_limits(*args) click to toggle source

Lists resource limits.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_resource_limits.rb, line 9
def list_resource_limits(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listResourceLimits') 
  else
    options.merge!('command' => 'listResourceLimits')
  end
  request(options)
end
list_routers(*args) click to toggle source

List routers.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_routers.rb, line 9
def list_routers(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listRouters') 
  else
    options.merge!('command' => 'listRouters')
  end
  request(options)
end
list_secondary_staging_stores(*args) click to toggle source

Lists secondary staging stores.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_secondary_staging_stores.rb, line 9
def list_secondary_staging_stores(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listSecondaryStagingStores') 
  else
    options.merge!('command' => 'listSecondaryStagingStores')
  end
  request(options)
end
list_service_offerings(*args) click to toggle source

Lists all available service offerings.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_service_offerings.rb, line 9
def list_service_offerings(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listServiceOfferings')
  else
    options.merge!('command' => 'listServiceOfferings')
  end
  request(options)
end
list_snapshots(*args) click to toggle source

Lists all available snapshots for the account.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_snapshots.rb, line 9
def list_snapshots(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listSnapshots')
  else
    options.merge!('command' => 'listSnapshots')
  end
  # add project id if we have one
  @cosmic_project_id ? options.merge!('projectid' => @cosmic_project_id) : nil
  request(options)
end
list_ssh_key_pairs(*args) click to toggle source

List registered keypairs

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_ssh_key_pairs.rb, line 9
def list_ssh_key_pairs(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listSSHKeyPairs')
  else
    options.merge!('command' => 'listSSHKeyPairs')
  end
  # add project id if we have one
  @cosmic_project_id ? options.merge!('projectid' => @cosmic_project_id) : nil
  request(options)
end
list_ssl_certs(*args) click to toggle source

Lists SSL certificates

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_ssl_certs.rb, line 9
def list_ssl_certs(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listSslCerts') 
  else
    options.merge!('command' => 'listSslCerts')
  end
  request(options)
end
list_static_routes(*args) click to toggle source

Lists all static routes

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_static_routes.rb, line 9
def list_static_routes(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listStaticRoutes') 
  else
    options.merge!('command' => 'listStaticRoutes')
  end
  request(options)
end
list_storage_network_ip_range(*args) click to toggle source

List a storage network IP range.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_storage_network_ip_range.rb, line 9
def list_storage_network_ip_range(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listStorageNetworkIpRange') 
  else
    options.merge!('command' => 'listStorageNetworkIpRange')
  end
  request(options)
end
list_storage_pools(*args) click to toggle source

Lists storage pools.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_storage_pools.rb, line 9
def list_storage_pools(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listStoragePools') 
  else
    options.merge!('command' => 'listStoragePools')
  end
  request(options)
end
list_storage_providers(*args) click to toggle source

Lists storage providers.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_storage_providers.rb, line 9
def list_storage_providers(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listStorageProviders') 
  else
    options.merge!('command' => 'listStorageProviders', 
    'type' => args[0])
  end
  request(options)
end
list_supported_network_services(*args) click to toggle source

Lists all network services provided by Cosmic or for the given provider.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_supported_network_services.rb, line 9
def list_supported_network_services(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listSupportedNetworkServices') 
  else
    options.merge!('command' => 'listSupportedNetworkServices')
  end
  request(options)
end
list_system_vms(*args) click to toggle source

List system virtual machines.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_system_vms.rb, line 9
def list_system_vms(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listSystemVms') 
  else
    options.merge!('command' => 'listSystemVms')
  end
  request(options)
end
list_tags(*args) click to toggle source

List resource tag(s)

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_tags.rb, line 9
def list_tags(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listTags') 
  else
    options.merge!('command' => 'listTags')
  end
  request(options)
end
list_template_permissions(*args) click to toggle source

List template visibility and all accounts that have permissions to view this template.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_template_permissions.rb, line 9
def list_template_permissions(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listTemplatePermissions') 
  else
    options.merge!('command' => 'listTemplatePermissions', 
    'id' => args[0])
  end
  request(options)
end
list_templates(*args) click to toggle source

List all public, private, and privileged templates.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_templates.rb, line 9
def list_templates(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listTemplates')
  else
    options.merge!('command' => 'listTemplates',
    'templatefilter' => args[0])
  end

  # add project id if we have one
  @cosmic_project_id ? options.merge!('projectid' => @cosmic_project_id) : nil

  request(options)
end
list_traffic_types(*args) click to toggle source

Lists traffic types of a given physical network.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_traffic_types.rb, line 9
def list_traffic_types(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listTrafficTypes') 
  else
    options.merge!('command' => 'listTrafficTypes', 
    'physicalnetworkid' => args[0])
  end
  request(options)
end
list_users(*args) click to toggle source

Lists user accounts

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_users.rb, line 9
def list_users(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listUsers') 
  else
    options.merge!('command' => 'listUsers')
  end
  request(options)
end
list_virtual_machines(*args) click to toggle source

List the virtual machines owned by the account.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_virtual_machines.rb, line 9
def list_virtual_machines(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listVirtualMachines')
  else
    options.merge!('command' => 'listVirtualMachines')
  end
  # add project id if we have one
  @cosmic_project_id ? options.merge!('projectid' => @cosmic_project_id) : nil
  request(options)
end
list_virtual_router_elements(*args) click to toggle source

Lists all available virtual router elements.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_virtual_router_elements.rb, line 9
def list_virtual_router_elements(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listVirtualRouterElements') 
  else
    options.merge!('command' => 'listVirtualRouterElements')
  end
  request(options)
end
list_vlan_ip_ranges(*args) click to toggle source

Lists all VLAN IP ranges.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_vlan_ip_ranges.rb, line 9
def list_vlan_ip_ranges(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listVlanIpRanges') 
  else
    options.merge!('command' => 'listVlanIpRanges')
  end
  request(options)
end
list_vm_snapshot(*args) click to toggle source

List virtual machine snapshot by conditions

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_vm_snapshot.rb, line 9
def list_vm_snapshot(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listVMSnapshot')
  else
    options.merge!('command' => 'listVMSnapshot')
  end
  # add project id if we have one
  @cosmic_project_id ? options.merge!('projectid' => @cosmic_project_id) : nil
  request(options)
end
list_volumes(*args) click to toggle source

Lists all volumes.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_volumes.rb, line 9
def list_volumes(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listVolumes')
  else
    options.merge!('command' => 'listVolumes')
  end
  # add project id if we have one
  @cosmic_project_id ? options.merge!('projectid' => @cosmic_project_id) : nil
  request(options)
end
list_vpc_offerings(*args) click to toggle source

Lists VPC offerings

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_vpc_offerings.rb, line 9
def list_vpc_offerings(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listVPCOfferings') 
  else
    options.merge!('command' => 'listVPCOfferings')
  end
  request(options)
end
list_vpcs(*args) click to toggle source

Lists VPCs

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_vpcs.rb, line 9
def list_vpcs(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listVPCs') 
  else
    options.merge!('command' => 'listVPCs')
  end
  request(options)
end
list_vpn_connections(*args) click to toggle source

Lists site to site vpn connection gateways

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_vpn_connections.rb, line 9
def list_vpn_connections(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listVpnConnections') 
  else
    options.merge!('command' => 'listVpnConnections')
  end
  request(options)
end
list_vpn_customer_gateways(*args) click to toggle source

Lists site to site vpn customer gateways

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_vpn_customer_gateways.rb, line 9
def list_vpn_customer_gateways(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listVpnCustomerGateways') 
  else
    options.merge!('command' => 'listVpnCustomerGateways')
  end
  request(options)
end
list_vpn_gateways(*args) click to toggle source

Lists site 2 site vpn gateways

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_vpn_gateways.rb, line 9
def list_vpn_gateways(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listVpnGateways') 
  else
    options.merge!('command' => 'listVpnGateways')
  end
  request(options)
end
list_vpn_users(*args) click to toggle source

Lists vpn users

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_vpn_users.rb, line 9
def list_vpn_users(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listVpnUsers') 
  else
    options.merge!('command' => 'listVpnUsers')
  end
  request(options)
end
list_zones(*args) click to toggle source

Lists zones

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/list_zones.rb, line 9
def list_zones(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'listZones') 
  else
    options.merge!('command' => 'listZones')
  end
  request(options)
end
lock_account(*args) click to toggle source

Locks an account

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/lock_account.rb, line 9
def lock_account(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'lockAccount') 
  else
    options.merge!('command' => 'lockAccount', 
    'account' => args[0], 
    'domainid' => args[1])
  end
  request(options)
end
lock_user(*args) click to toggle source

Locks a user account

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/lock_user.rb, line 9
def lock_user(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'lockUser') 
  else
    options.merge!('command' => 'lockUser', 
    'id' => args[0])
  end
  request(options)
end
login(username,password,domain) click to toggle source
# File lib/fog/cosmic/compute.rb, line 428
def login(username,password,domain)
  response = issue_request({
    'response' => 'json',
    'command'  => 'login',
    'username' => username,
    'password' => Digest::MD5.hexdigest(password),
    'domain'   => domain
  })

  # Parse response cookies to retrive JSESSIONID token
  cookies   = CGI::Cookie.parse(response.headers['Set-Cookie'])
  sessionid = cookies['JSESSIONID'].first

  # Decode the login response
  response   = Fog::JSON.decode(response.body)

  user = response['loginresponse']
  user.merge!('sessionid' => sessionid)

  @cosmic_session_id  = user['sessionid']
  @cosmic_session_key = user['sessionkey']

  user
end
mark_default_zone_for_account(*args) click to toggle source

Marks a default zone for this account

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/mark_default_zone_for_account.rb, line 9
def mark_default_zone_for_account(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'markDefaultZoneForAccount') 
  else
    options.merge!('command' => 'markDefaultZoneForAccount', 
    'zoneid' => args[0], 
    'account' => args[1], 
    'domainid' => args[2])
  end
  request(options)
end
migrate_system_vm(*args) click to toggle source

Attempts Migration of a system virtual machine to the host specified.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/migrate_system_vm.rb, line 9
def migrate_system_vm(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'migrateSystemVm') 
  else
    options.merge!('command' => 'migrateSystemVm', 
    'virtualmachineid' => args[0], 
    'hostid' => args[1])
  end
  request(options)
end
migrate_virtual_machine(*args) click to toggle source

Attempts Migration of a VM to a different host or Root volume of the vm to a different storage pool

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/migrate_virtual_machine.rb, line 9
def migrate_virtual_machine(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'migrateVirtualMachine') 
  else
    options.merge!('command' => 'migrateVirtualMachine', 
    'virtualmachineid' => args[0])
  end
  request(options)
end
migrate_virtual_machine_with_volume(*args) click to toggle source

Attempts Migration of a VM with its volumes to a different host

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/migrate_virtual_machine_with_volume.rb, line 9
def migrate_virtual_machine_with_volume(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'migrateVirtualMachineWithVolume') 
  else
    options.merge!('command' => 'migrateVirtualMachineWithVolume', 
    'hostid' => args[0], 
    'virtualmachineid' => args[1])
  end
  request(options)
end
migrate_volume(*args) click to toggle source

Migrate volume

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/migrate_volume.rb, line 9
def migrate_volume(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'migrateVolume') 
  else
    options.merge!('command' => 'migrateVolume', 
    'storageid' => args[0], 
    'volumeid' => args[1])
  end
  request(options)
end
prepare_host_for_maintenance(*args) click to toggle source

Prepares a host for maintenance.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/prepare_host_for_maintenance.rb, line 9
def prepare_host_for_maintenance(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'prepareHostForMaintenance') 
  else
    options.merge!('command' => 'prepareHostForMaintenance', 
    'id' => args[0])
  end
  request(options)
end
prepare_template(*args) click to toggle source

load template into primary storage

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/prepare_template.rb, line 9
def prepare_template(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'prepareTemplate') 
  else
    options.merge!('command' => 'prepareTemplate', 
    'templateid' => args[0], 
    'zoneid' => args[1])
  end
  request(options)
end
query_async_job_result(*args) click to toggle source

Retrieves the current status of asynchronous job.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/query_async_job_result.rb, line 9
def query_async_job_result(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'queryAsyncJobResult') 
  else
    options.merge!('command' => 'queryAsyncJobResult', 
    'jobid' => args[0])
  end
  request(options)
end
reboot_router(*args) click to toggle source

Starts a router.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/reboot_router.rb, line 9
def reboot_router(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'rebootRouter') 
  else
    options.merge!('command' => 'rebootRouter', 
    'id' => args[0])
  end
  request(options)
end
reboot_system_vm(*args) click to toggle source

Reboots a system VM.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/reboot_system_vm.rb, line 9
def reboot_system_vm(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'rebootSystemVm') 
  else
    options.merge!('command' => 'rebootSystemVm', 
    'id' => args[0])
  end
  request(options)
end
reboot_virtual_machine(*args) click to toggle source

Reboots a virtual machine.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/reboot_virtual_machine.rb, line 9
def reboot_virtual_machine(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'rebootVirtualMachine') 
  else
    options.merge!('command' => 'rebootVirtualMachine', 
    'id' => args[0])
  end
  request(options)
end
reconnect_host(*args) click to toggle source

Reconnects a host.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/reconnect_host.rb, line 9
def reconnect_host(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'reconnectHost') 
  else
    options.merge!('command' => 'reconnectHost', 
    'id' => args[0])
  end
  request(options)
end
recover_virtual_machine(*args) click to toggle source

Recovers a virtual machine.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/recover_virtual_machine.rb, line 9
def recover_virtual_machine(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'recoverVirtualMachine') 
  else
    options.merge!('command' => 'recoverVirtualMachine', 
    'id' => args[0])
  end
  request(options)
end
register_iso(*args) click to toggle source

Registers an existing ISO into the Cosmic cloud.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/register_iso.rb, line 9
def register_iso(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'registerIso') 
  else
    options.merge!('command' => 'registerIso', 
    'name' => args[0], 
    'displaytext' => args[1], 
    'url' => args[2], 
    'zoneid' => args[3])
  end
  request(options)
end
register_ssh_key_pair(*args) click to toggle source

Register a public key in a keypair under a certain name

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/register_ssh_key_pair.rb, line 9
def register_ssh_key_pair(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'registerSSHKeyPair')
  else
    options.merge!('command' => 'registerSSHKeyPair',
    'name' => args[0],
    'publickey' => args[1])
  end
  # add project id if we have one
  @cosmic_project_id ? options.merge!('projectid' => @cosmic_project_id) : nil
  request(options)
end
register_template(*args) click to toggle source

Registers an existing template into the Cosmic cloud.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/register_template.rb, line 9
def register_template(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'registerTemplate') 
  else
    options.merge!('command' => 'registerTemplate', 
    'zoneid' => args[0], 
    'format' => args[1], 
    'hypervisor' => args[2], 
    'url' => args[3], 
    'name' => args[4], 
    'ostypeid' => args[5], 
    'displaytext' => args[6])
  end
  request(options)
end
register_user_keys(*args) click to toggle source

This command allows a user to register for the developer API, returning a secret key and an API key. This request is made through the integration API port, so it is a privileged command and must be made on behalf of a user. It is up to the implementer just how the username and password are entered, and then how that translates to an integration API request. Both secret key and API key should be returned to the user

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/register_user_keys.rb, line 9
def register_user_keys(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'registerUserKeys') 
  else
    options.merge!('command' => 'registerUserKeys', 
    'id' => args[0])
  end
  request(options)
end
release_dedicated_cluster(*args) click to toggle source

Release the dedication for cluster

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/release_dedicated_cluster.rb, line 9
def release_dedicated_cluster(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'releaseDedicatedCluster') 
  else
    options.merge!('command' => 'releaseDedicatedCluster', 
    'clusterid' => args[0])
  end
  request(options)
end
release_dedicated_guest_vlan_range(*args) click to toggle source

Releases a dedicated guest vlan range to the system

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/release_dedicated_guest_vlan_range.rb, line 9
def release_dedicated_guest_vlan_range(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'releaseDedicatedGuestVlanRange') 
  else
    options.merge!('command' => 'releaseDedicatedGuestVlanRange', 
    'id' => args[0])
  end
  request(options)
end
release_dedicated_host(*args) click to toggle source

Release the dedication for host

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/release_dedicated_host.rb, line 9
def release_dedicated_host(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'releaseDedicatedHost') 
  else
    options.merge!('command' => 'releaseDedicatedHost', 
    'hostid' => args[0])
  end
  request(options)
end
release_dedicated_pod(*args) click to toggle source

Release the dedication for the pod

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/release_dedicated_pod.rb, line 9
def release_dedicated_pod(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'releaseDedicatedPod') 
  else
    options.merge!('command' => 'releaseDedicatedPod', 
    'podid' => args[0])
  end
  request(options)
end
release_dedicated_zone(*args) click to toggle source

Release dedication of zone

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/release_dedicated_zone.rb, line 9
def release_dedicated_zone(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'releaseDedicatedZone') 
  else
    options.merge!('command' => 'releaseDedicatedZone', 
    'zoneid' => args[0])
  end
  request(options)
end
release_host_reservation(*args) click to toggle source

Releases host reservation.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/release_host_reservation.rb, line 9
def release_host_reservation(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'releaseHostReservation') 
  else
    options.merge!('command' => 'releaseHostReservation', 
    'id' => args[0])
  end
  request(options)
end
release_public_ip_range(*args) click to toggle source

Releases a Public IP range back to the system pool

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/release_public_ip_range.rb, line 9
def release_public_ip_range(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'releasePublicIpRange') 
  else
    options.merge!('command' => 'releasePublicIpRange', 
    'id' => args[0])
  end
  request(options)
end
reload() click to toggle source
# File lib/fog/cosmic/compute.rb, line 424
def reload
  @connection.reset
end
remove_cert_from_load_balancer(*args) click to toggle source

Removes a certificate from a Load Balancer Rule

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/remove_cert_from_load_balancer.rb, line 9
def remove_cert_from_load_balancer(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'removeCertFromLoadBalancer') 
  else
    options.merge!('command' => 'removeCertFromLoadBalancer', 
    'lbruleid' => args[0])
  end
  request(options)
end
remove_from_load_balancer_rule(*args) click to toggle source

Removes a virtual machine or a list of virtual machines from a load balancer rule.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/remove_from_load_balancer_rule.rb, line 9
def remove_from_load_balancer_rule(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'removeFromLoadBalancerRule') 
  else
    options.merge!('command' => 'removeFromLoadBalancerRule', 
    'id' => args[0])
  end
  request(options)
end
remove_guest_os(*args) click to toggle source

Removes a Guest OS from listing.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/remove_guest_os.rb, line 9
def remove_guest_os(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'removeGuestOs') 
  else
    options.merge!('command' => 'removeGuestOs', 
    'id' => args[0])
  end
  request(options)
end
remove_guest_os_mapping(*args) click to toggle source

Removes a Guest OS Mapping.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/remove_guest_os_mapping.rb, line 9
def remove_guest_os_mapping(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'removeGuestOsMapping') 
  else
    options.merge!('command' => 'removeGuestOsMapping', 
    'id' => args[0])
  end
  request(options)
end
remove_ip_from_nic(*args) click to toggle source

Removes secondary IP from the NIC.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/remove_ip_from_nic.rb, line 9
def remove_ip_from_nic(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'removeIpFromNic') 
  else
    options.merge!('command' => 'removeIpFromNic', 
    'id' => args[0])
  end
  request(options)
end
remove_nic_from_virtual_machine(*args) click to toggle source

Removes VM from specified network by deleting a NIC

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/remove_nic_from_virtual_machine.rb, line 9
def remove_nic_from_virtual_machine(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'removeNicFromVirtualMachine') 
  else
    options.merge!('command' => 'removeNicFromVirtualMachine', 
    'virtualmachineid' => args[0], 
    'nicid' => args[1])
  end
  request(options)
end
remove_region(*args) click to toggle source

Removes specified region

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/remove_region.rb, line 9
def remove_region(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'removeRegion') 
  else
    options.merge!('command' => 'removeRegion', 
    'id' => args[0])
  end
  request(options)
end
remove_resource_detail(*args) click to toggle source

Removes detail for the Resource.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/remove_resource_detail.rb, line 9
def remove_resource_detail(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'removeResourceDetail') 
  else
    options.merge!('command' => 'removeResourceDetail', 
    'resourcetype' => args[0], 
    'resourceid' => args[1])
  end
  request(options)
end
remove_vpn_user(*args) click to toggle source

Removes vpn user

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/remove_vpn_user.rb, line 9
def remove_vpn_user(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'removeVpnUser') 
  else
    options.merge!('command' => 'removeVpnUser', 
    'username' => args[0])
  end
  request(options)
end
replace_network_acl_list(*args) click to toggle source

Replaces ACL associated with a Network or private gateway

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/replace_network_acl_list.rb, line 9
def replace_network_acl_list(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'replaceNetworkACLList') 
  else
    options.merge!('command' => 'replaceNetworkACLList', 
    'aclid' => args[0])
  end
  request(options)
end
request(params) click to toggle source
# File lib/fog/cosmic/compute.rb, line 453
def request(params)
  params.reject!{|k,v| v.nil?}

  params.merge!('response' => 'json')

  if has_session?
    params, headers = authorize_session(params)
  elsif has_keys?
    params, headers = authorize_api_keys(params)
  end

  response = issue_request(params,headers)
  response = Fog::JSON.decode(response.body) unless response.body.empty?
  response
end
reset_api_limit(*args) click to toggle source

Reset api count

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/reset_api_limit.rb, line 9
def reset_api_limit(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'resetApiLimit') 
  else
    options.merge!('command' => 'resetApiLimit')
  end
  request(options)
end
reset_password_for_virtual_machine(*args) click to toggle source

Resets the password for virtual machine. The virtual machine must be in a “Stopped” state and the template must already support this feature for this command to take effect. [async]

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/reset_password_for_virtual_machine.rb, line 9
def reset_password_for_virtual_machine(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'resetPasswordForVirtualMachine') 
  else
    options.merge!('command' => 'resetPasswordForVirtualMachine', 
    'id' => args[0])
  end
  request(options)
end
reset_ssh_key_for_virtual_machine(*args) click to toggle source

Resets the SSH Key for virtual machine. The virtual machine must be in a “Stopped” state. [async]

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/reset_ssh_key_for_virtual_machine.rb, line 9
def reset_ssh_key_for_virtual_machine(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'resetSSHKeyForVirtualMachine')
  else
    options.merge!('command' => 'resetSSHKeyForVirtualMachine',
    'id' => args[0],
    'keypair' => args[1])
  end
  # add project id if we have one
  @cosmic_project_id ? options.merge!('projectid' => @cosmic_project_id) : nil
  request(options)
end
reset_vpn_connection(*args) click to toggle source

Reset site to site vpn connection

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/reset_vpn_connection.rb, line 9
def reset_vpn_connection(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'resetVpnConnection') 
  else
    options.merge!('command' => 'resetVpnConnection', 
    'id' => args[0])
  end
  request(options)
end
resize_volume(*args) click to toggle source

Resizes a volume

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/resize_volume.rb, line 9
def resize_volume(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'resizeVolume') 
  else
    options.merge!('command' => 'resizeVolume', 
    'id' => args[0])
  end
  request(options)
end
restart_network(*args) click to toggle source

Restarts the network; includes 1) restarting network elements - virtual routers, dhcp servers 2) reapplying all public ips 3) reapplying loadBalancing/portForwarding rules

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/restart_network.rb, line 9
def restart_network(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'restartNetwork') 
  else
    options.merge!('command' => 'restartNetwork', 
    'id' => args[0])
  end
  request(options)
end
restart_vpc(*args) click to toggle source

Restarts a VPC

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/restart_vpc.rb, line 9
def restart_vpc(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'restartVPC') 
  else
    options.merge!('command' => 'restartVPC', 
    'id' => args[0])
  end
  request(options)
end
restore_virtual_machine(*args) click to toggle source

Restore a VM to original template/ISO or new template/ISO

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/restore_virtual_machine.rb, line 9
def restore_virtual_machine(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'restoreVirtualMachine') 
  else
    options.merge!('command' => 'restoreVirtualMachine', 
    'virtualmachineid' => args[0])
  end
  request(options)
end
revert_snapshot(*args) click to toggle source

revert a volume snapshot.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/revert_snapshot.rb, line 9
def revert_snapshot(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'revertSnapshot') 
  else
    options.merge!('command' => 'revertSnapshot', 
    'id' => args[0])
  end
  request(options)
end
revert_to_vm_snapshot(*args) click to toggle source

Revert VM from a vmsnapshot.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/revert_to_vm_snapshot.rb, line 9
def revert_to_vm_snapshot(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'revertToVMSnapshot') 
  else
    options.merge!('command' => 'revertToVMSnapshot', 
    'vmsnapshotid' => args[0])
  end
  request(options)
end
scale_system_vm(*args) click to toggle source

Scale the service offering for a system vm (console proxy or secondary storage). The system vm must be in a “Stopped” state for this command to take effect.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/scale_system_vm.rb, line 9
def scale_system_vm(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'scaleSystemVm') 
  else
    options.merge!('command' => 'scaleSystemVm', 
    'serviceofferingid' => args[0], 
    'id' => args[1])
  end
  request(options)
end
scale_virtual_machine(*args) click to toggle source

Scales the virtual machine to a new service offering.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/scale_virtual_machine.rb, line 9
def scale_virtual_machine(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'scaleVirtualMachine') 
  else
    options.merge!('command' => 'scaleVirtualMachine', 
    'serviceofferingid' => args[0], 
    'id' => args[1])
  end
  request(options)
end
start_router(*args) click to toggle source

Starts a router.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/start_router.rb, line 9
def start_router(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'startRouter') 
  else
    options.merge!('command' => 'startRouter', 
    'id' => args[0])
  end
  request(options)
end
start_system_vm(*args) click to toggle source

Starts a system virtual machine.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/start_system_vm.rb, line 9
def start_system_vm(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'startSystemVm') 
  else
    options.merge!('command' => 'startSystemVm', 
    'id' => args[0])
  end
  request(options)
end
start_virtual_machine(*args) click to toggle source

Starts a virtual machine.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/start_virtual_machine.rb, line 9
def start_virtual_machine(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'startVirtualMachine') 
  else
    options.merge!('command' => 'startVirtualMachine', 
    'id' => args[0])
  end
  request(options)
end
stop_router(*args) click to toggle source

Stops a router.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/stop_router.rb, line 9
def stop_router(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'stopRouter') 
  else
    options.merge!('command' => 'stopRouter', 
    'id' => args[0])
  end
  request(options)
end
stop_system_vm(*args) click to toggle source

Stops a system VM.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/stop_system_vm.rb, line 9
def stop_system_vm(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'stopSystemVm') 
  else
    options.merge!('command' => 'stopSystemVm', 
    'id' => args[0])
  end
  request(options)
end
stop_virtual_machine(*args) click to toggle source

Stops a virtual machine.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/stop_virtual_machine.rb, line 9
def stop_virtual_machine(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'stopVirtualMachine') 
  else
    options.merge!('command' => 'stopVirtualMachine', 
    'id' => args[0])
  end
  request(options)
end
suspend_project(*args) click to toggle source

Suspends a project

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/suspend_project.rb, line 9
def suspend_project(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'suspendProject') 
  else
    options.merge!('command' => 'suspendProject', 
    'id' => args[0])
  end
  request(options)
end
update_account(*args) click to toggle source

Updates account information for the authenticated user

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_account.rb, line 9
def update_account(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateAccount') 
  else
    options.merge!('command' => 'updateAccount', 
    'newname' => args[0])
  end
  request(options)
end
update_cluster(*args) click to toggle source

Updates an existing cluster

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_cluster.rb, line 9
def update_cluster(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateCluster') 
  else
    options.merge!('command' => 'updateCluster', 
    'id' => args[0])
  end
  request(options)
end
update_configuration(*args) click to toggle source

Updates a configuration.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_configuration.rb, line 9
def update_configuration(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateConfiguration') 
  else
    options.merge!('command' => 'updateConfiguration', 
    'name' => args[0])
  end
  request(options)
end
update_default_nic_for_virtual_machine(*args) click to toggle source

Changes the default NIC on a VM

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_default_nic_for_virtual_machine.rb, line 9
def update_default_nic_for_virtual_machine(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateDefaultNicForVirtualMachine') 
  else
    options.merge!('command' => 'updateDefaultNicForVirtualMachine', 
    'nicid' => args[0], 
    'virtualmachineid' => args[1])
  end
  request(options)
end
update_disk_offering(*args) click to toggle source

Updates a disk offering.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_disk_offering.rb, line 9
def update_disk_offering(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateDiskOffering') 
  else
    options.merge!('command' => 'updateDiskOffering', 
    'id' => args[0])
  end
  request(options)
end
update_domain(*args) click to toggle source

Updates a domain with a new name

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_domain.rb, line 9
def update_domain(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateDomain') 
  else
    options.merge!('command' => 'updateDomain', 
    'id' => args[0])
  end
  request(options)
end
update_egress_firewall_rule(*args) click to toggle source

Updates egress firewall rule

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_egress_firewall_rule.rb, line 9
def update_egress_firewall_rule(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateEgressFirewallRule') 
  else
    options.merge!('command' => 'updateEgressFirewallRule', 
    'id' => args[0])
  end
  request(options)
end
update_firewall_rule(*args) click to toggle source

Updates firewall rule

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_firewall_rule.rb, line 9
def update_firewall_rule(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateFirewallRule') 
  else
    options.merge!('command' => 'updateFirewallRule', 
    'id' => args[0])
  end
  request(options)
end
update_guest_os(*args) click to toggle source

Updates the information about Guest OS

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_guest_os.rb, line 9
def update_guest_os(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateGuestOs') 
  else
    options.merge!('command' => 'updateGuestOs', 
    'id' => args[0], 
    'osdisplayname' => args[1])
  end
  request(options)
end
update_guest_os_mapping(*args) click to toggle source

Updates the information about Guest OS to Hypervisor specific name mapping

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_guest_os_mapping.rb, line 9
def update_guest_os_mapping(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateGuestOsMapping') 
  else
    options.merge!('command' => 'updateGuestOsMapping', 
    'osnameforhypervisor' => args[0], 
    'id' => args[1])
  end
  request(options)
end
update_host(*args) click to toggle source

Updates a host.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_host.rb, line 9
def update_host(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateHost') 
  else
    options.merge!('command' => 'updateHost', 
    'id' => args[0])
  end
  request(options)
end
update_host_password(*args) click to toggle source

Update password of a host/pool on management server.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_host_password.rb, line 9
def update_host_password(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateHostPassword') 
  else
    options.merge!('command' => 'updateHostPassword', 
    'username' => args[0], 
    'password' => args[1])
  end
  request(options)
end
update_hypervisor_capabilities(*args) click to toggle source

Updates a hypervisor capabilities.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_hypervisor_capabilities.rb, line 9
def update_hypervisor_capabilities(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateHypervisorCapabilities') 
  else
    options.merge!('command' => 'updateHypervisorCapabilities')
  end
  request(options)
end
update_instance_group(*args) click to toggle source

Updates a vm group

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_instance_group.rb, line 9
def update_instance_group(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateInstanceGroup') 
  else
    options.merge!('command' => 'updateInstanceGroup', 
    'id' => args[0])
  end
  request(options)
end
update_ip_address(*args) click to toggle source

Updates an ip address

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_ip_address.rb, line 9
def update_ip_address(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateIpAddress') 
  else
    options.merge!('command' => 'updateIpAddress', 
    'id' => args[0])
  end
  request(options)
end
update_iso(*args) click to toggle source

Updates an ISO file.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_iso.rb, line 9
def update_iso(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateIso') 
  else
    options.merge!('command' => 'updateIso', 
    'id' => args[0])
  end
  request(options)
end
update_iso_permissions(*args) click to toggle source

Updates iso permissions

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_iso_permissions.rb, line 9
def update_iso_permissions(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateIsoPermissions') 
  else
    options.merge!('command' => 'updateIsoPermissions', 
    'id' => args[0])
  end
  request(options)
end
update_lb_health_check_policy(*args) click to toggle source

Updates LB HealthCheck policy

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_lb_health_check_policy.rb, line 9
def update_lb_health_check_policy(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateLBHealthCheckPolicy') 
  else
    options.merge!('command' => 'updateLBHealthCheckPolicy', 
    'id' => args[0])
  end
  request(options)
end
update_lb_stickiness_policy(*args) click to toggle source

Updates LB Stickiness policy

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_lb_stickiness_policy.rb, line 9
def update_lb_stickiness_policy(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateLBStickinessPolicy') 
  else
    options.merge!('command' => 'updateLBStickinessPolicy', 
    'id' => args[0])
  end
  request(options)
end
update_load_balancer_rule(*args) click to toggle source

Updates load balancer

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_load_balancer_rule.rb, line 9
def update_load_balancer_rule(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateLoadBalancerRule') 
  else
    options.merge!('command' => 'updateLoadBalancerRule', 
    'id' => args[0])
  end
  request(options)
end
update_network(*args) click to toggle source

Updates a network

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_network.rb, line 9
def update_network(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateNetwork') 
  else
    options.merge!('command' => 'updateNetwork', 
    'id' => args[0])
  end
  request(options)
end
update_network_acl_item(*args) click to toggle source

Updates ACL Item with specified Id

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_network_acl_item.rb, line 9
def update_network_acl_item(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateNetworkACLItem') 
  else
    options.merge!('command' => 'updateNetworkACLItem', 
    'id' => args[0])
  end
  request(options)
end
update_network_acl_list(*args) click to toggle source

Updates Network ACL list

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_network_acl_list.rb, line 9
def update_network_acl_list(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateNetworkACLList') 
  else
    options.merge!('command' => 'updateNetworkACLList', 
    'id' => args[0])
  end
  request(options)
end
update_network_offering(*args) click to toggle source

Updates a network offering.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_network_offering.rb, line 9
def update_network_offering(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateNetworkOffering') 
  else
    options.merge!('command' => 'updateNetworkOffering')
  end
  request(options)
end
update_network_service_provider(*args) click to toggle source

Updates a network serviceProvider of a physical network

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_network_service_provider.rb, line 9
def update_network_service_provider(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateNetworkServiceProvider') 
  else
    options.merge!('command' => 'updateNetworkServiceProvider', 
    'id' => args[0])
  end
  request(options)
end
update_physical_network(*args) click to toggle source

Updates a physical network

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_physical_network.rb, line 9
def update_physical_network(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updatePhysicalNetwork') 
  else
    options.merge!('command' => 'updatePhysicalNetwork', 
    'id' => args[0])
  end
  request(options)
end
update_pod(*args) click to toggle source

Updates a Pod.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_pod.rb, line 9
def update_pod(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updatePod') 
  else
    options.merge!('command' => 'updatePod', 
    'id' => args[0])
  end
  request(options)
end
update_port_forwarding_rule(*args) click to toggle source

Updates a port forwarding rule. Only the private port and the virtual machine can be updated.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_port_forwarding_rule.rb, line 9
def update_port_forwarding_rule(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updatePortForwardingRule') 
  else
    options.merge!('command' => 'updatePortForwardingRule', 
    'id' => args[0])
  end
  request(options)
end
update_project(*args) click to toggle source

Updates a project

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_project.rb, line 9
def update_project(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateProject') 
  else
    options.merge!('command' => 'updateProject', 
    'id' => args[0])
  end
  request(options)
end
update_project_invitation(*args) click to toggle source

Accepts or declines project invitation

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_project_invitation.rb, line 9
def update_project_invitation(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateProjectInvitation') 
  else
    options.merge!('command' => 'updateProjectInvitation', 
    'projectid' => args[0])
  end
  request(options)
end
update_region(*args) click to toggle source

Updates a region

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_region.rb, line 9
def update_region(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateRegion') 
  else
    options.merge!('command' => 'updateRegion', 
    'id' => args[0])
  end
  request(options)
end
update_remote_access_vpn(*args) click to toggle source

Updates remote access vpn

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_remote_access_vpn.rb, line 9
def update_remote_access_vpn(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateRemoteAccessVpn') 
  else
    options.merge!('command' => 'updateRemoteAccessVpn', 
    'id' => args[0])
  end
  request(options)
end
update_resource_count(*args) click to toggle source

Recalculate and update resource count for an account or domain.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_resource_count.rb, line 9
def update_resource_count(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateResourceCount') 
  else
    options.merge!('command' => 'updateResourceCount', 
    'domainid' => args[0])
  end
  request(options)
end
update_resource_limit(*args) click to toggle source

Updates resource limits for an account or domain.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_resource_limit.rb, line 9
def update_resource_limit(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateResourceLimit') 
  else
    options.merge!('command' => 'updateResourceLimit', 
    'resourcetype' => args[0])
  end
  request(options)
end
update_service_offering(*args) click to toggle source

Updates a service offering.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_service_offering.rb, line 9
def update_service_offering(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateServiceOffering') 
  else
    options.merge!('command' => 'updateServiceOffering', 
    'id' => args[0])
  end
  request(options)
end
update_storage_network_ip_range(*args) click to toggle source

Update a Storage network IP range, only allowed when no IPs in this range have been allocated.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_storage_network_ip_range.rb, line 9
def update_storage_network_ip_range(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateStorageNetworkIpRange') 
  else
    options.merge!('command' => 'updateStorageNetworkIpRange', 
    'id' => args[0])
  end
  request(options)
end
update_storage_pool(*args) click to toggle source

Updates a storage pool.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_storage_pool.rb, line 9
def update_storage_pool(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateStoragePool') 
  else
    options.merge!('command' => 'updateStoragePool', 
    'id' => args[0])
  end
  request(options)
end
update_template(*args) click to toggle source

Updates attributes of a template.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_template.rb, line 9
def update_template(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateTemplate') 
  else
    options.merge!('command' => 'updateTemplate', 
    'id' => args[0])
  end
  request(options)
end
update_template_permissions(*args) click to toggle source

Updates a template visibility permissions. A public template is visible to all accounts within the same domain. A private template is visible only to the owner of the template. A priviledged template is a private template with account permissions added. Only accounts specified under the template permissions are visible to them.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_template_permissions.rb, line 9
def update_template_permissions(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateTemplatePermissions') 
  else
    options.merge!('command' => 'updateTemplatePermissions', 
    'id' => args[0])
  end
  request(options)
end
update_user(*args) click to toggle source

Updates a user account

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_user.rb, line 9
def update_user(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateUser') 
  else
    options.merge!('command' => 'updateUser', 
    'id' => args[0])
  end
  request(options)
end
update_virtual_machine(*args) click to toggle source

Updates properties of a virtual machine. The VM has to be stopped and restarted for the new properties to take effect. UpdateVirtualMachine does not first check whether the VM is stopped. Therefore, stop the VM manually before issuing this call.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_virtual_machine.rb, line 9
def update_virtual_machine(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateVirtualMachine') 
  else
    options.merge!('command' => 'updateVirtualMachine', 
    'id' => args[0])
  end
  request(options)
end
update_vm_affinity_group(*args) click to toggle source

Updates the affinity/anti-affinity group associations of a virtual machine. The VM has to be stopped and restarted for the new properties to take effect.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_vm_affinity_group.rb, line 9
def update_vm_affinity_group(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateVMAffinityGroup') 
  else
    options.merge!('command' => 'updateVMAffinityGroup', 
    'id' => args[0])
  end
  request(options)
end
update_volume(*args) click to toggle source

Updates the volume.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_volume.rb, line 9
def update_volume(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateVolume') 
  else
    options.merge!('command' => 'updateVolume')
  end
  request(options)
end
update_vpc(*args) click to toggle source

Updates a VPC

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_vpc.rb, line 9
def update_vpc(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateVPC') 
  else
    options.merge!('command' => 'updateVPC', 
    'id' => args[0])
  end
  request(options)
end
update_vpcoffering(*args) click to toggle source

Updates VPC offering

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_vpcoffering.rb, line 9
def update_vpcoffering(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateVPCOffering') 
  else
    options.merge!('command' => 'updateVPCOffering', 
    'id' => args[0])
  end
  request(options)
end
update_vpn_connection(*args) click to toggle source

Updates site to site vpn connection

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_vpn_connection.rb, line 9
def update_vpn_connection(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateVpnConnection') 
  else
    options.merge!('command' => 'updateVpnConnection', 
    'id' => args[0])
  end
  request(options)
end
update_vpn_customer_gateway(*args) click to toggle source

Update site to site vpn customer gateway

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_vpn_customer_gateway.rb, line 9
def update_vpn_customer_gateway(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateVpnCustomerGateway') 
  else
    options.merge!('command' => 'updateVpnCustomerGateway', 
    'id' => args[0], 
    'gateway' => args[1], 
    'cidrlist' => args[2], 
    'ipsecpsk' => args[3], 
    'esppolicy' => args[4], 
    'ikepolicy' => args[5])
  end
  request(options)
end
update_vpn_gateway(*args) click to toggle source

Updates site to site vpn local gateway

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_vpn_gateway.rb, line 9
def update_vpn_gateway(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateVpnGateway') 
  else
    options.merge!('command' => 'updateVpnGateway', 
    'id' => args[0])
  end
  request(options)
end
update_zone(*args) click to toggle source

Updates a Zone.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/update_zone.rb, line 9
def update_zone(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'updateZone') 
  else
    options.merge!('command' => 'updateZone', 
    'id' => args[0])
  end
  request(options)
end
upgrade_router_template(*args) click to toggle source

Upgrades router to use newer template

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/upgrade_router_template.rb, line 9
def upgrade_router_template(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'upgradeRouterTemplate') 
  else
    options.merge!('command' => 'upgradeRouterTemplate')
  end
  request(options)
end
upload_custom_certificate(*args) click to toggle source

Uploads a custom certificate for the console proxy VMs to use for SSL. Can be used to upload a single certificate signed by a known CA. Can also be used, through multiple calls, to upload a chain of certificates from CA to the custom certificate itself.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/upload_custom_certificate.rb, line 9
def upload_custom_certificate(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'uploadCustomCertificate') 
  else
    options.merge!('command' => 'uploadCustomCertificate', 
    'domainsuffix' => args[0], 
    'certificate' => args[1])
  end
  request(options)
end
upload_ssl_cert(*args) click to toggle source

Upload a certificate to Cosmic

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/upload_ssl_cert.rb, line 9
def upload_ssl_cert(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'uploadSslCert') 
  else
    options.merge!('command' => 'uploadSslCert', 
    'certificate' => args[0], 
    'privatekey' => args[1])
  end
  request(options)
end
upload_volume(*args) click to toggle source

Uploads a data disk.

Cosmic API Reference

# File lib/fog/cosmic/requests/compute/upload_volume.rb, line 9
def upload_volume(*args)
  options = {}
  if args[0].is_a? Hash
    options = args[0]
    options.merge!('command' => 'uploadVolume')
  else
    options.merge!('command' => 'uploadVolume',
    'url' => args[0],
    'format' => args[1],
    'zoneid' => args[2],
    'name' => args[3])
  end
  # add project id if we have one
  @cosmic_project_id ? options.merge!('projectid' => @cosmic_project_id) : nil
  request(options)
end

Private Instance Methods

authorize_api_keys(params) click to toggle source
# File lib/fog/cosmic/compute.rb, line 487
def authorize_api_keys(params)
  headers = {}
  # merge the api key into the params
  params.merge!('apiKey' => @cosmic_api_key)
  # sign the request parameters
  signature = Fog::Cosmic.signed_params(@cosmic_secret_access_key,params)
  # merge signature into request param
  params.merge!({'signature' => signature})

  return params, headers
end
authorize_session(params) click to toggle source
# File lib/fog/cosmic/compute.rb, line 478
def authorize_session(params)
  # set the session id cookie for the request
  headers = {'Cookie' => "JSESSIONID=#{@cosmic_session_id};"}
  # set the sesion key for the request, params are not signed using session auth
  params.merge!('sessionkey' => @cosmic_session_key)

  return params, headers
end
has_keys?() click to toggle source
# File lib/fog/cosmic/compute.rb, line 474
def has_keys?
  @cosmic_api_key && @cosmic_secret_access_key
end
has_session?() click to toggle source
# File lib/fog/cosmic/compute.rb, line 470
def has_session?
  @cosmic_session_id && @cosmic_session_key
end
issue_request(params={},headers={},method='GET',expects=200) click to toggle source
# File lib/fog/cosmic/compute.rb, line 499
def issue_request(params={},headers={},method='GET',expects=200)
  begin
    @connection.request({
      :query => params,
      :headers => headers,
      :method => method,
      :expects => expects
    })

  rescue Excon::Errors::HTTPStatusError => error
    error_response = Fog::JSON.decode(error.response.body)

    error_code = error_response.values.first['errorcode']
    error_text = error_response.values.first['errortext']

    case error_code
    when 401
      raise Fog::Cosmic::Compute::Unauthorized, error_text
    when 431
      raise Fog::Cosmic::Compute::BadRequest, error_text
    else
      raise Fog::Cosmic::Compute::Error, error_text
    end
  end

end