morpheus-cli 5.5.1 → 5.5.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Dockerfile +2 -2
- 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/commands/deployments.rb +4 -4
- data/lib/morpheus/cli/mixins/infrastructure_helper.rb +2 -1
- data/lib/morpheus/cli/mixins/rest_command.rb +17 -1
- data/lib/morpheus/cli/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c60f08b038db5460dc2fbcb4ca3626f8784164f89ff477cd9b4ef0b32073a16e
|
4
|
+
data.tar.gz: 1b2a47809e7826fec9893d7b9899ee96e536c6661f4de7eedc4f467756dde5e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89fcdd4815408d056d3fd6adb79bcc82f7d26eaf6fdc9d6d640289d554cdab0f7c4eeeef55f130299a67b599a1e2746263d55eab209165e91e11e68d1e5cb8f8
|
7
|
+
data.tar.gz: 7fa16441f2d3612f1af1f86f8cb3c86363abd2f36f49f8da47550b6b2901a60227acc8407ab93e9a71e9d147431e0513905b9d63153378294a7bd57e0127b656
|
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', 'serviceUsername', 'servicePassword'].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
|
@@ -879,10 +879,10 @@ EOT
|
|
879
879
|
def add_deployment_version_option_types
|
880
880
|
[
|
881
881
|
{'fieldName' => 'userVersion', 'fieldLabel' => 'Version', 'type' => 'text', 'required' => true, 'displayOrder' => 1, 'description' => 'This is the deployment version identifier (userVersion)'},
|
882
|
-
{'fieldName' => 'deployType', 'fieldLabel' => 'Deploy Type', 'type' => 'select', 'optionSource' => 'deployTypes', 'required' => true, 'displayOrder' =>
|
883
|
-
{'fieldName' => 'fetchUrl', 'fieldLabel' => 'Fetch URL', 'type' => '
|
884
|
-
{'fieldName' => 'gitUrl', 'fieldLabel' => 'Git URL', 'type' => 'string', 'required' => true, 'displayOrder' =>
|
885
|
-
{'fieldName' => 'gitRef', 'fieldLabel' => 'Git Ref', 'type' => 'string', 'displayOrder' =>
|
882
|
+
{'fieldName' => 'deployType', 'fieldLabel' => 'Deploy Type', 'type' => 'select', 'optionSource' => 'deployTypes', 'required' => true, 'displayOrder' => 2, 'description' => 'This is the deployment version identifier (userVersion)', 'defaultValue' => 'file', 'code' => 'deployment.deployType'},
|
883
|
+
{'fieldName' => 'fetchUrl', 'fieldLabel' => 'Fetch URL', 'type' => 'string', 'required' => true, 'displayOrder' => 3, 'description' => 'The URL to fetch the deployment file(s) from.', 'dependsOnCode' => 'deployment.deployType:fetch'},
|
884
|
+
{'fieldName' => 'gitUrl', 'fieldLabel' => 'Git URL', 'type' => 'string', 'required' => true, 'displayOrder' => 4, 'description' => 'The URL to fetch the deployment file(s) from.', 'dependsOnCode' => 'deployment.deployType:git'},
|
885
|
+
{'fieldName' => 'gitRef', 'fieldLabel' => 'Git Ref', 'type' => 'string', 'displayOrder' => 5, 'description' => 'The Git Reference to use, this the branch or tag name, defaults to master.', 'dependsOnCode' => 'deployment.deployType:git'}
|
886
886
|
]
|
887
887
|
end
|
888
888
|
|
@@ -130,7 +130,8 @@ module Morpheus::Cli::InfrastructureHelper
|
|
130
130
|
end
|
131
131
|
|
132
132
|
def cloud_type_for_name(name)
|
133
|
-
|
133
|
+
types = get_available_cloud_types(true, {'name' => name})
|
134
|
+
return types.find { |z| z['code'].downcase == name.downcase} || types.find { |z| z['name'].downcase == name.downcase}
|
134
135
|
end
|
135
136
|
|
136
137
|
|
@@ -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.3
|
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: 2022-
|
14
|
+
date: 2022-08-01 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: bundler
|
@@ -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
|