aspera-cli 4.26.0 → 4.26.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.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/CHANGELOG.md +36 -4
  4. data/CONTRIBUTING.md +2 -5
  5. data/bin/ascli +2 -2
  6. data/lib/aspera/agent/direct.rb +1 -1
  7. data/lib/aspera/agent/factory.rb +4 -0
  8. data/lib/aspera/agent/httpgw.rb +1 -1
  9. data/lib/aspera/agent/node.rb +2 -2
  10. data/lib/aspera/api/aoc.rb +45 -37
  11. data/lib/aspera/api/cos_node.rb +1 -1
  12. data/lib/aspera/api/faspex.rb +7 -6
  13. data/lib/aspera/api/node.rb +9 -9
  14. data/lib/aspera/ascmd.rb +4 -4
  15. data/lib/aspera/ascp/installation.rb +13 -6
  16. data/lib/aspera/assert.rb +17 -13
  17. data/lib/aspera/cli/context.rb +58 -0
  18. data/lib/aspera/cli/extended_value.rb +9 -4
  19. data/lib/aspera/cli/formatter.rb +91 -187
  20. data/lib/aspera/cli/http.rb +167 -0
  21. data/lib/aspera/cli/manager.rb +132 -77
  22. data/lib/aspera/cli/options.schema.yaml +82 -0
  23. data/lib/aspera/cli/plugins/alee.rb +2 -2
  24. data/lib/aspera/cli/plugins/aoc.rb +113 -77
  25. data/lib/aspera/cli/plugins/ats.rb +16 -16
  26. data/lib/aspera/cli/plugins/base.rb +64 -49
  27. data/lib/aspera/cli/plugins/config.rb +172 -444
  28. data/lib/aspera/cli/plugins/console.rb +7 -7
  29. data/lib/aspera/cli/plugins/cos.rb +2 -2
  30. data/lib/aspera/cli/plugins/factory.rb +3 -0
  31. data/lib/aspera/cli/plugins/faspex.rb +22 -22
  32. data/lib/aspera/cli/plugins/faspex5.rb +68 -49
  33. data/lib/aspera/cli/plugins/faspio.rb +1 -1
  34. data/lib/aspera/cli/plugins/httpgw.rb +2 -2
  35. data/lib/aspera/cli/plugins/node.rb +80 -80
  36. data/lib/aspera/cli/plugins/orchestrator.rb +21 -26
  37. data/lib/aspera/cli/plugins/preview.rb +9 -9
  38. data/lib/aspera/cli/plugins/server.rb +7 -7
  39. data/lib/aspera/cli/plugins/shares.rb +2 -2
  40. data/lib/aspera/cli/preset_manager.rb +235 -0
  41. data/lib/aspera/cli/result.rb +310 -0
  42. data/lib/aspera/cli/{main.rb → runner.rb} +48 -130
  43. data/lib/aspera/cli/sync_actions.rb +15 -11
  44. data/lib/aspera/cli/terminal_formatter.rb +65 -0
  45. data/lib/aspera/cli/transfer_agent.rb +17 -15
  46. data/lib/aspera/cli/transfer_progress.rb +6 -6
  47. data/lib/aspera/cli/version.rb +1 -1
  48. data/lib/aspera/cli/wizard.rb +5 -6
  49. data/lib/aspera/command_line_builder.rb +22 -18
  50. data/lib/aspera/data_repository.rb +4 -0
  51. data/lib/aspera/dot_container.rb +1 -1
  52. data/lib/aspera/environment.rb +25 -6
  53. data/lib/aspera/faspex_gw.rb +1 -1
  54. data/lib/aspera/formatter_interface.rb +14 -0
  55. data/lib/aspera/hash_ext.rb +6 -0
  56. data/lib/aspera/json_rpc.rb +6 -5
  57. data/lib/aspera/keychain/base.rb +1 -1
  58. data/lib/aspera/keychain/encrypted_hash.rb +1 -1
  59. data/lib/aspera/keychain/factory.rb +1 -1
  60. data/lib/aspera/keychain/macos_security.rb +1 -1
  61. data/lib/aspera/log.rb +10 -5
  62. data/lib/aspera/markdown.rb +4 -1
  63. data/lib/aspera/nagios.rb +2 -2
  64. data/lib/aspera/oauth/base.rb +5 -5
  65. data/lib/aspera/oauth/boot.rb +43 -0
  66. data/lib/aspera/oauth/factory.rb +38 -14
  67. data/lib/aspera/oauth/web.rb +2 -2
  68. data/lib/aspera/oauth.rb +1 -0
  69. data/lib/aspera/persistency_action_once.rb +2 -2
  70. data/lib/aspera/preview/file_types.rb +4 -0
  71. data/lib/aspera/products/connect.rb +3 -0
  72. data/lib/aspera/products/transferd.rb +2 -2
  73. data/lib/aspera/proxy_auto_config.rb +6 -3
  74. data/lib/aspera/rest.rb +9 -5
  75. data/lib/aspera/rest_error_analyzer.rb +4 -0
  76. data/lib/aspera/rest_list.rb +10 -3
  77. data/lib/aspera/schema/IBM Aspera Faspex API-5.0-enhanced.yaml +62811 -0
  78. data/lib/aspera/schema/IBM Aspera on Cloud API-0.2.6-enhanced.yaml +9637 -0
  79. data/lib/aspera/schema/async_tables.yaml +361 -0
  80. data/lib/aspera/schema/documentation.rb +107 -0
  81. data/lib/aspera/schema/reader.rb +75 -0
  82. data/lib/aspera/schema/registry.rb +70 -0
  83. data/lib/aspera/secret_hider.rb +4 -0
  84. data/lib/aspera/sync/conf.schema.yaml +0 -26
  85. data/lib/aspera/sync/database.rb +14 -10
  86. data/lib/aspera/sync/operations.rb +14 -10
  87. data/lib/aspera/temp_file_manager.rb +4 -0
  88. data/lib/aspera/transfer/faux_file.rb +1 -1
  89. data/lib/aspera/transfer/parameters.rb +4 -4
  90. data/lib/aspera/transfer/resumer.rb +2 -2
  91. data/lib/aspera/transfer/spec.rb +3 -3
  92. data/lib/aspera/transfer/spec.schema.yaml +18 -9
  93. data/lib/aspera/transfer/uri.rb +1 -1
  94. data/lib/aspera/uri_reader.rb +1 -1
  95. data/lib/aspera/yaml.rb +4 -2
  96. data.tar.gz.sig +0 -0
  97. metadata +28 -15
  98. metadata.gz.sig +1 -1
  99. data/lib/aspera/transfer/spec_doc.rb +0 -76
