morpheus-cli 5.5.1 → 5.5.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Dockerfile +1 -1
- data/lib/morpheus/api/api_client.rb +8 -0
- data/lib/morpheus/api/backup_service_types_interface.rb +9 -0
- data/lib/morpheus/api/backup_services_interface.rb +9 -0
- data/lib/morpheus/cli/commands/backup_services_command.rb +44 -0
- data/lib/morpheus/cli/commands/clouds.rb +6 -0
- data/lib/morpheus/cli/mixins/rest_command.rb +17 -1
- data/lib/morpheus/cli/version.rb +1 -1
- metadata +4 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a66201f045d6e88db90746058ce40000b064616975aae3d00c025069c51f20d7
|
4
|
+
data.tar.gz: de2b69e5a52ca31f7bde8d573428853a765668b2d08ba8eaca1cdbe6743ecf0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ebc460c1903caf068710ac2512e73fb88329045a49ff603904e875ff2a02cb6a4ec02b34195d9ee19c98ab8eefb6388357d8c43cb69a8ad92891322a085f1dd1
|
7
|
+
data.tar.gz: 60a297a75a29a6bb53a3944b81fa14a9f46c846173bf98472886bb86a5a13491c55da9600fa691d861ba20812546b5d57e891a61a3b4dcef9c922ed3b43a3f9b
|
data/Dockerfile
CHANGED
@@ -836,6 +836,14 @@ class Morpheus::APIClient
|
|
836
836
|
Morpheus::BackupJobsInterface.new(common_interface_options).setopts(@options)
|
837
837
|
end
|
838
838
|
|
839
|
+
def backup_services
|
840
|
+
Morpheus::BackupServicesInterface.new(common_interface_options).setopts(@options)
|
841
|
+
end
|
842
|
+
|
843
|
+
def backup_service_types
|
844
|
+
Morpheus::BackupServiceTypesInterface.new(common_interface_options).setopts(@options)
|
845
|
+
end
|
846
|
+
|
839
847
|
def catalog_item_types
|
840
848
|
Morpheus::CatalogItemTypesInterface.new(common_interface_options).setopts(@options)
|
841
849
|
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require 'morpheus/cli/cli_command'
|
2
|
+
|
3
|
+
class Morpheus::Cli::BackupServices
|
4
|
+
include Morpheus::Cli::CliCommand
|
5
|
+
include Morpheus::Cli::RestCommand
|
6
|
+
|
7
|
+
set_command_description "View and manage backup services."
|
8
|
+
set_command_name :'backup-services'
|
9
|
+
register_subcommands :list, :get, :add, :update, :remove
|
10
|
+
register_interfaces :backup_services, :backup_service_types
|
11
|
+
set_rest_has_type true
|
12
|
+
|
13
|
+
protected
|
14
|
+
|
15
|
+
def load_option_types_for_backup_service(record_type, parent_record)
|
16
|
+
[
|
17
|
+
{'fieldName' => 'name', 'fieldLabel' => 'Name', 'type' => 'text', 'required' => true, 'displayOrder' => 1},
|
18
|
+
{'fieldName' => 'enabled', 'fieldLabel' => 'Enabled', 'type' => 'checkbox', 'defaultValue' => 'on', 'displayOrder' => 2},
|
19
|
+
{'fieldName' => 'visibility', 'fieldLabel' => 'Visibility', 'type' => 'select', 'selectOptions' => [{'name' => 'Public', 'value' => 'public'}, {'name' => 'Private', 'value' => 'private'}], 'defaultValue' => 'public', 'displayOrder' => 1000}
|
20
|
+
] + record_type['optionTypes']
|
21
|
+
end
|
22
|
+
|
23
|
+
def backup_service_list_column_definitions(options)
|
24
|
+
{
|
25
|
+
"ID" => 'id',
|
26
|
+
"Name" => 'name',
|
27
|
+
"Status" => 'status',
|
28
|
+
"Visibility" => 'visibility'
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
def backup_service_column_definitions(options)
|
33
|
+
{
|
34
|
+
"ID" => 'id',
|
35
|
+
"Name" => 'name',
|
36
|
+
"Enabled" => 'enabled',
|
37
|
+
"Api URL" => 'serviceUrl',
|
38
|
+
"Host" => 'host',
|
39
|
+
"Port" => 'port',
|
40
|
+
"Credential" => lambda {|it| it['credential']['type'] == 'local' ? 'local' : it['credential']['name']},
|
41
|
+
"Visibility" => 'visibility'
|
42
|
+
}
|
43
|
+
end
|
44
|
+
end
|
@@ -985,9 +985,15 @@ class Morpheus::Cli::Clouds
|
|
985
985
|
# Details (zoneType.optionTypes)
|
986
986
|
|
987
987
|
if cloud_type && cloud_type['optionTypes']
|
988
|
+
if !cloud_type['optionTypes'].find {|opt| opt['type'] == 'credential'}
|
989
|
+
tmp_option_types << {'fieldName' => 'type', 'fieldLabel' => 'Credentials', 'type' => 'credential', 'optionSource' => 'credentials', 'required' => true, 'defaultValue' => 'local', 'config' => {'credentialTypes' => ['username-password']}, 'displayOrder' => 7}
|
990
|
+
cloud_type['optionTypes'].select {|opt| ['username', 'password'].include?(opt['fieldName'])}.each {|opt| opt['localCredential'] = true}
|
991
|
+
end
|
988
992
|
# adjust displayOrder to put these at the end
|
989
993
|
#tmp_option_types = tmp_option_types + cloud_type['optionTypes']
|
990
994
|
cloud_type['optionTypes'].each do |opt|
|
995
|
+
# temp fix for typo
|
996
|
+
opt['optionSource'] = 'credentials' if opt['optionSource'] == 'credentials,'
|
991
997
|
tmp_option_types << opt.merge({'displayOrder' => opt['displayOrder'].to_i + 100})
|
992
998
|
end
|
993
999
|
end
|
@@ -159,6 +159,17 @@ module Morpheus::Cli::RestCommand
|
|
159
159
|
|
160
160
|
alias :set_rest_perms_config :rest_perms_config=
|
161
161
|
|
162
|
+
# rest_option_context_map specifies context mapping during option prompt. default is domain => ''
|
163
|
+
def rest_option_context_map
|
164
|
+
@option_context_map || {'domain' => ''}
|
165
|
+
end
|
166
|
+
|
167
|
+
def rest_option_context_map=(v)
|
168
|
+
@option_context_map = v
|
169
|
+
end
|
170
|
+
|
171
|
+
alias :set_rest_option_context_map :rest_option_context_map=
|
172
|
+
|
162
173
|
# rest_has_type indicates a resource has a type. default is false
|
163
174
|
def rest_has_type
|
164
175
|
@rest_has_type == true
|
@@ -344,6 +355,10 @@ module Morpheus::Cli::RestCommand
|
|
344
355
|
self.class.rest_perms_config
|
345
356
|
end
|
346
357
|
|
358
|
+
def rest_option_context_map
|
359
|
+
self.class.rest_option_context_map
|
360
|
+
end
|
361
|
+
|
347
362
|
# returns the default rest interface, allows using rest_interface_name = "your"
|
348
363
|
# or override this method to return @your_interface if needed
|
349
364
|
def rest_interface
|
@@ -582,7 +597,8 @@ EOT
|
|
582
597
|
def add(args)
|
583
598
|
record_type = nil
|
584
599
|
record_type_id = nil
|
585
|
-
options = {}
|
600
|
+
options = {:options => {:context_map => rest_option_context_map}}
|
601
|
+
#respond_to?("#{rest_key}_option_context_map", true) ? send("#{rest_key}_option_context_map") : {'domain' => ''}}}
|
586
602
|
option_types = respond_to?("add_#{rest_key}_option_types", true) ? send("add_#{rest_key}_option_types") : []
|
587
603
|
advanced_option_types = respond_to?("add_#{rest_key}_advanced_option_types", true) ? send("add_#{rest_key}_advanced_option_types") : []
|
588
604
|
type_option_type = option_types.find {|it| it['fieldName'] == 'type'}
|
data/lib/morpheus/cli/version.rb
CHANGED
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.1
|
4
|
+
version: 5.5.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Estes
|
@@ -185,6 +185,8 @@ files:
|
|
185
185
|
- lib/morpheus/api/audit_interface.rb
|
186
186
|
- lib/morpheus/api/auth_interface.rb
|
187
187
|
- lib/morpheus/api/backup_jobs_interface.rb
|
188
|
+
- lib/morpheus/api/backup_service_types_interface.rb
|
189
|
+
- lib/morpheus/api/backup_services_interface.rb
|
188
190
|
- lib/morpheus/api/backup_settings_interface.rb
|
189
191
|
- lib/morpheus/api/backups_interface.rb
|
190
192
|
- lib/morpheus/api/billing_interface.rb
|
@@ -342,6 +344,7 @@ files:
|
|
342
344
|
- lib/morpheus/cli/commands/archives_command.rb
|
343
345
|
- lib/morpheus/cli/commands/audit.rb
|
344
346
|
- lib/morpheus/cli/commands/backup_jobs_command.rb
|
347
|
+
- lib/morpheus/cli/commands/backup_services_command.rb
|
345
348
|
- lib/morpheus/cli/commands/backup_settings_command.rb
|
346
349
|
- lib/morpheus/cli/commands/backups_command.rb
|
347
350
|
- lib/morpheus/cli/commands/benchmark_command.rb
|