morpheus-cli 5.3.4 → 5.4.3
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 +69 -11
- data/lib/morpheus/api/audit_interface.rb +9 -0
- data/lib/morpheus/api/catalog_item_types_interface.rb +20 -0
- data/lib/morpheus/api/health_interface.rb +37 -3
- data/lib/morpheus/api/instances_interface.rb +49 -0
- data/lib/morpheus/api/load_balancer_monitors_interface.rb +9 -0
- data/lib/morpheus/api/load_balancer_pools_interface.rb +4 -4
- data/lib/morpheus/api/load_balancer_profiles_interface.rb +4 -5
- data/lib/morpheus/api/load_balancer_virtual_servers_interface.rb +13 -4
- 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 +9 -0
- data/lib/morpheus/api/network_servers_interface.rb +68 -12
- data/lib/morpheus/api/network_static_routes_interface.rb +36 -0
- data/lib/morpheus/api/ping_interface.rb +2 -0
- data/lib/morpheus/api/read_interface.rb +4 -3
- data/lib/morpheus/api/rest_interface.rb +3 -3
- 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/setup_interface.rb +4 -0
- data/lib/morpheus/api/snapshots_interface.rb +19 -0
- 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/cli/cli_command.rb +260 -13
- data/lib/morpheus/cli/cli_registry.rb +2 -1
- 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} +14 -87
- 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} +88 -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} +0 -4
- data/lib/morpheus/cli/{clouds.rb → commands/clouds.rb} +0 -7
- data/lib/morpheus/cli/{clusters.rb → commands/clusters.rb} +96 -64
- 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} +27 -24
- data/lib/morpheus/cli/{image_builder_command.rb → commands/image_builder_command.rb} +6 -16
- data/lib/morpheus/cli/{instance_types.rb → commands/instance_types.rb} +0 -3
- data/lib/morpheus/cli/{instances.rb → commands/instances.rb} +359 -7
- data/lib/morpheus/cli/{integrations_command.rb → commands/integrations_command.rb} +1 -12
- data/lib/morpheus/cli/{invoices_command.rb → commands/invoices_command.rb} +1 -1
- 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} +0 -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} +3 -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} +0 -4
- 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 +70 -0
- data/lib/morpheus/cli/commands/load_balancer_pools.rb +90 -0
- data/lib/morpheus/cli/commands/load_balancer_profiles.rb +64 -0
- data/lib/morpheus/cli/{load_balancer_types.rb → commands/load_balancer_types.rb} +9 -8
- data/lib/morpheus/cli/{load_balancer_virtual_servers.rb → commands/load_balancer_virtual_servers.rb} +69 -58
- data/lib/morpheus/cli/commands/load_balancers.rb +192 -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} +0 -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} +96 -50
- 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 +451 -0
- data/lib/morpheus/cli/{network_scopes_command.rb → commands/network_transport_zones_command.rb} +102 -92
- data/lib/morpheus/cli/{networks_command.rb → commands/networks_command.rb} +20 -20
- 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} +3 -12
- data/lib/morpheus/cli/{policies_command.rb → commands/policies_command.rb} +2 -9
- 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} +1 -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} +21 -19
- 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} +2 -8
- 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} +1 -1
- 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} +1 -1
- 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/snapshots.rb +139 -0
- 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} +0 -4
- data/lib/morpheus/cli/{tasks.rb → commands/tasks.rb} +5 -9
- 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} +3 -2
- 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} +0 -0
- 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} +4 -5
- 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 +24 -4
- 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 +96 -6
- data/lib/morpheus/cli/mixins/rest_command.rb +222 -62
- data/lib/morpheus/cli/mixins/secondary_rest_command.rb +249 -70
- 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_types.rb +150 -46
- data/lib/morpheus/cli/version.rb +1 -1
- data/lib/morpheus/cli.rb +5 -135
- 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
- metadata +174 -144
- data/lib/morpheus/cli/change_password_command.rb +0 -147
- data/lib/morpheus/cli/library.rb +0 -1
- data/lib/morpheus/cli/load_balancer_pools.rb +0 -111
- data/lib/morpheus/cli/load_balancers.rb +0 -90
- data/lib/morpheus/cli/logout.rb +0 -81
@@ -11,10 +11,10 @@ class Morpheus::NetworkServersInterface < Morpheus::RestInterface
|
|
11
11
|
execute(method: :get, url: "#{base_path}/#{server_id}/scopes", params: params, headers: headers)
|
12
12
|
end
|
13
13
|
|
14
|
-
def get_scope(server_id,
|
14
|
+
def get_scope(server_id, id, params={}, headers={})
|
15
15
|
validate_id!(server_id)
|
16
|
-
validate_id!(
|
17
|
-
execute(method: :get, url: "#{base_path}/#{server_id}/scopes/#{
|
16
|
+
validate_id!(id)
|
17
|
+
execute(method: :get, url: "#{base_path}/#{server_id}/scopes/#{id}", params: params, headers: headers)
|
18
18
|
end
|
19
19
|
|
20
20
|
def create_scope(server_id, payload, params={}, headers={})
|
@@ -22,21 +22,77 @@ class Morpheus::NetworkServersInterface < Morpheus::RestInterface
|
|
22
22
|
execute(method: :post, url: "#{base_path}/#{server_id}/scopes", params: params, payload: payload, headers: headers)
|
23
23
|
end
|
24
24
|
|
25
|
-
def update_scope(server_id,
|
25
|
+
def update_scope(server_id, id, payload, params={}, headers={})
|
26
26
|
validate_id!(server_id)
|
27
|
-
validate_id!(
|
28
|
-
execute(method: :put, url: "#{base_path}/#{server_id}/scopes/#{
|
27
|
+
validate_id!(id)
|
28
|
+
execute(method: :put, url: "#{base_path}/#{server_id}/scopes/#{id}", params: params, payload: payload, headers: headers)
|
29
29
|
end
|
30
30
|
|
31
|
-
def destroy_scope(server_id,
|
31
|
+
def destroy_scope(server_id, id, params={}, headers={})
|
32
32
|
validate_id!(server_id)
|
33
|
-
validate_id!(
|
34
|
-
execute(method: :delete, url: "#{base_path}/#{server_id}/scopes/#{
|
33
|
+
validate_id!(id)
|
34
|
+
execute(method: :delete, url: "#{base_path}/#{server_id}/scopes/#{id}", params: params, headers: headers)
|
35
35
|
end
|
36
36
|
|
37
|
-
def update_scope_permissions(server_id,
|
37
|
+
def update_scope_permissions(server_id, id, payload, params={}, headers={})
|
38
38
|
validate_id!(server_id)
|
39
|
-
validate_id!(
|
40
|
-
execute(method: :put, url: "#{base_path}/#{server_id}/scopes/#{
|
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)
|
41
97
|
end
|
42
98
|
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'morpheus/api/api_client'
|
2
|
+
|
3
|
+
class Morpheus::NetworkStaticRoutesInterface < Morpheus::RestInterface
|
4
|
+
|
5
|
+
def base_path
|
6
|
+
"/api/networks"
|
7
|
+
end
|
8
|
+
|
9
|
+
def get_static_route(network_id, route_id, params={}, headers={})
|
10
|
+
validate_id!(network_id)
|
11
|
+
validate_id!(route_id)
|
12
|
+
execute(method: :get, url: "#{base_path}/#{network_id}/routes/#{route_id}", params: params, headers: headers)
|
13
|
+
end
|
14
|
+
|
15
|
+
def list_static_routes(network_id, params={}, headers={})
|
16
|
+
validate_id!(network_id)
|
17
|
+
execute(method: :get, url: "#{base_path}/#{network_id}/routes", params: params, headers: headers)
|
18
|
+
end
|
19
|
+
|
20
|
+
def create_static_route(network_id, payload, params={}, headers={})
|
21
|
+
validate_id!(network_id)
|
22
|
+
execute(method: :post, url: "#{base_path}/#{network_id}/routes", params: params, payload: payload, headers: headers)
|
23
|
+
end
|
24
|
+
|
25
|
+
def update_static_route(network_id, route_id, payload, params={}, headers={})
|
26
|
+
validate_id!(network_id)
|
27
|
+
validate_id!(route_id)
|
28
|
+
execute(method: :put, url: "#{base_path}/#{network_id}/routes/#{route_id}", params: params, payload: payload, headers: headers)
|
29
|
+
end
|
30
|
+
|
31
|
+
def delete_static_route(network_id, route_id, params={}, headers={})
|
32
|
+
validate_id!(network_id)
|
33
|
+
validate_id!(route_id)
|
34
|
+
execute(method: :delete, url: "#{base_path}/#{network_id}/routes/#{route_id}", params: params, headers: headers)
|
35
|
+
end
|
36
|
+
end
|
@@ -14,6 +14,8 @@ class Morpheus::PingInterface < Morpheus::APIClient
|
|
14
14
|
|
15
15
|
def get(params={})
|
16
16
|
headers = {params: params}
|
17
|
+
# use access token if authenticated
|
18
|
+
headers[:authorization] = "Bearer #{@access_token}" if @access_token
|
17
19
|
execute(method: :get, url: "/api/ping", headers: headers)
|
18
20
|
end
|
19
21
|
|
@@ -6,9 +6,10 @@ require 'morpheus/api/api_client'
|
|
6
6
|
class Morpheus::ReadInterface < Morpheus::APIClient
|
7
7
|
|
8
8
|
# subclasses should override in your interface
|
9
|
-
# Example: "/api/
|
9
|
+
# Example: "/api/things"
|
10
10
|
def base_path
|
11
|
-
raise "#{self.class} has not defined base_path!"
|
11
|
+
raise "#{self.class} has not defined base_path!" if @options[:base_path].nil?
|
12
|
+
@options[:base_path]
|
12
13
|
end
|
13
14
|
|
14
15
|
def list(params={}, headers={})
|
@@ -17,7 +18,7 @@ class Morpheus::ReadInterface < Morpheus::APIClient
|
|
17
18
|
|
18
19
|
def get(id, params={}, headers={})
|
19
20
|
validate_id!(id)
|
20
|
-
execute(method: :get, url: "#{base_path}/#{id}", params: params, headers: headers)
|
21
|
+
execute(method: :get, url: "#{base_path}/#{CGI::escape(id.to_s)}", params: params, headers: headers)
|
21
22
|
end
|
22
23
|
|
23
24
|
end
|
@@ -17,7 +17,7 @@ class Morpheus::RestInterface < Morpheus::APIClient
|
|
17
17
|
|
18
18
|
def get(id, params={}, headers={})
|
19
19
|
validate_id!(id)
|
20
|
-
execute(method: :get, url: "#{base_path}/#{id}", params: params, headers: headers)
|
20
|
+
execute(method: :get, url: "#{base_path}/#{CGI::escape(id.to_s)}", params: params, headers: headers)
|
21
21
|
end
|
22
22
|
|
23
23
|
def create(payload, params={}, headers={})
|
@@ -26,12 +26,12 @@ class Morpheus::RestInterface < Morpheus::APIClient
|
|
26
26
|
|
27
27
|
def update(id, payload, params={}, headers={})
|
28
28
|
validate_id!(id)
|
29
|
-
execute(method: :put, url: "#{base_path}/#{id}", params: params, payload: payload, headers: headers)
|
29
|
+
execute(method: :put, url: "#{base_path}/#{CGI::escape(id.to_s)}", params: params, payload: payload, headers: headers)
|
30
30
|
end
|
31
31
|
|
32
32
|
def destroy(id, params = {}, headers={})
|
33
33
|
validate_id!(id)
|
34
|
-
execute(method: :delete, url: "#{base_path}/#{id}", params: params, headers: headers)
|
34
|
+
execute(method: :delete, url: "#{base_path}/#{CGI::escape(id.to_s)}", params: params, headers: headers)
|
35
35
|
end
|
36
36
|
|
37
37
|
end
|
@@ -92,6 +92,13 @@ class Morpheus::RolesInterface < Morpheus::APIClient
|
|
92
92
|
execute(method: :put, url: url, headers: headers, payload: payload.to_json)
|
93
93
|
end
|
94
94
|
|
95
|
+
def update_report_type(account_id, id, options)
|
96
|
+
url = build_url(account_id, id) + "/update-report-type"
|
97
|
+
headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
98
|
+
payload = options
|
99
|
+
execute(method: :put, url: url, headers: headers, payload: payload.to_json)
|
100
|
+
end
|
101
|
+
|
95
102
|
private
|
96
103
|
|
97
104
|
def build_url(account_id=nil, role_id=nil)
|
@@ -19,7 +19,7 @@ class Morpheus::SecondaryReadInterface < Morpheus::APIClient
|
|
19
19
|
def get(resource_id, id, params={}, headers={})
|
20
20
|
validate_id!(resource_id)
|
21
21
|
validate_id!(id)
|
22
|
-
execute(method: :get, url: "#{base_path(resource_id)}/#{id}", params: params, headers: headers)
|
22
|
+
execute(method: :get, url: "#{base_path(resource_id)}/#{CGI::escape(id.to_s)}", params: params, headers: headers)
|
23
23
|
end
|
24
24
|
|
25
25
|
end
|
@@ -2,41 +2,41 @@ require 'morpheus/api/api_client'
|
|
2
2
|
|
3
3
|
# Interface class to be subclassed by interfaces that provide CRUD endpoints
|
4
4
|
# for objects underneath another resource
|
5
|
-
# Subclasses must override the base_path(
|
5
|
+
# Subclasses must override the base_path(parent_id) method
|
6
6
|
class Morpheus::SecondaryRestInterface < Morpheus::APIClient
|
7
7
|
|
8
8
|
# subclasses should override in your interface
|
9
|
-
# Example: "/api/things/#{
|
10
|
-
def base_path(
|
11
|
-
raise "#{self.class} has not defined base_path(
|
9
|
+
# Example: "/api/things/#{parent_id}/widgets"
|
10
|
+
def base_path(parent_id)
|
11
|
+
raise "#{self.class} has not defined base_path(parent_id)!"
|
12
12
|
end
|
13
13
|
|
14
|
-
def list(
|
15
|
-
validate_id!(
|
16
|
-
execute(method: :get, url: "#{base_path(
|
14
|
+
def list(parent_id, params={}, headers={})
|
15
|
+
validate_id!(parent_id)
|
16
|
+
execute(method: :get, url: "#{base_path(parent_id)}", params: params, headers: headers)
|
17
17
|
end
|
18
18
|
|
19
|
-
def get(
|
20
|
-
validate_id!(
|
19
|
+
def get(parent_id, id, params={}, headers={})
|
20
|
+
validate_id!(parent_id)
|
21
21
|
validate_id!(id)
|
22
|
-
execute(method: :get, url: "#{base_path(
|
22
|
+
execute(method: :get, url: "#{base_path(parent_id)}/#{CGI::escape(id.to_s)}", params: params, headers: headers)
|
23
23
|
end
|
24
24
|
|
25
|
-
def create(
|
26
|
-
validate_id!(
|
27
|
-
execute(method: :post, url: "#{base_path(
|
25
|
+
def create(parent_id, payload, params={}, headers={})
|
26
|
+
validate_id!(parent_id)
|
27
|
+
execute(method: :post, url: "#{base_path(parent_id)}", params: params, payload: payload, headers: headers)
|
28
28
|
end
|
29
29
|
|
30
|
-
def update(
|
31
|
-
validate_id!(
|
30
|
+
def update(parent_id, id, payload, params={}, headers={})
|
31
|
+
validate_id!(parent_id)
|
32
32
|
validate_id!(id)
|
33
|
-
execute(method: :put, url: "#{base_path(
|
33
|
+
execute(method: :put, url: "#{base_path(parent_id)}/#{CGI::escape(id.to_s)}", params: params, payload: payload, headers: headers)
|
34
34
|
end
|
35
35
|
|
36
|
-
def destroy(
|
37
|
-
validate_id!(
|
36
|
+
def destroy(parent_id, id, params = {}, headers={})
|
37
|
+
validate_id!(parent_id)
|
38
38
|
validate_id!(id)
|
39
|
-
execute(method: :delete, url: "#{base_path(
|
39
|
+
execute(method: :delete, url: "#{base_path(parent_id)}/#{CGI::escape(id.to_s)}", params: params, headers: headers)
|
40
40
|
end
|
41
41
|
|
42
42
|
end
|
@@ -14,12 +14,16 @@ class Morpheus::SetupInterface < Morpheus::APIClient
|
|
14
14
|
|
15
15
|
def get(params={})
|
16
16
|
headers = {params: params}
|
17
|
+
# use access token if authenticated
|
18
|
+
headers[:authorization] = "Bearer #{@access_token}" if @access_token
|
17
19
|
execute(method: :get, url: "/api/setup", headers: headers)
|
18
20
|
end
|
19
21
|
|
20
22
|
#this should go away and just use
|
21
23
|
def check(params={}, timeout=5)
|
22
24
|
headers = {params: params}
|
25
|
+
# use access token if authenticated
|
26
|
+
headers[:authorization] = "Bearer #{@access_token}" if @access_token
|
23
27
|
execute(method: :get, url: "/api/setup/check", headers: headers, timeout: timeout)
|
24
28
|
end
|
25
29
|
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'morpheus/api/api_client'
|
2
|
+
|
3
|
+
# Snapshots API interface.
|
4
|
+
class Morpheus::SnapshotsInterface < Morpheus::APIClient
|
5
|
+
|
6
|
+
def get(snapshot_id)
|
7
|
+
url = "#{@base_url}/api/snapshots/#{snapshot_id}"
|
8
|
+
headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
9
|
+
opts = {method: :get, url: url, headers: headers}
|
10
|
+
execute(opts)
|
11
|
+
end
|
12
|
+
|
13
|
+
def remove(snapshot_id, payload={})
|
14
|
+
url = "#{@base_url}/api/snapshots/#{snapshot_id}"
|
15
|
+
headers = {:authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
16
|
+
opts = {method: :delete, url: url, headers: headers, payload: payload.to_json}
|
17
|
+
execute(opts)
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'morpheus/api/read_interface'
|
2
|
+
|
3
|
+
class Morpheus::StorageServerTypesInterface < Morpheus::ReadInterface
|
4
|
+
|
5
|
+
def base_path
|
6
|
+
"/api/storage-server-types"
|
7
|
+
end
|
8
|
+
|
9
|
+
# def option_types(id, params={}, headers={})
|
10
|
+
# validate_id!(id)
|
11
|
+
# execute(method: :get, url: "#{base_path}/#{id}/option-types", params: params, headers: headers)
|
12
|
+
# end
|
13
|
+
|
14
|
+
end
|
@@ -1,78 +1,31 @@
|
|
1
|
-
require 'morpheus/api/
|
1
|
+
require 'morpheus/api/rest_interface'
|
2
2
|
|
3
|
-
class Morpheus::UsersInterface < Morpheus::
|
3
|
+
class Morpheus::UsersInterface < Morpheus::RestInterface
|
4
4
|
|
5
|
-
def
|
6
|
-
|
7
|
-
url = build_url(account_id, id)
|
8
|
-
headers = { params: params, authorization: "Bearer #{@access_token}" }
|
9
|
-
opts = {method: :get, url: url, timeout: 10, headers: headers}
|
10
|
-
execute(opts)
|
5
|
+
def base_path
|
6
|
+
"/api/users"
|
11
7
|
end
|
12
8
|
|
13
|
-
def
|
14
|
-
|
15
|
-
|
16
|
-
opts = {method: :get, url: url, timeout: 10, headers: headers}
|
17
|
-
execute(opts)
|
9
|
+
def feature_permissions(id, params={}, headers={})
|
10
|
+
validate_id!(id)
|
11
|
+
execute(method: :get, url: "#{base_path}/#{id}/feature-permissions", params: params, headers: headers)
|
18
12
|
end
|
19
13
|
|
20
|
-
def
|
21
|
-
|
22
|
-
|
23
|
-
opts = {method: :get, url: url, timeout: 10, headers: headers}
|
24
|
-
execute(opts)
|
14
|
+
def permissions(id, params={}, headers={})
|
15
|
+
validate_id!(id)
|
16
|
+
execute(method: :get, url: "#{base_path}/#{id}/permissions", params: params, headers: headers)
|
25
17
|
end
|
26
18
|
|
27
|
-
def
|
28
|
-
url
|
29
|
-
headers = { params: {}, authorization: "Bearer #{@access_token}" }
|
30
|
-
opts = {method: :get, url: url, timeout: 10, headers: headers}
|
31
|
-
execute(opts)
|
32
|
-
end
|
33
|
-
|
34
|
-
def available_roles(account_id, id=nil, options={})
|
35
|
-
url = build_url(account_id, id) + "/available-roles"
|
36
|
-
headers = { params: {}, authorization: "Bearer #{@access_token}" }
|
37
|
-
headers[:params].merge!(options)
|
38
|
-
opts = {method: :get, url: url, timeout: 10, headers: headers}
|
39
|
-
execute(opts)
|
40
|
-
end
|
41
|
-
|
42
|
-
def create(account_id, options)
|
43
|
-
url = build_url(account_id)
|
44
|
-
headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
45
|
-
payload = options
|
46
|
-
opts = {method: :post, url: url, timeout: 10, headers: headers, payload: payload.to_json}
|
47
|
-
execute(opts)
|
48
|
-
end
|
49
|
-
|
50
|
-
def update(account_id, id, options)
|
51
|
-
url = build_url(account_id, id)
|
52
|
-
headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
53
|
-
payload = options
|
54
|
-
opts = {method: :put, url: url, timeout: 10, headers: headers, payload: payload.to_json}
|
55
|
-
execute(opts)
|
56
|
-
end
|
57
|
-
|
58
|
-
def destroy(account_id, id)
|
59
|
-
url = build_url(account_id, id)
|
60
|
-
headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
61
|
-
opts = {method: :delete, url: url, timeout: 10, headers: headers}
|
62
|
-
execute(opts)
|
19
|
+
def available_roles(id=nil, params={}, headers={})
|
20
|
+
execute(method: :get, url: "#{build_url(id)}/available-roles", params: params, headers: headers)
|
63
21
|
end
|
64
22
|
|
65
23
|
private
|
66
24
|
|
67
|
-
def build_url(
|
68
|
-
url =
|
69
|
-
if
|
70
|
-
url += "
|
71
|
-
else
|
72
|
-
url += "/users"
|
73
|
-
end
|
74
|
-
if user_id
|
75
|
-
url += "/#{user_id}"
|
25
|
+
def build_url(id=nil)
|
26
|
+
url = base_path
|
27
|
+
if id
|
28
|
+
url += "/#{id}"
|
76
29
|
end
|
77
30
|
url
|
78
31
|
end
|