@@ -16,7 +16,6 @@ properties:
16
16
  ascp_dir:
17
17
  description: Directory containing ascp executable to use.
18
18
  type: string
19
- default: ""
20
19
  assume_no_mods:
21
20
  description: Assume that the directory structure has not been modified.
22
21
  type: boolean
@@ -52,7 +51,6 @@ properties:
52
51
  cookie:
53
52
  description: User-defined identification string.
54
53
  type: string
55
- default: ""
56
54
  x-cli-option: true
57
55
  cooloff_max_seconds:
58
56
  description:
@@ -153,7 +151,6 @@ properties:
153
151
  absolute:
154
152
  description: UTC timestamp. Empty value for disabled.
155
153
  type: string
156
- default: ""
157
154
  relative_seconds:
158
155
  description: Relative to async start time. `-1` for disabled.
159
156
  type: integer
@@ -185,7 +182,6 @@ properties:
185
182
  pass:
186
183
  description: Authenticate the local async with the specified password.
187
184
  type: string
188
- default: ""
189
185
  path:
190
186
  description: The directory to be synchronized on the local host.
191
187
  type: string
@@ -201,7 +197,6 @@ properties:
201
197
  description: Use the specified database directory on the local host.
202
198
  Default is `.private-asp` at the root level of the synchronized directory.
203
199
  type: string
204
- default: ""
205
200
  x-cli-option: true
206
201
  x-cli-short: -b
207
202
  local_checksum_threads:
@@ -215,7 +210,6 @@ properties:
215
210
  Store/Restore the database to/from the specified directory on the local host.
216
211
  The value can be an absolute path, an URI or - (use the local sync dir)
217
212
  type: string
218
- default: ""
219
213
  x-cli-option: true
220
214
  local_force_stat:
221
215
  description: Forces the local async to retrieve file information even when no changes are detected by the scanner or monitor.
@@ -233,12 +227,10 @@ properties:
233
227
  local_keep_dir:
234
228
  description: Move deleted files into the specified directory on the local host.
235
229
  type: string
236
- default: ""
237
230
  x-cli-option: --keep-dir-local
238
231
  local_mount_signature:
239
232
  description: Verify that the file system is mounted by the existence of this file on the local host.
240
233
  type: string
241
- default: ""
242
234
  x-cli-option: true
243
235
  local_move_cache_timeout_seconds:
244
236
  description:
@@ -299,13 +291,11 @@ properties:
299
291
  local_dir:
300
292
  description: Use the specified logging directory on the local host.
301
293
  type: string
302
- default: ""
303
294
  x-cli-option: --alt-logdir
304
295
  x-cli-short: -L
305
296
  remote_dir:
306
297
  description: Use the specified logging directory on the remote host.
307
298
  type: string
308
- default: ""
309
299
  x-cli-option: --remote-logdir
310
300
  x-cli-short: -R
311
301
  manifest_path:
@@ -313,7 +303,6 @@ properties:
313
303
  A directory path where ascp will create manifest TEXT files (passed
314
304
  to ascp as --file-manifest-path)
315
305
  type: string
316
- default: ""
317
306
  mirror:
318
307
  description:
319
308
  Force the pulling side to be exactly like the pushing side, removing
@@ -352,7 +341,6 @@ properties:
352
341
  description: Suppress log messages for ITEM.
353
342
  The only currently supported ITEM is 'stats', which suppresses both STATS and PROG log messages.
354
343
  type: string
355
- default: ""
356
344
  x-cli-option: true
357
345
  no_preserve_root_attrs:
358
346
  description: Disable the preservation of attributes on the Sync root.
@@ -455,7 +443,6 @@ properties:
455
443
  fingerprint:
