Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/cloudstack_ruby_client/api/accounts_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ module Usage
:list_traffic_type_implementors,
:generate_usage_records,
:list_usage_records,
:list_usage_types,
:add_traffic_monitor,
:delete_traffic_monitor,
:list_traffic_monitors
end
end
end
end
9 changes: 9 additions & 0 deletions lib/cloudstack_ruby_client/api/address_api.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module CloudstackRubyClient
module Api
module Address
cmd_processor :associate_ip_address,
:disassociate_ip_address,
:list_public_ip_addresses
end
end
end
7 changes: 7 additions & 0 deletions lib/cloudstack_ruby_client/api/alert_api.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module CloudstackRubyClient
module Api
module Alert
cmd_processor :list_alerts
end
end
end
9 changes: 9 additions & 0 deletions lib/cloudstack_ruby_client/api/bigswitchvns_api.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module CloudstackRubyClient
module Api
module BigSwitchVNS
cmd_processor :add_big_switch_vns_device,
:delete_big_switch_vns_device,
:list_big_switch_vns_devices
end
end
end
7 changes: 7 additions & 0 deletions lib/cloudstack_ruby_client/api/certificate_api.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module CloudstackRubyClient
module Api
module Certificate
cmd_processor :upload_custom_certificate
end
end
end
7 changes: 7 additions & 0 deletions lib/cloudstack_ruby_client/api/cloudidentifier_api.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module CloudstackRubyClient
module Api
module CloudIdentifier
cmd_processor :get_cloud_identifier
end
end
end
9 changes: 9 additions & 0 deletions lib/cloudstack_ruby_client/api/guestos_api.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module CloudstackRubyClient
module Api
module GuestOs
cmd_processor :list_os_types,
:list_os_categories
end
end
end

7 changes: 7 additions & 0 deletions lib/cloudstack_ruby_client/api/hypervisor_api.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module CloudstackRubyClient
module Api
module Hypervisor
cmd_processor :list_hypervisors
end
end
end
16 changes: 10 additions & 6 deletions lib/cloudstack_ruby_client/api/infra_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,43 @@ module Region
:remove_region,
:list_regions
end

module Zone
cmd_processor :list_zones,
:create_zone,
:update_zone,
:delete_zone,
:dedicate_zone
:dedicate_zone,
:mark_default_zone_for_account
end

module Pod
cmd_processor :list_pods,
:create_pod,
:update_pod,
:delete_pod,
:dedicate_pod
end

module Cluster
cmd_processor :list_clusters,
:add_cluster,
:update_cluster,
:delete_cluster,
:dedicate_cluster
end

module Host
cmd_processor :list_hosts,
:add_host,
:update_host,
:delete_host,
:dedicate_host,
:reconnect_host,
:add_secondary_storage
:add_secondary_storage,
:prepare_host_for_maintenance,
:cancel_host_maintenance,
:update_host_password
end
end
end
9 changes: 9 additions & 0 deletions lib/cloudstack_ruby_client/api/ldap_api.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module CloudstackRubyClient
module Api
module Ldap
cmd_processor :ldap_config,
:ldap_remove
end
end
end

26 changes: 13 additions & 13 deletions lib/cloudstack_ruby_client/api/network_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,64 +6,64 @@ module NetworkOffering
:delete_network_offering,
:list_network_offerings
end

module Network
cmd_processor :create_network,
:delete_network,
:list_networks,
:restart_network,
:update_network
end

module PhysicalNetwork
cmd_processor :create_physical_network,
:delete_physical_network,
:list_physical_networks,
:update_physical_network
end

module NetworkServiceProvider
cmd_processor :list_supported_network_services,
:add_network_service_provider,
:delete_network_service_provider,
:list_network_service_providers,
:update_network_service_provider
end

module StorageIpRange
cmd_processor :create_storage_network_ip_range,
:delete_storage_network_ip_range,
:list_storage_network_ip_range,
:update_storage_network_ip_range
end

module NetworkDevice
cmd_processor :add_network_device,
:list_network_device,
:delete_network_device
end

module NetworkACL
cmd_processor :create_network_acl,
:delete_network_acl,
:list_network_acls,
:list_nicira_nvp_device_networks
end

