morpheus-cli 9.0.1 → 9.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1f2fdd08e0bf0dbe8567812778748a10d38dbb6efd64430fc50fdf1134528be3
4
- data.tar.gz: 2219cdf94a929a790e75d727068567adb10d09a80c30971e96365726812d3334
3
+ metadata.gz: a1c28da8f1406a4119d87de9b4f0defe5e98ad69d347625c8c8018bcf02f196b
4
+ data.tar.gz: 65164bb33eb05de4d1627de11a43297316e8bb5a82849a6010d91cfdcb2d5236
5
5
  SHA512:
6
- metadata.gz: 7b276775f4746e397b8d4b05c3c09c04d9b02409c7511e6a40a3ac80a160642d376fb10a2bf78477bfe84f3b3fc9abc1680ca332307efe4c250ec2b478a961f3
7
- data.tar.gz: 7046dcbfff992519d64e93c1fd1383b0bb1c3166dfad466d56661a2ee65e0b45038a9d94d4c7812ab423c285267347609337e0312fddeeae82fe5f001b67cc6e
6
+ metadata.gz: a265975de9ea8d79e23679f035536d6d201929c4133cd3cd4a410ae626597b4931019fed1c354e4ff0e67d8a83506719f10b921580522656aab858ddea23c69e
7
+ data.tar.gz: 142b6cd4634d72f4636e0d251d0cfd905050ba9cceed13e75acd6091f4ca4f263e03043d30f10b40158ab15962e0a22307e2acdcfae75cfe18a059e8279b0049
data/Dockerfile CHANGED
@@ -1,5 +1,5 @@
1
1
  FROM ruby:2.7.5
2
2
 
3
- RUN gem install morpheus-cli -v 9.0.1
3
+ RUN gem install morpheus-cli -v 9.0.2
4
4
 
5
5
  ENTRYPOINT ["morpheus"]
@@ -1038,6 +1038,10 @@ class Morpheus::APIClient
1038
1038
  Morpheus::TokensInterface.new(common_interface_options).setopts(@options)
1039
1039
  end
1040
1040
 
1041
+ def virtual_switches
1042
+ Morpheus::VirtualSwitchesInterface.new(common_interface_options).setopts(@options)
1043
+ end
1044
+
1041
1045
  def rest(endpoint)
1042
1046
  Morpheus::RestInterface.new(common_interface_options).setopts(@options.merge({base_path: "#{@base_url}/api/#{endpoint}"}))
1043
1047
  end
@@ -390,6 +390,54 @@ class Morpheus::ClustersInterface < Morpheus::APIClient
390
390
  execute(method: :delete, url: url, headers: headers)
391
391
  end
392
392
 
