aspera-cli 4.19.0 → 4.21.1
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +46 -0
- data/CONTRIBUTING.md +18 -4
- data/README.md +886 -510
- data/bin/asession +27 -20
- data/examples/build_exec +65 -76
- data/examples/build_exec_rubyc +40 -0
- data/examples/get_proto_file.rb +7 -0
- data/lib/aspera/agent/alpha.rb +18 -24
- data/lib/aspera/agent/base.rb +2 -18
- data/lib/aspera/agent/connect.rb +34 -15
- data/lib/aspera/agent/direct.rb +44 -54
- data/lib/aspera/agent/httpgw.rb +2 -3
- data/lib/aspera/agent/node.rb +11 -21
- data/lib/aspera/agent/{trsdk.rb → transferd.rb} +27 -51
- data/lib/aspera/api/alee.rb +15 -0
- data/lib/aspera/api/aoc.rb +139 -105
- data/lib/aspera/api/ats.rb +1 -1
- data/lib/aspera/api/cos_node.rb +1 -1
- data/lib/aspera/api/httpgw.rb +15 -10
- data/lib/aspera/api/node.rb +70 -32
- data/lib/aspera/ascmd.rb +56 -48
- data/lib/aspera/ascp/installation.rb +166 -70
- data/lib/aspera/ascp/management.rb +30 -8
- data/lib/aspera/assert.rb +10 -5
- data/lib/aspera/cli/formatter.rb +166 -162
- data/lib/aspera/cli/hints.rb +2 -1
- data/lib/aspera/cli/info.rb +12 -10
- data/lib/aspera/cli/main.rb +28 -13
- data/lib/aspera/cli/manager.rb +7 -2
- data/lib/aspera/cli/plugin.rb +17 -31
- data/lib/aspera/cli/plugins/alee.rb +3 -3
- data/lib/aspera/cli/plugins/aoc.rb +246 -208
- data/lib/aspera/cli/plugins/ats.rb +16 -14
- data/lib/aspera/cli/plugins/config.rb +154 -94
- data/lib/aspera/cli/plugins/console.rb +3 -3
- data/lib/aspera/cli/plugins/cos.rb +1 -0
- data/lib/aspera/cli/plugins/faspex.rb +15 -23
- data/lib/aspera/cli/plugins/faspex5.rb +64 -50
- data/lib/aspera/cli/plugins/faspio.rb +2 -2
- data/lib/aspera/cli/plugins/httpgw.rb +1 -1
- data/lib/aspera/cli/plugins/node.rb +174 -109
- data/lib/aspera/cli/plugins/orchestrator.rb +14 -13
- data/lib/aspera/cli/plugins/preview.rb +8 -9
- data/lib/aspera/cli/plugins/server.rb +5 -9
- data/lib/aspera/cli/plugins/shares.rb +2 -2
- data/lib/aspera/cli/sync_actions.rb +2 -2
- data/lib/aspera/cli/transfer_agent.rb +12 -14
- data/lib/aspera/cli/transfer_progress.rb +37 -17
- data/lib/aspera/cli/version.rb +1 -1
- data/lib/aspera/command_line_builder.rb +4 -5
- data/lib/aspera/coverage.rb +13 -1
- data/lib/aspera/environment.rb +75 -25
- data/lib/aspera/faspex_gw.rb +2 -2
- data/lib/aspera/json_rpc.rb +1 -1
- data/lib/aspera/keychain/macos_security.rb +7 -12
- data/lib/aspera/log.rb +3 -4
- data/lib/aspera/node_simulator.rb +230 -112
- data/lib/aspera/oauth/base.rb +64 -83
- data/lib/aspera/oauth/factory.rb +52 -6
- data/lib/aspera/oauth/generic.rb +4 -8
- data/lib/aspera/oauth/jwt.rb +6 -3
- data/lib/aspera/oauth/url_json.rb +1 -2
- data/lib/aspera/oauth/web.rb +5 -2
- data/lib/aspera/persistency_action_once.rb +16 -8
- data/lib/aspera/persistency_folder.rb +20 -2
- data/lib/aspera/preview/generator.rb +1 -1
- data/lib/aspera/preview/utils.rb +11 -17
- data/lib/aspera/products/alpha.rb +30 -0
- data/lib/aspera/products/connect.rb +48 -0
- data/lib/aspera/products/other.rb +82 -0
- data/lib/aspera/products/transferd.rb +54 -0
- data/lib/aspera/rest.rb +116 -87
- data/lib/aspera/secret_hider.rb +2 -2
- data/lib/aspera/ssh.rb +31 -24
- data/lib/aspera/transfer/faux_file.rb +4 -4
- data/lib/aspera/transfer/parameters.rb +16 -17
- data/lib/aspera/transfer/spec.rb +12 -12
- data/lib/aspera/transfer/spec.yaml +22 -20
- data/lib/aspera/transfer/sync.rb +2 -10
- data/lib/aspera/transfer/uri.rb +3 -3
- data/lib/aspera/uri_reader.rb +1 -1
- data/lib/aspera/web_auth.rb +166 -17
- data/lib/aspera/web_server_simple.rb +4 -3
- data/lib/transferd_pb.rb +86 -0
- data/lib/transferd_services_pb.rb +84 -0
- data.tar.gz.sig +0 -0
- metadata +58 -22
- metadata.gz.sig +0 -0
- data/lib/aspera/ascp/products.rb +0 -156
metadata
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aspera-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.21.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Laurent Martin
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain:
|
11
11
|
- |
|
@@ -37,7 +37,7 @@ cert_chain:
|
|
37
37
|
eTf9kxhVM40wGQOECVNA8UsEEZHD48eF+csUYZtAJOF5oxTI8UyV9T/o6CgO0c9/
|
38
38
|
Gzz+Qm5ULOUcPiJLjSpaiTrkiIVYiDGnqNSr6R1Hb1c=
|
39
39
|
-----END CERTIFICATE-----
|
40
|
-
date:
|
40
|
+
date: 2025-03-14 00:00:00.000000000 Z
|
41
41
|
dependencies:
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: blankslate
|
@@ -115,70 +115,70 @@ dependencies:
|
|
115
115
|
requirements:
|
116
116
|
- - "~>"
|
117
117
|
- !ruby/object:Gem::Version
|
118
|
-
version: '7.
|
118
|
+
version: '7.3'
|
119
119
|
type: :runtime
|
120
120
|
prerelease: false
|
121
121
|
version_requirements: !ruby/object:Gem::Requirement
|
122
122
|
requirements:
|
123
123
|
- - "~>"
|
124
124
|
- !ruby/object:Gem::Version
|
125
|
-
version: '7.
|
125
|
+
version: '7.3'
|
126
126
|
- !ruby/object:Gem::Dependency
|
127
|
-
name:
|
127
|
+
name: openssl
|
128
128
|
requirement: !ruby/object:Gem::Requirement
|
129
129
|
requirements:
|
130
130
|
- - "~>"
|
131
131
|
- !ruby/object:Gem::Version
|
132
|
-
version:
|
132
|
+
version: 3.3.0
|
133
133
|
type: :runtime
|
134
134
|
prerelease: false
|
135
135
|
version_requirements: !ruby/object:Gem::Requirement
|
136
136
|
requirements:
|
137
137
|
- - "~>"
|
138
138
|
- !ruby/object:Gem::Version
|
139
|
-
version:
|
139
|
+
version: 3.3.0
|
140
140
|
- !ruby/object:Gem::Dependency
|
141
|
-
name:
|
141
|
+
name: rainbow
|
142
142
|
requirement: !ruby/object:Gem::Requirement
|
143
143
|
requirements:
|
144
144
|
- - "~>"
|
145
145
|
- !ruby/object:Gem::Version
|
146
|
-
version: '
|
146
|
+
version: '3.0'
|
147
147
|
type: :runtime
|
148
148
|
prerelease: false
|
149
149
|
version_requirements: !ruby/object:Gem::Requirement
|
150
150
|
requirements:
|
151
151
|
- - "~>"
|
152
152
|
- !ruby/object:Gem::Version
|
153
|
-
version: '
|
153
|
+
version: '3.0'
|
154
154
|
- !ruby/object:Gem::Dependency
|
155
|
-
name:
|
155
|
+
name: ruby-progressbar
|
156
156
|
requirement: !ruby/object:Gem::Requirement
|
157
157
|
requirements:
|
158
158
|
- - "~>"
|
159
159
|
- !ruby/object:Gem::Version
|
160
|
-
version: '
|
160
|
+
version: '1.0'
|
161
161
|
type: :runtime
|
162
162
|
prerelease: false
|
163
163
|
version_requirements: !ruby/object:Gem::Requirement
|
164
164
|
requirements:
|
165
165
|
- - "~>"
|
166
166
|
- !ruby/object:Gem::Version
|
167
|
-
version: '
|
167
|
+
version: '1.0'
|
168
168
|
- !ruby/object:Gem::Dependency
|
169
|
-
name:
|
169
|
+
name: rubyzip
|
170
170
|
requirement: !ruby/object:Gem::Requirement
|
171
171
|
requirements:
|
172
172
|
- - "~>"
|
173
173
|
- !ruby/object:Gem::Version
|
174
|
-
version: '
|
174
|
+
version: '2.0'
|
175
175
|
type: :runtime
|
176
176
|
prerelease: false
|
177
177
|
version_requirements: !ruby/object:Gem::Requirement
|
178
178
|
requirements:
|
179
179
|
- - "~>"
|
180
180
|
- !ruby/object:Gem::Version
|
181
|
-
version: '
|
181
|
+
version: '2.0'
|
182
182
|
- !ruby/object:Gem::Dependency
|
183
183
|
name: terminal-table
|
184
184
|
requirement: !ruby/object:Gem::Requirement
|
@@ -249,6 +249,20 @@ dependencies:
|
|
249
249
|
- - "~>"
|
250
250
|
- !ruby/object:Gem::Version
|
251
251
|
version: '1.0'
|
252
|
+
- !ruby/object:Gem::Dependency
|
253
|
+
name: grpc-tools
|
254
|
+
requirement: !ruby/object:Gem::Requirement
|
255
|
+
requirements:
|
256
|
+
- - "~>"
|
257
|
+
- !ruby/object:Gem::Version
|
258
|
+
version: 1.67.0
|
259
|
+
type: :development
|
260
|
+
prerelease: false
|
261
|
+
version_requirements: !ruby/object:Gem::Requirement
|
262
|
+
requirements:
|
263
|
+
- - "~>"
|
264
|
+
- !ruby/object:Gem::Version
|
265
|
+
version: 1.67.0
|
252
266
|
- !ruby/object:Gem::Dependency
|
253
267
|
name: rake
|
254
268
|
requirement: !ruby/object:Gem::Requirement
|
@@ -347,6 +361,20 @@ dependencies:
|
|
347
361
|
- - "~>"
|
348
362
|
- !ruby/object:Gem::Version
|
349
363
|
version: '2.0'
|
364
|
+
- !ruby/object:Gem::Dependency
|
365
|
+
name: ruby-lsp
|
366
|
+
requirement: !ruby/object:Gem::Requirement
|
367
|
+
requirements:
|
368
|
+
- - "~>"
|
369
|
+
- !ruby/object:Gem::Version
|
370
|
+
version: '0.23'
|
371
|
+
type: :development
|
372
|
+
prerelease: false
|
373
|
+
version_requirements: !ruby/object:Gem::Requirement
|
374
|
+
requirements:
|
375
|
+
- - "~>"
|
376
|
+
- !ruby/object:Gem::Version
|
377
|
+
version: '0.23'
|
350
378
|
- !ruby/object:Gem::Dependency
|
351
379
|
name: simplecov
|
352
380
|
requirement: !ruby/object:Gem::Requirement
|
@@ -391,8 +419,10 @@ files:
|
|
391
419
|
- bin/ascli
|
392
420
|
- bin/asession
|
393
421
|
- examples/build_exec
|
422
|
+
- examples/build_exec_rubyc
|
394
423
|
- examples/build_package.sh
|
395
424
|
- examples/dascli
|
425
|
+
- examples/get_proto_file.rb
|
396
426
|
- examples/proxy.pac
|
397
427
|
- lib/aspera/agent/alpha.rb
|
398
428
|
- lib/aspera/agent/base.rb
|
@@ -400,7 +430,8 @@ files:
|
|
400
430
|
- lib/aspera/agent/direct.rb
|
401
431
|
- lib/aspera/agent/httpgw.rb
|
402
432
|
- lib/aspera/agent/node.rb
|
403
|
-
- lib/aspera/agent/
|
433
|
+
- lib/aspera/agent/transferd.rb
|
434
|
+
- lib/aspera/api/alee.rb
|
404
435
|
- lib/aspera/api/aoc.rb
|
405
436
|
- lib/aspera/api/ats.rb
|
406
437
|
- lib/aspera/api/cos_node.rb
|
@@ -409,7 +440,6 @@ files:
|
|
409
440
|
- lib/aspera/ascmd.rb
|
410
441
|
- lib/aspera/ascp/installation.rb
|
411
442
|
- lib/aspera/ascp/management.rb
|
412
|
-
- lib/aspera/ascp/products.rb
|
413
443
|
- lib/aspera/assert.rb
|
414
444
|
- lib/aspera/cli/basic_auth_plugin.rb
|
415
445
|
- lib/aspera/cli/error.rb
|
@@ -479,6 +509,10 @@ files:
|
|
479
509
|
- lib/aspera/preview/terminal.rb
|
480
510
|
- lib/aspera/preview/utils.rb
|
481
511
|
- lib/aspera/preview/video_error.png
|
512
|
+
- lib/aspera/products/alpha.rb
|
513
|
+
- lib/aspera/products/connect.rb
|
514
|
+
- lib/aspera/products/other.rb
|
515
|
+
- lib/aspera/products/transferd.rb
|
482
516
|
- lib/aspera/proxy_auto_config.js
|
483
517
|
- lib/aspera/proxy_auto_config.rb
|
484
518
|
- lib/aspera/rest.rb
|
@@ -501,6 +535,8 @@ files:
|
|
501
535
|
- lib/aspera/uri_reader.rb
|
502
536
|
- lib/aspera/web_auth.rb
|
503
537
|
- lib/aspera/web_server_simple.rb
|
538
|
+
- lib/transferd_pb.rb
|
539
|
+
- lib/transferd_services_pb.rb
|
504
540
|
homepage: https://github.com/IBM/aspera-cli
|
505
541
|
licenses:
|
506
542
|
- Apache-2.0
|
@@ -511,7 +547,7 @@ metadata:
|
|
511
547
|
changelog_uri: https://github.com/IBM/aspera-cli/CHANGELOG.md
|
512
548
|
rubygems_uri: https://rubygems.org/gems/aspera-cli
|
513
549
|
documentation_uri: https://www.rubydoc.info/gems/aspera-cli
|
514
|
-
post_install_message:
|
550
|
+
post_install_message:
|
515
551
|
rdoc_options: []
|
516
552
|
require_paths:
|
517
553
|
- lib
|
@@ -519,7 +555,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
519
555
|
requirements:
|
520
556
|
- - ">="
|
521
557
|
- !ruby/object:Gem::Version
|
522
|
-
version: '
|
558
|
+
version: '3.1'
|
523
559
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
524
560
|
requirements:
|
525
561
|
- - ">="
|
@@ -528,7 +564,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
528
564
|
requirements:
|
529
565
|
- Read the manual for any requirement
|
530
566
|
rubygems_version: 3.4.19
|
531
|
-
signing_key:
|
567
|
+
signing_key:
|
532
568
|
specification_version: 4
|
533
569
|
summary: 'Execute actions using command line on IBM Aspera Server products: Aspera
|
534
570
|
on Cloud, Faspex, Shares, Node, Console, Orchestrator, High Speed Transfer Server'
|
metadata.gz.sig
CHANGED
Binary file
|
data/lib/aspera/ascp/products.rb
DELETED
@@ -1,156 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# cspell:ignore LOCALAPPDATA
|
4
|
-
require 'aspera/environment'
|
5
|
-
|
6
|
-
module Aspera
|
7
|
-
module Ascp
|
8
|
-
# find Aspera standard products installation in standard paths
|
9
|
-
class Products
|
10
|
-
# known product names
|
11
|
-
CONNECT = 'IBM Aspera Connect'
|
12
|
-
ASPERA = 'IBM Aspera (Client)'
|
13
|
-
CLI_V1 = 'Aspera CLI (deprecated)'
|
14
|
-
DRIVE = 'Aspera Drive (deprecated)'
|
15
|
-
HSTS = 'IBM Aspera High-Speed Transfer Server'
|
16
|
-
# product information manifest: XML (part of aspera product)
|
17
|
-
INFO_META_FILE = 'product-info.mf'
|
18
|
-
BIN_SUBFOLDER = 'bin'
|
19
|
-
ETC_SUBFOLDER = 'etc'
|
20
|
-
VAR_RUN_SUBFOLDER = File.join('var', 'run')
|
21
|
-
|
22
|
-
@@found_products = nil # rubocop:disable Style/ClassVars
|
23
|
-
class << self
|
24
|
-
# @return product folders depending on OS fields
|
25
|
-
# :expected M app name is taken from the manifest if present, else defaults to this value
|
26
|
-
# :app_root M main folder for the application
|
27
|
-
# :log_root O location of log files (Linux uses syslog)
|
28
|
-
# :run_root O only for Connect Client, location of http port file
|
29
|
-
# :sub_bin O subfolder with executables, default : bin
|
30
|
-
def product_locations_on_current_os
|
31
|
-
result =
|
32
|
-
case Aspera::Environment.os
|
33
|
-
when Aspera::Environment::OS_WINDOWS then [{
|
34
|
-
expected: CONNECT,
|
35
|
-
app_root: File.join(ENV.fetch('LOCALAPPDATA', nil), 'Programs', 'Aspera', 'Aspera Connect'),
|
36
|
-
log_root: File.join(ENV.fetch('LOCALAPPDATA', nil), 'Aspera', 'Aspera Connect', 'var', 'log'),
|
37
|
-
run_root: File.join(ENV.fetch('LOCALAPPDATA', nil), 'Aspera', 'Aspera Connect')
|
38
|
-
}, {
|
39
|
-
expected: CLI_V1,
|
40
|
-
app_root: File.join('C:', 'Program Files', 'Aspera', 'cli'),
|
41
|
-
log_root: File.join('C:', 'Program Files', 'Aspera', 'cli', 'var', 'log')
|
42
|
-
}, {
|
43
|
-
expected: HSTS,
|
44
|
-
app_root: File.join('C:', 'Program Files', 'Aspera', 'Enterprise Server'),
|
45
|
-
log_root: File.join('C:', 'Program Files', 'Aspera', 'Enterprise Server', 'var', 'log')
|
46
|
-
}]
|
47
|
-
when Aspera::Environment::OS_MACOS then [{
|
48
|
-
expected: CONNECT,
|
49
|
-
app_root: File.join(Dir.home, 'Applications', 'Aspera Connect.app'),
|
50
|
-
log_root: File.join(Dir.home, 'Library', 'Logs', 'Aspera_Connect'),
|
51
|
-
run_root: File.join(Dir.home, 'Library', 'Application Support', 'Aspera', 'Aspera Connect'),
|
52
|
-
sub_bin: File.join('Contents', 'Resources')
|
53
|
-
}, {
|
54
|
-
expected: CONNECT,
|
55
|
-
app_root: File.join('', 'Applications', 'Aspera Connect.app'),
|
56
|
-
log_root: File.join(Dir.home, 'Library', 'Logs', 'Aspera_Connect'),
|
57
|
-
run_root: File.join(Dir.home, 'Library', 'Application Support', 'Aspera', 'Aspera Connect'),
|
58
|
-
sub_bin: File.join('Contents', 'Resources')
|
59
|
-
}, {
|
60
|
-
expected: CLI_V1,
|
61
|
-
app_root: File.join(Dir.home, 'Applications', 'Aspera CLI'),
|
62
|
-
log_root: File.join(Dir.home, 'Library', 'Logs', 'Aspera')
|
63
|
-
}, {
|
64
|
-
expected: HSTS,
|
65
|
-
app_root: File.join('', 'Library', 'Aspera'),
|
66
|
-
log_root: File.join(Dir.home, 'Library', 'Logs', 'Aspera')
|
67
|
-
}, {
|
68
|
-
expected: DRIVE,
|
69
|
-
app_root: File.join('', 'Applications', 'Aspera Drive.app'),
|
70
|
-
log_root: File.join(Dir.home, 'Library', 'Logs', 'Aspera_Drive'),
|
71
|
-
sub_bin: File.join('Contents', 'Resources')
|
72
|
-
}, {
|
73
|
-
expected: ASPERA,
|
74
|
-
app_root: File.join('', 'Applications', 'IBM Aspera.app'),
|
75
|
-
log_root: File.join(Dir.home, 'Library', 'Logs', 'IBM Aspera'),
|
76
|
-
sub_bin: File.join('Contents', 'Resources', 'sdk', 'aspera', 'bin')
|
77
|
-
}]
|
78
|
-
else [{ # other: Linux and Unix family
|
79
|
-
expected: CONNECT,
|
80
|
-
app_root: File.join(Dir.home, '.aspera', 'connect'),
|
81
|
-
run_root: File.join(Dir.home, '.aspera', 'connect')
|
82
|
-
}, {
|
83
|
-
expected: CLI_V1,
|
84
|
-
app_root: File.join(Dir.home, '.aspera', 'cli')
|
85
|
-
}, {
|
86
|
-
expected: HSTS,
|
87
|
-
app_root: File.join('', 'opt', 'aspera')
|
88
|
-
}]
|
89
|
-
end
|
90
|
-
result # .each {|item| item.deep_do {|h, _k, _v, _m|h.freeze}}.freeze
|
91
|
-
end
|
92
|
-
|
93
|
-
# @return the list of installed products in format of product_locations_on_current_os
|
94
|
-
def installed_products
|
95
|
-
if @@found_products.nil?
|
96
|
-
scan_locations = product_locations_on_current_os.clone
|
97
|
-
# add SDK as first search path
|
98
|
-
scan_locations.unshift({
|
99
|
-
expected: 'SDK',
|
100
|
-
app_root: Installation.instance.sdk_folder,
|
101
|
-
sub_bin: ''
|
102
|
-
})
|
103
|
-
# search installed products: with ascp
|
104
|
-
@@found_products = scan_locations.select! do |item| # rubocop:disable Style/ClassVars
|
105
|
-
# skip if not main folder
|
106
|
-
next false unless Dir.exist?(item[:app_root])
|
107
|
-
Log.log.debug{"Found #{item[:app_root]}"}
|
108
|
-
sub_bin = item[:sub_bin] || BIN_SUBFOLDER
|
109
|
-
item[:ascp_path] = File.join(item[:app_root], sub_bin, ascp_filename)
|
110
|
-
# skip if no ascp
|
111
|
-
next false unless File.exist?(item[:ascp_path])
|
112
|
-
# read info from product info file if present
|
113
|
-
product_info_file = "#{item[:app_root]}/#{INFO_META_FILE}"
|
114
|
-
if File.exist?(product_info_file)
|
115
|
-
res_s = XmlSimple.xml_in(File.read(product_info_file), {'ForceArray' => false})
|
116
|
-
item[:name] = res_s['name']
|
117
|
-
item[:version] = res_s['version']
|
118
|
-
else
|
119
|
-
item[:name] = item[:expected]
|
120
|
-
end
|
121
|
-
true # select this version
|
122
|
-
end
|
123
|
-
end
|
124
|
-
return @@found_products
|
125
|
-
end
|
126
|
-
|
127
|
-
# filename for ascp with optional extension (Windows)
|
128
|
-
def ascp_filename
|
129
|
-
return "ascp#{Environment.exe_extension}"
|
130
|
-
end
|
131
|
-
|
132
|
-
# @return folder paths for specified applications
|
133
|
-
# @param name Connect or CLI
|
134
|
-
def folders(name)
|
135
|
-
found = Products.installed_products.select{|i|i[:expected].eql?(name) || i[:name].eql?(name)}
|
136
|
-
raise "Product: #{name} not found, please install." if found.empty?
|
137
|
-
return found.first
|
138
|
-
end
|
139
|
-
|
140
|
-
# @return the file path of local connect where API's URI can be read
|
141
|
-
def connect_uri
|
142
|
-
connect = folders(CONNECT)
|
143
|
-
folder = File.join(connect[:run_root], VAR_RUN_SUBFOLDER)
|
144
|
-
['', 's'].each do |ext|
|
145
|
-
uri_file = File.join(folder, "http#{ext}.uri")
|
146
|
-
Log.log.debug{"checking connect port file: #{uri_file}"}
|
147
|
-
if File.exist?(uri_file)
|
148
|
-
return File.open(uri_file, &:gets).strip
|
149
|
-
end
|
150
|
-
end
|
151
|
-
raise "no connect uri file found in #{folder}"
|
152
|
-
end
|
153
|
-
end
|
154
|
-
end
|
155
|
-
end
|
156
|
-
end
|