module Vlan
cmd_processor :create_vlan_ip_range,
:delete_vlan_ip_range,
:list_vlan_ip_ranges
end

module Nat
cmd_processor :enable_static_nat,
:create_ip_forwarding_rule,
:delete_ip_forwarding_rule,
:list_ip_forwarding_rules,
:disable_static_nat
end

module VPN
cmd_processor :create_remote_access_vpn,
:delete_remote_access_vpn,
Expand All @@ -80,7 +80,7 @@ module VPN
:list_vpn_gateways,
:list_vpn_connections
end

module LoadBalancer
cmd_processor :create_load_balancer_rule,
:delete_load_balancer_rule,
Expand All @@ -89,11 +89,11 @@ module LoadBalancer
:create_lb_stickiness_policy,
:delete_lb_stickiness_policy,
:list_load_balancer_rules,
:list_lb_Stickiness_policies,
:list_lb_stickiness_policies,
:list_load_balancer_rule_instances,
:update_load_balancer_rule
end

module VPC
cmd_processor :create_vpc,
:list_vpcs,
Expand All @@ -112,4 +112,4 @@ module VPC
:list_static_routes
end
end
end
end
9 changes: 9 additions & 0 deletions lib/cloudstack_ruby_client/api/niciranvp_api.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module CloudstackRubyClient
module Api
module NiciraNvp
cmd_processor :add_nicira_nvp_device,
:delete_nicira_nvp_device,
:list_nicira_nvp_devices
end
end
end
9 changes: 9 additions & 0 deletions lib/cloudstack_ruby_client/api/s3_api.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module CloudstackRubyClient
module Api
module S3
cmd_processor :add_s3,
:list_s3s
end
end
end

9 changes: 9 additions & 0 deletions lib/cloudstack_ruby_client/api/sshkeypair_api.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module CloudstackRubyClient
module Api
module Ssh
cmd_processor :create_ssh_key_pair,
:delete_ssh_key_pair,
:list_ssh_key_pairs
end
end
end
9 changes: 9 additions & 0 deletions lib/cloudstack_ruby_client/api/swift_api.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module CloudstackRubyClient
module Api
module Swift
cmd_processor :add_swift,
:list_swifts
end
end
end

7 changes: 7 additions & 0 deletions lib/cloudstack_ruby_client/api/systemcapacity_api.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module CloudstackRubyClient
module Api
module SystemCapacity
cmd_processor :list_capacity
end
end
end
9 changes: 9 additions & 0 deletions lib/cloudstack_ruby_client/api/tag_api.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module CloudstackRubyClient
module Api
module Tags
cmd_processor :create_tags,
:delete_tags,
:list_tags
end
end
end
11 changes: 6 additions & 5 deletions lib/cloudstack_ruby_client/client_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Module
/getvmpassword/i => 'getVMPassword'
}

#
#
# The following is malformed response title in ACS, should be fixed
#
MALFORMED_RESPONSES = {
Expand All @@ -21,6 +21,7 @@ class Module
/activateproject/i => 'activaterojectresponse',
/listnetworkdevice/i => 'listnetworkdevice',
/listniciranvpdevicenetworks/i => 'listniciranvpdevicenetworks',
/listniciranvpdevices/i => 'listniciranvpdeviceresponse',
/cancelstoragemaintenance/i => 'cancelprimarystoragemaintenanceresponse',
/enablestoragemaintenance/i => 'prepareprimarystorageformaintenanceresponse',
/copyiso/i => 'copytemplateresponse',
Expand Down Expand Up @@ -75,14 +76,14 @@ def #{arg}(args={});
if /.*vpc.*/i =~ command
command.gsub!(/vpc/i, 'VPC')
end
} +
} +
%Q{
params = {'command' => command}
params.merge!(args) unless args.empty?

response = request(params)
json = JSON.parse(response.body)

if !response.is_a?(Net::HTTPOK)
if ["431","530"].include?(response.code) and ["9999","4350"].include?(json[resp_title]['cserrorcode'])
raise ArgumentError, json[resp_title]['errortext']
Expand All @@ -96,8 +97,8 @@ def #{arg}(args={});
json[resp_title]
end
}

self.class_eval(meta_method)
end
end
end
end