393
+ def affinity_group_form_options(id, params={})
394
+ url = "#{base_path}/#{id}/affinity-groups/form-options"
395
+ headers = { params: params, authorization: "Bearer #{@access_token}" }
396
+ execute(method: :get, url: url, headers: headers)
397
+ end
398
+
399
+ def affinity_group_violations(params={})
400
+ url = "#{@base_url}/api/affinity-groups/violations"
401
+ headers = { params: params, authorization: "Bearer #{@access_token}" }
402
+ execute(method: :get, url: url, headers: headers)
403
+ end
404
+
405
+ def list_host_vm_groups(id, params={})
406
+ url = "#{base_path}/#{id}/host-vm-groups"
407
+ headers = { params: params, authorization: "Bearer #{@access_token}" }
408
+ execute(method: :get, url: url, headers: headers)
409
+ end
410
+
411
+ def get_host_vm_group(id, host_vm_group_id, params={})
412
+ url = "#{base_path}/#{id}/host-vm-groups/#{host_vm_group_id}"
413
+ headers = { params: params, authorization: "Bearer #{@access_token}" }
414
+ execute(method: :get, url: url, headers: headers)
415
+ end
416
+
417
+ def create_host_vm_group(id, payload)
418
+ url = "#{base_path}/#{id}/host-vm-groups"
419
+ headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
420
+ execute(method: :post, url: url, headers: headers, payload: payload.to_json)
421
+ end
422
+
423
+ def update_host_vm_group(id, host_vm_group_id, payload)
424
+ url = "#{base_path}/#{id}/host-vm-groups/#{host_vm_group_id}"
425
+ headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
426
+ execute(method: :put, url: url, headers: headers, payload: payload.to_json)
427
+ end
428
+
429
+ def destroy_host_vm_group(id, host_vm_group_id, params={})
430
+ url = "#{base_path}/#{id}/host-vm-groups/#{host_vm_group_id}"
431
+ headers = { :params => params, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
432
+ execute(method: :delete, url: url, headers: headers)
433
+ end
434
+
435
+ def host_vm_group_form_options(id, params={})
436
+ url = "#{base_path}/#{id}/host-vm-groups/form-options"
437
+ headers = { params: params, authorization: "Bearer #{@access_token}" }
438
+ execute(method: :get, url: url, headers: headers)
439
+ end
440
+
393
441
  def available_updates(id, params={})
394
442
  url = "#{base_path}/#{id}/available-updates"
395
443
  headers = { params: params, authorization: "Bearer #{@access_token}" }
@@ -219,4 +219,12 @@ class Morpheus::ServersInterface < Morpheus::APIClient
219
219
  execute(opts)
220
220
  end
221
221
 
222
+
223
+ def create_linked_clone(id, snapshot_id, payload={})
224
+ url = "#{@base_url}/api/servers/#{id}/linked-clone/#{snapshot_id}"
225
+ headers = {:authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
226
+ opts = {method: :put, url: url, headers: headers, payload: payload.to_json}
227
+ execute(opts)
228
+ end
229
+
222
230
  end
@@ -0,0 +1,9 @@
1
+ require 'morpheus/api/rest_interface'
2
+
3
+ class Morpheus::VirtualSwitchesInterface < Morpheus::RestInterface
4
+
5
+ def base_path
6
+ "/api/virtual-switches"
7
+ end
8
+
9
+ end
@@ -187,6 +187,17 @@ EOT
187
187
  params['backupType'] = Morpheus::Cli::OptionTypes.prompt([{'fieldName' => 'backupType', 'fieldLabel' => 'Backup Type', 'type' => 'select', 'selectOptions' => avail_backup_types, 'defaultValue' => avail_backup_types[0] ? avail_backup_types[0]['name'] : nil, 'required' => true}], options[:options], @api_client)['backupType']
188
188
  end
189
189
 
190
+ # Plugin optionTypes
191
+ plugin_option_type_inputs = @options_interface.options_for_source('backupOptionTypes', {'backupTypeCode' => params['backupType']} )['data']['optionTypes']
192
+ plugin_opt_parser = Morpheus::Cli::OptionParser.new do |opts|
193
+ build_option_type_options(opts, options, plugin_option_type_inputs)
194
+ end
195
+
196
+ plugin_opt_parser.parse!(args)
197
+ v_prompt = Morpheus::Cli::OptionTypes.prompt(plugin_option_type_inputs, options[:options].deep_merge({:context_map => {'domain' => 'backup'}}), @api_client)
198
+ v_prompt.deep_compact!.booleanize! # remove empty values and convert checkbox "on" and "off" to true and false
199
+ params.merge!(v_prompt.delete('backup'))
200
+
190
201
  # Job / Schedule
191
202
  params['jobAction'] = Morpheus::Cli::OptionTypes.prompt([{'fieldName' => 'jobAction', 'fieldLabel' => 'Backup Job Type', 'type' => 'select', 'optionSource' => 'backupJobActions', 'required' => true, 'defaultValue' => 'new'}], options[:options], @api_client)['jobAction']
192
203
  if params['jobAction'] == 'new'