456
444
  description: Check it against server SSH host key fingerprint.
457
445
  type: string
458
- default: ""
459
446
  x-ts-name: sshfp
460
447
  host:
461
448
  description: Use the specified host name or address of the remote host.
@@ -465,7 +452,6 @@ properties:
465
452
  pass:
466
453
  description: Authenticate the transfer with the specified password.
467
454
  type: string
468
- default: ""
469
455
  x-ts-name: remote_password
470
456
  x-cli-option: true
471
457
  x-cli-short: -w
@@ -516,11 +502,9 @@ properties:
516
502
  host:
517
503
  description: Use the specified host name or address of the proxy.
518
504
  type: string
519
- default: ""
520
505
  pass:
521
506
  description: Authenticate to the proxy with the specified password.
522
507
  type: string
523
- default: ""
524
508
  port:
525
509
  description: Use the specified port, default is 9091 for dnat, 9092.
526
510
  for dnats
@@ -536,18 +520,15 @@ properties:
536
520
  user:
537
521
  description: Authenticate to the proxy with the specified username.
538
522
  type: string
539
- default: ""
540
523
  token:
541
524
  description: Token string passed to server's authentication service.
542
525
  type: string
543
- default: ""
544
526
  x-ts-name: token
545
527
  x-cli-short: -W
546
528
  token_node_user:
547
529
  description: Node API user identity associated with the token.
548
530
  Required for node user bearer tokens
549
531
  type: string
550
- default: ""
551
532
  user:
552
533
  description: Authenticate the transfer with the specified username.
553
534
  type: string
@@ -563,7 +544,6 @@ properties:
563
544
  description: Use the specified database directory on the remote host.
564
545
  Default is `.private-asp` at the root level of the synchronized directory.
565
546
  type: string
566
- default: ""
567
547
  x-cli-option: true
568
548
  x-cli-short: -B
569
549
  remote_db_store_dir:
@@ -571,7 +551,6 @@ properties:
571
551
  Store/Restore the database to/from the specified directory on the remote host.
572
552
  The value can be an absolute path, an URI or - (use the remote sync dir).
573
553
  type: string
574
- default: ""
575
554
  x-cli-option: true
576
555
  remote_force_stat:
577
556
  description: Forces the remote async to retrieve file information even when no changes are detected by the scanner or monitor.
@@ -589,12 +568,10 @@ properties:
589
568
  remote_keep_dir:
590
569
  description: Move deleted files into the specified directory on the remote host.
591
570
  type: string
592
- default: ""
593
571
  x-cli-option: --keep-dir-remote
594
572
  remote_mount_signature:
595
573
  description: Verify that the file system is mounted by the existence of this file on the remote host.
596
574
  type: string
597
- default: ""
598
575
  x-cli-option: true
599
576
  remote_move_cache_timeout_seconds:
600
577
  description:
@@ -868,7 +845,6 @@ properties:
868
845
  host:
869
846
  description: Use the specified host name or address to connect to the datastore.
870
847
  type: string
871
- default: ""
872
848
  port:
873
849
  description: Use the specified port.
874
850
  type: integer
@@ -876,10 +852,8 @@ properties:
876
852
  write_gid:
877
853
  description: Try to write files as the specified group.
878
854
  type: string
879
- default: ""
880
855
  x-cli-option: true
881
856
  write_uid:
882
857
  description: Try to write files as the specified user.
883
858
  type: string
884
- default: ""
885
859
  x-cli-option: true
@@ -35,12 +35,12 @@ class SqLite3Wrapper
35
35
  end
36
36
 
37
37
  # The table contains a single row
38
- def single_table(table_name)
39
- execute("SELECT * FROM #{table_name} LIMIT 1").first
38
+ def single_table(table_name, sql_suffix = nil)
39
+ execute(["SELECT * FROM #{table_name}", sql_suffix, 'LIMIT 1'].compact.join(' ')).first
40
40
  end
41
41
 
42
- def full_table(table_name)
43
- execute("SELECT * FROM #{table_name}")
42
+ def full_table(table_name, sql_suffix = nil)
43
+ execute(["SELECT * FROM #{table_name}", sql_suffix].compact.join(' '))
44
44
  end
45
45
 
46
46
  private
@@ -68,16 +68,20 @@ module Aspera
68
68
  end
69
69
  end
70
70
 
71
- def meta
72
- @db.single_table('sync_snapmeta_table')
71
+ def meta(sql_suffix = nil)
72
+ @db.single_table('sync_snapmeta_table', sql_suffix)
73
73
  end
74
74
 
75
- def counters
76
- @db.single_table('sync_snap_counters_table')
75
+ def counters(sql_suffix = nil)
76
+ @db.single_table('sync_snap_counters_table', sql_suffix)
77
77
  end
78
78
 
79
- def file_info
80
- @db.full_table('sync_snapdb_table')
79
+ def file_info(sql_suffix = nil)
80
+ @db.full_table('sync_snapdb_table', sql_suffix)
81
+ end
82
+
83
+ def execute(sql)
84
+ @db.execute(sql)
81
85
  end
82
86
  end
83
87
  end
@@ -9,6 +9,7 @@ require 'aspera/command_line_builder'
9
9
  require 'aspera/log'
