aspera-cli 4.26.1 → 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 (86) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/CHANGELOG.md +19 -1
  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 +43 -36
  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 +7 -7
  14. data/lib/aspera/ascmd.rb +4 -4
  15. data/lib/aspera/ascp/installation.rb +6 -2
  16. data/lib/aspera/cli/context.rb +58 -0
  17. data/lib/aspera/cli/extended_value.rb +3 -2
  18. data/lib/aspera/cli/formatter.rb +83 -184
  19. data/lib/aspera/cli/http.rb +167 -0
  20. data/lib/aspera/cli/manager.rb +3 -2
  21. data/lib/aspera/cli/plugins/alee.rb +2 -2
  22. data/lib/aspera/cli/plugins/aoc.rb +78 -67
  23. data/lib/aspera/cli/plugins/ats.rb +16 -16
  24. data/lib/aspera/cli/plugins/base.rb +18 -12
  25. data/lib/aspera/cli/plugins/config.rb +166 -438
  26. data/lib/aspera/cli/plugins/console.rb +7 -7
  27. data/lib/aspera/cli/plugins/cos.rb +2 -2
  28. data/lib/aspera/cli/plugins/factory.rb +3 -0
  29. data/lib/aspera/cli/plugins/faspex.rb +21 -21
  30. data/lib/aspera/cli/plugins/faspex5.rb +64 -44
  31. data/lib/aspera/cli/plugins/faspio.rb +1 -1
  32. data/lib/aspera/cli/plugins/httpgw.rb +2 -2
  33. data/lib/aspera/cli/plugins/node.rb +79 -79
  34. data/lib/aspera/cli/plugins/orchestrator.rb +21 -26
  35. data/lib/aspera/cli/plugins/preview.rb +9 -9
  36. data/lib/aspera/cli/plugins/server.rb +7 -7
  37. data/lib/aspera/cli/plugins/shares.rb +2 -2
  38. data/lib/aspera/cli/preset_manager.rb +235 -0
  39. data/lib/aspera/cli/result.rb +310 -0
  40. data/lib/aspera/cli/{main.rb → runner.rb} +14 -155
  41. data/lib/aspera/cli/sync_actions.rb +14 -10
  42. data/lib/aspera/cli/terminal_formatter.rb +65 -0
  43. data/lib/aspera/cli/transfer_progress.rb +6 -6
  44. data/lib/aspera/cli/version.rb +1 -1
  45. data/lib/aspera/cli/wizard.rb +5 -6
  46. data/lib/aspera/command_line_builder.rb +1 -1
  47. data/lib/aspera/data_repository.rb +4 -0
  48. data/lib/aspera/dot_container.rb +1 -1
  49. data/lib/aspera/environment.rb +22 -3
  50. data/lib/aspera/faspex_gw.rb +1 -1
  51. data/lib/aspera/json_rpc.rb +6 -5
  52. data/lib/aspera/keychain/base.rb +1 -1
  53. data/lib/aspera/keychain/encrypted_hash.rb +1 -1
  54. data/lib/aspera/keychain/factory.rb +1 -1
  55. data/lib/aspera/keychain/macos_security.rb +1 -1
  56. data/lib/aspera/log.rb +6 -2
  57. data/lib/aspera/nagios.rb +2 -2
  58. data/lib/aspera/oauth/base.rb +5 -5
  59. data/lib/aspera/oauth/boot.rb +43 -0
  60. data/lib/aspera/oauth/factory.rb +37 -13
  61. data/lib/aspera/oauth/web.rb +2 -2
  62. data/lib/aspera/oauth.rb +1 -0
  63. data/lib/aspera/persistency_action_once.rb +2 -2
  64. data/lib/aspera/preview/file_types.rb +4 -0
  65. data/lib/aspera/products/connect.rb +3 -0
  66. data/lib/aspera/products/transferd.rb +2 -2
  67. data/lib/aspera/proxy_auto_config.rb +3 -3
  68. data/lib/aspera/rest.rb +8 -4
  69. data/lib/aspera/rest_error_analyzer.rb +4 -0
  70. data/lib/aspera/rest_list.rb +10 -3
  71. data/lib/aspera/schema/IBM Aspera Faspex API-5.0-enhanced.yaml +14 -4
  72. data/lib/aspera/schema/IBM Aspera on Cloud API-0.2.6-enhanced.yaml +827 -88
  73. data/lib/aspera/schema/async_tables.yaml +361 -0
  74. data/lib/aspera/schema/reader.rb +1 -1
  75. data/lib/aspera/schema/registry.rb +13 -6
  76. data/lib/aspera/secret_hider.rb +4 -0
  77. data/lib/aspera/sync/database.rb +14 -10
  78. data/lib/aspera/sync/operations.rb +5 -5
  79. data/lib/aspera/temp_file_manager.rb +4 -0
  80. data/lib/aspera/transfer/parameters.rb +4 -4
  81. data/lib/aspera/transfer/resumer.rb +1 -1
  82. data/lib/aspera/transfer/spec.schema.yaml +17 -8
  83. data/lib/aspera/transfer/uri.rb +1 -1
  84. data.tar.gz.sig +0 -0
  85. metadata +21 -14
  86. metadata.gz.sig +0 -0
