morpheus-cli 5.3.2.3 → 5.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Dockerfile +1 -1
- data/lib/morpheus/api/account_users_interface.rb +68 -0
- data/lib/morpheus/api/api_client.rb +75 -8
- data/lib/morpheus/api/audit_interface.rb +9 -0
- data/lib/morpheus/api/clouds_interface.rb +4 -11
- data/lib/morpheus/api/health_interface.rb +37 -3
- data/lib/morpheus/api/instances_interface.rb +39 -5
- data/lib/morpheus/api/load_balancer_monitors_interface.rb +9 -0
- data/lib/morpheus/api/load_balancer_profiles_interface.rb +9 -0
- data/lib/morpheus/api/load_balancer_virtual_servers_interface.rb +9 -0
- data/lib/morpheus/api/load_balancers_interface.rb +5 -0
- data/lib/morpheus/api/network_dhcp_relays_interface.rb +36 -0
- data/lib/morpheus/api/network_dhcp_servers_interface.rb +36 -0
- data/lib/morpheus/api/network_edge_clusters_interface.rb +26 -0
- data/lib/morpheus/api/network_routers_interface.rb +30 -0
- data/lib/morpheus/api/network_servers_interface.rb +98 -0
- data/lib/morpheus/api/network_static_routes_interface.rb +36 -0
- data/lib/morpheus/api/read_interface.rb +4 -3
- data/lib/morpheus/api/rest_interface.rb +5 -4
- data/lib/morpheus/api/roles_interface.rb +7 -0
- data/lib/morpheus/api/secondary_read_interface.rb +1 -1
- data/lib/morpheus/api/secondary_rest_interface.rb +19 -19
- data/lib/morpheus/api/storage_server_types_interface.rb +14 -0
- data/lib/morpheus/api/storage_servers_interface.rb +9 -0
- data/lib/morpheus/api/storage_volume_types_interface.rb +9 -0
- data/lib/morpheus/api/storage_volumes_interface.rb +9 -0
- data/lib/morpheus/api/users_interface.rb +16 -63
- data/lib/morpheus/api/virtual_images_interface.rb +23 -2
- data/lib/morpheus/api/virtual_servers_interface.rb +9 -0
- data/lib/morpheus/cli/cli_command.rb +274 -19
- data/lib/morpheus/cli/cli_registry.rb +56 -2
- data/lib/morpheus/cli/{access_token_command.rb → commands/access_token_command.rb} +1 -1
- data/lib/morpheus/cli/{account_groups_command.rb → commands/account_groups_command.rb} +0 -8
- data/lib/morpheus/cli/{activity_command.rb → commands/activity_command.rb} +0 -0
- data/lib/morpheus/cli/commands/{standard/alias_command.rb → alias_command.rb} +1 -4
- data/lib/morpheus/cli/{appliance_settings_command.rb → commands/appliance_settings_command.rb} +0 -0
- data/lib/morpheus/cli/{approvals_command.rb → commands/approvals_command.rb} +0 -0
- data/lib/morpheus/cli/{apps.rb → commands/apps.rb} +17 -89
- data/lib/morpheus/cli/{archives_command.rb → commands/archives_command.rb} +0 -6
- data/lib/morpheus/cli/commands/audit.rb +188 -0
- data/lib/morpheus/cli/{backup_jobs_command.rb → commands/backup_jobs_command.rb} +0 -0
- data/lib/morpheus/cli/{backup_settings_command.rb → commands/backup_settings_command.rb} +0 -0
- data/lib/morpheus/cli/{backups_command.rb → commands/backups_command.rb} +0 -0
- data/lib/morpheus/cli/commands/{standard/benchmark_command.rb → benchmark_command.rb} +0 -3
- data/lib/morpheus/cli/{blueprints_command.rb → commands/blueprints_command.rb} +1 -1
- data/lib/morpheus/cli/{boot_scripts_command.rb → commands/boot_scripts_command.rb} +0 -3
- data/lib/morpheus/cli/{budgets_command.rb → commands/budgets_command.rb} +0 -0
- data/lib/morpheus/cli/commands/{standard/cat_command.rb → cat_command.rb} +0 -0
- data/lib/morpheus/cli/{catalog_item_types_command.rb → commands/catalog_item_types_command.rb} +0 -0
- data/lib/morpheus/cli/{certificates_command.rb → commands/certificates_command.rb} +0 -0
- data/lib/morpheus/cli/commands/change_password_command.rb +132 -0
- data/lib/morpheus/cli/{cloud_datastores_command.rb → commands/cloud_datastores_command.rb} +0 -4
- data/lib/morpheus/cli/{cloud_folders_command.rb → commands/cloud_folders_command.rb} +0 -4
- data/lib/morpheus/cli/{cloud_resource_pools_command.rb → commands/cloud_resource_pools_command.rb} +170 -138
- data/lib/morpheus/cli/{clouds.rb → commands/clouds.rb} +22 -47
- data/lib/morpheus/cli/{clusters.rb → commands/clusters.rb} +86 -49
- data/lib/morpheus/cli/commands/{standard/coloring_command.rb → coloring_command.rb} +0 -2
- data/lib/morpheus/cli/{containers_command.rb → commands/containers_command.rb} +0 -7
- data/lib/morpheus/cli/commands/{standard/curl_command.rb → curl_command.rb} +0 -3
- data/lib/morpheus/cli/{cypher_command.rb → commands/cypher_command.rb} +0 -1
- data/lib/morpheus/cli/{dashboard_command.rb → commands/dashboard_command.rb} +0 -2
- data/lib/morpheus/cli/commands/{standard/debug_command.rb → debug_command.rb} +0 -1
- data/lib/morpheus/cli/{deploy.rb → commands/deploy.rb} +0 -1
- data/lib/morpheus/cli/{deployments.rb → commands/deployments.rb} +0 -0
- data/lib/morpheus/cli/{deploys.rb → commands/deploys.rb} +0 -1
- data/lib/morpheus/cli/{doc.rb → commands/doc.rb} +1 -1
- data/lib/morpheus/cli/commands/{standard/echo_command.rb → echo_command.rb} +0 -2
- data/lib/morpheus/cli/commands/{standard/edit_profile_command.rb → edit_profile_command.rb} +15 -4
- data/lib/morpheus/cli/commands/{standard/edit_rc_command.rb → edit_rc_command.rb} +19 -3
- data/lib/morpheus/cli/{environments_command.rb → commands/environments_command.rb} +0 -5
- data/lib/morpheus/cli/{execute_schedules_command.rb → commands/execute_schedules_command.rb} +0 -0
- data/lib/morpheus/cli/{execution_request_command.rb → commands/execution_request_command.rb} +0 -2
- data/lib/morpheus/cli/commands/{standard/exit_command.rb → exit_command.rb} +0 -2
- data/lib/morpheus/cli/{file_copy_request_command.rb → commands/file_copy_request_command.rb} +0 -4
- data/lib/morpheus/cli/{forgot_password.rb → commands/forgot_password.rb} +0 -0
- data/lib/morpheus/cli/commands/{standard/get_prompt_command.rb → get_prompt_command.rb} +0 -3
- data/lib/morpheus/cli/{groups.rb → commands/groups.rb} +0 -7
- data/lib/morpheus/cli/{guidance_command.rb → commands/guidance_command.rb} +1 -1
- data/lib/morpheus/cli/{health_command.rb → commands/health_command.rb} +104 -19
- data/lib/morpheus/cli/commands/{standard/history_command.rb → history_command.rb} +0 -3
- data/lib/morpheus/cli/{hosts.rb → commands/hosts.rb} +15 -25
- data/lib/morpheus/cli/{image_builder_command.rb → commands/image_builder_command.rb} +2 -8
- data/lib/morpheus/cli/{instance_types.rb → commands/instance_types.rb} +0 -3
- data/lib/morpheus/cli/{instances.rb → commands/instances.rb} +473 -150
- data/lib/morpheus/cli/{integrations_command.rb → commands/integrations_command.rb} +0 -0
- data/lib/morpheus/cli/{invoices_command.rb → commands/invoices_command.rb} +118 -134
- data/lib/morpheus/cli/{jobs_command.rb → commands/jobs_command.rb} +0 -0
- data/lib/morpheus/cli/{key_pairs.rb → commands/key_pairs.rb} +0 -6
- data/lib/morpheus/cli/{library_cluster_layouts_command.rb → commands/library_cluster_layouts_command.rb} +20 -4
- data/lib/morpheus/cli/{library_container_scripts_command.rb → commands/library_container_scripts_command.rb} +0 -0
- data/lib/morpheus/cli/{library_container_templates_command.rb → commands/library_container_templates_command.rb} +0 -1
- data/lib/morpheus/cli/{library_container_types_command.rb → commands/library_container_types_command.rb} +0 -4
- data/lib/morpheus/cli/{library_instance_types_command.rb → commands/library_instance_types_command.rb} +0 -4
- data/lib/morpheus/cli/{library_layouts_command.rb → commands/library_layouts_command.rb} +0 -4
- data/lib/morpheus/cli/{library_option_lists_command.rb → commands/library_option_lists_command.rb} +3 -7
- data/lib/morpheus/cli/{library_option_types_command.rb → commands/library_option_types_command.rb} +0 -4
- data/lib/morpheus/cli/{library_spec_templates_command.rb → commands/library_spec_templates_command.rb} +0 -1
- data/lib/morpheus/cli/{library_upgrades_command.rb → commands/library_upgrades_command.rb} +0 -4
- data/lib/morpheus/cli/{license.rb → commands/license.rb} +0 -3
- data/lib/morpheus/cli/commands/load_balancer_monitors.rb +71 -0
- data/lib/morpheus/cli/commands/load_balancer_pools.rb +91 -0
- data/lib/morpheus/cli/commands/load_balancer_profiles.rb +65 -0
- data/lib/morpheus/cli/{load_balancer_types.rb → commands/load_balancer_types.rb} +9 -8
- data/lib/morpheus/cli/commands/load_balancer_virtual_servers.rb +156 -0
- data/lib/morpheus/cli/commands/load_balancers.rb +176 -0
- data/lib/morpheus/cli/commands/{standard/log_level_command.rb → log_level_command.rb} +0 -3
- data/lib/morpheus/cli/{log_settings_command.rb → commands/log_settings_command.rb} +0 -0
- data/lib/morpheus/cli/{login.rb → commands/login.rb} +0 -5
- data/lib/morpheus/cli/commands/logout.rb +63 -0
- data/lib/morpheus/cli/{logs_command.rb → commands/logs_command.rb} +0 -3
- data/lib/morpheus/cli/commands/{standard/man_command.rb → man_command.rb} +0 -2
- data/lib/morpheus/cli/{monitoring_alerts_command.rb → commands/monitoring_alerts_command.rb} +0 -7
- data/lib/morpheus/cli/{monitoring_apps_command.rb → commands/monitoring_apps_command.rb} +0 -1
- data/lib/morpheus/cli/{monitoring_checks_command.rb → commands/monitoring_checks_command.rb} +2 -1
- data/lib/morpheus/cli/{monitoring_contacts_command.rb → commands/monitoring_contacts_command.rb} +0 -7
- data/lib/morpheus/cli/{monitoring_groups_command.rb → commands/monitoring_groups_command.rb} +0 -1
- data/lib/morpheus/cli/{monitoring_incidents_command.rb → commands/monitoring_incidents_command.rb} +0 -1
- data/lib/morpheus/cli/commands/network_dhcp_relays_command.rb +416 -0
- data/lib/morpheus/cli/commands/network_dhcp_servers_command.rb +407 -0
- data/lib/morpheus/cli/{network_domains_command.rb → commands/network_domains_command.rb} +0 -4
- data/lib/morpheus/cli/commands/network_edge_clusters_command.rb +329 -0
- data/lib/morpheus/cli/commands/network_firewalls_command.rb +823 -0
- data/lib/morpheus/cli/{network_groups_command.rb → commands/network_groups_command.rb} +0 -4
- data/lib/morpheus/cli/{network_pool_servers_command.rb → commands/network_pool_servers_command.rb} +0 -4
- data/lib/morpheus/cli/{network_pools_command.rb → commands/network_pools_command.rb} +0 -4
- data/lib/morpheus/cli/{network_proxies_command.rb → commands/network_proxies_command.rb} +0 -4
- data/lib/morpheus/cli/{network_routers_command.rb → commands/network_routers_command.rb} +387 -57
- data/lib/morpheus/cli/{network_services_command.rb → commands/network_services_command.rb} +0 -4
- data/lib/morpheus/cli/commands/network_static_routes_command.rb +446 -0
- data/lib/morpheus/cli/commands/network_transport_zones_command.rb +452 -0
- data/lib/morpheus/cli/{networks_command.rb → commands/networks_command.rb} +21 -21
- data/lib/morpheus/cli/commands/open_command.rb +30 -0
- data/lib/morpheus/cli/commands/options.rb +98 -0
- data/lib/morpheus/cli/{packages_command.rb → commands/packages_command.rb} +0 -2
- data/lib/morpheus/cli/{ping.rb → commands/ping.rb} +0 -7
- data/lib/morpheus/cli/{policies_command.rb → commands/policies_command.rb} +1 -8
- data/lib/morpheus/cli/{power_schedules_command.rb → commands/power_schedules_command.rb} +0 -0
- data/lib/morpheus/cli/{preseed_scripts_command.rb → commands/preseed_scripts_command.rb} +0 -3
- data/lib/morpheus/cli/{price_sets_command.rb → commands/price_sets_command.rb} +0 -0
- data/lib/morpheus/cli/{prices_command.rb → commands/prices_command.rb} +7 -7
- data/lib/morpheus/cli/{processes_command.rb → commands/processes_command.rb} +0 -1
- data/lib/morpheus/cli/{projects_command.rb → commands/projects_command.rb} +0 -0
- data/lib/morpheus/cli/{provisioning_licenses_command.rb → commands/provisioning_licenses_command.rb} +0 -0
- data/lib/morpheus/cli/{provisioning_settings_command.rb → commands/provisioning_settings_command.rb} +0 -0
- data/lib/morpheus/cli/{recent_activity_command.rb → commands/recent_activity_command.rb} +0 -0
- data/lib/morpheus/cli/{remote.rb → commands/remote.rb} +5 -9
- data/lib/morpheus/cli/{reports_command.rb → commands/reports_command.rb} +0 -2
- data/lib/morpheus/cli/commands/{standard/rm_command.rb → rm_command.rb} +0 -0
- data/lib/morpheus/cli/{roles.rb → commands/roles.rb} +245 -40
- data/lib/morpheus/cli/{search_command.rb → commands/search_command.rb} +0 -0
- data/lib/morpheus/cli/{security_group_rules.rb → commands/security_group_rules.rb} +0 -5
- data/lib/morpheus/cli/{security_groups.rb → commands/security_groups.rb} +0 -6
- data/lib/morpheus/cli/{service_catalog_command.rb → commands/service_catalog_command.rb} +0 -0
- data/lib/morpheus/cli/{service_plans_command.rb → commands/service_plans_command.rb} +0 -0
- data/lib/morpheus/cli/commands/{standard/set_prompt_command.rb → set_prompt_command.rb} +0 -3
- data/lib/morpheus/cli/{setup.rb → commands/setup.rb} +0 -0
- data/lib/morpheus/cli/{shell.rb → commands/shell.rb} +4 -105
- data/lib/morpheus/cli/commands/{standard/sleep_command.rb → sleep_command.rb} +0 -2
- data/lib/morpheus/cli/commands/{standard/source_command.rb → source_command.rb} +0 -2
- data/lib/morpheus/cli/commands/{standard/ssl_verification_command.rb → ssl_verification_command.rb} +0 -3
- data/lib/morpheus/cli/{storage_providers_command.rb → commands/storage_providers_command.rb} +0 -4
- data/lib/morpheus/cli/commands/storage_server_types.rb +50 -0
- data/lib/morpheus/cli/commands/storage_servers.rb +122 -0
- data/lib/morpheus/cli/commands/storage_volume_types.rb +50 -0
- data/lib/morpheus/cli/commands/storage_volumes.rb +103 -0
- data/lib/morpheus/cli/{subnets_command.rb → commands/subnets_command.rb} +7 -6
- data/lib/morpheus/cli/{tasks.rb → commands/tasks.rb} +25 -6
- data/lib/morpheus/cli/commands/{standard/tee_command.rb → tee_command.rb} +0 -0
- data/lib/morpheus/cli/{tenants_command.rb → commands/tenants_command.rb} +1 -8
- data/lib/morpheus/cli/commands/{standard/update_command.rb → update_command.rb} +0 -1
- data/lib/morpheus/cli/{usage_command.rb → commands/usage_command.rb} +0 -0
- data/lib/morpheus/cli/{user_groups_command.rb → commands/user_groups_command.rb} +1 -2
- data/lib/morpheus/cli/{user_settings_command.rb → commands/user_settings_command.rb} +2 -1
- data/lib/morpheus/cli/{user_sources_command.rb → commands/user_sources_command.rb} +1 -2
- data/lib/morpheus/cli/{users.rb → commands/users.rb} +28 -35
- data/lib/morpheus/cli/{vdi_allocations_command.rb → commands/vdi_allocations_command.rb} +0 -0
- data/lib/morpheus/cli/{vdi_apps_command.rb → commands/vdi_apps_command.rb} +0 -0
- data/lib/morpheus/cli/{vdi_command.rb → commands/vdi_command.rb} +0 -0
- data/lib/morpheus/cli/{vdi_gateways_command.rb → commands/vdi_gateways_command.rb} +0 -0
- data/lib/morpheus/cli/{vdi_pools_command.rb → commands/vdi_pools_command.rb} +4 -1
- data/lib/morpheus/cli/commands/{standard/version_command.rb → version_command.rb} +0 -0
- data/lib/morpheus/cli/commands/view.rb +102 -0
- data/lib/morpheus/cli/{virtual_images.rb → commands/virtual_images.rb} +251 -33
- data/lib/morpheus/cli/{whitelabel_settings_command.rb → commands/whitelabel_settings_command.rb} +0 -1
- data/lib/morpheus/cli/{whoami.rb → commands/whoami.rb} +0 -4
- data/lib/morpheus/cli/{wiki_command.rb → commands/wiki_command.rb} +0 -5
- data/lib/morpheus/cli/{workflows.rb → commands/workflows.rb} +0 -3
- data/lib/morpheus/cli/mixins/accounts_helper.rb +5 -5
- data/lib/morpheus/cli/mixins/load_balancers_helper.rb +26 -6
- data/lib/morpheus/cli/mixins/logs_helper.rb +1 -1
- data/lib/morpheus/cli/mixins/print_helper.rb +51 -18
- data/lib/morpheus/cli/mixins/processes_helper.rb +1 -2
- data/lib/morpheus/cli/mixins/provisioning_helper.rb +167 -110
- data/lib/morpheus/cli/mixins/rest_command.rb +268 -94
- data/lib/morpheus/cli/mixins/secondary_rest_command.rb +668 -0
- data/lib/morpheus/cli/mixins/storage_servers_helper.rb +156 -0
- data/lib/morpheus/cli/mixins/storage_volumes_helper.rb +119 -0
- data/lib/morpheus/cli/option_parser.rb +25 -17
- data/lib/morpheus/cli/option_types.rb +137 -52
- data/lib/morpheus/cli/version.rb +1 -1
- data/lib/morpheus/cli.rb +6 -128
- data/lib/morpheus/ext/string.rb +29 -6
- data/lib/morpheus/routes.rb +238 -0
- data/lib/morpheus/terminal.rb +5 -6
- data/lib/morpheus/util.rb +6 -1
- data/morpheus-cli.gemspec +1 -1
- metadata +183 -149
- data/lib/morpheus/cli/change_password_command.rb +0 -147
- data/lib/morpheus/cli/library.rb +0 -1
- data/lib/morpheus/cli/load_balancers.rb +0 -245
- data/lib/morpheus/cli/logout.rb +0 -81
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6cb700dea3828e709872e3cbdd2273b369aeee43bc7f451a305101ee3e0d7385
|
4
|
+
data.tar.gz: 19414673dc1b1631b4221f6c280228cbc14f49b2a4356bc45a3a98a67bdfa9a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1cc0cd19da8b84cff01f68e92ad8f82261bb399beff06b99461b4e9fc4fa76b5e1553e3f7a2aacf0dff746f858b9ef805f9d5a2c058da3af7d71fbd2bf616cc
|
7
|
+
data.tar.gz: dc86c29c0192b1b82b5f449f6c1803f7476164c4444f7ee285d3db5397d7778ae0e45438b14ca27feab8d14269222cc59a17dd7a329c6962aeb8bd8cf2bb6962
|
data/Dockerfile
CHANGED
@@ -0,0 +1,68 @@
|
|
1
|
+
require 'morpheus/api/rest_interface'
|
2
|
+
|
3
|
+
class Morpheus::AccountUsersInterface < Morpheus::RestInterface
|
4
|
+
|
5
|
+
def base_path(account_id)
|
6
|
+
if account_id
|
7
|
+
"/api/accounts/#{account_id}/users"
|
8
|
+
else
|
9
|
+
"/api/users"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def list(account_id, params={}, headers={})
|
14
|
+
#validate_id!(account_id, "account_id")
|
15
|
+
execute(method: :get, url: "#{build_url(account_id)}", params: params, headers: headers)
|
16
|
+
end
|
17
|
+
|
18
|
+
def get(account_id, id, params={}, headers={})
|
19
|
+
#validate_id!(account_id, "account_id")
|
20
|
+
validate_id!(id)
|
21
|
+
execute(method: :get, url: "#{build_url(account_id, id)}", params: params, headers: headers)
|
22
|
+
end
|
23
|
+
|
24
|
+
def create(account_id, payload, params={}, headers={})
|
25
|
+
#validate_id!(account_id, "account_id")
|
26
|
+
execute(method: :post, url: "#{build_url(account_id)}", params: params, payload: payload, headers: headers)
|
27
|
+
end
|
28
|
+
|
29
|
+
def update(account_id, id, payload, params={}, headers={})
|
30
|
+
#validate_id!(account_id, "account_id")
|
31
|
+
validate_id!(id)
|
32
|
+
execute(method: :put, url: "#{build_url(account_id, id)}", params: params, payload: payload, headers: headers)
|
33
|
+
end
|
34
|
+
|
35
|
+
def destroy(account_id, id, params = {}, headers={})
|
36
|
+
#validate_id!(account_id, "account_id")
|
37
|
+
validate_id!(id)
|
38
|
+
execute(method: :delete, url: "#{build_url(account_id, id)}", params: params, headers: headers)
|
39
|
+
end
|
40
|
+
|
41
|
+
def feature_permissions(account_id, id, params={}, headers={})
|
42
|
+
#validate_id!(account_id, "account_id")
|
43
|
+
validate_id!(id)
|
44
|
+
execute(method: :get, url: "#{build_url(account_id, id)}/feature-permissions", params: params, headers: headers)
|
45
|
+
end
|
46
|
+
|
47
|
+
def permissions(account_id, id, params={}, headers={})
|
48
|
+
#validate_id!(account_id, "account_id")
|
49
|
+
validate_id!(id)
|
50
|
+
execute(method: :get, url: "#{build_url(account_id, id)}/permissions", params: params, headers: headers)
|
51
|
+
end
|
52
|
+
|
53
|
+
def available_roles(account_id, id=nil, params={}, headers={})
|
54
|
+
#validate_id!(account_id, "account_id")
|
55
|
+
execute(method: :get, url: "#{build_url(account_id, id)}/available-roles", params: params, headers: headers)
|
56
|
+
end
|
57
|
+
|
58
|
+
private
|
59
|
+
|
60
|
+
def build_url(account_id, id=nil)
|
61
|
+
url = base_path(account_id)
|
62
|
+
if id
|
63
|
+
url += "/#{CGI::escape(id.to_s)}"
|
64
|
+
end
|
65
|
+
url
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
@@ -1,7 +1,8 @@
|
|
1
1
|
require 'json'
|
2
2
|
require 'uri'
|
3
3
|
require 'cgi'
|
4
|
-
require '
|
4
|
+
require 'morpheus/rest_client'
|
5
|
+
# require 'rest-client'
|
5
6
|
|
6
7
|
class Morpheus::APIClient
|
7
8
|
|
@@ -241,7 +242,7 @@ class Morpheus::APIClient
|
|
241
242
|
# @verify_ssl is not used atm
|
242
243
|
# todo: finish this and use it instead of the global variable RestClient.ssl_verification_enabled?
|
243
244
|
# gotta clean up all APIClient subclasses new() methods to support this
|
244
|
-
# the CliCommand subclasses should be changed to @
|
245
|
+
# the CliCommand subclasses should be changed to @foos_interface = @api_client.foos
|
245
246
|
# also.. Credentials.new()
|
246
247
|
if @verify_ssl == false
|
247
248
|
opts[:verify_ssl] = OpenSSL::SSL::VERIFY_NONE
|
@@ -486,6 +487,14 @@ class Morpheus::APIClient
|
|
486
487
|
Morpheus::LoadBalancerPoolsInterface.new(common_interface_options).setopts(@options)
|
487
488
|
end
|
488
489
|
|
490
|
+
def load_balancer_profiles
|
491
|
+
Morpheus::LoadBalancerProfilesInterface.new(common_interface_options).setopts(@options)
|
492
|
+
end
|
493
|
+
|
494
|
+
def load_balancer_monitors
|
495
|
+
Morpheus::LoadBalancerMonitorsInterface.new(common_interface_options).setopts(@options)
|
496
|
+
end
|
497
|
+
|
489
498
|
def tasks
|
490
499
|
Morpheus::TasksInterface.new(common_interface_options).setopts(@options)
|
491
500
|
end
|
@@ -538,6 +547,10 @@ class Morpheus::APIClient
|
|
538
547
|
Morpheus::UsersInterface.new(common_interface_options).setopts(@options)
|
539
548
|
end
|
540
549
|
|
550
|
+
def account_users
|
551
|
+
Morpheus::AccountUsersInterface.new(common_interface_options).setopts(@options)
|
552
|
+
end
|
553
|
+
|
541
554
|
def user_groups
|
542
555
|
Morpheus::UserGroupsInterface.new(common_interface_options).setopts(@options)
|
543
556
|
end
|
@@ -684,6 +697,22 @@ class Morpheus::APIClient
|
|
684
697
|
Morpheus::StorageProvidersInterface.new(common_interface_options).setopts(@options)
|
685
698
|
end
|
686
699
|
|
700
|
+
def storage_servers
|
701
|
+
Morpheus::StorageServersInterface.new(common_interface_options).setopts(@options)
|
702
|
+
end
|
703
|
+
|
704
|
+
def storage_server_types
|
705
|
+
Morpheus::StorageServerTypesInterface.new(common_interface_options).setopts(@options)
|
706
|
+
end
|
707
|
+
|
708
|
+
def storage_volumes
|
709
|
+
Morpheus::StorageVolumesInterface.new(common_interface_options).setopts(@options)
|
710
|
+
end
|
711
|
+
|
712
|
+
def storage_volume_types
|
713
|
+
Morpheus::StorageVolumeTypesInterface.new(common_interface_options).setopts(@options)
|
714
|
+
end
|
715
|
+
|
687
716
|
def library_instance_types
|
688
717
|
Morpheus::LibraryInstanceTypesInterface.new(common_interface_options).setopts(@options)
|
689
718
|
end
|
@@ -768,14 +797,18 @@ class Morpheus::APIClient
|
|
768
797
|
Morpheus::WikiInterface.new(common_interface_options).setopts(@options)
|
769
798
|
end
|
770
799
|
|
771
|
-
def budgets
|
772
|
-
Morpheus::BudgetsInterface.new(common_interface_options).setopts(@options)
|
773
|
-
end
|
774
|
-
|
775
800
|
def health
|
776
801
|
Morpheus::HealthInterface.new(common_interface_options).setopts(@options)
|
777
802
|
end
|
778
803
|
|
804
|
+
def audit
|
805
|
+
Morpheus::AuditInterface.new(common_interface_options).setopts(@options)
|
806
|
+
end
|
807
|
+
|
808
|
+
def budgets
|
809
|
+
Morpheus::BudgetsInterface.new(common_interface_options).setopts(@options)
|
810
|
+
end
|
811
|
+
|
779
812
|
def invoices
|
780
813
|
Morpheus::InvoicesInterface.new(common_interface_options).setopts(@options)
|
781
814
|
end
|
@@ -836,12 +869,46 @@ class Morpheus::APIClient
|
|
836
869
|
Morpheus::VdiGatewaysInterface.new(common_interface_options).setopts(@options)
|
837
870
|
end
|
838
871
|
|
872
|
+
def network_servers
|
873
|
+
Morpheus::NetworkServersInterface.new(common_interface_options).setopts(@options)
|
874
|
+
end
|
875
|
+
|
876
|
+
def network_edge_clusters
|
877
|
+
Morpheus::NetworkEdgeClustersInterface.new(common_interface_options).setopts(@options)
|
878
|
+
end
|
879
|
+
|
880
|
+
def network_dhcp_servers
|
881
|
+
Morpheus::NetworkDhcpServersInterface.new(common_interface_options).setopts(@options)
|
882
|
+
end
|
883
|
+
|
884
|
+
def network_dhcp_relays
|
885
|
+
Morpheus::NetworkDhcpRelaysInterface.new(common_interface_options).setopts(@options)
|
886
|
+
end
|
887
|
+
|
888
|
+
def network_static_routes
|
889
|
+
Morpheus::NetworkStaticRoutesInterface.new(common_interface_options).setopts(@options)
|
890
|
+
end
|
891
|
+
|
892
|
+
def rest(endpoint)
|
893
|
+
Morpheus::RestInterface.new(common_interface_options).setopts(@options.merge({base_path: "#{@base_url}/api/#{endpoint}"}))
|
894
|
+
end
|
895
|
+
|
896
|
+
def interface(type)
|
897
|
+
type = type.to_s.singularize.underscore
|
898
|
+
interface_name = type.pluralize
|
899
|
+
if !respond_to?(interface_name)
|
900
|
+
raise "#{self.class} has not defined an interface method named '#{interface_name}'"
|
901
|
+
end
|
902
|
+
return send(interface_name)
|
903
|
+
end
|
904
|
+
alias :get_interface :interface
|
905
|
+
|
839
906
|
# add new interfaces here
|
840
907
|
|
841
908
|
protected
|
842
909
|
|
843
|
-
def validate_id!(id)
|
844
|
-
raise "#{self.class} passed a blank
|
910
|
+
def validate_id!(id, param_name='id')
|
911
|
+
raise "#{self.class} passed a blank #{param_name}!" if id.to_s.strip.empty?
|
845
912
|
end
|
846
913
|
|
847
914
|
end
|
@@ -24,17 +24,10 @@ class Morpheus::CloudsInterface < Morpheus::APIClient
|
|
24
24
|
execute(opts)
|
25
25
|
end
|
26
26
|
|
27
|
-
def get(params=
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
if params.is_a?(Hash)
|
32
|
-
headers[:params].merge!(params)
|
33
|
-
elsif params.is_a?(Numeric)
|
34
|
-
url = "#{@base_url}/api/zones/#{params}"
|
35
|
-
elsif params.is_a?(String)
|
36
|
-
headers[:params]['name'] = params
|
37
|
-
end
|
27
|
+
def get(id, params={})
|
28
|
+
validate_id!(id)
|
29
|
+
url = "#{@base_url}/api/zones/#{id}"
|
30
|
+
headers = { params: params, authorization: "Bearer #{@access_token}" }
|
38
31
|
opts = {method: :get, url: url, headers: headers}
|
39
32
|
execute(opts)
|
40
33
|
end
|
@@ -49,6 +49,13 @@ class Morpheus::HealthInterface < Morpheus::APIClient
|
|
49
49
|
execute(opts)
|
50
50
|
end
|
51
51
|
|
52
|
+
def notifications(params={})
|
53
|
+
url = "#{@base_url}/api/health/notifications"
|
54
|
+
headers = { params: params, authorization: "Bearer #{@access_token}" }
|
55
|
+
opts = {method: :get, url: url, headers: headers}
|
56
|
+
execute(opts)
|
57
|
+
end
|
58
|
+
|
52
59
|
def logs(params={})
|
53
60
|
url = "#{@base_url}/api/health/logs"
|
54
61
|
headers = { params: params, authorization: "Bearer #{@access_token}" }
|
@@ -56,11 +63,38 @@ class Morpheus::HealthInterface < Morpheus::APIClient
|
|
56
63
|
execute(opts)
|
57
64
|
end
|
58
65
|
|
59
|
-
def
|
60
|
-
url = "#{@base_url}/api/health/
|
66
|
+
def export_logs(outfile, params={})
|
67
|
+
url = "#{@base_url}/api/health/logs/export"
|
61
68
|
headers = { params: params, authorization: "Bearer #{@access_token}" }
|
62
69
|
opts = {method: :get, url: url, headers: headers}
|
63
|
-
execute(opts)
|
70
|
+
# execute(opts, {parse_json: false})
|
71
|
+
if Dir.exists?(outfile)
|
72
|
+
raise "outfile is invalid. It is the name of an existing directory: #{outfile}"
|
73
|
+
end
|
74
|
+
# if @verify_ssl == false
|
75
|
+
# opts[:verify_ssl] = OpenSSL::SSL::VERIFY_NONE
|
76
|
+
# end
|
77
|
+
if @dry_run
|
78
|
+
return opts
|
79
|
+
end
|
80
|
+
http_response = nil
|
81
|
+
bad_body = nil
|
82
|
+
File.open(outfile, 'w') {|f|
|
83
|
+
block = proc { |response|
|
84
|
+
if response.code.to_i == 200
|
85
|
+
response.read_body do |chunk|
|
86
|
+
#puts "writing to #{outfile} ..."
|
87
|
+
f.write chunk
|
88
|
+
end
|
89
|
+
else
|
90
|
+
# puts_error (#{response.inspect}) #{chunk} ..."
|
91
|
+
bad_body = response.body.to_s
|
92
|
+
end
|
93
|
+
}
|
94
|
+
opts[:block_response] = block
|
95
|
+
http_response = Morpheus::RestClient.execute(opts)
|
96
|
+
}
|
97
|
+
return http_response, bad_body
|
64
98
|
end
|
65
99
|
|
66
100
|
end
|
@@ -57,11 +57,24 @@ class Morpheus::InstancesInterface < Morpheus::APIClient
|
|
57
57
|
execute(opts)
|
58
58
|
end
|
59
59
|
|
60
|
-
def
|
61
|
-
url
|
62
|
-
|
63
|
-
|
64
|
-
|
60
|
+
def extend_shutdown(id, params={}, payload={}, headers={})
|
61
|
+
execute(method: :put, url: "#{base_path}/#{id}/extend-shutdown", params: params, payload: payload, headers: headers)
|
62
|
+
end
|
63
|
+
|
64
|
+
def extend_expiration(id, params={}, payload={}, headers={})
|
65
|
+
execute(method: :put, url: "#{base_path}/#{id}/extend-expiration", params: params, payload: payload, headers: headers)
|
66
|
+
end
|
67
|
+
|
68
|
+
def cancel_shutdown(id, params={}, payload={}, headers={})
|
69
|
+
execute(method: :put, url: "#{base_path}/#{id}/cancel-shutdown", params: params, payload: payload, headers: headers)
|
70
|
+
end
|
71
|
+
|
72
|
+
def cancel_expiration(id, params={}, payload={}, headers={})
|
73
|
+
execute(method: :put, url: "#{base_path}/#{id}/cancel-expiration", params: params, payload: payload, headers: headers)
|
74
|
+
end
|
75
|
+
|
76
|
+
def cancel_removal(id, params={}, payload={}, headers={})
|
77
|
+
execute(method: :put, url: "#{base_path}/#{id}/cancel-removal", params: params, payload: payload, headers: headers)
|
65
78
|
end
|
66
79
|
|
67
80
|
def stop(id, params={})
|
@@ -331,4 +344,25 @@ class Morpheus::InstancesInterface < Morpheus::APIClient
|
|
331
344
|
execute(method: :get, url: "/api/instances/#{id}/deploy", params: params)
|
332
345
|
end
|
333
346
|
|
347
|
+
def refresh(id, params, payload)
|
348
|
+
url = "#{@base_url}/api/instances/#{id}/refresh"
|
349
|
+
headers = {:params => params, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
350
|
+
opts = {method: :post, url: url, headers: headers, payload: payload.to_json}
|
351
|
+
execute(opts)
|
352
|
+
end
|
353
|
+
|
354
|
+
def apply(id, params, payload)
|
355
|
+
url = "#{@base_url}/api/instances/#{id}/apply"
|
356
|
+
headers = {:params => params, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
357
|
+
opts = {method: :post, url: url, headers: headers, payload: payload.to_json}
|
358
|
+
execute(opts)
|
359
|
+
end
|
360
|
+
|
361
|
+
def state_summary(id, params={})
|
362
|
+
url = "#{@base_url}/api/instances/#{id}/state-summary"
|
363
|
+
headers = { params: params, authorization: "Bearer #{@access_token}" }
|
364
|
+
opts = {method: :get, url: url, headers: headers}
|
365
|
+
execute(opts)
|
366
|
+
end
|
367
|
+
|
334
368
|
end
|
@@ -6,4 +6,13 @@ class Morpheus::LoadBalancerVirtualServersInterface < Morpheus::SecondaryRestInt
|
|
6
6
|
"/api/load-balancers/#{load_balancer_id}/virtual-servers"
|
7
7
|
end
|
8
8
|
|
9
|
+
def list(parent_id=nil, params={}, headers={})
|
10
|
+
if parent_id
|
11
|
+
validate_id!(parent_id)
|
12
|
+
execute(method: :get, url: "#{base_path(parent_id)}", params: params, headers: headers)
|
13
|
+
else
|
14
|
+
execute(method: :get, url: "/api/load-balancer-virtual-servers", params: params, headers: headers)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
9
18
|
end
|
@@ -6,4 +6,9 @@ class Morpheus::LoadBalancersInterface < Morpheus::RestInterface
|
|
6
6
|
"/api/load-balancers"
|
7
7
|
end
|
8
8
|
|
9
|
+
def refresh(id, payload, params={}, headers={})
|
10
|
+
validate_id!(id)
|
11
|
+
execute(method: :put, url: "#{base_path}/#{CGI::escape(id.to_s)}/refresh", params: params, payload: payload, headers: headers)
|
12
|
+
end
|
13
|
+
|
9
14
|
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'morpheus/api/api_client'
|
2
|
+
|
3
|
+
class Morpheus::NetworkDhcpRelaysInterface < Morpheus::RestInterface
|
4
|
+
|
5
|
+
def base_path
|
6
|
+
"/api/networks/servers"
|
7
|
+
end
|
8
|
+
|
9
|
+
def get_dhcp_relay(server_id, dhcp_relay_id, params={}, headers={})
|
10
|
+
validate_id!(server_id)
|
11
|
+
validate_id!(dhcp_relay_id)
|
12
|
+
execute(method: :get, url: "#{base_path}/#{server_id}/dhcp-relays/#{dhcp_relay_id}", params: params, headers: headers)
|
13
|
+
end
|
14
|
+
|
15
|
+
def list_dhcp_relays(server_id, params={}, headers={})
|
16
|
+
validate_id!(server_id)
|
17
|
+
execute(method: :get, url: "#{base_path}/#{server_id}/dhcp-relays", params: params, headers: headers)
|
18
|
+
end
|
19
|
+
|
20
|
+
def create_dhcp_relay(server_id, payload, params={}, headers={})
|
21
|
+
validate_id!(server_id)
|
22
|
+
execute(method: :post, url: "#{base_path}/#{server_id}/dhcp-relays", params: params, payload: payload, headers: headers)
|
23
|
+
end
|
24
|
+
|
25
|
+
def update_dhcp_relay(server_id, dhcp_relay_id, payload, params={}, headers={})
|
26
|
+
validate_id!(server_id)
|
27
|
+
validate_id!(dhcp_relay_id)
|
28
|
+
execute(method: :put, url: "#{base_path}/#{server_id}/dhcp-relays/#{dhcp_relay_id}", params: params, payload: payload, headers: headers)
|
29
|
+
end
|
30
|
+
|
31
|
+
def delete_dhcp_relay(server_id, dhcp_relay_id, params={}, headers={})
|
32
|
+
validate_id!(server_id)
|
33
|
+
validate_id!(dhcp_relay_id)
|
34
|
+
execute(method: :delete, url: "#{base_path}/#{server_id}/dhcp-relays/#{dhcp_relay_id}", params: params, headers: headers)
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'morpheus/api/api_client'
|
2
|
+
|
3
|
+
class Morpheus::NetworkDhcpServersInterface < Morpheus::RestInterface
|
4
|
+
|
5
|
+
def base_path
|
6
|
+
"/api/networks/servers"
|
7
|
+
end
|
8
|
+
|
9
|
+
def get_dhcp_server(server_id, dhcp_server_id, params={}, headers={})
|
10
|
+
validate_id!(server_id)
|
11
|
+
validate_id!(dhcp_server_id)
|
12
|
+
execute(method: :get, url: "#{base_path}/#{server_id}/dhcp-servers/#{dhcp_server_id}", params: params, headers: headers)
|
13
|
+
end
|
14
|
+
|
15
|
+
def list_dhcp_servers(server_id, params={}, headers={})
|
16
|
+
validate_id!(server_id)
|
17
|
+
execute(method: :get, url: "#{base_path}/#{server_id}/dhcp-servers", params: params, headers: headers)
|
18
|
+
end
|
19
|
+
|
20
|
+
def create_dhcp_server(server_id, payload, params={}, headers={})
|
21
|
+
validate_id!(server_id)
|
22
|
+
execute(method: :post, url: "#{base_path}/#{server_id}/dhcp-servers", params: params, payload: payload, headers: headers)
|
23
|
+
end
|
24
|
+
|
25
|
+
def update_dhcp_server(server_id, dhcp_server_id, payload, params={}, headers={})
|
26
|
+
validate_id!(server_id)
|
27
|
+
validate_id!(dhcp_server_id)
|
28
|
+
execute(method: :put, url: "#{base_path}/#{server_id}/dhcp-servers/#{dhcp_server_id}", params: params, payload: payload, headers: headers)
|
29
|
+
end
|
30
|
+
|
31
|
+
def delete_dhcp_server(server_id, dhcp_server_id, params={}, headers={})
|
32
|
+
validate_id!(server_id)
|
33
|
+
validate_id!(dhcp_server_id)
|
34
|
+
execute(method: :delete, url: "#{base_path}/#{server_id}/dhcp-servers/#{dhcp_server_id}", params: params, headers: headers)
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'morpheus/api/api_client'
|
2
|
+
|
3
|
+
class Morpheus::NetworkEdgeClustersInterface < Morpheus::RestInterface
|
4
|
+
|
5
|
+
def base_path
|
6
|
+
"/api/networks/servers"
|
7
|
+
end
|
8
|
+
|
9
|
+
def list_edge_clusters(server_id, params={}, headers={})
|
10
|
+
validate_id!(server_id)
|
11
|
+
execute(method: :get, url: "#{base_path}/#{server_id}/edge-clusters", params: params, headers: headers)
|
12
|
+
end
|
13
|
+
|
14
|
+
def get_edge_cluster(server_id, edge_cluster_id, params={}, headers={})
|
15
|
+
validate_id!(server_id)
|
16
|
+
validate_id!(edge_cluster_id)
|
17
|
+
execute(method: :get, url: "#{base_path}/#{server_id}/edge-clusters/#{edge_cluster_id}", params: params, headers: headers)
|
18
|
+
end
|
19
|
+
|
20
|
+
def update_edge_cluster(server_id, edge_cluster_id, payload, params={}, headers={})
|
21
|
+
validate_id!(server_id)
|
22
|
+
validate_id!(edge_cluster_id)
|
23
|
+
execute(method: :put, url: "#{base_path}/#{server_id}/edge-clusters/#{edge_cluster_id}", params: params, payload: payload, headers: headers)
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
@@ -66,6 +66,15 @@ class Morpheus::NetworkRoutersInterface < Morpheus::APIClient
|
|
66
66
|
execute(opts)
|
67
67
|
end
|
68
68
|
|
69
|
+
def get_firewall_rule_group(router_id, group_id, params={})
|
70
|
+
raise "#{self.class}.get() passed a blank router id!" if router_id.to_s == ''
|
71
|
+
raise "#{self.class}.get() passed a blank group id!" if group_id.to_s == ''
|
72
|
+
url = "#{@base_url}/api/networks/routers/#{router_id}/firewall-rule-groups/#{group_id}"
|
73
|
+
headers = { params: params, authorization: "Bearer #{@access_token}" }
|
74
|
+
opts = {method: :get, url: url, headers: headers}
|
75
|
+
execute(opts)
|
76
|
+
end
|
77
|
+
|
69
78
|
def create_firewall_rule_group(router_id, payload={})
|
70
79
|
url = "#{@base_url}/api/networks/routers/#{router_id}/firewall-rule-groups"
|
71
80
|
headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
@@ -143,6 +152,27 @@ class Morpheus::NetworkRoutersInterface < Morpheus::APIClient
|
|
143
152
|
execute(opts)
|
144
153
|
end
|
145
154
|
|
155
|
+
def create_bgp_neighbor(router_id, payload={})
|
156
|
+
url = "#{@base_url}/api/networks/routers/#{router_id}/bgp-neighbors"
|
157
|
+
headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
158
|
+
opts = {method: :post, url: url, headers: headers, payload: payload.to_json}
|
159
|
+
execute(opts)
|
160
|
+
end
|
161
|
+
|
162
|
+
def update_bgp_neighbor(router_id, nat_id, payload={})
|
163
|
+
url = "#{@base_url}/api/networks/routers/#{router_id}/bgp-neighbors/#{nat_id}"
|
164
|
+
headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
165
|
+
opts = {method: :put, url: url, headers: headers, payload: payload.to_json}
|
166
|
+
execute(opts)
|
167
|
+
end
|
168
|
+
|
169
|
+
def destroy_bgp_neighbor(router_id, nat_id, payload={})
|
170
|
+
url = "#{@base_url}/api/networks/routers/#{router_id}/bgp-neighbors/#{nat_id}"
|
171
|
+
headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
172
|
+
opts = {method: :delete, url: url, headers: headers, payload: payload.to_json}
|
173
|
+
execute(opts)
|
174
|
+
end
|
175
|
+
|
146
176
|
def update_permissions(router_id, payload)
|
147
177
|
url = "#{@base_url}/api/networks/routers/#{router_id}/permissions"
|
148
178
|
headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
@@ -0,0 +1,98 @@
|
|
1
|
+
require 'morpheus/api/api_client'
|
2
|
+
|
3
|
+
class Morpheus::NetworkServersInterface < Morpheus::RestInterface
|
4
|
+
|
5
|
+
def base_path
|
6
|
+
"/api/networks/servers"
|
7
|
+
end
|
8
|
+
|
9
|
+
def list_scopes(server_id, params={}, headers={})
|
10
|
+
validate_id!(server_id)
|
11
|
+
execute(method: :get, url: "#{base_path}/#{server_id}/scopes", params: params, headers: headers)
|
12
|
+
end
|
13
|
+
|
14
|
+
def get_scope(server_id, id, params={}, headers={})
|
15
|
+
validate_id!(server_id)
|
16
|
+
validate_id!(id)
|
17
|
+
execute(method: :get, url: "#{base_path}/#{server_id}/scopes/#{id}", params: params, headers: headers)
|
18
|
+
end
|
19
|
+
|
20
|
+
def create_scope(server_id, payload, params={}, headers={})
|
21
|
+
validate_id!(server_id)
|
22
|
+
execute(method: :post, url: "#{base_path}/#{server_id}/scopes", params: params, payload: payload, headers: headers)
|
23
|
+
end
|
24
|
+
|
25
|
+
def update_scope(server_id, id, payload, params={}, headers={})
|
26
|
+
validate_id!(server_id)
|
27
|
+
validate_id!(id)
|
28
|
+
execute(method: :put, url: "#{base_path}/#{server_id}/scopes/#{id}", params: params, payload: payload, headers: headers)
|
29
|
+
end
|
30
|
+
|
31
|
+
def destroy_scope(server_id, id, params={}, headers={})
|
32
|
+
validate_id!(server_id)
|
33
|
+
validate_id!(id)
|
34
|
+
execute(method: :delete, url: "#{base_path}/#{server_id}/scopes/#{id}", params: params, headers: headers)
|
35
|
+
end
|
36
|
+
|
37
|
+
def update_scope_permissions(server_id, id, payload, params={}, headers={})
|
38
|
+
validate_id!(server_id)
|
39
|
+
validate_id!(id)
|
40
|
+
execute(method: :put, url: "#{base_path}/#{server_id}/scopes/#{id}", payload: payload.to_json, params: params, headers: headers)
|
41
|
+
end
|
42
|
+
|
43
|
+
def list_firewall_rules(server_id, params={}, headers={})
|
44
|
+
validate_id!(server_id)
|
45
|
+
execute(method: :get, url: "#{base_path}/#{server_id}/firewall-rules", params: params, headers: headers)
|
46
|
+
end
|
47
|
+
|
48
|
+
def get_firewall_rule(server_id, id, params={}, headers={})
|
49
|
+
validate_id!(server_id)
|
50
|
+
validate_id!(id)
|
51
|
+
execute(method: :get, url: "#{base_path}/#{server_id}/firewall-rules/#{id}", params: params, headers: headers)
|
52
|
+
end
|
53
|
+
|
54
|
+
def create_firewall_rule(server_id, payload, params={}, headers={})
|
55
|
+
validate_id!(server_id)
|
56
|
+
execute(method: :post, url: "#{base_path}/#{server_id}/firewall-rules", params: params, payload: payload, headers: headers)
|
57
|
+
end
|
58
|
+
|
59
|
+
def update_firewall_rule(server_id, id, payload, params={}, headers={})
|
60
|
+
validate_id!(server_id)
|
61
|
+
validate_id!(id)
|
62
|
+
execute(method: :put, url: "#{base_path}/#{server_id}/firewall-rules/#{id}", params: params, payload: payload, headers: headers)
|
63
|
+
end
|
64
|
+
|
65
|
+
def destroy_firewall_rule(server_id, id, params={}, headers={})
|
66
|
+
validate_id!(server_id)
|
67
|
+
validate_id!(id)
|
68
|
+
execute(method: :delete, url: "#{base_path}/#{server_id}/firewall-rules/#{id}", params: params, headers: headers)
|
69
|
+
end
|
70
|
+
|
71
|
+
def list_firewall_rule_groups(server_id, params={}, headers={})
|
72
|
+
validate_id!(server_id)
|
73
|
+
execute(method: :get, url: "#{base_path}/#{server_id}/firewall-rule-groups", params: params, headers: headers)
|
74
|
+
end
|
75
|
+
|
76
|
+
def get_firewall_rule_group(server_id, id, params={}, headers={})
|
77
|
+
validate_id!(server_id)
|
78
|
+
validate_id!(id)
|
79
|
+
execute(method: :get, url: "#{base_path}/#{server_id}/firewall-rule-groups/#{id}", params: params, headers: headers)
|
80
|
+
end
|
81
|
+
|
82
|
+
def create_firewall_rule_group(server_id, payload, params={}, headers={})
|
83
|
+
validate_id!(server_id)
|
84
|
+
execute(method: :post, url: "#{base_path}/#{server_id}/firewall-rule-groups", params: params, payload: payload, headers: headers)
|
85
|
+
end
|
86
|
+
|
87
|
+
def update_firewall_rule_group(server_id, id, payload, params={}, headers={})
|
88
|
+
validate_id!(server_id)
|
89
|
+
validate_id!(id)
|
90
|
+
execute(method: :put, url: "#{base_path}/#{server_id}/firewall-rule-groups/#{id}", params: params, payload: payload, headers: headers)
|
91
|
+
end
|
92
|
+
|
93
|
+
def destroy_firewall_rule_group(server_id, id, params={}, headers={})
|
94
|
+
validate_id!(server_id)
|
95
|
+
validate_id!(id)
|
96
|
+
execute(method: :delete, url: "#{base_path}/#{server_id}/firewall-rule-groups/#{id}", params: params, headers: headers)
|
97
|
+
end
|
98
|
+
end
|