morpheus-cli 5.5.2.2 → 5.5.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/Dockerfile +1 -1
- data/README.md +57 -4
- data/Rakefile +9 -0
- data/bin/morpheus +4 -4
- data/lib/morpheus/api/api_client.rb +20 -2
- data/lib/morpheus/api/appliance_settings_interface.rb +15 -0
- data/lib/morpheus/api/archive_buckets_interface.rb +1 -1
- data/lib/morpheus/api/archive_files_interface.rb +3 -3
- data/lib/morpheus/api/clients_interface.rb +2 -2
- data/lib/morpheus/api/clusters_interface.rb +8 -1
- data/lib/morpheus/api/containers_interface.rb +29 -16
- data/lib/morpheus/api/custom_instance_types_interface.rb +0 -2
- data/lib/morpheus/api/cypher_interface.rb +1 -2
- data/lib/morpheus/api/doc_interface.rb +8 -6
- data/lib/morpheus/api/file_copy_request_interface.rb +1 -1
- data/lib/morpheus/api/guidance_settings_interface.rb +17 -0
- data/lib/morpheus/api/health_interface.rb +1 -1
- data/lib/morpheus/api/image_builder_interface.rb +3 -3
- data/lib/morpheus/api/instances_interface.rb +25 -0
- data/lib/morpheus/api/logs_interface.rb +2 -4
- data/lib/morpheus/api/monitoring_interface.rb +6 -6
- data/lib/morpheus/api/monitoring_settings_interface.rb +25 -0
- data/lib/morpheus/api/network_server_groups_interface.rb +7 -0
- data/lib/morpheus/api/packages_interface.rb +1 -1
- data/lib/morpheus/api/reports_interface.rb +1 -1
- data/lib/morpheus/api/servers_interface.rb +9 -1
- data/lib/morpheus/api/storage_providers_interface.rb +2 -2
- data/lib/morpheus/api/virtual_images_interface.rb +1 -1
- data/lib/morpheus/api.rb +2 -0
- data/lib/morpheus/benchmarking.rb +1 -1
- data/lib/morpheus/cli/cli_command.rb +79 -37
- data/lib/morpheus/cli/cli_registry.rb +19 -10
- data/lib/morpheus/cli/commands/access_token_command.rb +1 -1
- data/lib/morpheus/cli/commands/appliance_settings_command.rb +57 -2
- data/lib/morpheus/cli/commands/apps.rb +1 -1
- data/lib/morpheus/cli/commands/archives_command.rb +25 -33
- data/lib/morpheus/cli/commands/backup_settings_command.rb +1 -1
- data/lib/morpheus/cli/commands/blueprints_command.rb +10 -21
- data/lib/morpheus/cli/commands/boot_scripts_command.rb +2 -2
- data/lib/morpheus/cli/commands/cat_command.rb +1 -1
- data/lib/morpheus/cli/commands/catalog_item_types_command.rb +18 -13
- data/lib/morpheus/cli/commands/clouds.rb +3 -3
- data/lib/morpheus/cli/commands/clusters.rb +154 -3
- data/lib/morpheus/cli/commands/containers_command.rb +398 -253
- data/lib/morpheus/cli/commands/cypher_command.rb +3 -0
- data/lib/morpheus/cli/commands/deployments.rb +1 -1
- data/lib/morpheus/cli/commands/deploys.rb +9 -9
- data/lib/morpheus/cli/commands/doc.rb +15 -16
- data/lib/morpheus/cli/commands/execution_request_command.rb +2 -2
- data/lib/morpheus/cli/commands/file_copy_request_command.rb +5 -5
- data/lib/morpheus/cli/commands/groups.rb +2 -2
- data/lib/morpheus/cli/commands/guidance_command.rb +2 -2
- data/lib/morpheus/cli/commands/guidance_settings.rb +148 -0
- data/lib/morpheus/cli/commands/health_command.rb +4 -4
- data/lib/morpheus/cli/commands/hosts.rb +43 -5
- data/lib/morpheus/cli/commands/image_builder_command.rb +1 -1
- data/lib/morpheus/cli/commands/instances.rb +419 -148
- data/lib/morpheus/cli/commands/integrations_command.rb +22 -20
- data/lib/morpheus/cli/commands/key_pairs.rb +2 -2
- data/lib/morpheus/cli/commands/library_container_scripts_command.rb +2 -2
- data/lib/morpheus/cli/commands/library_container_templates_command.rb +2 -2
- data/lib/morpheus/cli/commands/library_instance_types_command.rb +3 -3
- data/lib/morpheus/cli/commands/library_spec_templates_command.rb +2 -2
- data/lib/morpheus/cli/commands/log_settings_command.rb +1 -1
- data/lib/morpheus/cli/commands/login.rb +1 -1
- data/lib/morpheus/cli/commands/man_command.rb +32 -18
- data/lib/morpheus/cli/commands/monitoring_settings.rb +228 -0
- data/lib/morpheus/cli/commands/network_server_groups_command.rb +222 -0
- data/lib/morpheus/cli/commands/packages_command.rb +11 -11
- data/lib/morpheus/cli/commands/plugins.rb +1 -1
- data/lib/morpheus/cli/commands/policies_command.rb +4 -4
- data/lib/morpheus/cli/commands/preseed_scripts_command.rb +2 -2
- data/lib/morpheus/cli/commands/provisioning_settings_command.rb +1 -1
- data/lib/morpheus/cli/commands/remote.rb +1 -1
- data/lib/morpheus/cli/commands/reports_command.rb +13 -3
- data/lib/morpheus/cli/commands/security_groups.rb +1 -1
- data/lib/morpheus/cli/commands/shell.rb +40 -62
- data/lib/morpheus/cli/commands/snapshots.rb +3 -5
- data/lib/morpheus/cli/commands/source_command.rb +8 -16
- data/lib/morpheus/cli/commands/storage_providers_command.rb +7 -7
- data/lib/morpheus/cli/commands/tasks.rb +2 -2
- data/lib/morpheus/cli/commands/vdi_pools_command.rb +6 -6
- data/lib/morpheus/cli/commands/view.rb +5 -1
- data/lib/morpheus/cli/commands/whitelabel_settings_command.rb +5 -5
- data/lib/morpheus/cli/commands/whoami.rb +2 -2
- data/lib/morpheus/cli/credentials.rb +30 -8
- data/lib/morpheus/cli/dot_file.rb +8 -15
- data/lib/morpheus/cli/error_handler.rb +16 -0
- data/lib/morpheus/cli/errors.rb +8 -1
- data/lib/morpheus/cli/mixins/print_helper.rb +17 -13
- data/lib/morpheus/cli/mixins/provisioning_helper.rb +14 -12
- data/lib/morpheus/cli/mixins/rest_command.rb +23 -19
- data/lib/morpheus/cli/mixins/secondary_rest_command.rb +47 -24
- data/lib/morpheus/cli/option_parser.rb +5 -1
- data/lib/morpheus/cli/option_types.rb +59 -12
- data/lib/morpheus/cli/version.rb +1 -1
- data/lib/morpheus/cli.rb +26 -16
- data/lib/morpheus/ext/rest_client.rb +3 -2
- data/lib/morpheus/ext/string.rb +6 -4
- data/lib/morpheus/formatters.rb +1 -1
- data/lib/morpheus/logging.rb +4 -4
- data/lib/morpheus/morpkg.rb +4 -4
- data/lib/morpheus/rest_client.rb +2 -2
- data/lib/morpheus/routes.rb +41 -9
- data/lib/morpheus/terminal.rb +65 -16
- data/lib/morpheus.rb +1 -1
- data/morpheus-cli.gemspec +1 -0
- data/test/api/containers_interface_test.rb +68 -0
- data/test/api/doc_interface_test.rb +35 -0
- data/test/api/instances_interface_test.rb +22 -0
- data/test/api/whoami_interface_test.rb +14 -0
- data/test/cli/access_token_test.rb +36 -0
- data/test/cli/auth_test.rb +82 -0
- data/test/cli/cli_test.rb +48 -0
- data/test/cli/containers_test.rb +92 -0
- data/test/cli/doc_test.rb +35 -0
- data/test/cli/help_test.rb +25 -0
- data/test/cli/instances_test.rb +36 -0
- data/test/cli/man_test.rb +14 -0
- data/test/cli/remote_test.rb +89 -0
- data/test/cli/roles_test.rb +34 -0
- data/test/cli/shell_test.rb +81 -0
- data/test/cli/version_test.rb +23 -0
- data/test/cli/view_test.rb +55 -0
- data/test/cli/whoami_test.rb +17 -0
- data/test/morpheus_test.rb +16 -0
- data/test/test_case.rb +338 -0
- data/test/test_config.rb +137 -0
- data/test/test_data_helper.rb +97 -0
- metadata +67 -3
@@ -0,0 +1,97 @@
|
|
1
|
+
module MorpheusTest
|
2
|
+
|
3
|
+
# Mixin to provide loading test data / fixtures for tests
|
4
|
+
module TestDataHelper
|
5
|
+
|
6
|
+
def self.included(base)
|
7
|
+
#base.extend ClassMethods
|
8
|
+
#todo: load test/fixtures/*yaml
|
9
|
+
end
|
10
|
+
|
11
|
+
protected
|
12
|
+
|
13
|
+
## Instances
|
14
|
+
|
15
|
+
def find_first_instance_id()
|
16
|
+
instance_id = client.instances.list({})['instances'].collect {|it| it['id'] }.first
|
17
|
+
assert_not_nil instance_id, "Failed to find an instance to test with"
|
18
|
+
return instance_id
|
19
|
+
end
|
20
|
+
|
21
|
+
def find_many_instance_ids()
|
22
|
+
instance_ids = client.instances.list({})['instances'].collect {|it| it['id'] }.first(5)
|
23
|
+
assert instance_ids.size > 1, "Failed to find many instances to test with"
|
24
|
+
return instance_ids
|
25
|
+
end
|
26
|
+
|
27
|
+
# populates test with the following data as instance variables
|
28
|
+
# @container - Container
|
29
|
+
# @id - Container id
|
30
|
+
#todo: create a container instead...
|
31
|
+
# maybe just warn and omit the test, but it asserts and fails now...
|
32
|
+
# instead of env, have a test/fixtures/test-instance-payload.json or
|
33
|
+
# or maybe put it in the test_config.yaml under fixtures.
|
34
|
+
def load_instance_test_data()
|
35
|
+
# todo: cache this , maybe Thread.current for now...
|
36
|
+
@id = nil
|
37
|
+
|
38
|
+
test_instance_id = ENV['TEST_INSTANCE_ID']
|
39
|
+
if test_instance_id
|
40
|
+
# use the first container in our test instance
|
41
|
+
@instance = client.instances.get(test_instance_id.to_i)['instance']
|
42
|
+
# rescue ::RestClient::Exception => e on 404
|
43
|
+
assert_not_nil @instance, "Test instance #{test_instance_id} was not found!"
|
44
|
+
@container = client.containers.get(@instance['containers'].first)['container']
|
45
|
+
@id = @instance['id']
|
46
|
+
end
|
47
|
+
assert_not_nil @id, "A test instance must be specified to run this test.\nTry setting environment variable TEST_CONTAINER_ID=42 or TEST_INSTANCE_ID=99"
|
48
|
+
end
|
49
|
+
|
50
|
+
## Containers
|
51
|
+
|
52
|
+
def find_first_container_id()
|
53
|
+
container_id = client.instances.list({})['instances'].collect {|it| it['containers'] }.flatten.uniq.first
|
54
|
+
assert_not_nil container_id, "Failed to find a container to test with"
|
55
|
+
return container_id
|
56
|
+
end
|
57
|
+
|
58
|
+
def find_many_container_ids()
|
59
|
+
container_ids = client.instances.list({})['instances'].collect {|it| it['containers'] }.flatten.uniq.first(5)
|
60
|
+
assert container_ids.size > 1, "Failed to find many containers to test with"
|
61
|
+
return container_ids
|
62
|
+
end
|
63
|
+
|
64
|
+
# populates test with the following data as instance variables
|
65
|
+
# @container - Container
|
66
|
+
# @id - Container id
|
67
|
+
#todo: create a container instead...
|
68
|
+
# maybe just warn and omit the test, but it asserts and fails now...
|
69
|
+
# instead of env, have a test/fixtures/test-instance-payload.json or
|
70
|
+
# or maybe put it in the test_config.yaml under fixtures.
|
71
|
+
def load_container_test_data()
|
72
|
+
# todo: cache this , maybe Thread.current for now...
|
73
|
+
@id = nil
|
74
|
+
test_container_id = ENV['TEST_CONTAINER_ID']
|
75
|
+
test_instance_id = ENV['TEST_INSTANCE_ID']
|
76
|
+
if test_container_id
|
77
|
+
# use our test container
|
78
|
+
@container = client.containers.get(test_container_id)['container']
|
79
|
+
# rescue ::RestClient::Exception => e on 404
|
80
|
+
assert_not_nil @container, "Container #{test_container_id} was not found"
|
81
|
+
@id = @container['id']
|
82
|
+
elsif test_instance_id
|
83
|
+
# use the first container in our test instance
|
84
|
+
@instance = client.instances.get(test_instance_id.to_i)['instance']
|
85
|
+
# rescue ::RestClient::Exception => e on 404
|
86
|
+
assert_not_nil @instance, "Test instance #{test_instance_id} was not found!"
|
87
|
+
assert_not_nil @instance['containers'].first, "Instance #{@instance['id']} does not have any containers\nTry setting environment variable TEST_CONTAINER_ID=42"
|
88
|
+
@container = client.containers.get(@instance['containers'].first)['container']
|
89
|
+
assert_not_nil @container, "Container #{@instance['containers'].first} was not found"
|
90
|
+
@id = @container['id']
|
91
|
+
end
|
92
|
+
assert_not_nil @id, "A test container must be specified to run this test.\nTry setting environment variable TEST_CONTAINER_ID=42 or TEST_INSTANCE_ID=99"
|
93
|
+
end
|
94
|
+
|
95
|
+
end
|
96
|
+
|
97
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: morpheus-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.5.
|
4
|
+
version: 5.5.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Estes
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2023-01-19 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: bundler
|
@@ -153,6 +153,20 @@ dependencies:
|
|
153
153
|
- - ">="
|
154
154
|
- !ruby/object:Gem::Version
|
155
155
|
version: '0'
|
156
|
+
- !ruby/object:Gem::Dependency
|
157
|
+
name: test-unit
|
158
|
+
requirement: !ruby/object:Gem::Requirement
|
159
|
+
requirements:
|
160
|
+
- - ">="
|
161
|
+
- !ruby/object:Gem::Version
|
162
|
+
version: '0'
|
163
|
+
type: :runtime
|
164
|
+
prerelease: false
|
165
|
+
version_requirements: !ruby/object:Gem::Requirement
|
166
|
+
requirements:
|
167
|
+
- - ">="
|
168
|
+
- !ruby/object:Gem::Version
|
169
|
+
version: '0'
|
156
170
|
description: Infrastructure agnostic cloud application management & orchestration
|
157
171
|
CLI for Morpheus. Easily manage and orchestrate VMS on private or public infrastructure
|
158
172
|
and containerized architectures.
|
@@ -221,6 +235,7 @@ files:
|
|
221
235
|
- lib/morpheus/api/group_policies_interface.rb
|
222
236
|
- lib/morpheus/api/groups_interface.rb
|
223
237
|
- lib/morpheus/api/guidance_interface.rb
|
238
|
+
- lib/morpheus/api/guidance_settings_interface.rb
|
224
239
|
- lib/morpheus/api/health_interface.rb
|
225
240
|
- lib/morpheus/api/image_builder_boot_scripts_interface.rb
|
226
241
|
- lib/morpheus/api/image_builder_image_builds_interface.rb
|
@@ -259,6 +274,7 @@ files:
|
|
259
274
|
- lib/morpheus/api/monitoring_groups_interface.rb
|
260
275
|
- lib/morpheus/api/monitoring_incidents_interface.rb
|
261
276
|
- lib/morpheus/api/monitoring_interface.rb
|
277
|
+
- lib/morpheus/api/monitoring_settings_interface.rb
|
262
278
|
- lib/morpheus/api/network_dhcp_relays_interface.rb
|
263
279
|
- lib/morpheus/api/network_dhcp_servers_interface.rb
|
264
280
|
- lib/morpheus/api/network_domain_records_interface.rb
|
@@ -272,6 +288,7 @@ files:
|
|
272
288
|
- lib/morpheus/api/network_proxies_interface.rb
|
273
289
|
- lib/morpheus/api/network_routers_interface.rb
|
274
290
|
- lib/morpheus/api/network_security_servers_interface.rb
|
291
|
+
- lib/morpheus/api/network_server_groups_interface.rb
|
275
292
|
- lib/morpheus/api/network_servers_interface.rb
|
276
293
|
- lib/morpheus/api/network_services_interface.rb
|
277
294
|
- lib/morpheus/api/network_static_routes_interface.rb
|
@@ -392,6 +409,7 @@ files:
|
|
392
409
|
- lib/morpheus/cli/commands/get_prompt_command.rb
|
393
410
|
- lib/morpheus/cli/commands/groups.rb
|
394
411
|
- lib/morpheus/cli/commands/guidance_command.rb
|
412
|
+
- lib/morpheus/cli/commands/guidance_settings.rb
|
395
413
|
- lib/morpheus/cli/commands/health_command.rb
|
396
414
|
- lib/morpheus/cli/commands/history_command.rb
|
397
415
|
- lib/morpheus/cli/commands/hosts.rb
|
@@ -431,6 +449,7 @@ files:
|
|
431
449
|
- lib/morpheus/cli/commands/monitoring_contacts_command.rb
|
432
450
|
- lib/morpheus/cli/commands/monitoring_groups_command.rb
|
433
451
|
- lib/morpheus/cli/commands/monitoring_incidents_command.rb
|
452
|
+
- lib/morpheus/cli/commands/monitoring_settings.rb
|
434
453
|
- lib/morpheus/cli/commands/network_dhcp_relays_command.rb
|
435
454
|
- lib/morpheus/cli/commands/network_dhcp_servers_command.rb
|
436
455
|
- lib/morpheus/cli/commands/network_domains_command.rb
|
@@ -442,6 +461,7 @@ files:
|
|
442
461
|
- lib/morpheus/cli/commands/network_pools_command.rb
|
443
462
|
- lib/morpheus/cli/commands/network_proxies_command.rb
|
444
463
|
- lib/morpheus/cli/commands/network_routers_command.rb
|
464
|
+
- lib/morpheus/cli/commands/network_server_groups_command.rb
|
445
465
|
- lib/morpheus/cli/commands/network_services_command.rb
|
446
466
|
- lib/morpheus/cli/commands/network_static_routes_command.rb
|
447
467
|
- lib/morpheus/cli/commands/network_transport_zones_command.rb
|
@@ -550,6 +570,28 @@ files:
|
|
550
570
|
- lib/morpheus/terminal.rb
|
551
571
|
- lib/morpheus/util.rb
|
552
572
|
- morpheus-cli.gemspec
|
573
|
+
- test/api/containers_interface_test.rb
|
574
|
+
- test/api/doc_interface_test.rb
|
575
|
+
- test/api/instances_interface_test.rb
|
576
|
+
- test/api/whoami_interface_test.rb
|
577
|
+
- test/cli/access_token_test.rb
|
578
|
+
- test/cli/auth_test.rb
|
579
|
+
- test/cli/cli_test.rb
|
580
|
+
- test/cli/containers_test.rb
|
581
|
+
- test/cli/doc_test.rb
|
582
|
+
- test/cli/help_test.rb
|
583
|
+
- test/cli/instances_test.rb
|
584
|
+
- test/cli/man_test.rb
|
585
|
+
- test/cli/remote_test.rb
|
586
|
+
- test/cli/roles_test.rb
|
587
|
+
- test/cli/shell_test.rb
|
588
|
+
- test/cli/version_test.rb
|
589
|
+
- test/cli/view_test.rb
|
590
|
+
- test/cli/whoami_test.rb
|
591
|
+
- test/morpheus_test.rb
|
592
|
+
- test/test_case.rb
|
593
|
+
- test/test_config.rb
|
594
|
+
- test/test_data_helper.rb
|
553
595
|
homepage:
|
554
596
|
licenses:
|
555
597
|
- MIT
|
@@ -573,4 +615,26 @@ rubygems_version: 3.1.6
|
|
573
615
|
signing_key:
|
574
616
|
specification_version: 4
|
575
617
|
summary: Provides CLI Interface to the Morpheus Public/Private Cloud Appliance
|
576
|
-
test_files:
|
618
|
+
test_files:
|
619
|
+
- test/api/containers_interface_test.rb
|
620
|
+
- test/api/doc_interface_test.rb
|
621
|
+
- test/api/instances_interface_test.rb
|
622
|
+
- test/api/whoami_interface_test.rb
|
623
|
+
- test/cli/access_token_test.rb
|
624
|
+
- test/cli/auth_test.rb
|
625
|
+
- test/cli/cli_test.rb
|
626
|
+
- test/cli/containers_test.rb
|
627
|
+
- test/cli/doc_test.rb
|
628
|
+
- test/cli/help_test.rb
|
629
|
+
- test/cli/instances_test.rb
|
630
|
+
- test/cli/man_test.rb
|
631
|
+
- test/cli/remote_test.rb
|
632
|
+
- test/cli/roles_test.rb
|
633
|
+
- test/cli/shell_test.rb
|
634
|
+
- test/cli/version_test.rb
|
635
|
+
- test/cli/view_test.rb
|
636
|
+
- test/cli/whoami_test.rb
|
637
|
+
- test/morpheus_test.rb
|
638
|
+
- test/test_case.rb
|
639
|
+
- test/test_config.rb
|
640
|
+
- test/test_data_helper.rb
|