@@ -0,0 +1,361 @@
1
+ # Schema for the SQLite tables inside the Async snap database (snap.db).
2
+ # Sources:
3
+ # include/async/session/Sqlite3_SSDB.h (SYNC_SQLITE3_META_SCHEMA, SYNC_SQLITE3_COUNTERS_SCHEMA, SYNC_SQLITE3_SCHEMA_1_0)
4
+ # include/async/common/Sync_types.h (SSSTATE values)
5
+ # Verified against a live snap.db using: ascli config sync admin overview <path>
6
+ $schema: https://json-schema.org/draft/2020-12/schema
7
+ $id: https://github.com/IBM/aspera-cli/tree/main/lib/aspera/schema/async_tables.yaml
8
+ title: Async snap database tables
9
+ description: Schemas for the SQLite tables stored inside the Async snap database (`snap.db`).
10
+ type: object
11
+ properties:
12
+ meta:
13
+ title: sync_snapmeta_table
14
+ description: One row per session, written at start and updated at stop.
15
+ type: object
16
+ properties:
17
+ dbversion:
18
+ description: Database schema version.
19
+ type: string
20
+ pairname:
21
+ description: Sync session name.
22
+ type: string
23
+ ldir:
24
+ description: Local directory path.
25
+ type: string
26
+ rhost:
27
+ description: Remote host.
28
+ type: string
29
+ rdir:
30
+ description: Remote directory path.
31
+ type: string
32
+ direction:
33
+ description: Sync direction.
34
+ type: string
35
+ enum:
36
+ - push
37
+ - pull
38
+ - bidi
39
+ inode_format:
40
+ description: Inode format used by the session.
41
+ type: string
42
+ checksum:
43
+ description: Checksum algorithm.
44
+ type: string
45
+ enum:
46
+ - sha1
47
+ - md5
48
+ - sha1_sparse
49
+ - md5_sparse
50
+ - none
51
+ start_time:
52
+ description: Session start timestamp.
53
+ type: string
54
+ format: date-time
55
+ stop_time:
56
+ description: Session stop timestamp (written when session ends).
57
+ type: string
58
+ format: date-time
59
+ condition:
60
+ description: Last known session condition.
61
+ type: string
62
+ enum:
63
+ - running
64
+ - stopped
65
+ scn_true_val:
66
+ description: Scan counter true value (internal).
67
+ type: integer
68
+ sync_point:
69
+ description: Synchronization point sequence number.
70
+ type: integer
71
+ max_recid:
72
+ description: Highest record ID allocated in the snapshot table.
73
+ type: integer
74
+ sync_uuid:
75
+ description: UUID identifying this sync pair.
76
+ type: string
77
+ cip_true_val:
78
+ description: Candidate-in-progress counter true value (internal).
79
+ type: integer
80
+ exclude_dirs_older_than:
81
+ description: Exclude directories with modification time older than this epoch value (0 = disabled).
82
+ type: integer
83
+ path_synced:
84
+ description: Number of paths successfully synchronized.
85
+ type: integer
86
+ byte_synced:
87
+ description: Number of bytes successfully synchronized.
88
+ type: integer
89
+ filters:
90
+ description: Active include/exclude filter patterns.
91
+ type: string
92
+ path_peerxfer:
93
+ description: Number of paths transferred by the peer.
94
+ type: integer
95
+ byte_peerxfer:
96
+ description: Number of bytes transferred by the peer.
97
+ type: integer
98
+ path_xferres:
99
+ description: Number of paths for which transfer was resumed.
100
+ type: integer
101
+ byte_xferres:
102
+ description: Number of bytes for which transfer was resumed.
103
+ type: integer
104
+ file_synced:
105
+ description: Number of files successfully synchronized.
106
+ type: integer
107
+ file_peerxfer:
108
+ description: Number of files transferred by the peer.
109
+ type: integer
110
+ file_xferres:
111
+ description: Number of files for which transfer was resumed.
112
+ type: integer
113
+ ascp_sids:
114
+ description: Last known FASP (ascp) session IDs.
115
+ type: string
116
+ counters:
117
+ title: sync_snap_counters_table
118
+ description: One row, updated live during the session with path and file counts per state.
119
+ type: object
120
+ properties:
121
+ syncd:
122
+ description: Number of paths in the `Syncd` state.
123
+ type: integer
124
+ conflict:
125
+ description: Number of paths in the `Conflict` state.
126
+ type: integer
127
+ potential_conflict:
128
+ description: Number of paths in the `Potential conflict` state.
129
+ type: integer
130
+ error:
131
+ description: Number of paths in the `Error` state.
132
+ type: integer
133
+ pending:
134
+ description: Number of paths still pending synchronization.
135
+ type: integer
136
+ unused:
137
+ description: Reserved (unused counter slot).
138
+ type: integer
139
+ files_syncd:
140
+ description: Number of files in the `Syncd` state.
141
+ type: integer
142
+ files_conflict:
143
+ description: Number of files in the `Conflict` state.
144
+ type: integer
145
+ files_potential_conflict:
146
+ description: Number of files in the `Potential conflict` state.
147
+ type: integer
148
+ files_error:
149
+ description: Number of files in the `Error` state.
150
+ type: integer
151
+ files_pending:
152
+ description: Number of files still pending synchronization.
153
+ type: integer
154
+ file_info:
155
+ title: sync_snapdb_table
156
+ description: One row per tracked file or directory. Primary source for the `file_info` command.
157
+ type: object
158
+ properties:
159
+ record_id:
160
+ description: Primary key (auto-increment).
161
+ type: integer
162
+ nodeid:
163
+ description: Local filesystem node ID.
164
+ type: integer
165
+ peer_rid:
166
+ description: Peer record ID for this entry.
167
+ type: integer
168
+ state:
169
+ description: |
170
+ Sync state of the entry.
171
+
172
+ | Value | Name |
173
+ |-------|-------------------|
174
+ | 0 | Nil |
175
+ | 1–18 | Pending (variant) |
176
+ | 19 | Syncd |
177
+ | 20 | Error |
178
+ | 21 | Conflict |
179
+ | 22 | PotentialConflict |
180
+ | 23–24 | Pending (variant) |
181
+ type: integer
182
+ version:
183
+ description: Schema version field (not used).
184
+ type: integer
185
+ c_meta_type:
186
+ description: Current metadata — file type (file, directory, …).
187
+ type: integer
188
+ c_meta_parentrid:
189
+ description: Current metadata — parent record ID.
190
+ type: integer
191
+ c_meta_path:
192
+ description: Current metadata — file path as known to the snapshot.
193
+ type: string
194
+ c_meta_attrs:
195
+ description: Current metadata — file attributes.
196
+ type: string
197
+ c_meta_uid:
198
+ description: Current metadata — user ID (Unix).
199
+ type: integer
200
+ c_meta_gid:
201
+ description: Current metadata — group ID (Unix).
202
+ type: integer
203
+ c_meta_mtime:
204
+ description: Current metadata — modification time (epoch).
205
+ type: integer
206
+ c_meta_atime:
207
+ description: Current metadata — access time (epoch).
208
+ type: integer
209
+ c_meta_ctime:
210
+ description: Current metadata — change time (epoch).
211
+ type: integer
212
+ c_meta_xattrs:
213
+ description: Current metadata — extended attributes (not used).
214
+ type: integer
215
+ c_meta_xattrs_cksum:
216
+ description: Current metadata — checksum of extended attributes.
217
+ type: string
218
+ c_meta_ol_legal_hold:
219
+ description: Current metadata — object lock legal hold flag.
220
+ type: integer
221
+ c_meta_ol_mode:
222
+ description: Current metadata — object lock mode.
223
+ type: integer
224
+ c_meta_ol_retain_until:
225
+ description: Current metadata — object lock retain-until date (epoch).
226
+ type: integer
227
+ c_meta_object_metadata:
228
+ description: Current metadata — object metadata (JSON).
229
+ type: string
230
+ c_cont_size:
231
+ description: Current content — file size in bytes.
232
+ type: integer
233
+ c_cont_csum:
234
+ description: Current content — checksum.
235
+ type: string
236
+ c_cont_mtime:
237
+ description: Current content — modification time (epoch).
238
+ type: integer
239
+ c_cont_timestamp:
240
+ description: Current content — internal timestamp.
241
+ type: integer
242
+ p_cont_size:
243
+ description: Pending content — file size in bytes.
244
+ type: integer
245
+ p_cont_csum:
246
+ description: Pending content — checksum.
247
+ type: string
248
+ p_cont_mtime:
249
+ description: Pending content — modification time (epoch).
250
+ type: integer
251
+ p_cont_timestamp:
252
+ description: Pending content — internal timestamp.
253
+ type: integer
254
+ f_meta_type:
255
+ description: Filesystem metadata — file type.
256
+ type: integer
257
+ f_meta_parentrid:
258
+ description: Filesystem metadata — parent record ID.
259
+ type: integer
260
+ f_meta_path:
261
+ description: Filesystem metadata — file path as seen on disk (displayed by `file_info`).
262
+ type: string
263
+ f_meta_attrs:
264
+ description: Filesystem metadata — file attributes.
265
+ type: string
266
+ f_meta_uid:
267
+ description: Filesystem metadata — user ID (Unix).
268
+ type: integer
269
+ f_meta_gid:
270
+ description: Filesystem metadata — group ID (Unix).
271
+ type: integer
272
+ f_meta_mtime:
273
+ description: Filesystem metadata — modification time (epoch).
274
+ type: integer
275
+ f_meta_atime:
276
+ description: Filesystem metadata — access time (epoch).
277
+ type: integer
278
+ f_meta_ctime:
279
+ description: Filesystem metadata — change time (epoch).
280
+ type: integer
281
+ f_meta_xattrs:
282
+ description: Filesystem metadata — extended attributes (not used).
283
+ type: integer
284
+ f_meta_xattrs_cksum:
285
+ description: Filesystem metadata — checksum of extended attributes.
286
+ type: string
287
+ f_meta_ol_legal_hold:
288
+ description: Filesystem metadata — object lock legal hold flag.
289
+ type: integer
290
+ f_meta_ol_mode:
291
+ description: Filesystem metadata — object lock mode.
292
+ type: integer
293
+ f_meta_ol_retain_until:
294
+ description: Filesystem metadata — object lock retain-until date (epoch).
295
+ type: integer
296
+ f_meta_object_metadata:
297
+ description: Filesystem metadata — object metadata (JSON).
298
+ type: string
299
+ f_cont_size:
300
+ description: Filesystem content — file size in bytes.
301
+ type: integer
302
+ f_cont_csum:
303
+ description: Filesystem content — checksum.
304
+ type: string
305
+ f_cont_mtime:
306
+ description: Filesystem content — modification time (epoch).
307
+ type: integer
308
+ f_cont_timestamp:
309
+ description: Filesystem content — internal timestamp.
310
+ type: integer
311
+ pcr_reqno:
312
+ description: Peer content request sequence number.
313
+ type: integer
314
+ pp_cont_size:
315
+ description: Peer pending content — file size in bytes.
316
+ type: integer
317
+ pp_cont_csum:
318
+ description: Peer pending content — checksum.
319
+ type: string
320
+ pp_cont_mtime:
321
+ description: Peer pending content — modification time (epoch).
322
+ type: integer
323
+ pp_cont_timestamp:
324
+ description: Peer pending content — internal timestamp.
325
+ type: integer
326
+ tobe_deleted:
327
+ description: Set to 1 when the record is flagged for deletion (garbage collection pending).
328
+ type: integer
329
+ scn_not_visited:
330
+ description: Set to 1 when the scanner has not yet visited this entry in the current scan pass.
331
+ type: integer
332
+ scn_required:
333
+ description: Set to 1 when a rescan of this entry is required.
334
+ type: integer
335
+ scn_completed:
336
+ description: Set to 1 when the scan of this directory entry has completed.
337
+ type: integer
338
+ candidate_in_prog:
339
+ description: Set to 1 when this record is currently in the candidate transfer list.
340
+ type: integer
341
+ meta_lastreq_no:
342
+ description: Sequence number of the last metadata request sent.
343
+ type: integer
344
+ meta_lastresp_no:
345
+ description: Sequence number of the last metadata response received.
346
+ type: integer
347
+ commit_version:
348
+ description: Local commit version for this entry.
349
+ type: integer
350
+ peer_commit_version:
351
+ description: Peer commit version for this entry.
352
+ type: integer
353
+ peer_nodeid:
354
+ description: Peer filesystem node ID.
355
+ type: integer
356
+ recursive_mtime:
357
+ description: Most recent modification time across all descendants (directories only).
358
+ type: integer
359
+ message:
360
+ description: Error or status message associated with this entry.
361
+ type: string
@@ -24,7 +24,7 @@ module Aspera
24
24
  Aspera.assert_type(current, Hash){'schema'}
