aspera-cli 4.0.0.pre1
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 +7 -0
- data/README.md +3592 -0
- data/bin/ascli +7 -0
- data/bin/asession +89 -0
- data/docs/Makefile +59 -0
- data/docs/README.erb.md +3012 -0
- data/docs/README.md +13 -0
- data/docs/diagrams.txt +49 -0
- data/docs/secrets.make +38 -0
- data/docs/test_env.conf +117 -0
- data/docs/transfer_spec.html +99 -0
- data/examples/aoc.rb +17 -0
- data/examples/proxy.pac +60 -0
- data/examples/transfer.rb +115 -0
- data/lib/aspera/api_detector.rb +60 -0
- data/lib/aspera/ascmd.rb +151 -0
- data/lib/aspera/ats_api.rb +43 -0
- data/lib/aspera/cli/basic_auth_plugin.rb +38 -0
- data/lib/aspera/cli/extended_value.rb +88 -0
- data/lib/aspera/cli/formater.rb +238 -0
- data/lib/aspera/cli/listener/line_dump.rb +17 -0
- data/lib/aspera/cli/listener/logger.rb +20 -0
- data/lib/aspera/cli/listener/progress.rb +52 -0
- data/lib/aspera/cli/listener/progress_multi.rb +91 -0
- data/lib/aspera/cli/main.rb +304 -0
- data/lib/aspera/cli/manager.rb +440 -0
- data/lib/aspera/cli/plugin.rb +90 -0
- data/lib/aspera/cli/plugins/alee.rb +24 -0
- data/lib/aspera/cli/plugins/ats.rb +231 -0
- data/lib/aspera/cli/plugins/bss.rb +71 -0
- data/lib/aspera/cli/plugins/config.rb +806 -0
- data/lib/aspera/cli/plugins/console.rb +62 -0
- data/lib/aspera/cli/plugins/cos.rb +106 -0
- data/lib/aspera/cli/plugins/faspex.rb +377 -0
- data/lib/aspera/cli/plugins/faspex5.rb +93 -0
- data/lib/aspera/cli/plugins/node.rb +438 -0
- data/lib/aspera/cli/plugins/oncloud.rb +937 -0
- data/lib/aspera/cli/plugins/orchestrator.rb +169 -0
- data/lib/aspera/cli/plugins/preview.rb +464 -0
- data/lib/aspera/cli/plugins/server.rb +216 -0
- data/lib/aspera/cli/plugins/shares.rb +63 -0
- data/lib/aspera/cli/plugins/shares2.rb +114 -0
- data/lib/aspera/cli/plugins/sync.rb +65 -0
- data/lib/aspera/cli/plugins/xnode.rb +115 -0
- data/lib/aspera/cli/transfer_agent.rb +251 -0
- data/lib/aspera/cli/version.rb +5 -0
- data/lib/aspera/colors.rb +39 -0
- data/lib/aspera/command_line_builder.rb +137 -0
- data/lib/aspera/fasp/aoc.rb +24 -0
- data/lib/aspera/fasp/connect.rb +99 -0
- data/lib/aspera/fasp/error.rb +21 -0
- data/lib/aspera/fasp/error_info.rb +60 -0
- data/lib/aspera/fasp/http_gw.rb +81 -0
- data/lib/aspera/fasp/installation.rb +240 -0
- data/lib/aspera/fasp/listener.rb +11 -0
- data/lib/aspera/fasp/local.rb +377 -0
- data/lib/aspera/fasp/manager.rb +69 -0
- data/lib/aspera/fasp/node.rb +88 -0
- data/lib/aspera/fasp/parameters.rb +235 -0
- data/lib/aspera/fasp/resume_policy.rb +76 -0
- data/lib/aspera/fasp/uri.rb +51 -0
- data/lib/aspera/faspex_gw.rb +196 -0
- data/lib/aspera/hash_ext.rb +28 -0
- data/lib/aspera/log.rb +80 -0
- data/lib/aspera/nagios.rb +71 -0
- data/lib/aspera/node.rb +14 -0
- data/lib/aspera/oauth.rb +319 -0
- data/lib/aspera/on_cloud.rb +421 -0
- data/lib/aspera/open_application.rb +72 -0
- data/lib/aspera/persistency_action_once.rb +42 -0
- data/lib/aspera/persistency_folder.rb +91 -0
- data/lib/aspera/preview/file_types.rb +300 -0
- data/lib/aspera/preview/generator.rb +258 -0
- data/lib/aspera/preview/image_error.png +0 -0
- data/lib/aspera/preview/options.rb +35 -0
- data/lib/aspera/preview/utils.rb +131 -0
- data/lib/aspera/preview/video_error.png +0 -0
- data/lib/aspera/proxy_auto_config.erb.js +287 -0
- data/lib/aspera/proxy_auto_config.rb +34 -0
- data/lib/aspera/rest.rb +296 -0
- data/lib/aspera/rest_call_error.rb +13 -0
- data/lib/aspera/rest_error_analyzer.rb +98 -0
- data/lib/aspera/rest_errors_aspera.rb +58 -0
- data/lib/aspera/ssh.rb +53 -0
- data/lib/aspera/sync.rb +82 -0
- data/lib/aspera/temp_file_manager.rb +37 -0
- data/lib/aspera/uri_reader.rb +25 -0
- metadata +288 -0
data/docs/README.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
docs/README.erb.md uses markdown format with embeded ruby macros (erb)
|
2
|
+
|
3
|
+
/README.md is generated after compilation of README.erb.md
|
4
|
+
|
5
|
+
docs/README.erb.md contains the following macros:
|
6
|
+
|
7
|
+
* `<%=cmd%>` just the command line tool name
|
8
|
+
* `<%=tool%>` the tool name in courrier to be included in text paragraphs
|
9
|
+
* `<%=evp%>` env var prefix
|
10
|
+
* `<%=opprst%>` option preset
|
11
|
+
* `<%=prst%>` link to preset section, name and link to preset
|
12
|
+
* `<%=prstt%>` preset in title
|
13
|
+
|
data/docs/diagrams.txt
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
|
2
|
+
The following section contains the diagrams posted on support KB.
|
3
|
+
mde with: https://www.websequencediagrams.com/
|
4
|
+
|
5
|
+
|
6
|
+
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
7
|
+
title general Aspera Files APIs use
|
8
|
+
Client->+Files API: GET authorization(parameters)
|
9
|
+
Files API-->-Client: Result=Bearer token
|
10
|
+
Client-->Files API: use APIs with Authorization=Bearer
|
11
|
+
|
12
|
+
|
13
|
+
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
14
|
+
title basic OAuth with grant_type=password (username/password, only local users, not google, SAML)
|
15
|
+
Client->+Files API: GET authorization(username/password)
|
16
|
+
Files API-->-Client: Result=Bearer token
|
17
|
+
Client-->Files API: use APIs with Authorization=Bearer
|
18
|
+
|
19
|
+
|
20
|
+
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
21
|
+
title OAuth with grant_type=code (any user: local users, google, SAML)
|
22
|
+
note right of Client
|
23
|
+
* Client is registered in "Files", with redirect_uri
|
24
|
+
* Files generates client_id and secret
|
25
|
+
* Listen on "redirect_uri" end point (TCP port)
|
26
|
+
* build "login address" for user:
|
27
|
+
api.asperafiles.com/oauth2/<org>/authorize
|
28
|
+
* open a browser for user with this URL
|
29
|
+
end note
|
30
|
+
Client->*Local Port: listen
|
31
|
+
Client->Browser: open login url in browser (give redirect_uri and scope)
|
32
|
+
Browser->Files: load login page
|
33
|
+
note right of Browser: user clicks on "google auth"
|
34
|
+
Browser->+Google: display google login page
|
35
|
+
note right of Browser: user authenticates
|
36
|
+
Google-->-Browser: browser is redirected to the "redirect URI" providing a "code"
|
37
|
+
Browser->Local Port: browser provides code to client
|
38
|
+
Local Port-->Client: read code
|
39
|
+
Client->Local Port: close
|
40
|
+
destroy Local Port
|
41
|
+
note right of Client: close listening port after use
|
42
|
+
Client->+Files: GET oauth/token(grant_type=code)
|
43
|
+
Files-->-Client: Bearer token
|
44
|
+
Client-->Files API: use APIs with Authorization=Bearer
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
|
data/docs/secrets.make
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
# Private data for test systems
|
2
|
+
# Do not share, github contains only empty values
|
3
|
+
# fill this file and place in folder "local"
|
4
|
+
|
5
|
+
|
6
|
+
# Incoming asset processing
|
7
|
+
|
8
|
+
# received package public link : https://sedemo.ibmaspera.com/packages/public/receive?token=_value_here_
|
9
|
+
CF_AOC_PUBLINK_RECV_PACKAGE=_value_here_
|
10
|
+
# shared inbox public link: https://aspera.pub/xxxxxxx
|
11
|
+
CF_AOC_PUBLINK_SEND_DROPBOX=_value_here_
|
12
|
+
# public link to send package to user: https://aspera.pub/xxxxxx
|
13
|
+
CF_AOC_PUBLINK_SEND_USER=_value_here_
|
14
|
+
# public link to send files to user's shared folder: https://aspera.pub/xxxxxx
|
15
|
+
CF_AOC_PUBLINK_FOLDER=_value_here_
|
16
|
+
# workspace with shared inbox
|
17
|
+
CF_AOC_SH_BX_WS=_value_here_
|
18
|
+
# name of shared inbox in this workspace
|
19
|
+
CF_AOC_SH_BX_NAME=_value_here_
|
20
|
+
# name of node to test "node resource"
|
21
|
+
CF_AOC_NODE1_NAME=_value_here_
|
22
|
+
CF_AOC_NODE1_SECRET=_value_here_
|
23
|
+
|
24
|
+
|
25
|
+
CF_AWS_ACCESS_KEY=_value_here_
|
26
|
+
CF_AWS_SECRET_KEY=_value_here_
|
27
|
+
CF_AWS_BUCKET=_value_here_
|
28
|
+
CF_AWS_REGION=_value_here_
|
29
|
+
|
30
|
+
CF_ICOS_AK_ID=_value_here_
|
31
|
+
CF_ICOS_SECRET_AK=_value_here_
|
32
|
+
CF_ICOS_BUCKET=_value_here_
|
33
|
+
CF_ICOS_REGION=_value_here_
|
34
|
+
|
35
|
+
CF_EMAIL_ADDR=_value_here_
|
36
|
+
CF_AOC_EXTERNAL_EMAIL=_value_here_
|
37
|
+
CF_AOC_ORG=_value_here_
|
38
|
+
CF_AOC_USER=_value_here_
|
data/docs/test_env.conf
ADDED
@@ -0,0 +1,117 @@
|
|
1
|
+
---
|
2
|
+
config:
|
3
|
+
version: 4.0.0.pre1
|
4
|
+
default:
|
5
|
+
config: cli_default
|
6
|
+
oncloud: tst_oncloud
|
7
|
+
faspex: tst_faspex
|
8
|
+
faspex5: tst_faspex5
|
9
|
+
shares: tst_shares
|
10
|
+
shares2: tst_shares2
|
11
|
+
node: tst_node
|
12
|
+
server: tst_server
|
13
|
+
orchestrator: orch_eudemo
|
14
|
+
console: tst_console
|
15
|
+
preview: tst_ak_preview
|
16
|
+
ats: tst_ats
|
17
|
+
bss: tst_bss
|
18
|
+
cos: tst_cos
|
19
|
+
cli_default:
|
20
|
+
interactive: your value here
|
21
|
+
smtp: your value here
|
22
|
+
ascp_path: your value here
|
23
|
+
misc:
|
24
|
+
upload_folder: your value here
|
25
|
+
syncuser: your value here
|
26
|
+
faspex_publink_recv_from_fxuser: your value here
|
27
|
+
faspex_publink_send_to_fxuser: your value here
|
28
|
+
faspex_publink_send_to_dropbox: your value here
|
29
|
+
shares_upload: your value here
|
30
|
+
orch_workflow_id: your value here
|
31
|
+
file_dcm: your value here
|
32
|
+
file_pdf: your value here
|
33
|
+
file_docx: your value here
|
34
|
+
file_mxf: your value here
|
35
|
+
local_user:
|
36
|
+
ssh_keys: your value here
|
37
|
+
smtp_config:
|
38
|
+
server: your value here
|
39
|
+
port: your value here
|
40
|
+
domain: your value here
|
41
|
+
tls: your value here
|
42
|
+
from_email: your value here
|
43
|
+
from_name: your value here
|
44
|
+
username: your value here
|
45
|
+
password: your value here
|
46
|
+
tst_oncloud:
|
47
|
+
url: your value here
|
48
|
+
username: your value here
|
49
|
+
auth: your value here
|
50
|
+
private_key: your value here
|
51
|
+
tst_faspex:
|
52
|
+
url: your value here
|
53
|
+
username: your value here
|
54
|
+
password: your value here
|
55
|
+
storage: your value here
|
56
|
+
tst_hstsfaspex_ssh:
|
57
|
+
url: your value here
|
58
|
+
username: your value here
|
59
|
+
tst_node_faspex:
|
60
|
+
url: your value here
|
61
|
+
username: your value here
|
62
|
+
password: your value here
|
63
|
+
tst_faspex5:
|
64
|
+
url: your value here
|
65
|
+
username: your value here
|
66
|
+
password: your value here
|
67
|
+
tst_shares:
|
68
|
+
url: your value here
|
69
|
+
username: your value here
|
70
|
+
password: your value here
|
71
|
+
tst_shares_1:
|
72
|
+
url: your value here
|
73
|
+
username: your value here
|
74
|
+
password: your value here
|
75
|
+
tst_shares2:
|
76
|
+
url: your value here
|
77
|
+
username: your value here
|
78
|
+
password: your value here
|
79
|
+
tst_node:
|
80
|
+
url: your value here
|
81
|
+
username: your value here
|
82
|
+
password: your value here
|
83
|
+
tst_console:
|
84
|
+
url: your value here
|
85
|
+
username: your value here
|
86
|
+
password: your value here
|
87
|
+
tst_server:
|
88
|
+
url: your value here
|
89
|
+
username: your value here
|
90
|
+
password: your value here
|
91
|
+
tst_server_bykey:
|
92
|
+
url: your value here
|
93
|
+
username: your value here
|
94
|
+
orch_eudemo:
|
95
|
+
url: your value here
|
96
|
+
username: your value here
|
97
|
+
password: your value here
|
98
|
+
tst_ats:
|
99
|
+
ibm_api_key: your value here
|
100
|
+
ats_key: your value here
|
101
|
+
ats_secret: your value here
|
102
|
+
instance: your value here
|
103
|
+
tst_bss:
|
104
|
+
password: your value here
|
105
|
+
tst_ak_preview:
|
106
|
+
url: your value here
|
107
|
+
username: your value here
|
108
|
+
password: your value here
|
109
|
+
tst_node_preview:
|
110
|
+
url: your value here
|
111
|
+
username: your value here
|
112
|
+
password: your value here
|
113
|
+
tst_cos:
|
114
|
+
apikey: your value here
|
115
|
+
crn: your value here
|
116
|
+
bucket: your value here
|
117
|
+
endpoint: your value here
|
@@ -0,0 +1,99 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<title>Transfer Specification</title>
|
4
|
+
<style type="text/css">
|
5
|
+
table {border-collapse: collapse;}
|
6
|
+
table, th, td {border: 1px solid black;}
|
7
|
+
.yes {color:white;background-color:green;font-weight:bold;}
|
8
|
+
.no {color:white;background-color:red;font-weight:bold;}
|
9
|
+
</style>
|
10
|
+
</head>
|
11
|
+
<body>
|
12
|
+
<p>
|
13
|
+
Columns:
|
14
|
+
<ul>
|
15
|
+
<li>F=Fasp Manager(local FASP execution)</li>
|
16
|
+
<li>N=remote node(node API)</li>
|
17
|
+
<li>C=Connect Client(web plugin)</li>
|
18
|
+
</ul>
|
19
|
+
</p>
|
20
|
+
<p>
|
21
|
+
Req/Def : Required or default value (- means emty)
|
22
|
+
</p>
|
23
|
+
<p>
|
24
|
+
Fields with EX_ prefix are specific extensions to local mode.
|
25
|
+
</p>
|
26
|
+
<p>
|
27
|
+
arg: related ascp argument or env var suffix (PASS for ASPERA_SCP_PASS)
|
28
|
+
</p>
|
29
|
+
<p>
|
30
|
+
UNDER CONSTRUCTION<br/>
|
31
|
+
<a href="https://developer.ibm.com/api/view/aspera-prod:ibm-aspera:title-IBM_Aspera#id90944">Documentation→Node API→/opt/transfers</a><br/>
|
32
|
+
</p>
|
33
|
+
|
34
|
+
<table>
|
35
|
+
<tr><th>Field</th><th>Req/Def</th><th>Type</th><th>F</th><th>N</th><th>C</th><th>arg</th><th>Description</th></tr>
|
36
|
+
<tr><td>direction</td><td>Required</td><td>string</td><td class="yes">Y</td><td class="yes">Y</td><td class="yes">Y</td><td>--mode</td><td>Direction: "send" or "receive"</td></tr>
|
37
|
+
<tr><td>remote_host</td><td>Required</td><td>string</td><td class="yes">Y</td><td class="yes">Y</td><td class="yes">Y</td><td>--host</td><td>IP or fully qualified domain name of the remote server</td></tr>
|
38
|
+
<tr><td>remote_user</td><td>Required</td><td>string</td></td><td class="yes">Y</td><td class="yes">Y</td><td class="yes">Y</td><td>--user</td><td>Remote user. Default value is "xfer" on node or connect.</td></tr>
|
39
|
+
<tr><td>destination_root</td><td>Required</td><td>string</td><td class="yes">Y</td><td class="yes">Y</td><td class="yes">Y</td><td>last arg</td><td>Destination root directory.</td></tr>
|
40
|
+
<tr><td>title</td><td>-</td><td>string</td><td class="no">N</td><td class="yes">Y</td><td class="yes">Y</td><td>-</td><td>Title of the transfer</td></tr>
|
41
|
+
<tr><td>tags</td><td>-</td><td>hash</td><td class="yes">Y</td><td class="yes">Y</td><td class="yes">Y</td><td>--tags<br>--tags64</td><td>Metadata for transfer</td></tr>
|
42
|
+
<tr><td>token</td><td>-</td><td>string</td><td class="yes">Y</td><td class="yes">Y</td><td class="yes">Y</td><td>TOKEN<br/>-W</td><td>Authorization token: Bearer, Basic or ATM</td></tr>
|
43
|
+
<tr><td>cookie</td><td>-</td><td>string</td><td class="yes">Y</td><td class="yes">Y</td><td class="yes">Y</td><td>COOKIE</td><td>Metadata for transfer (older,string)</td></tr>
|
44
|
+
<tr><td>remote_access_key</td><td>TODO</td><td>string</td><td></td><td></td><td></td><td>?</td><td>Node only?</td></tr>
|
45
|
+
<tr><td>source_root</td><td>-</td><td>string</td><td></td><td></td><td></td><td>--source-prefix<br/>--source-prefix64</td><td>Source root directory.(TODO: verify option)</td></tr>
|
46
|
+
<tr><td>fasp_port</td><td>33001</td><td>integer</td></td><td class="yes">Y</td><td class="yes">Y</td><td class="yes">Y</td><td>-O</td><td>Specifies fasp (UDP) port.</td></tr>
|
47
|
+
<tr><td>ssh_port</td><td>22 or 33001</td><td>integer</td></td><td class="yes">Y</td><td class="yes">Y</td><td class="yes">Y</td><td>-P</td><td>Specifies ssh (TCP) port.</td></tr>
|
48
|
+
<tr><td>rate_policy</td><td>server config</td><td>string</td><td class="yes">Y</td><td class="yes">Y</td><td class="yes">Y</td><td>--policy</td><td>Valid literals include "low","fair","high" and "fixed".</td></tr>
|
49
|
+
<tr><td>symlink_policy</td><td>follow</td><td>string</td><td class="yes">Y</td><td class="yes">Y</td><td class="yes">Y</td><td>--symbolic-links</td><td>copy, follow, copy+force, skip. Default is follow. Handle source side symbolic links by following the link (follow), copying the link itself (copy), skipping (skip), or forcibly copying the link itself (copy+force).</td></tr>
|
50
|
+
<tr><td>target_rate_kbps</td><td>-</td><td>integer</td><td class="yes">Y</td><td class="yes">Y</td><td class="yes">Y</td><td>-l</td><td>Specifies desired speed for the transfer.</td></tr>
|
51
|
+
<tr><td>min_rate_kbps</td><td>0</td><td>integer</td><td class="yes">Y</td><td class="yes">Y</td><td class="yes">Y</td><td>-m</td><td>Set the minimum transfer rate in kilobits per second.</td></tr>
|
52
|
+
<tr><td>cipher</td><td>none</td><td>string</td><td class="yes">Y</td><td class="yes">Y</td><td class="yes">Y</td><td>-c</td><td>in transit encryption type.<br/>none, aes-128, aes-256</td></tr>
|
53
|
+
<tr><td>content_protection</td><td>encrypt<br/>decrypt</td><td>string</td><td></td><td></td><td></td><td>--file-crypt=</td><td>encryption at rest</td></tr>
|
54
|
+
<tr><td>content_protection_password</td><td>-</td><td>string</td><td></td><td></td><td></td><td>PASS</td><td>Specifies a string password.</td></tr>
|
55
|
+
<tr><td>overwrite</td><td>diff</td><td>string</td><td class="yes">Y</td><td class="yes">Y</td><td class="yes">Y</td><td>--overwrite</td><td>Overwrite destination files with the source files of the same name.<br/>never, always, diff, older, or diff+older</td></tr>
|
56
|
+
<tr><td>retry_duration</td><td></td><td>string</td><td></td><td></td><td></td><td>TODO</td><td>Specifies how long to wait before retrying transfer. (e.g. "5min")</td></tr>
|
57
|
+
<tr><td>http_fallback</td><td></td><td>bool (node), integer</td><td></td><td></td><td></td><td>-y<br/>TODO</td><td>When true(1), attempts to perform an HTTP transfer if a fasp transfer cannot be performed.</td></tr>
|
58
|
+
<tr><td>create_dir</td><td></td><td>boolean</td><td class="yes">Y</td><td class="yes">Y</td><td class="yes">Y</td><td>-d</td><td>Specifies whether to create new directories.</td></tr>
|
59
|
+
<tr><td>precalculate_job_size</td><td>srv. def.</td><td>boolean</td><td class="yes">Y</td><td class="yes">Y</td><td class="yes">Y</td><td>--precalculate-job-size</td><td>Specifies whether to precalculate the job size.</td></tr>
|
60
|
+
<tr><td>delete_source</td><td></td><td>boolean</td><td></td><td class="yes">Y</td><td></td><td>?</td><td>?</td></tr>
|
61
|
+
<tr><td>remove_after_transfer</td><td></td><td>boolean</td><td></td><td class="yes">Y</td><td></td><td>?</td><td>Specifies whether to remove file after transfer.</td></tr>
|
62
|
+
<tr><td>remove_empty_directories</td><td></td><td>boolean</td><td></td><td class="yes">Y</td><td></td><td>?</td><td>Specifies whether to remove empty directories.</td></tr>
|
63
|
+
<tr><td>multi_session</td><td>1</td><td>integer</td><td class="no">N</td><td class="yes">Y</td><td class="no">N</td><td>-C</td><td>Specifies how many parts the transfer is in.</td></tr>
|
64
|
+
<tr><td>multi_session_threshold</td><td>null</td><td>integer</td><td class="no">N</td><td class="yes">Y</td><td class="no">N</td><td>-</td><td>in bytes</td></tr>
|
65
|
+
<tr><td>exclude_newer_than</td><td></td><td>integer</td><td class="yes">Y</td><td></td><td></td><td>--exclude-newer-than</td><td>-</td></tr>
|
66
|
+
<tr><td>exclude_older_than</td><td></td><td>integer</td><td class="yes">Y</td><td></td><td></td><td>--exclude-older-than</td><td>-</td></tr>
|
67
|
+
<tr><td>preserve_acls</td><td></td><td>string</td><td class="yes">Y</td><td></td><td></td><td>--preserve-acls</td><td>-</td></tr>
|
68
|
+
<tr><td>dgram_size</td><td></td><td>integer</td><td class="yes">Y</td><td></td><td></td><td>-Z</td><td>in bytes</td></tr>
|
69
|
+
<tr><td>compression</td><td></td><td>integer</td><td></td><td></td><td></td><td></td><td>ascp4 only, 0 / 1?</td></tr>
|
70
|
+
<tr><td>read_threads</td><td></td><td>integer</td><td></td><td></td><td></td><td>-</td><td>ascp4 only</td></tr>
|
71
|
+
<tr><td>write_threads</td><td></td><td>integer</td><td></td><td></td><td></td><td>-</td><td>ascp4 only</td></tr>
|
72
|
+
<tr><td>use_ascp4</td><td>false</td><td>boolean</td><td></td><td class="yes">Y</td><td></td><td>-</td><td>specify version of protocol</td></tr>
|
73
|
+
<tr><td>paths</td><td>source files (dest)</td><td>array</td><td></td><td></td><td></td><td>positional<br/>--file-list<br/>--file-pair-list</td><td>Contains a path to the source (required) and a path to the destination.</td></tr>
|
74
|
+
<tr><td>http_fallback_port</td><td></td><td>integer</td><td class="yes">Y</td><td></td><td></td><td>-t</td><td>Specifies http port.</td></tr>
|
75
|
+
<tr><td>https_fallback_port</td><td></td><td>integer</td><td></td><td></td><td></td><td>todo</td><td>Specifies https port.</td></tr>
|
76
|
+
<tr><td>cipher_allowed</td><td></td><td>string</td><td></td><td></td><td></td><td>-</td><td>returned by node API. Valid literals include "aes-128" and "none".</td></tr>
|
77
|
+
<tr><td>target_rate_cap_kbps</td><td></td><td></td><td class="no">N</td><td class="no">?</td><td class="yes">?</td><td>-</td><td>Returned by upload/download_setup node api.</td></tr>
|
78
|
+
<tr><td>rate_policy_allowed</td><td></td><td></td><td></td><td></td><td></td><td>-</td><td>returned by node API. Specifies most aggressive rate policy that is allowed. Valid literals include "low", "fair","high" and "fixed".</td></tr>
|
79
|
+
<tr><td>ssh_private_key</td><td>-</td><td>string</td><td class="yes">Y</td><td class="no">N</td><td class="no">N</td><td>KEY</td><td>Private key used for SSH authentication, Shall look like: `-----BEGIN RSA PRIVATE KEY-----\nMII`<br/>Note the JSON encoding `\` + `n` for newlines.</td></tr>
|
80
|
+
<tr><td>remote_password</td><td>-</td><td>string</td><td class="yes">Y</td><td class="yes">Y</td><td class="yes">Y</td><td>PASS</td><td>SSH session password</td></tr>
|
81
|
+
<tr><td>resume_policy</td><td>faspmgr:<br/>none<br/>other:<br/>sparse_csum</td><td>string</td><td class="yes">Y</td><td class="yes">Y</td><td class="yes">Y</td><td>-k</td><td>none,attrs,sparse_csum,full_csum</td></tr>
|
82
|
+
<tr><td>authentication</td><td>-</td><td class="no">N</td><td class="no">N</td><td class="yes">Y</td><td>-</td><td>token: Aspera web keys are provided to allow transparent web based session initiation. on connect: password is not asked. Else, password is asked, and keys are not provided.</td></tr>
|
83
|
+
<tr><td>EX_ssh_key_paths</td><td>-</td><td>array</td><td class="yes">Y</td><td class="no">N</td><td class="no">N</td><td>-i</td><td>Use public key authentication and specify the private key file</td></tr>
|
84
|
+
<tr><td>EX_at_rest_password</td><td>-</td><td>string</td><td class="yes">Y</td><td class="no">N</td><td class="no">N</td><td>FILEPASS</td><td>Passphrase used for at rest encryption or decryption</td></tr>
|
85
|
+
<tr><td>EX_proxy_password</td><td>-</td><td>string</td><td class="yes">Y</td><td class="no">N</td><td class="no">N</td><td>PROXY_PASS</td><td>TODO</td></tr>
|
86
|
+
<tr><td>EX_fasp_proxy_url</td><td>-</td><td>string</td><td class="yes">Y</td><td class="no">N</td><td class="no">N</td><td>--proxy</td><td>Specify the address of the Aspera high-speed proxy server</td></tr>
|
87
|
+
<tr><td>EX_http_proxy_url</td><td>-</td><td>string</td><td class="yes">Y</td><td class="no">N</td><td class="no">N</td><td>-x</td><td>Specify the proxy server address used by HTTP Fallback</td></tr>
|
88
|
+
<tr><td>EX_ascp_args</td><td>-</td><td>array</td><td class="yes">Y</td><td class="no">N</td><td class="no">N</td><td>same</td><td>Add command line arguments to ascp</td></tr>
|
89
|
+
<tr><td>EX_http_transfer_jpeg</td><td>0</td><td>integer</td><td class="yes">Y</td><td class="no">N</td><td class="no">N</td><td>-j</td><td>HTTP transfers as JPEG file</td></tr>
|
90
|
+
<tr><td>EX_license_text</td><td>-</td><td>string</td><td class="yes">Y</td><td class="no">N</td><td class="no">N</td><td>LICENSE</td><td>license file text</td></tr>
|
91
|
+
<tr><td>EX_file_list</td><td>-</td><td>string</td><td class="yes">Y</td><td class="no">N</td><td class="no">N</td><td>--file-list</td><td>source file list</td></tr>
|
92
|
+
<tr><td>EX_file_pair_list</td><td>-</td><td>string</td><td class="yes">Y</td><td class="no">N</td><td class="no">N</td><td>--file-pair-list</td><td>source file pair list</td></tr>
|
93
|
+
<tr><td>EX_multi_session_part</td><td>-</td><td>string</td><td class="yes">Y</td><td class="no">N</td><td class="no">N</td><td>-C</td><td>part for multisession</td></tr>
|
94
|
+
<tr><td>EX_no_read</td><td>-</td><td>-</td><td class="yes">Y</td><td class="no">N</td><td class="no">N</td><td>--no-read</td><td>no read source</td></tr>
|
95
|
+
<tr><td>EX_no_write</td><td>-</td><td>-</td><td class="yes">Y</td><td class="no">N</td><td class="no">N</td><td>--no-write</td><td>no write estination</td></tr>
|
96
|
+
</table>
|
97
|
+
</body>
|
98
|
+
</html>
|
99
|
+
|
data/examples/aoc.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'aspera/on_cloud'
|
3
|
+
require 'aspera/log'
|
4
|
+
|
5
|
+
Aspera::Log.instance.level=:debug
|
6
|
+
|
7
|
+
aocapi=Aspera::OnCloud.new(
|
8
|
+
url: 'https://myorg.ibmaspera.com',
|
9
|
+
auth: :jwt,
|
10
|
+
private_key: File.read('path/to_your_private_key.pem'),
|
11
|
+
username: 'my.email@example.com',
|
12
|
+
scope: 'user:all',
|
13
|
+
subpath: 'api/v1')
|
14
|
+
|
15
|
+
self_user_data=aocapi.read('self')
|
16
|
+
|
17
|
+
Aspera::Log.dump('self',self_user_data)
|
data/examples/proxy.pac
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
/* demo proxy pac for Amelia */
|
2
|
+
function FindProxyForURL(url, host) {
|
3
|
+
/* Normalize the URL for pattern matching */
|
4
|
+
url = url.toLowerCase();
|
5
|
+
host = host.toLowerCase();
|
6
|
+
|
7
|
+
/* Don't proxy local hostnames */
|
8
|
+
if (isPlainHostName(host)) {
|
9
|
+
return 'DIRECT';
|
10
|
+
}
|
11
|
+
|
12
|
+
/* Don't proxy local domains */
|
13
|
+
if (dnsDomainIs(host, ".example1.com") || (host == "example1.com")
|
14
|
+
|| dnsDomainIs(host, ".example2.com") || (host == "example2.com")
|
15
|
+
|| dnsDomainIs(host, ".example3.com") || (host == "example3.com")) {
|
16
|
+
return 'DIRECT';
|
17
|
+
}
|
18
|
+
|
19
|
+
/* Don't proxy Windows Update */
|
20
|
+
if ((host == "download.microsoft.com")
|
21
|
+
|| (host == "ntservicepack.microsoft.com")
|
22
|
+
|| (host == "cdm.microsoft.com") || (host == "wustat.windows.com")
|
23
|
+
|| (host == "windowsupdate.microsoft.com")
|
24
|
+
|| (dnsDomainIs(host, ".windowsupdate.microsoft.com"))
|
25
|
+
|| (host == "update.microsoft.com")
|
26
|
+
|| (dnsDomainIs(host, ".update.microsoft.com"))
|
27
|
+
|| (dnsDomainIs(host, ".windowsupdate.com"))) {
|
28
|
+
return 'DIRECT';
|
29
|
+
}
|
30
|
+
|
31
|
+
if (isResolvable(host)) {
|
32
|
+
var hostIP = dnsResolve(host);
|
33
|
+
|
34
|
+
/* Don't proxy non-routable addresses (RFC 3330) */
|
35
|
+
if (isInNet(hostIP, '0.0.0.0', '255.0.0.0')
|
36
|
+
|| isInNet(hostIP, '10.0.0.0', '255.0.0.0')
|
37
|
+
|| isInNet(hostIP, '127.0.0.0', '255.0.0.0')
|
38
|
+
|| isInNet(hostIP, '169.254.0.0', '255.255.0.0')
|
39
|
+
|| isInNet(hostIP, '172.16.0.0', '255.240.0.0')
|
40
|
+
|| isInNet(hostIP, '192.0.2.0', '255.255.255.0')
|
41
|
+
|| isInNet(hostIP, '192.88.99.0', '255.255.255.0')
|
42
|
+
|| isInNet(hostIP, '192.168.0.0', '255.255.0.0')
|
43
|
+
|| isInNet(hostIP, '198.18.0.0', '255.254.0.0')
|
44
|
+
|| isInNet(hostIP, '224.0.0.0', '240.0.0.0')
|
45
|
+
|| isInNet(hostIP, '240.0.0.0', '240.0.0.0')) {
|
46
|
+
return 'DIRECT';
|
47
|
+
}
|
48
|
+
}
|
49
|
+
|
50
|
+
if (url.substring(0, 5) == 'http:' || url.substring(0, 6) == 'https:'
|
51
|
+
|| url.substring(0, 4) == 'ftp:') {
|
52
|
+
return 'PROXY proxy.example.com:8080';
|
53
|
+
}
|
54
|
+
|
55
|
+
if (url.substring(0, 4) == 'ssh:') {
|
56
|
+
return 'PROXY proxy.aspera.com:9092';
|
57
|
+
}
|
58
|
+
|
59
|
+
return 'DIRECT';
|
60
|
+
}
|
@@ -0,0 +1,115 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# Example: transfer a file using one of the provided transfer agents
|
3
|
+
|
4
|
+
require 'aspera/fasp/local'
|
5
|
+
require 'aspera/fasp/listener'
|
6
|
+
require 'aspera/fasp/installation'
|
7
|
+
require 'aspera/log'
|
8
|
+
require 'aspera/rest'
|
9
|
+
require 'aspera/rest_errors_aspera'
|
10
|
+
require 'json'
|
11
|
+
|
12
|
+
tmpdir=ENV['tmp'] || '.'
|
13
|
+
|
14
|
+
##############################################################
|
15
|
+
# generic initialisation : configuration of FaspManager
|
16
|
+
|
17
|
+
# set trace level for sample, set to :debug to see complete list of debug information
|
18
|
+
Aspera::Log.instance.level=:debug
|
19
|
+
|
20
|
+
# set path to your copy of ascp binary
|
21
|
+
Aspera::Fasp::Installation.instance.ascp_path=ENV['ascp'] || '/Library/aspera/bin/ascp'
|
22
|
+
# some required files are generated here (keys, certs)
|
23
|
+
Aspera::Fasp::Installation.instance.config_folder = tmpdir
|
24
|
+
|
25
|
+
# register aspera REST call error handlers
|
26
|
+
Aspera::RestErrorsAspera.registerHandlers
|
27
|
+
|
28
|
+
# another way is to detect installed products and use one of them
|
29
|
+
#Aspera::Fasp::Installation.instance.installed_products.each{|p|puts("found: #{p[:name]}")}
|
30
|
+
#Aspera::Fasp::Installation.instance.use_ascp_from_product('Aspera Connect')
|
31
|
+
|
32
|
+
# get FASP Manager singleton based on above ascp location
|
33
|
+
fasp_manager=Aspera::Fasp::Local.new
|
34
|
+
|
35
|
+
# Note that it would also be possible to start transfers using other agents
|
36
|
+
#require 'aspera/fasp/connect'
|
37
|
+
#fasp_manager=Aspera::Fasp::Connect.new
|
38
|
+
#require 'aspera/fasp/node'
|
39
|
+
#fasp_manager=Aspera::Fasp::Node.new(Aspera::Rest.new(...))
|
40
|
+
|
41
|
+
##############################################################
|
42
|
+
# Optional : register an event listener
|
43
|
+
|
44
|
+
# example of event listener that displays events on stdout
|
45
|
+
class MyListener < Aspera::Fasp::Listener
|
46
|
+
# this is the callback called during transfers, here we only display the received information
|
47
|
+
# but it could be used to get detailed error information, check "type" field is "ERROR"
|
48
|
+
def event_enhanced(data);STDOUT.puts(JSON.generate(data));STDOUT.flush;end
|
49
|
+
end
|
50
|
+
|
51
|
+
# register the sample listener to display events
|
52
|
+
fasp_manager.add_listener(MyListener.new)
|
53
|
+
|
54
|
+
##############################################################
|
55
|
+
# first example: download by SSH credentials
|
56
|
+
|
57
|
+
# manually build teansfer spec
|
58
|
+
transfer_spec={
|
59
|
+
#'remote_host' =>'demo.asperasoft.com',
|
60
|
+
'remote_host' =>'eudemo.asperademo.com',
|
61
|
+
'remote_user' =>'asperaweb',
|
62
|
+
'remote_password' =>'demoaspera',
|
63
|
+
'direction' =>'receive',
|
64
|
+
'ssh_port' =>33001,
|
65
|
+
'destination_root'=>tmpdir,
|
66
|
+
'paths' =>[{'source'=>'aspera-test-dir-tiny/200KB.1'}]
|
67
|
+
}
|
68
|
+
# start transfer in separate thread
|
69
|
+
# method returns as soon as transfer thread is created
|
70
|
+
# it des not wait for completion, or even for session startup
|
71
|
+
fasp_manager.start_transfer(transfer_spec)
|
72
|
+
|
73
|
+
# optional: helper method: wait for completion of transfers
|
74
|
+
# here we started a single transfer session (no multisession parameter)
|
75
|
+
# get array of status, one for each session (so, a single value array)
|
76
|
+
# each status is either :success or "error message"
|
77
|
+
transfer_result=fasp_manager.wait_for_transfers_completion
|
78
|
+
STDOUT.puts(JSON.generate(transfer_result))
|
79
|
+
# get list of errors only
|
80
|
+
errors=transfer_result.select{|i|!i.eql?(:success)}
|
81
|
+
# the transfer was not success, as there is at least one error
|
82
|
+
raise "Error(s) occured: #{errors.join(',')}" if !errors.empty?
|
83
|
+
|
84
|
+
##############################################################
|
85
|
+
# second example: upload with node authorization
|
86
|
+
|
87
|
+
# create rest client for Node API on a public demo system, using public demo credentials
|
88
|
+
node_api=Aspera::Rest.new({
|
89
|
+
:base_url => 'https://eudemo.asperademo.com:9092',
|
90
|
+
:auth => {
|
91
|
+
:type => :basic,
|
92
|
+
:username => 'node_asperaweb',
|
93
|
+
:password => 'demoaspera'
|
94
|
+
}})
|
95
|
+
# define sample file(s) and destination folder
|
96
|
+
sources=["#{tmpdir}/sample_file.txt"]
|
97
|
+
destination='/Upload'
|
98
|
+
# create sample file(s)
|
99
|
+
sources.each{|p|File.write(p,"Hello World!")}
|
100
|
+
# request transfer authorization to node for a single transfer (This is a node api v3 call)
|
101
|
+
send_result=node_api.create('files/upload_setup',{ :transfer_requests => [ { :transfer_request => { :paths => [ { :destination => destination } ] } } ] } )[:data]
|
102
|
+
# we normally have only one transfer spec in list, so just get the first transfer_spec
|
103
|
+
transfer_spec=send_result['transfer_specs'].first['transfer_spec']
|
104
|
+
# add list of files to upload
|
105
|
+
transfer_spec['paths']=sources.map{|p|{'source'=>p}}
|
106
|
+
# set authentication type to "token" (will trigger use of bypass SSH key)
|
107
|
+
transfer_spec['authentication']='token'
|
108
|
+
# from here : same as example 1
|
109
|
+
fasp_manager.start_transfer(transfer_spec)
|
110
|
+
# optional: wait for transfer completion helper function to get events
|
111
|
+
transfer_result=fasp_manager.wait_for_transfers_completion
|
112
|
+
errors=transfer_result.select{|i|!i.eql?(:success)}
|
113
|
+
# the transfer was not success, as there is at least one error
|
114
|
+
raise "Error(s) occured: #{errors.join(',')}" if !errors.empty?
|
115
|
+
|