aspera-cli 4.17.0 → 4.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +2 -4
- data/CHANGELOG.md +23 -0
- data/CONTRIBUTING.md +15 -1
- data/README.md +620 -378
- data/bin/ascli +5 -0
- data/bin/asession +2 -2
- data/lib/aspera/agent/alpha.rb +6 -4
- data/lib/aspera/agent/base.rb +9 -6
- data/lib/aspera/agent/connect.rb +4 -4
- data/lib/aspera/agent/direct.rb +56 -37
- data/lib/aspera/agent/httpgw.rb +23 -324
- data/lib/aspera/agent/node.rb +19 -20
- data/lib/aspera/agent/trsdk.rb +19 -20
- data/lib/aspera/api/aoc.rb +17 -14
- data/lib/aspera/api/cos_node.rb +4 -4
- data/lib/aspera/api/httpgw.rb +339 -0
- data/lib/aspera/api/node.rb +34 -21
- data/lib/aspera/ascmd.rb +4 -3
- data/lib/aspera/ascp/installation.rb +15 -7
- data/lib/aspera/ascp/management.rb +2 -2
- data/lib/aspera/cli/basic_auth_plugin.rb +5 -9
- data/lib/aspera/cli/extended_value.rb +12 -6
- data/lib/aspera/cli/formatter.rb +155 -65
- data/lib/aspera/cli/hints.rb +18 -0
- data/lib/aspera/cli/main.rb +22 -29
- data/lib/aspera/cli/manager.rb +53 -36
- data/lib/aspera/cli/plugin.rb +26 -17
- data/lib/aspera/cli/plugin_factory.rb +31 -20
- data/lib/aspera/cli/plugins/alee.rb +14 -2
- data/lib/aspera/cli/plugins/aoc.rb +141 -131
- data/lib/aspera/cli/plugins/ats.rb +1 -1
- data/lib/aspera/cli/plugins/config.rb +52 -46
- data/lib/aspera/cli/plugins/console.rb +8 -5
- data/lib/aspera/cli/plugins/faspex.rb +27 -19
- data/lib/aspera/cli/plugins/faspex5.rb +222 -149
- data/lib/aspera/cli/plugins/faspio.rb +85 -0
- data/lib/aspera/cli/plugins/httpgw.rb +55 -0
- data/lib/aspera/cli/plugins/node.rb +86 -29
- data/lib/aspera/cli/plugins/orchestrator.rb +31 -29
- data/lib/aspera/cli/plugins/preview.rb +6 -2
- data/lib/aspera/cli/plugins/server.rb +5 -5
- data/lib/aspera/cli/plugins/shares.rb +16 -14
- data/lib/aspera/cli/sync_actions.rb +6 -6
- data/lib/aspera/cli/transfer_agent.rb +5 -4
- data/lib/aspera/cli/version.rb +1 -1
- data/lib/aspera/environment.rb +7 -6
- data/lib/aspera/faspex_gw.rb +5 -4
- data/lib/aspera/faspex_postproc.rb +2 -2
- data/lib/aspera/log.rb +6 -3
- data/lib/aspera/node_simulator.rb +2 -2
- data/lib/aspera/oauth/base.rb +31 -19
- data/lib/aspera/oauth/factory.rb +12 -13
- data/lib/aspera/oauth/generic.rb +1 -0
- data/lib/aspera/oauth/jwt.rb +18 -15
- data/lib/aspera/oauth/url_json.rb +8 -6
- data/lib/aspera/open_application.rb +5 -7
- data/lib/aspera/persistency_folder.rb +2 -2
- data/lib/aspera/preview/generator.rb +3 -3
- data/lib/aspera/preview/options.rb +3 -3
- data/lib/aspera/preview/terminal.rb +4 -4
- data/lib/aspera/preview/utils.rb +3 -3
- data/lib/aspera/proxy_auto_config.rb +5 -1
- data/lib/aspera/rest.rb +60 -74
- data/lib/aspera/rest_call_error.rb +1 -1
- data/lib/aspera/rest_error_analyzer.rb +2 -2
- data/lib/aspera/rest_errors_aspera.rb +1 -1
- data/lib/aspera/resumer.rb +1 -1
- data/lib/aspera/secret_hider.rb +2 -4
- data/lib/aspera/ssh.rb +1 -1
- data/lib/aspera/transfer/parameters.rb +39 -36
- data/lib/aspera/transfer/spec.rb +2 -0
- data/lib/aspera/transfer/sync.rb +2 -1
- data/lib/aspera/transfer/uri.rb +1 -1
- data/lib/aspera/uri_reader.rb +5 -4
- data/lib/aspera/web_auth.rb +1 -1
- data/lib/aspera/web_server_simple.rb +4 -3
- data.tar.gz.sig +0 -0
- metadata +5 -3
- metadata.gz.sig +0 -0
- data/lib/aspera/cli/plugins/bss.rb +0 -71
@@ -1,71 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'aspera/rest'
|
4
|
-
|
5
|
-
module Aspera
|
6
|
-
module Cli
|
7
|
-
module Plugins
|
8
|
-
class Bss < Cli::BasicAuthPlugin
|
9
|
-
ACTIONS = %i[subscription].freeze
|
10
|
-
|
11
|
-
FIELDS = {
|
12
|
-
'bssSubscriptions' => %w[id name termVolumeGb termMonths trial startDate endDate plan renewalType chargeAgreementNumber customerName]
|
13
|
-
}.freeze
|
14
|
-
|
15
|
-
def initialize(**env)
|
16
|
-
super
|
17
|
-
end
|
18
|
-
|
19
|
-
def all_fields(name)
|
20
|
-
return FIELDS[name].join(' ')
|
21
|
-
end
|
22
|
-
|
23
|
-
def execute_action
|
24
|
-
if @api_bss.nil?
|
25
|
-
key = options.get_option(:password, mandatory: true)
|
26
|
-
@api_bss = Rest.new(
|
27
|
-
base_url: 'https://dashboard.bss.asperasoft.com/platform',
|
28
|
-
headers: {cookie: "_dashboard_key=#{key}"})
|
29
|
-
end
|
30
|
-
command = options.get_next_command(ACTIONS)
|
31
|
-
case command
|
32
|
-
when :subscription
|
33
|
-
command = options.get_next_command(%i[find show instances])
|
34
|
-
object = 'bssSubscriptions'
|
35
|
-
case command
|
36
|
-
when :find
|
37
|
-
query = options.get_option(:query, mandatory: true) # AOC_ORGANIZATION_QUERY AOC_USER_EMAIL
|
38
|
-
value = value_create_modify(command: command)
|
39
|
-
request = {
|
40
|
-
'variables' => {'filter' => {'key' => query, 'value' => value}},
|
41
|
-
'query' => "query($filter: BssSubscriptionFilter!) {#{object}(filter: $filter) { #{all_fields('bssSubscriptions')} } }"
|
42
|
-
}
|
43
|
-
result = @api_bss.create('graphql', request)[:data]
|
44
|
-
# give fields to keep order
|
45
|
-
return {type: :object_list, data: result['data'][object], fields: FIELDS['bssSubscriptions']}
|
46
|
-
when :show
|
47
|
-
id = instance_identifier
|
48
|
-
request = {
|
49
|
-
'variables' => {'id' => id},
|
50
|
-
'query' => "query($id: ID!) {#{object}(id: $id) { #{all_fields('bssSubscriptions')} roleAssignments(uniqueSubjectId: true) { id subjectId } " \
|
51
|
-
'instances { id state planId serviceId ssmSubscriptionId entitlement { id } aocOrganization { id subdomainName name status tier urlId trialExpiresAt ' \
|
52
|
-
'users(organizationAdmin: true) { id name email atsAdmin subscriptionAdmin } } } } }'
|
53
|
-
}
|
54
|
-
result = @api_bss.create('graphql', request)[:data]['data'][object].first
|
55
|
-
result.delete('instances')
|
56
|
-
return {type: :single_object, data: result}
|
57
|
-
when :instances
|
58
|
-
id = instance_identifier
|
59
|
-
request = {
|
60
|
-
'variables' => {'id' => id},
|
61
|
-
'query' => "query($id: ID!) {#{object}(id: $id) { aocOrganization { id subdomainName name status tier urlId trialExpiresAt } } } }"
|
62
|
-
}
|
63
|
-
result = @api_bss.create('graphql', request)[:data]['data'][object].first
|
64
|
-
return {type: :object_list, data: result['instances']}
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end # Bss
|
69
|
-
end # Plugins
|
70
|
-
end # Cli
|
71
|
-
end # Aspera
|