10
10
  require 'aspera/assert'
11
11
  require 'aspera/environment'
12
+ require 'aspera/schema/registry'
12
13
  require 'json'
13
14
  require 'base64'
14
15
  require 'open3'
@@ -81,11 +82,14 @@ module Aspera
81
82
  # Start the sync process
82
83
  # @param sync_info [Hash] Sync parameters, old or new format
83
84
  # @param opt_ts [Hash] Optional transfer spec
84
- # @param &block [nil, Proc] block to generate transfer spec, takes: `direction` (one of DIRECTIONS), `local_dir`, `remote_dir`
85
+ # @yieldparam direction [Symbol] Sync direction (one of DIRECTIONS: :push, :pull, :bidi)
86
+ # @yieldparam local_dir [String] Local directory path
87
+ # @yieldparam remote_dir [String] Remote directory path
88
+ # @yieldreturn [Hash] Transfer spec to use for authentication
85
89
  def start(sync_info, opt_ts = nil)
86
90
  Log.dump(:sync_params_initial, sync_info)
87
91
  Aspera.assert_type(sync_info, Hash)
88
- Aspera.assert(PARAM_KEYS.any?{ |k| sync_info.key?(k)}, type: Error){'At least one of `local` or `sessions` must be present in async parameters'}
92
+ Aspera.assert(PARAM_KEYS.any?{ |k| sync_info.key?(k)}, 'At least one of `local` or `sessions` must be present in async parameters', type: Error)
89
93
  env_args = {
90
94
  args: [],
91
95
  env: {}
@@ -141,7 +145,7 @@ module Aspera
141
145
  end
142
146
  sync_info['sessions'].each do |session_params|
143
147
  Aspera.assert_type(session_params, Hash)
144
- Aspera.assert(session_params.key?('name')){'session must contain at least: name'}
148
+ Aspera.assert(session_params.key?('name'), 'session must contain at least: name')
145
149
  session_builder = CommandLineBuilder.new(session_params, ARGS_SESSION_SCHEMA, CommandLineConverter)
146
150
  session_builder.process_params
147
151
  session_builder.add_env_args(env_args)
@@ -173,7 +177,7 @@ module Aspera
173
177
  # @param sync_info [Hash] sync parameters in conf or args format
174
178
  # @return [Hash] parsed output of asyncadmin
175
179
  def admin_status(sync_info)
176
- Aspera.assert(PARAM_KEYS.any?{ |k| sync_info.key?(k)}, type: Error){'At least one of `local` or `sessions` must be present in async parameters'}
180
+ Aspera.assert(PARAM_KEYS.any?{ |k| sync_info.key?(k)}, 'At least one of `local` or `sessions` must be present in async parameters', type: Error)
177
181
  arguments = [ASYNC_ADMIN_EXECUTABLE, '--quiet']
178
182
  if sync_info.key?('local')
179
183
  # `conf` format
@@ -205,7 +209,7 @@ module Aspera
205
209
  # @param sync_info [Hash] sync parameters in conf or args format
206
210
  # @return [String, nil] Path to "local DB dir", i.e. folder that contains folders that contain `snap.db`
207
211
  def local_db_folder(sync_info)
208
- Aspera.assert(PARAM_KEYS.any?{ |k| sync_info.key?(k)}, type: Error){'At least one of `local` or `sessions` must be present in async parameters'}
212
+ Aspera.assert(PARAM_KEYS.any?{ |k| sync_info.key?(k)}, 'At least one of `local` or `sessions` must be present in async parameters', type: Error)
209
213
  if sync_info.key?('local')
210
214
  # `conf` format
211
215
  if sync_info.key?('local_db_dir')
@@ -230,7 +234,7 @@ module Aspera
230
234
  end
231
235
 
232
236
  def session_name(sync_info)
233
- Aspera.assert(PARAM_KEYS.any?{ |k| sync_info.key?(k)}, type: Error){'At least one of `local` or `sessions` must be present in async parameters'}
237
+ Aspera.assert(PARAM_KEYS.any?{ |k| sync_info.key?(k)}, 'At least one of `local` or `sessions` must be present in async parameters', type: Error)
234
238
  if sync_info.key?('local')
235
239
  # `conf` format
236
240
  return sync_info['name']
@@ -336,10 +340,10 @@ module Aspera
336
340
  end
337
341
  # Private stuff:
338
342
  # Read JSON schema and mapping to command line options
339
- ARGS_INSTANCE_SCHEMA = CommandLineBuilder.read_schema(__dir__, 'args')
340
- ARGS_SESSION_SCHEMA = ARGS_INSTANCE_SCHEMA['properties']['sessions']['items']
341
- ARGS_INSTANCE_SCHEMA['properties'].delete('sessions')
342
- CONF_SCHEMA = CommandLineBuilder.read_schema(__dir__, 'conf')
343
+ ARGS_INSTANCE_SCHEMA = CommandLineBuilder.read_schema(Schema::Registry::SYNC_ARGS)
344
+ ARGS_SESSION_SCHEMA = ARGS_INSTANCE_SCHEMA.dig(*%w[properties sessions items])
345
+ ARGS_INSTANCE_SCHEMA.dig('properties').current.delete('sessions')
346
+ CONF_SCHEMA = CommandLineBuilder.read_schema(Schema::Registry::SYNC_CONF)
343
347
  CMDLINE_PARAMS_KEYS = %w[instance sessions].freeze
344
348
  ASYNC_ADMIN_EXECUTABLE = 'asyncadmin'
345
349
  PRIVATE_FOLDER = "#{Environment.instance.os.eql?(Environment::OS_WINDOWS) ? '~' : '.'}private-asp"
@@ -7,6 +7,10 @@ require 'etc'
7
7
  module Aspera
8
8
  # create a temp file name for a given folder
9
9
  # files can be deleted on process exit by calling cleanup
10
+ #
11
+ # @!method self.instance
12
+ # Returns the singleton instance of TempFileManager
13
+ # @return [TempFileManager] the singleton instance
10
14
  class TempFileManager
11
15
  include Singleton
12
16
 
@@ -14,7 +14,7 @@ module Aspera
14
14
  # @return nil if not a faux: scheme, else a FauxFile instance
15
15
  def create(name)
16
16
  return unless name.start_with?(PREFIX)
17
- name_params = name[PREFIX.length..-1].split('?', 2)
17
+ name_params = name.delete_prefix(PREFIX).split('?', 2)
18
18
  raise Error, 'Format: #{PREFIX}<file path>?<size>' unless name_params.length.eql?(2)
19
19
  raise Error, "Format: <integer>[#{SIZE_UNITS.join(',')}]" unless (m = name_params[1].downcase.match(/^(\d+)([#{SIZE_UNITS.join('')}])$/))
20
20
  size = m[1].to_i
@@ -85,12 +85,12 @@ module Aspera
85
85
  file_list_option = nil
86
86
  # transfer spec contains paths ?
87
87
  if !ts_paths_array.nil?
88
- Aspera.assert(!ascp_file_list_provided){'file list provided both in transfer spec and ascp file list. Remove one of them.'}
89
- Aspera.assert(ts_paths_array.all?{ |i| i.key?('source')}){"All elements of paths must have a 'source' key"}
88
+ Aspera.assert(!ascp_file_list_provided, 'file list provided both in transfer spec and ascp file list. Remove one of them.')
89
+ Aspera.assert(ts_paths_array.all?{ |i| i.key?('source')}, "All elements of paths must have a 'source' key")
90
90
  is_pair_list = ts_paths_array.any?{ |i| i.key?('destination')}
91
91
  raise "All elements of paths must be consistent with 'destination' key" if is_pair_list && !ts_paths_array.all?{ |i| i.key?('destination')}
92
92
  if self.class.file_list_folder.nil?
93
- Aspera.assert(!is_pair_list){'file pair list is not supported when file list folder is not set'}
93
+ Aspera.assert(!is_pair_list, 'file pair list is not supported when file list folder is not set')
94
94
  # not safe for special characters ? (maybe not, depends on OS)
95
95
  Log.log.debug('placing source file list on command line (no file list file)')
96
96
  @builder.add_command_line_options(ts_paths_array.map{ |i| i['source']})
@@ -160,7 +160,7 @@ module Aspera
160
160
  @job_spec.delete('source_root') if @job_spec.key?('source_root') && @job_spec['source_root'].empty?
161
161
 
162
162
  # Notify multi-session was already used, anyway it was deleted by agent direct
163
- Aspera.assert(!@builder.read_param('multi_session'))
163
+ Aspera.assert(!@builder.read_param('multi_session'), 'multi_session already consumed, must not be set here')
164
164
 
165
165
  # Add ssh or wss certificates
166
166
  # (reverse, to keep order, as we unshift)
@@ -32,9 +32,9 @@ module Aspera
32
32
  # Calls block a number of times (resumes) until success or limit reached
33
33
  # This is re-entrant, one resumer can handle multiple transfers in //
34
34
  #
35
- # @param block [Proc]
35
+ # @yieldreturn [void] Executes the transfer operation
36
36
  def execute_with_resume
37
- Aspera.assert(block_given?)
37
+ Aspera.assert(block_given?, 'block required for execute_with_resume')
38
38
  # maximum of retry
39
39
  remaining_resumes = @iter_max
40
40
  sleep_seconds = @sleep_initial
@@ -50,9 +50,9 @@ module Aspera
50
50
  transfer_spec['resume_policy'] = POLICY_FIX[transfer_spec['resume_policy']] if transfer_spec.key?('resume_policy')
51
51
  end
52
52
  end
53
- SCHEMA = CommandLineBuilder.read_schema(__dir__, 'spec', ascp: true)
54
- # define constants for enums of parameters: <parameter>_<enum>, e.g. CIPHER_AES_128, DIRECTION_SEND, ...
55
- SCHEMA['properties'].each do |name, description|
53
+ SCHEMA = CommandLineBuilder.read_schema(Schema::Registry::TRANSFER_SPEC, ascp: true)
54
+ # Define constants for enums of parameters: <parameter>_<enum>, e.g. CIPHER_AES_128, DIRECTION_SEND, ...
55
+ SCHEMA.current['properties'].each do |name, description|
56
56
  next unless description['enum'].is_a?(Array)
57
57
  const_set(:"#{name.to_s.upcase}_ENUM_VALUES", description['enum'])
58
58
  description['enum'].each do |enum|
@@ -8,7 +8,7 @@ $comment: >-
8
8
  x-cli-envvar [String] Name of env var
9
9
  x-cli-option [String] Command line option (starts with "-"), or `true`: same as ts, or `false`: not an option
10
10
  x-cli-switch [Boolean] `true` if option has no arg, else by default option has a value
11
- x-cli-special [Boolean] `true` if not anaged by command line generator (special handling: option or argument)
11
+ x-cli-special [Boolean] `true` if not managed by command line generator (special handling: option or argument)
12
12
  x-cli-convert [String,Hash] Method name for Convert object or Conversion Hash for enum: ts to arg
13
13
  x-agents [Array] Supported agents (for doc only), if not specified: all
14
14
  x-deprecation [String] Deprecation message for doc
@@ -706,7 +706,17 @@ properties:
706
706
  - transferd
707
707
  x-cli-option: -i
708
708
  symlink_policy:
709
- description: Handle source side symbolic links.
709
+ description: >-
710
+ Handle source side symbolic links.
711
+ Refer to HSTS manual for more details.
712
+
713
+ - `follow`: Follow a symbolic link and transfer the contents of the linked file or directory when the link target is in the user's docroot.
714
+
715
+ - `copy`: Copy only the symbolic link. If a file with the same name exists at the destination, the symbolic link does not replace the file.
716
+
717
+ - `skip`: Skip-symbolic links. The link or the file to which it points are not transferred.
718
+
719
+ - `copy+force`: Copy only the symbolic link. If a file with the same name exists at the destination, the symbolic link replaces the file. If the file of the same name at the destination is a symbolic link to a directory, it is not replaced.
710
720
  type: string
711
721
  enum:
712
722
  - follow
@@ -719,15 +729,13 @@ properties:
719
729
  description: >-
720
730
  Metadata for transfer as JSON.
721
731
  Key `aspera` is reserved.
722
- Key `aspera.xfer_retry` specifies a retry timeout for node API initiated transfers.
732
+ Key `aspera.xfer_retry` specifies a "retry timeout" but is not actually used for node API initiated transfers.
723
733
  type: object
724
734
  x-cli-option: --tags64
725
735
  x-cli-convert: json64
726
736
  tags64:
727
737
  description: >-
728
- Metadata for transfer as JSON.
729
- Key `aspera` is reserved.
730
- Key `aspera.xfer_retry` specifies a retry timeout for node API initiated transfers.
738
+ Base64 string for `tags`.
731
739
  type: string
732
740
  x-agents:
733
741
  - direct
@@ -753,11 +761,12 @@ properties:
753
761
  - connect
754
762
  - transferd
755
763
  token:
756
- description: "Authorization token. Type: Bearer, Basic or ATM. (Also arg -W)"
764
+ $comment: Also arg -W
765
+ description: Authorization token. Type is Bearer, Basic or ATM.
757
766
  type: string
758
767
  x-cli-envvar: ASPERA_SCP_TOKEN
759
768
  use_ascp4:
760
- description: Specify version of protocol. Do not use `ascp4`.
769
+ description: Specify version of protocol. `ascp4` will be deprecated.
761
770
  type: boolean
762
771
  default: false
763
772
  x-agents:
@@ -881,7 +890,7 @@ properties:
881
890
  xfer_max_retries:
882
891
  description: >-
883
892
  Maximum number of retries, for node API initiated transfers.
884
- Shall not exceed `aspera.conf` parameter `transfer_manager_max_retries` (default 5).
893
+ Shall not exceed `aspera.conf` parameter `transfer_manager_max_retries` (default 3).
885
894
  type: integer
886
895
  x-agents:
887
896
  - node
@@ -13,7 +13,7 @@ module Aspera
13
13
  SCHEME = 'faspe'
14
14
  def initialize(fasp_link)
15
15
  @fasp_uri = URI.parse(fasp_link.gsub(' ', '%20'))
16
- Aspera.assert(@fasp_uri.scheme == SCHEME, "Invalid scheme: #{@fasp_uri.scheme}")
16
+ Aspera.assert_values(@fasp_uri.scheme, [SCHEME]){"Invalid scheme: #{@fasp_uri.scheme}"}
17
17
  end
18
18
 
19
19
  # Generate transfer spec from provided faspe: URL
@@ -27,7 +27,7 @@ module Aspera
27
27
  # @return [String] the path of a file:// URL
28
28
  def file_path(url)
29
29
  Aspera.assert(file?(url)){"use format: #{file_url('<path>')}"}
30
- File.expand_path(url[SCHEME_FILE_PFX2.length..-1])
30
+ File.expand_path(url.delete_prefix(SCHEME_FILE_PFX2))
31
31
  end
32
32
 
33
33
  # Read some content from some URI, support file: , http: and https: schemes
data/lib/aspera/yaml.rb CHANGED
@@ -34,14 +34,16 @@ module Aspera
34
34
  duplicate_keys
35
35
  end
36
36
 
37
- # Safely load YAML content, raising an error if duplicate keys are found
37
+ # Safely load YAML content
38
+ # raising an error if duplicate keys are found
39
+ # Validates the yaml, and then call `YAML.safe_load`
38
40
  # @param yaml [String] YAML content
39
41
  # @return [Object] Parsed YAML content
40
42
  # @raise [RuntimeError] If duplicate keys are found
41
43
  def safe_load(yaml)
42
44
  duplicate_keys = find_duplicate_keys(Psych.parse_stream(yaml))
43
45
  raise "Duplicate keys: #{duplicate_keys.join('; ')}" unless duplicate_keys.empty?
44
- YAML.safe_load(yaml)
46
+ YAML.safe_load(yaml, permitted_classes: [Time, Date, Symbol])
45
47
  end
46
48
 
47
49
  module_function :find_duplicate_keys, :safe_load
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aspera-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.26.0
4
+ version: 4.26.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Laurent Martin
@@ -11,8 +11,8 @@ cert_chain:
11
11
  -----BEGIN CERTIFICATE-----
12
12
  MIIEzDCCAzSgAwIBAgIBATANBgkqhkiG9w0BAQsFADBeMR4wHAYDVQQDDBVsYXVy
13
13
  ZW50Lm1hcnRpbi5hc3BlcmExEjAQBgoJkiaJk/IsZAEZFgJmcjETMBEGCgmSJomT
14
- 8ixkARkWA2libTETMBEGCgmSJomT8ixkARkWA2NvbTAeFw0yMzA2MjcwODUwMDRa
15
- Fw0yNjA3MDEwODUwMDRaMF4xHjAcBgNVBAMMFWxhdXJlbnQubWFydGluLmFzcGVy
14
+ 8ixkARkWA2libTETMBEGCgmSJomT8ixkARkWA2NvbTAeFw0yNjA3MTcxMjE0MzNa
15
+ Fw0yODA3MTYxMjE0MzNaMF4xHjAcBgNVBAMMFWxhdXJlbnQubWFydGluLmFzcGVy
16
16
  YTESMBAGCgmSJomT8ixkARkWAmZyMRMwEQYKCZImiZPyLGQBGRYDaWJtMRMwEQYK
17
17
  CZImiZPyLGQBGRYDY29tMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA
18
18
  1E7e2PvDM1xOXrAQKYzkFG2uZcPC+uAdcq2zqUdfLv2iwAXhGQ/P5f/6uDt/cL5b
@@ -26,15 +26,15 @@ cert_chain:
26
26
  AgMBAAGjgZQwgZEwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFPZD
27
27
  HBRnWTjzjeZq3Sx/yv7hhY9rMCsGA1UdEQQkMCKBIGxhdXJlbnQubWFydGluLmFz
28
28
  cGVyYUBmci5pYm0uY29tMCsGA1UdEgQkMCKBIGxhdXJlbnQubWFydGluLmFzcGVy
29
- YUBmci5pYm0uY29tMA0GCSqGSIb3DQEBCwUAA4IBgQCtbncBw6IjRWDjiaeH6gmQ
30
- GrfPX53oAJOMnyjhhgKfLd/PPJIckCxz/Tscsuq9+ZUDTubz2E3ltycdxrz0OOul
31
- M8cWfkJ4cvdGAGTtqhmv3GGWZwFN8V8WYmmXrgej4o33vx6o8B6uwBn38hvkkAlB
32
- ixQDORrk0ck1GVUYYo2UmDOlqArf6paaqd7rziY0dntYl0DfFWe7eJYA467FKjM6
33
- /V3L2mTuHg4nCqC2febbAG+W+n158UrEkIKoOpAvQsykuuRtMaTpSTnYd0kLtQIF
34
- qNyjadnjZB8iMIedYmEOKApKUJS/9BN1iXHxVbL03AS4o5xMQO3PPjXcwwaybE8G
35
- sqAiwQUoawi1m3fZ8u3Xx+GmWE7tE9oxnPA48Y44EkiiWozq263f4S2Xa449ODoh
36
- eTf9kxhVM40wGQOECVNA8UsEEZHD48eF+csUYZtAJOF5oxTI8UyV9T/o6CgO0c9/
37
- Gzz+Qm5ULOUcPiJLjSpaiTrkiIVYiDGnqNSr6R1Hb1c=
29
+ YUBmci5pYm0uY29tMA0GCSqGSIb3DQEBCwUAA4IBgQDIMFaig1C/3xA+ccAZD89x
30
+ CF16MUxdTWkmDh1uWrC87tJzdSDwRUnvXvqnGCGU7L0slEfYfP2Aa2n/+3C70Eks
31
+ rE/SbOWEw1jvAGCZkzQehbg33rEGWymAzFzcBdwoF7AQTyux6ylhcfd0XCO+LQHW
32
+ CimlmOrKfR72Hahk7rt0fc72XY1M9q4IAc7PE/ldaiHKKzX5RbelvM8nMS8oV6tT
33
+ dIOyDDZFhBRhOmeAh6Rix57FA65pw7rxxxlMqtNYmM60s8Yzdb6YNW2p+Kk9IWgz
34
+ PCv9trmuKaozXi9HAQ7285yPMjeccIX28FWZzALu/OZt/98+E+l15rb2qq6AhYvn
35
+ FOfe1hzTtPWN7gAcyb+9pVICat2KG0WNzmM9wvLMc1IuPgaMGfeMg2moeELGAwqS
36
+ Mar5Df73cC83QnpW3RalwgGSb5ch8Cz8L9j/DaLIy/RoZ0lpNqGOvm8DUDQ/XoqM
37
+ IWpYzVavdZxwcrakRXil3x0kelFqCzC57twcNj0b0QI=
38
38
  -----END CERTIFICATE-----
39
39
  date: 1980-01-02 00:00:00.000000000 Z
40
40
  dependencies:
@@ -338,13 +338,15 @@ files:
338
338
  - lib/aspera/ascp/installation.rb
339
339
  - lib/aspera/ascp/management.rb
340
340
  - lib/aspera/assert.rb
341
+ - lib/aspera/cli/context.rb
341
342
  - lib/aspera/cli/error.rb
342
343
  - lib/aspera/cli/extended_value.rb
343
344
  - lib/aspera/cli/formatter.rb
344
345
  - lib/aspera/cli/hints.rb
346
+ - lib/aspera/cli/http.rb
345
347
  - lib/aspera/cli/info.rb
346
- - lib/aspera/cli/main.rb
347
348
  - lib/aspera/cli/manager.rb
349
+ - lib/aspera/cli/options.schema.yaml
348
350
  - lib/aspera/cli/plugins/alee.rb
349
351
  - lib/aspera/cli/plugins/aoc.rb
350
352
  - lib/aspera/cli/plugins/ats.rb
@@ -364,8 +366,12 @@ files:
364
366
  - lib/aspera/cli/plugins/preview.rb
365
367
  - lib/aspera/cli/plugins/server.rb
366
368
  - lib/aspera/cli/plugins/shares.rb
369
+ - lib/aspera/cli/preset_manager.rb
370
+ - lib/aspera/cli/result.rb
371
+ - lib/aspera/cli/runner.rb
367
372
  - lib/aspera/cli/special_values.rb
368
373
  - lib/aspera/cli/sync_actions.rb
374
+ - lib/aspera/cli/terminal_formatter.rb
369
375
  - lib/aspera/cli/transfer_agent.rb
370
376
  - lib/aspera/cli/transfer_progress.rb
371
377
  - lib/aspera/cli/version.rb
@@ -385,6 +391,7 @@ files:
385
391
  - lib/aspera/environment.rb
386
392
  - lib/aspera/faspex_gw.rb
387
393
  - lib/aspera/faspex_postproc.rb
394
+ - lib/aspera/formatter_interface.rb
388
395
  - lib/aspera/hash_ext.rb
389
396
  - lib/aspera/id_generator.rb
390
397
  - lib/aspera/json_rpc.rb
@@ -400,6 +407,7 @@ files:
400
407
  - lib/aspera/node_simulator.rb
401
408
  - lib/aspera/oauth.rb
402
409
  - lib/aspera/oauth/base.rb
410
+ - lib/aspera/oauth/boot.rb
403
411
  - lib/aspera/oauth/factory.rb
404
412
  - lib/aspera/oauth/generic.rb
405
413
  - lib/aspera/oauth/jwt.rb
@@ -425,6 +433,12 @@ files:
425
433
  - lib/aspera/rest_error_analyzer.rb
426
434
  - lib/aspera/rest_errors_aspera.rb
427
435
  - lib/aspera/rest_list.rb
436
+ - lib/aspera/schema/IBM Aspera Faspex API-5.0-enhanced.yaml
437
+ - lib/aspera/schema/IBM Aspera on Cloud API-0.2.6-enhanced.yaml
438
+ - lib/aspera/schema/async_tables.yaml
439
+ - lib/aspera/schema/documentation.rb
440
+ - lib/aspera/schema/reader.rb
441
+ - lib/aspera/schema/registry.rb
428
442
  - lib/aspera/secret_hider.rb
429
443
  - lib/aspera/ssh.rb
430
444
  - lib/aspera/ssl.rb
@@ -440,7 +454,6 @@ files:
440
454
  - lib/aspera/transfer/resumer.rb
441
455
  - lib/aspera/transfer/spec.rb
442
456
  - lib/aspera/transfer/spec.schema.yaml
443
- - lib/aspera/transfer/spec_doc.rb
444
457
  - lib/aspera/transfer/uri.rb
445
458
  - lib/aspera/uri_reader.rb
446
459
  - lib/aspera/web_auth.rb
@@ -473,7 +486,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
473
486
  version: '0'
474
487
  requirements:
475
488
  - Read the manual for any requirement
476
- rubygems_version: 4.0.6
489
+ rubygems_version: 4.0.16
477
490
  specification_version: 4
478
491
  summary: 'Execute actions using command line on IBM Aspera Server products: Aspera
479
492
  on Cloud, Faspex, Shares, Node, Console, Orchestrator, High Speed Transfer Server'
metadata.gz.sig CHANGED
@@ -1 +1 @@
1
- ���a���y:p�*�:'"�����״�9�����ZG�Ӡ�S~��(����zDb�.Vt
1
+ "C�|g�y�C���{J��<�N�b�� 6���V��Ʊ�3