25
25
  if current.key?('$ref')
26
26
  ref = current['$ref']
27
- Aspera.assert(ref.start_with?('#/'))
27
+ Aspera.assert(ref.start_with?('#/')){"schema $ref must start with '#/': #{ref}"}
28
28
  current = @root.dig(*ref[2..].split('/'))
29
29
  end
30
30
  end
@@ -7,6 +7,9 @@ require 'aspera/schema/reader'
7
7
  module Aspera
8
8
  # base class for plugins modules
9
9
  module Schema
10
+ # @!method self.instance
11
+ # Returns the singleton instance of Registry
12
+ # @return [Registry] the singleton instance
10
13
  class Registry
11
14
  include Singleton
12
15
 
@@ -15,18 +18,21 @@ module Aspera
15
18
  LOCATIONS.key?(sym)
16
19
  end
17
20
 
21
+ # Get path to request body, no check if it exists
22
+ # @return [String] path to request body
18
23
  def req_body(component, endpoint)
19
24
  "#{component}:paths./#{endpoint}.requestBody.content.application/json.schema"
20
25
  end
21
26
  end
22
27
 
23
28
  LOCATIONS = {
24
- spec: 'aspera/transfer/spec.schema.yaml',
25
- args: 'aspera/sync/args.schema.yaml',
26
- conf: 'aspera/sync/conf.schema.yaml',
27
- opts: 'aspera/cli/options.schema.yaml',
28
- aoc: 'aspera/schema/IBM Aspera on Cloud API-0.2.6-enhanced.yaml',
29
- faspex: 'aspera/schema/IBM Aspera Faspex API-5.0-enhanced.yaml'
29
+ spec: 'aspera/transfer/spec.schema.yaml',
30
+ args: 'aspera/sync/args.schema.yaml',
31
+ conf: 'aspera/sync/conf.schema.yaml',
32
+ opts: 'aspera/cli/options.schema.yaml',
33
+ aoc: 'aspera/schema/IBM Aspera on Cloud API-0.2.6-enhanced.yaml',
34
+ faspex: 'aspera/schema/IBM Aspera Faspex API-5.0-enhanced.yaml',
35
+ async_tables: 'aspera/schema/async_tables.yaml'
30
36
  }
