morpheus-cli 3.6.28 → 3.6.29
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/morpheus/api/api_client.rb +16 -0
- data/lib/morpheus/api/cloud_folders_interface.rb +47 -0
- data/lib/morpheus/api/cloud_resource_pools_interface.rb +47 -0
- data/lib/morpheus/api/network_types_interface.rb +26 -0
- data/lib/morpheus/api/reports_interface.rb +77 -0
- data/lib/morpheus/api/security_group_rules_interface.rb +6 -0
- data/lib/morpheus/api/security_groups_interface.rb +21 -15
- data/lib/morpheus/cli.rb +3 -0
- data/lib/morpheus/cli/accounts.rb +1 -1
- data/lib/morpheus/cli/apps.rb +2 -2
- data/lib/morpheus/cli/archives_command.rb +18 -18
- data/lib/morpheus/cli/blueprints_command.rb +1 -1
- data/lib/morpheus/cli/boot_scripts_command.rb +6 -6
- data/lib/morpheus/cli/cli_command.rb +4 -0
- data/lib/morpheus/cli/cloud_datastores_command.rb +58 -20
- data/lib/morpheus/cli/cloud_folders_command.rb +463 -0
- data/lib/morpheus/cli/cloud_resource_pools_command.rb +707 -0
- data/lib/morpheus/cli/clouds.rb +2 -0
- data/lib/morpheus/cli/hosts.rb +33 -8
- data/lib/morpheus/cli/instances.rb +79 -54
- data/lib/morpheus/cli/library_option_lists_command.rb +1 -1
- data/lib/morpheus/cli/library_option_types_command.rb +1 -1
- data/lib/morpheus/cli/mixins/provisioning_helper.rb +11 -2
- data/lib/morpheus/cli/monitoring_contacts_command.rb +1 -1
- data/lib/morpheus/cli/monitoring_incidents_command.rb +1 -1
- data/lib/morpheus/cli/network_services_command.rb +7 -3
- data/lib/morpheus/cli/networks_command.rb +164 -63
- data/lib/morpheus/cli/option_types.rb +16 -15
- data/lib/morpheus/cli/policies_command.rb +76 -9
- data/lib/morpheus/cli/preseed_scripts_command.rb +2 -2
- data/lib/morpheus/cli/remote.rb +26 -28
- data/lib/morpheus/cli/reports_command.rb +594 -0
- data/lib/morpheus/cli/security_group_rules.rb +5 -1
- data/lib/morpheus/cli/security_groups.rb +882 -45
- data/lib/morpheus/cli/tasks.rb +158 -23
- data/lib/morpheus/cli/tenants_command.rb +1 -1
- data/lib/morpheus/cli/users.rb +1 -1
- data/lib/morpheus/cli/version.rb +1 -1
- metadata +9 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0de4d4e9a97c7bbbfa7c55bc246c3160f9de9d63dfb94a9c8cc5fe396de61ee
|
4
|
+
data.tar.gz: d663cbe5ebf76f8f603250a9454435cf7d89e62056222ff373e922c3ca2d9ff0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10989bc3cd5896f6e7492998e874377a53b8e1f327a9309f7ef3642430f9eb50d86a6afb4e2a2e1aa18b85dbd1a7b6b44d754cc23010e271dca1d41441d486dc
|
7
|
+
data.tar.gz: f5c87086afe345cae27d8789912c358590d025ca6f3b10a6c770859a155ceec23c3221fb80d232a059fa58895cb99a69d9fa372a952b897335702ab3e078c2d1
|
@@ -216,6 +216,14 @@ class Morpheus::APIClient
|
|
216
216
|
Morpheus::CloudDatastoresInterface.new(@access_token, @refresh_token, @expires_at, @base_url).setopts(@options)
|
217
217
|
end
|
218
218
|
|
219
|
+
def cloud_resource_pools
|
220
|
+
Morpheus::CloudResourcePoolsInterface.new(@access_token, @refresh_token, @expires_at, @base_url).setopts(@options)
|
221
|
+
end
|
222
|
+
|
223
|
+
def cloud_folders
|
224
|
+
Morpheus::CloudFoldersInterface.new(@access_token, @refresh_token, @expires_at, @base_url).setopts(@options)
|
225
|
+
end
|
226
|
+
|
219
227
|
def servers
|
220
228
|
Morpheus::ServersInterface.new(@access_token, @refresh_token, @expires_at, @base_url).setopts(@options)
|
221
229
|
end
|
@@ -370,6 +378,10 @@ class Morpheus::APIClient
|
|
370
378
|
Morpheus::NetworksInterface.new(@access_token, @refresh_token, @expires_at, @base_url).setopts(@options)
|
371
379
|
end
|
372
380
|
|
381
|
+
def network_types
|
382
|
+
Morpheus::NetworkTypesInterface.new(@access_token, @refresh_token, @expires_at, @base_url).setopts(@options)
|
383
|
+
end
|
384
|
+
|
373
385
|
def network_groups
|
374
386
|
Morpheus::NetworkGroupsInterface.new(@access_token, @refresh_token, @expires_at, @base_url).setopts(@options)
|
375
387
|
end
|
@@ -458,6 +470,10 @@ class Morpheus::APIClient
|
|
458
470
|
Morpheus::ProcessesInterface.new(@access_token, @refresh_token, @expires_at, @base_url).setopts(@options)
|
459
471
|
end
|
460
472
|
|
473
|
+
def reports
|
474
|
+
Morpheus::ReportsInterface.new(@access_token, @refresh_token, @expires_at, @base_url).setopts(@options)
|
475
|
+
end
|
476
|
+
|
461
477
|
# new interfaces get added here
|
462
478
|
|
463
479
|
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'morpheus/api/api_client'
|
2
|
+
|
3
|
+
class Morpheus::CloudFoldersInterface < Morpheus::APIClient
|
4
|
+
def initialize(access_token, refresh_token,expires_at = nil, base_url=nil)
|
5
|
+
@access_token = access_token
|
6
|
+
@refresh_token = refresh_token
|
7
|
+
@base_url = base_url
|
8
|
+
@expires_at = expires_at
|
9
|
+
end
|
10
|
+
|
11
|
+
def get(cloud_id, id, params={})
|
12
|
+
raise "#{self.class}.get() passed a blank id!" if id.to_s == ''
|
13
|
+
url = "#{@base_url}/api/zones/#{cloud_id}/folders/#{id}"
|
14
|
+
headers = { params: params, authorization: "Bearer #{@access_token}" }
|
15
|
+
opts = {method: :get, url: url, headers: headers}
|
16
|
+
execute(opts)
|
17
|
+
end
|
18
|
+
|
19
|
+
def list(cloud_id, params={})
|
20
|
+
url = "#{@base_url}/api/zones/#{cloud_id}/folders"
|
21
|
+
headers = { params: params, authorization: "Bearer #{@access_token}" }
|
22
|
+
opts = {method: :get, url: url, headers: headers}
|
23
|
+
execute(opts)
|
24
|
+
end
|
25
|
+
|
26
|
+
def create(cloud_id, payload)
|
27
|
+
url = "#{@base_url}/api/zones/#{cloud_id}/folders"
|
28
|
+
headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
29
|
+
opts = {method: :post, url: url, headers: headers, payload: payload.to_json}
|
30
|
+
execute(opts)
|
31
|
+
end
|
32
|
+
|
33
|
+
def update(cloud_id, id, payload)
|
34
|
+
url = "#{@base_url}/api/zones/#{cloud_id}/folders/#{id}"
|
35
|
+
headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
36
|
+
opts = {method: :put, url: url, headers: headers, payload: payload.to_json}
|
37
|
+
execute(opts)
|
38
|
+
end
|
39
|
+
|
40
|
+
def destroy(cloud_id, id, params={})
|
41
|
+
url = "#{@base_url}/api/zones/#{cloud_id}/folders/#{id}"
|
42
|
+
headers = { :params => params, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
43
|
+
opts = {method: :delete, url: url, headers: headers}
|
44
|
+
execute(opts)
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'morpheus/api/api_client'
|
2
|
+
|
3
|
+
class Morpheus::CloudResourcePoolsInterface < Morpheus::APIClient
|
4
|
+
def initialize(access_token, refresh_token,expires_at = nil, base_url=nil)
|
5
|
+
@access_token = access_token
|
6
|
+
@refresh_token = refresh_token
|
7
|
+
@base_url = base_url
|
8
|
+
@expires_at = expires_at
|
9
|
+
end
|
10
|
+
|
11
|
+
def get(cloud_id, id, params={})
|
12
|
+
raise "#{self.class}.get() passed a blank id!" if id.to_s == ''
|
13
|
+
url = "#{@base_url}/api/zones/#{cloud_id}/resource-pools/#{id}"
|
14
|
+
headers = { params: params, authorization: "Bearer #{@access_token}" }
|
15
|
+
opts = {method: :get, url: url, headers: headers}
|
16
|
+
execute(opts)
|
17
|
+
end
|
18
|
+
|
19
|
+
def list(cloud_id, params={})
|
20
|
+
url = "#{@base_url}/api/zones/#{cloud_id}/resource-pools"
|
21
|
+
headers = { params: params, authorization: "Bearer #{@access_token}" }
|
22
|
+
opts = {method: :get, url: url, headers: headers}
|
23
|
+
execute(opts)
|
24
|
+
end
|
25
|
+
|
26
|
+
def create(cloud_id, payload)
|
27
|
+
url = "#{@base_url}/api/zones/#{cloud_id}/resource-pools"
|
28
|
+
headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
29
|
+
opts = {method: :post, url: url, headers: headers, payload: payload.to_json}
|
30
|
+
execute(opts)
|
31
|
+
end
|
32
|
+
|
33
|
+
def update(cloud_id, id, payload)
|
34
|
+
url = "#{@base_url}/api/zones/#{cloud_id}/resource-pools/#{id}"
|
35
|
+
headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
36
|
+
opts = {method: :put, url: url, headers: headers, payload: payload.to_json}
|
37
|
+
execute(opts)
|
38
|
+
end
|
39
|
+
|
40
|
+
def destroy(cloud_id, id, params={})
|
41
|
+
url = "#{@base_url}/api/zones/#{cloud_id}/resource-pools/#{id}"
|
42
|
+
headers = { :params => params, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
43
|
+
opts = {method: :delete, url: url, headers: headers}
|
44
|
+
execute(opts)
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'morpheus/api/api_client'
|
2
|
+
|
3
|
+
class Morpheus::NetworkTypesInterface < Morpheus::APIClient
|
4
|
+
def initialize(access_token, refresh_token,expires_at = nil, base_url=nil)
|
5
|
+
@access_token = access_token
|
6
|
+
@refresh_token = refresh_token
|
7
|
+
@base_url = base_url
|
8
|
+
@expires_at = expires_at
|
9
|
+
end
|
10
|
+
|
11
|
+
def get(id, params={})
|
12
|
+
raise "#{self.class}.get() passed a blank id!" if id.to_s == ''
|
13
|
+
url = "#{@base_url}/api/network-types/#{id}"
|
14
|
+
headers = { params: params, authorization: "Bearer #{@access_token}" }
|
15
|
+
opts = {method: :get, url: url, headers: headers}
|
16
|
+
execute(opts)
|
17
|
+
end
|
18
|
+
|
19
|
+
def list(params={})
|
20
|
+
url = "#{@base_url}/api/network-types"
|
21
|
+
headers = { params: params, authorization: "Bearer #{@access_token}" }
|
22
|
+
opts = {method: :get, url: url, headers: headers}
|
23
|
+
execute(opts)
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
require 'morpheus/api/api_client'
|
2
|
+
|
3
|
+
class Morpheus::ReportsInterface < Morpheus::APIClient
|
4
|
+
def initialize(access_token, refresh_token,expires_at = nil, base_url=nil)
|
5
|
+
@access_token = access_token
|
6
|
+
@refresh_token = refresh_token
|
7
|
+
@base_url = base_url
|
8
|
+
@expires_at = expires_at
|
9
|
+
end
|
10
|
+
|
11
|
+
def get(id, params={})
|
12
|
+
raise "#{self.class}.get() passed a blank id!" if id.to_s == ''
|
13
|
+
url = "#{@base_url}/api/reports/#{id}"
|
14
|
+
headers = { params: params, authorization: "Bearer #{@access_token}" }
|
15
|
+
execute(method: :get, url: url, headers: headers)
|
16
|
+
end
|
17
|
+
|
18
|
+
def list(params={})
|
19
|
+
url = "#{@base_url}/api/reports"
|
20
|
+
headers = { params: params, authorization: "Bearer #{@access_token}" }
|
21
|
+
execute(method: :get, url: url, headers: headers)
|
22
|
+
end
|
23
|
+
|
24
|
+
def create(payload)
|
25
|
+
url = "#{@base_url}/api/reports"
|
26
|
+
headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
27
|
+
execute(method: :post, url: url, headers: headers, payload: payload.to_json)
|
28
|
+
end
|
29
|
+
|
30
|
+
# def update(id, payload)
|
31
|
+
# url = "#{@base_url}/api/reports/#{id}"
|
32
|
+
# headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
33
|
+
# execute(method: :put, url: url, headers: headers, payload: payload.to_json)
|
34
|
+
# end
|
35
|
+
|
36
|
+
def destroy(id, params={})
|
37
|
+
url = "#{@base_url}/api/reports/#{id}"
|
38
|
+
headers = { :params => params, :authorization => "Bearer #{@access_token}"}
|
39
|
+
execute(method: :delete, url: url, headers: headers)
|
40
|
+
end
|
41
|
+
|
42
|
+
def types(params={})
|
43
|
+
url = "#{@base_url}/api/report-types"
|
44
|
+
headers = { params: params, authorization: "Bearer #{@access_token}" }
|
45
|
+
execute(method: :get, url: url, headers: headers)
|
46
|
+
end
|
47
|
+
|
48
|
+
def export(id, outfile, params={}, report_format='json')
|
49
|
+
url = "#{@base_url}/api/reports/export/#{id}.#{report_format}"
|
50
|
+
headers = { params: params, authorization: "Bearer #{@access_token}" }
|
51
|
+
opts = {method: :get, url: url, headers: headers, timeout: 172800}
|
52
|
+
# execute(opts, {parse_json: false})
|
53
|
+
if Dir.exists?(outfile)
|
54
|
+
raise "outfile is invalid. It is the name of an existing directory: #{outfile}"
|
55
|
+
end
|
56
|
+
# if @verify_ssl == false
|
57
|
+
# opts[:verify_ssl] = OpenSSL::SSL::VERIFY_NONE
|
58
|
+
# end
|
59
|
+
if @dry_run
|
60
|
+
return opts
|
61
|
+
end
|
62
|
+
http_response = nil
|
63
|
+
File.open(outfile, 'w') {|f|
|
64
|
+
block = proc { |response|
|
65
|
+
response.read_body do |chunk|
|
66
|
+
# writing to #{outfile} ..."
|
67
|
+
f.write chunk
|
68
|
+
end
|
69
|
+
}
|
70
|
+
opts[:block_response] = block
|
71
|
+
http_response = RestClient::Request.new(opts).execute
|
72
|
+
# RestClient::Request.execute(opts)
|
73
|
+
}
|
74
|
+
return http_response
|
75
|
+
end
|
76
|
+
|
77
|
+
end
|
@@ -28,6 +28,12 @@ class Morpheus::SecurityGroupRulesInterface < Morpheus::APIClient
|
|
28
28
|
execute(method: :post, url: url, headers: headers, payload: payload.to_json)
|
29
29
|
end
|
30
30
|
|
31
|
+
def update(security_group_id, id, payload)
|
32
|
+
url = "#{@base_url}/api/security-groups/#{security_group_id}/rules/#{id}"
|
33
|
+
headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
34
|
+
execute(method: :put, url: url, headers: headers, payload: payload.to_json)
|
35
|
+
end
|
36
|
+
|
31
37
|
def delete(security_group_id, id)
|
32
38
|
url = "#{@base_url}/api/security-groups/#{security_group_id}/rules/#{id}"
|
33
39
|
headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
@@ -8,35 +8,28 @@ class Morpheus::SecurityGroupsInterface < Morpheus::APIClient
|
|
8
8
|
@expires_at = expires_at
|
9
9
|
end
|
10
10
|
|
11
|
-
def list(
|
11
|
+
def list(params={})
|
12
12
|
url = "#{@base_url}/api/security-groups"
|
13
|
-
headers = { params:
|
14
|
-
if options.is_a?(Hash)
|
15
|
-
headers[:params].merge!(options)
|
16
|
-
end
|
13
|
+
headers = { params: params, authorization: "Bearer #{@access_token}" }
|
17
14
|
execute(method: :get, url: url, headers: headers)
|
18
15
|
end
|
19
16
|
|
20
|
-
def get(
|
21
|
-
url = "#{@base_url}/api/security-groups/#{
|
22
|
-
headers = { params:
|
23
|
-
if options.is_a?(Hash)
|
24
|
-
headers[:params].merge!(options)
|
25
|
-
end
|
17
|
+
def get(id, params={})
|
18
|
+
url = "#{@base_url}/api/security-groups/#{id}"
|
19
|
+
headers = { params: params, authorization: "Bearer #{@access_token}" }
|
26
20
|
execute(method: :get, url: url, headers: headers)
|
27
21
|
end
|
28
22
|
|
29
|
-
def create(
|
23
|
+
def create(payload)
|
30
24
|
url = "#{@base_url}/api/security-groups"
|
31
25
|
headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
32
|
-
payload = options
|
33
26
|
execute(method: :post, url: url, headers: headers, payload: payload.to_json)
|
34
27
|
end
|
35
28
|
|
36
|
-
def update(id)
|
29
|
+
def update(id, payload)
|
37
30
|
url = "#{@base_url}/api/security-groups/#{id}"
|
38
31
|
headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
39
|
-
execute(method: :put, url: url, headers: headers)
|
32
|
+
execute(method: :put, url: url, headers: headers, payload: payload.to_json)
|
40
33
|
end
|
41
34
|
|
42
35
|
def delete(id)
|
@@ -44,4 +37,17 @@ class Morpheus::SecurityGroupsInterface < Morpheus::APIClient
|
|
44
37
|
headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
45
38
|
execute(method: :delete, url: url, headers: headers)
|
46
39
|
end
|
40
|
+
|
41
|
+
def create_location(id, payload)
|
42
|
+
url = "#{@base_url}/api/security-groups/#{id}/locations"
|
43
|
+
headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
44
|
+
execute(method: :post, url: url, headers: headers, payload: payload.to_json)
|
45
|
+
end
|
46
|
+
|
47
|
+
def delete_location(id, location_id, params={})
|
48
|
+
url = "#{@base_url}/api/security-groups/#{id}/locations/#{location_id}"
|
49
|
+
headers = { :params => params, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
50
|
+
execute(method: :delete, url: url, headers: headers)
|
51
|
+
end
|
52
|
+
|
47
53
|
end
|
data/lib/morpheus/cli.rb
CHANGED
@@ -82,6 +82,8 @@ module Morpheus
|
|
82
82
|
load 'morpheus/cli/groups.rb'
|
83
83
|
load 'morpheus/cli/clouds.rb'
|
84
84
|
load 'morpheus/cli/cloud_datastores_command.rb'
|
85
|
+
load 'morpheus/cli/cloud_resource_pools_command.rb'
|
86
|
+
load 'morpheus/cli/cloud_folders_command.rb'
|
85
87
|
load 'morpheus/cli/hosts.rb'
|
86
88
|
load 'morpheus/cli/load_balancers.rb'
|
87
89
|
load 'morpheus/cli/shell.rb'
|
@@ -140,6 +142,7 @@ module Morpheus
|
|
140
142
|
load 'morpheus/cli/file_copy_request_command.rb'
|
141
143
|
load 'morpheus/cli/processes_command.rb'
|
142
144
|
load 'morpheus/cli/packages_command.rb'
|
145
|
+
load 'morpheus/cli/reports_command.rb'
|
143
146
|
|
144
147
|
# Your new commands go here...
|
145
148
|
|
data/lib/morpheus/cli/apps.rb
CHANGED
@@ -766,7 +766,7 @@ class Morpheus::Cli::Apps
|
|
766
766
|
params['group'] = {'id' => group['id'], 'name' => group['name']}
|
767
767
|
end
|
768
768
|
if params.empty?
|
769
|
-
print_red_alert "Specify
|
769
|
+
print_red_alert "Specify at least one option to update"
|
770
770
|
puts optparse
|
771
771
|
return 1
|
772
772
|
end
|
@@ -986,7 +986,7 @@ class Morpheus::Cli::Apps
|
|
986
986
|
options = {}
|
987
987
|
optparse = Morpheus::Cli::OptionParser.new do |opts|
|
988
988
|
opts.banner = subcommand_usage("[app]")
|
989
|
-
build_common_options(opts, options, [:list, :json, :dry_run])
|
989
|
+
build_common_options(opts, options, [:list, :json, :dry_run, :remote])
|
990
990
|
opts.footer = "List logs for an app.\n" +
|
991
991
|
"[app] is required. This is the name or id of an app."
|
992
992
|
end
|
@@ -62,7 +62,7 @@ class Morpheus::Cli::ArchivesCommand
|
|
62
62
|
options = {}
|
63
63
|
optparse = Morpheus::Cli::OptionParser.new do |opts|
|
64
64
|
opts.banner = subcommand_usage()
|
65
|
-
build_common_options(opts, options, [:list, :json, :dry_run])
|
65
|
+
build_common_options(opts, options, [:list, :json, :dry_run, :remote])
|
66
66
|
opts.footer = "List archive buckets."
|
67
67
|
end
|
68
68
|
optparse.parse!(args)
|
@@ -151,7 +151,7 @@ class Morpheus::Cli::ArchivesCommand
|
|
151
151
|
options = {}
|
152
152
|
optparse = Morpheus::Cli::OptionParser.new do |opts|
|
153
153
|
opts.banner = subcommand_usage("[bucket:/path]")
|
154
|
-
build_common_options(opts, options, [:json, :dry_run])
|
154
|
+
build_common_options(opts, options, [:json, :dry_run, :remote])
|
155
155
|
opts.footer = "Display archive bucket details and files. " +
|
156
156
|
"\nThe [bucket] component of the argument is the name or id of an archive bucket." +
|
157
157
|
"\nThe [:/path] component is optional and can be used to display files under a sub-directory."
|
@@ -264,7 +264,7 @@ class Morpheus::Cli::ArchivesCommand
|
|
264
264
|
opts.on('--isPublic [on|off]', String, "Enabling Public URL allows files to be downloaded without any authentication.") do |val|
|
265
265
|
options['isPublic'] = (val.to_s == 'on' || val.to_s == 'true')
|
266
266
|
end
|
267
|
-
build_common_options(opts, options, [:options, :payload, :json, :dry_run, :quiet])
|
267
|
+
build_common_options(opts, options, [:options, :payload, :json, :dry_run, :quiet, :remote])
|
268
268
|
opts.footer = "Create a new archive bucket."
|
269
269
|
end
|
270
270
|
optparse.parse!(args)
|
@@ -342,7 +342,7 @@ class Morpheus::Cli::ArchivesCommand
|
|
342
342
|
opts.on('--isPublic [on|off]', String, "Enabling Public URL allows files to be downloaded without any authentication.") do |val|
|
343
343
|
options['isPublic'] = (val.to_s == 'on' || val.to_s == 'true')
|
344
344
|
end
|
345
|
-
build_common_options(opts, options, [:options, :payload, :json, :dry_run, :quiet])
|
345
|
+
build_common_options(opts, options, [:options, :payload, :json, :dry_run, :quiet, :remote])
|
346
346
|
opts.footer = "Update an existing archive bucket."
|
347
347
|
end
|
348
348
|
optparse.parse!(args)
|
@@ -394,7 +394,7 @@ class Morpheus::Cli::ArchivesCommand
|
|
394
394
|
query_params = {}
|
395
395
|
optparse = Morpheus::Cli::OptionParser.new do |opts|
|
396
396
|
opts.banner = subcommand_usage("[bucket]")
|
397
|
-
build_common_options(opts, options, [:auto_confirm, :json, :dry_run])
|
397
|
+
build_common_options(opts, options, [:auto_confirm, :json, :dry_run, :remote])
|
398
398
|
end
|
399
399
|
optparse.parse!(args)
|
400
400
|
|
@@ -460,7 +460,7 @@ class Morpheus::Cli::ArchivesCommand
|
|
460
460
|
"\nThe [:/path] component is optional and can be used to specify the destination of the uploaded file or folder." +
|
461
461
|
"\nThe default destination is the same name as the [local-file], under the root bucket directory '/'. " +
|
462
462
|
"\nThis will overwrite any existing remote files that match the destination /path."
|
463
|
-
build_common_options(opts, options, [:auto_confirm, :json, :dry_run])
|
463
|
+
build_common_options(opts, options, [:auto_confirm, :json, :dry_run, :remote])
|
464
464
|
end
|
465
465
|
optparse.parse!(args)
|
466
466
|
|
@@ -664,7 +664,7 @@ class Morpheus::Cli::ArchivesCommand
|
|
664
664
|
opts.on('-a', '--all', "Show all files, including subdirectories under the /path.") do
|
665
665
|
params[:fullTree] = true
|
666
666
|
end
|
667
|
-
build_common_options(opts, options, [:list, :json, :dry_run])
|
667
|
+
build_common_options(opts, options, [:list, :json, :dry_run, :remote])
|
668
668
|
opts.footer = "List files in an archive bucket. \nInclude [/path] to show files under a directory."
|
669
669
|
end
|
670
670
|
optparse.parse!(args)
|
@@ -749,7 +749,7 @@ class Morpheus::Cli::ArchivesCommand
|
|
749
749
|
opts.on('-1', '--oneline', "One file per line. The default delimiter is a single space.") do
|
750
750
|
do_one_file_per_line = true
|
751
751
|
end
|
752
|
-
build_common_options(opts, options, [:list, :json, :dry_run])
|
752
|
+
build_common_options(opts, options, [:list, :json, :dry_run, :remote])
|
753
753
|
opts.footer = "Print filenames for a given archive location.\nPass archive location in the format bucket/path."
|
754
754
|
end
|
755
755
|
optparse.parse!(args)
|
@@ -904,7 +904,7 @@ class Morpheus::Cli::ArchivesCommand
|
|
904
904
|
opts.on('-H', '--all-history', "Display all history instead of only 10." ) do
|
905
905
|
max_history = 10000
|
906
906
|
end
|
907
|
-
build_common_options(opts, options, [:json, :dry_run])
|
907
|
+
build_common_options(opts, options, [:json, :dry_run, :remote])
|
908
908
|
opts.footer = "Get details about an archive file.\n" +
|
909
909
|
"[bucket:/path] is required. This is the name of the bucket and /path the file or folder to be fetched." + "\n" +
|
910
910
|
"[id] can be passed instead of [bucket:/path]. This is the numeric File ID."
|
@@ -1038,7 +1038,7 @@ class Morpheus::Cli::ArchivesCommand
|
|
1038
1038
|
opts.on( '-R', '--recursive', "Delete a directory and all of its files. This must be passed if specifying a directory." ) do
|
1039
1039
|
do_recursive = true
|
1040
1040
|
end
|
1041
|
-
build_common_options(opts, options, [:auto_confirm, :json, :dry_run])
|
1041
|
+
build_common_options(opts, options, [:auto_confirm, :json, :dry_run, :remote])
|
1042
1042
|
opts.footer = "Delete an archive file or directory."
|
1043
1043
|
end
|
1044
1044
|
optparse.parse!(args)
|
@@ -1093,7 +1093,7 @@ class Morpheus::Cli::ArchivesCommand
|
|
1093
1093
|
options = {}
|
1094
1094
|
optparse = Morpheus::Cli::OptionParser.new do |opts|
|
1095
1095
|
opts.banner = subcommand_usage("[bucket:/path]")
|
1096
|
-
build_common_options(opts, options, [:list, :json, :dry_run])
|
1096
|
+
build_common_options(opts, options, [:list, :json, :dry_run, :remote])
|
1097
1097
|
opts.footer = "List history log events for an archive file."
|
1098
1098
|
end
|
1099
1099
|
optparse.parse!(args)
|
@@ -1156,7 +1156,7 @@ class Morpheus::Cli::ArchivesCommand
|
|
1156
1156
|
options = {}
|
1157
1157
|
optparse = Morpheus::Cli::OptionParser.new do |opts|
|
1158
1158
|
opts.banner = subcommand_usage("[bucket:/path]")
|
1159
|
-
build_common_options(opts, options, [:list, :json, :dry_run])
|
1159
|
+
build_common_options(opts, options, [:list, :json, :dry_run, :remote])
|
1160
1160
|
opts.footer = "List links for an archive file."
|
1161
1161
|
end
|
1162
1162
|
optparse.parse!(args)
|
@@ -1236,7 +1236,7 @@ class Morpheus::Cli::ArchivesCommand
|
|
1236
1236
|
use_public_url = true
|
1237
1237
|
# do_mkdir = true
|
1238
1238
|
end
|
1239
|
-
build_common_options(opts, options, [:dry_run, :quiet])
|
1239
|
+
build_common_options(opts, options, [:dry_run, :quiet, :remote])
|
1240
1240
|
opts.footer = "Download an archive file or directory.\n" +
|
1241
1241
|
"[bucket:/path] is required. This is the name of the bucket and /path the file or folder to be downloaded.\n" +
|
1242
1242
|
"[local-file] is required. This is the full local filepath for the downloaded file.\n" +
|
@@ -1360,7 +1360,7 @@ class Morpheus::Cli::ArchivesCommand
|
|
1360
1360
|
do_overwrite = false
|
1361
1361
|
optparse = Morpheus::Cli::OptionParser.new do |opts|
|
1362
1362
|
opts.banner = subcommand_usage("[bucket:/path]")
|
1363
|
-
build_common_options(opts, options, [:auto_confirm, :dry_run])
|
1363
|
+
build_common_options(opts, options, [:auto_confirm, :dry_run, :remote])
|
1364
1364
|
opts.footer = "Print the contents of an archive file.\n" +
|
1365
1365
|
"[bucket:/path] is required. This is the name of the bucket and /path the file or folder to be downloaded.\n" +
|
1366
1366
|
"Confirmation is needed if the specified file is more than 1KB.\n" +
|
@@ -1407,7 +1407,7 @@ class Morpheus::Cli::ArchivesCommand
|
|
1407
1407
|
opts.on('-e', '--expire SECONDS', "The time to live for this link. The default is 1200 (20 minutes). A value less than 1 means never expire.") do |val|
|
1408
1408
|
expiration_seconds = val.to_i
|
1409
1409
|
end
|
1410
|
-
build_common_options(opts, options, [:json, :dry_run, :quiet])
|
1410
|
+
build_common_options(opts, options, [:json, :dry_run, :quiet, :remote])
|
1411
1411
|
opts.footer = "Create a public link to a file.\n" +
|
1412
1412
|
"[bucket:/path] is required. This is the name of the bucket and /path the file or folder to be fetched."
|
1413
1413
|
end
|
@@ -1452,7 +1452,7 @@ class Morpheus::Cli::ArchivesCommand
|
|
1452
1452
|
options = {}
|
1453
1453
|
optparse = Morpheus::Cli::OptionParser.new do |opts|
|
1454
1454
|
opts.banner = subcommand_usage("[bucket:/path] [token]")
|
1455
|
-
build_common_options(opts, options, [:auto_confirm, :dry_run, :quiet])
|
1455
|
+
build_common_options(opts, options, [:auto_confirm, :dry_run, :quiet, :remote])
|
1456
1456
|
opts.footer = "Delete a public link to a file.\n" +
|
1457
1457
|
"[bucket:/path] is required. This is the name of the bucket and /path the file or folder to be fetched." +
|
1458
1458
|
"[token] is required. This is the secret access key that identifies the link."
|
@@ -1517,7 +1517,7 @@ class Morpheus::Cli::ArchivesCommand
|
|
1517
1517
|
opts.on( '-p', '--mkdir', "Create missing directories for [local-file] if they do not exist." ) do
|
1518
1518
|
do_mkdir = true
|
1519
1519
|
end
|
1520
|
-
build_common_options(opts, options, [:dry_run, :quiet])
|
1520
|
+
build_common_options(opts, options, [:dry_run, :quiet, :remote])
|
1521
1521
|
opts.footer = "Download an archive file link.\n" +
|
1522
1522
|
"[link-key] is required. This is the secret access key for the archive file link.\n" +
|
1523
1523
|
"[local-file] is required. This is the full local filepath for the downloaded file."
|
@@ -1634,7 +1634,7 @@ class Morpheus::Cli::ArchivesCommand
|
|
1634
1634
|
# use_public_url = true
|
1635
1635
|
# # do_mkdir = true
|
1636
1636
|
# end
|
1637
|
-
build_common_options(opts, options, [:dry_run, :quiet])
|
1637
|
+
build_common_options(opts, options, [:dry_run, :quiet, :remote])
|
1638
1638
|
opts.footer = "Download an entire archive bucket as a .zip file.\n" +
|
1639
1639
|
"[bucket] is required. This is the name of the bucket.\n" +
|
1640
1640
|
"[local-file] is required. This is the full local filepath for the downloaded file.\n" +
|