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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0f9a8ef29c8d96c51593c8c762e94e34409426fb787ce3944396af9fc1e71279
4
- data.tar.gz: 9a89c3ce4161499a9cf9df9ec30d48f0f8e9f4faf04746a19f966c1dc6cda7fd
3
+ metadata.gz: c60f08b038db5460dc2fbcb4ca3626f8784164f89ff477cd9b4ef0b32073a16e
4
+ data.tar.gz: 1b2a47809e7826fec9893d7b9899ee96e536c6661f4de7eedc4f467756dde5e5
5
5
  SHA512:
6
- metadata.gz: 2d4ef36713c80b4ce6c9037b5ac971f8abdcd65ad4ff732a7e1c9ab89e46ca7199fa4ce7f4bcb5cbe67e79236f9b90ee7b894d1d62ea5809c6da4c7b54e7ca7b
7
- data.tar.gz: fc6fca36a81248ad7f44c8dd7aabb03fe60d7b9aaafd03311385a7b86a101a1cfb180dacf1a33d7306a5e5cf204d70ffb7e61ca02cef3c5180ff52df89d8fe65
6
+ metadata.gz: 89fcdd4815408d056d3fd6adb79bcc82f7d26eaf6fdc9d6d640289d554cdab0f7c4eeeef55f130299a67b599a1e2746263d55eab209165e91e11e68d1e5cb8f8
7
+ data.tar.gz: 7fa16441f2d3612f1af1f86f8cb3c86363abd2f36f49f8da47550b6b2901a60227acc8407ab93e9a71e9d147431e0513905b9d63153378294a7bd57e0127b656
data/Dockerfile CHANGED
@@ -1,5 +1,5 @@
1
- FROM ruby:2.5.1
1
+ FROM ruby:2.7.5
2
2
 
3
- RUN gem install morpheus-cli -v 5.5.1
3
+ RUN gem install morpheus-cli -v 5.5.1.3
4
4
 
5
5
  ENTRYPOINT ["morpheus"]
@@ -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,9 @@
1
+ require 'morpheus/api/read_interface'
2
+
3
+ class Morpheus::BackupServiceTypesInterface < Morpheus::ReadInterface
4
+
5
+ def base_path
6
+ "/api/backup-service-types"
7
+ end
8
+
9
+ end
@@ -0,0 +1,9 @@
1
+ require 'morpheus/api/rest_interface'
2
+
3
+ class Morpheus::BackupServicesInterface < Morpheus::RestInterface
4
+
5
+ def base_path
6
+ "/api/backup-services"
7
+ end
8
+
9
+ 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' => 1, 'description' => 'This is the deployment version identifier (userVersion)', 'defaultValue' => 'file', 'code' => 'deployment.deployType'},
883
- {'fieldName' => 'fetchUrl', 'fieldLabel' => 'Fetch URL', 'type' => 'select', 'optionSource' => 'deployTypes', 'required' => true, 'displayOrder' => 1, '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' => 1, 'description' => 'The URL to fetch the deployment file(s) from.', 'dependsOnCode' => 'deployment.deployType:git'},
885
- {'fieldName' => 'gitRef', 'fieldLabel' => 'Git Ref', 'type' => 'string', 'displayOrder' => 1, 'description' => 'The Git Reference to use, this the branch or tag name, defaults to master.', 'dependsOnCode' => 'deployment.deployType:git'}
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
- return get_available_cloud_types(true, {'name' => name}).find { |z| z['name'].downcase == name.downcase || z['code'].downcase == name.downcase}
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'}
@@ -1,6 +1,6 @@
1
1
 
2
2
  module Morpheus
3
3
  module Cli
4
- VERSION = "5.5.1"
4
+ VERSION = "5.5.1.3"
5
5
  end
6
6
  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.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-07-19 00:00:00.000000000 Z
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