31
37
 
32
38
  OPTIONS = 'opts'
@@ -35,6 +41,7 @@ module Aspera
35
41
  SYNC_ARGS = 'args'
36
42
  AOC = 'aoc'
37
43
  FASPEX = 'faspex'
44
+ ASYNC_TABLES = 'async_tables'
38
45
  TRANSFER_INFO = "#{OPTIONS}:components.schemas.TransferInfo"
39
46
 
40
47
  REQ_BODY = '.requestBody.content.application/json.schema'
@@ -6,6 +6,10 @@ require 'singleton'
6
6
 
7
7
  module Aspera
8
8
  # remove secret from logs and output
9
+ #
10
+ # @!method self.instance
11
+ # Returns the singleton instance of SecretHider
12
+ # @return [SecretHider] the singleton instance
9
13
  class SecretHider
10
14
  include Singleton
11
15
 
@@ -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
@@ -89,7 +89,7 @@ module Aspera
89
89
  def start(sync_info, opt_ts = nil)
90
90
  Log.dump(:sync_params_initial, sync_info)
91
91
  Aspera.assert_type(sync_info, Hash)
92
- 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)
93
93
  env_args = {
94
94
  args: [],
95
95
  env: {}
@@ -145,7 +145,7 @@ module Aspera
145
145
  end
146
146
  sync_info['sessions'].each do |session_params|
147
147
  Aspera.assert_type(session_params, Hash)
148
- 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')
149
149
  session_builder = CommandLineBuilder.new(session_params, ARGS_SESSION_SCHEMA, CommandLineConverter)
150
150
  session_builder.process_params
151
151
  session_builder.add_env_args(env_args)
@@ -177,7 +177,7 @@ module Aspera
177
177
  # @param sync_info [Hash] sync parameters in conf or args format
178
178
  # @return [Hash] parsed output of asyncadmin
179
179
  def admin_status(sync_info)
180
- 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)
181
181
  arguments = [ASYNC_ADMIN_EXECUTABLE, '--quiet']
182
182
  if sync_info.key?('local')
183
183
  # `conf` format
@@ -209,7 +209,7 @@ module Aspera
209
209
  # @param sync_info [Hash] sync parameters in conf or args format
210
210
  # @return [String, nil] Path to "local DB dir", i.e. folder that contains folders that contain `snap.db`
211
211
  def local_db_folder(sync_info)
212
- 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)
213
213
  if sync_info.key?('local')
214
214
  # `conf` format
215
215
  if sync_info.key?('local_db_dir')
@@ -234,7 +234,7 @@ module Aspera
234
234
  end
235
235
 
236
236
  def session_name(sync_info)
237
- 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)
238
238
  if sync_info.key?('local')
239
239
  # `conf` format
240
240
  return sync_info['name']
@@ -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
 
@@ -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)
@@ -34,7 +34,7 @@ module Aspera
34
34
  #
35
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
@@ -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
data.tar.gz.sig CHANGED
Binary file