How to initiate transfer to ATS from a Node API

Summary
This article describes how to transfer from an On Demand Node API to ATS.

 

Details - Transfer Authorization

Step 1: Query /files/upload_setup on ATS to get a valid token

  1. Use your Access Key.

Step 2: Query /ops/transfers on SHOD to initiate a transfer

  1. Use Node API user to initiate.
  2. The payload should include the token from step #1

 

Example 1 - Transfer Authorization

Query Node API on ATS for transfer auth

  1. Key: KGKCI0Va5Ljr9DOA-Feddf-X
  2. Secret: pZ1ak3oAK4wSEQD3eVIGILfZl7R4g4QYK0W7ZKi8cPWs
  3. URL: ats-aws-us-east-1.aspera.io
  4. REST API:   https://ats-aws-us-east-1.aspera.io/files/upload_setup

JSON Payload:

{
 "transfer_requests": [
   {
     "transfer_request": {
      "create_dir": true,
      "overwrite": "always",
       "destination_root": "/TEST/",
      "paths": [
         {
           "source": "/100MB"
         }
       ]
     }
   }
 ]
}

Full response (token bolded):

 "transfer_specs": [
   {
     "transfer_spec": {
       "paths": [
         {
           "source": "/100MB"
         }
       ],
       "source_root": "",
       "destination_root": "/TEST/",
       "token": "ATB3_AEAmtYyLJqPYNQh82tadrL2R-icJv5oTrMODut9xCyqb-ajWDfSHpsWFPWCh5501z4bAAGO3TN3AX2TOuB7Ob_s7xE1_3BTA",
       "direction": "send",
       "cipher": "aes-128",
       "tags": null,
       "rate_policy_allowed": "fixed",
       "rate_policy": "fair",
       "target_rate_kbps": 10000,
       "min_rate_kbps": 0,
       "create_dir": true,
       "remote_host": "ats-aws-us-east-1.aspera.io",
      "remote_user": "xfer",
       "sshfp": null,
       "ssh_port": 33001,
       "fasp_port": 33001,
       "http_fallback": true,
       "http_fallback_port": 8443
     }
   }
 ]
}

POST to Node API on SHOD to initiate transfer

  • Node user:  xfer2
  • Node password:  aspera
  • Path to file:  /100MB
  • Destination path: “/TEST/”
  • REST API:  https://shod.demo.asperacloud.org:9092/ops/transfers

Valid JSON:

{
    "remote_host": "ats-aws-us-east-1.aspera.io",
    "remote_user": "xfer",
        "token": "ATB3_AEAmtYyLJqPYNQh82tadrL2R-icJv5oTrMODut9xCyqb-ajWDfSHpsWFPWCh5501z4bAAGO3TN3AX2TOuB7Ob_s7xE1_3BTA",
     "overwrite": "always",
     "target_rate_kbps": 3000,
    "destination_root": "/TEST/",
     "direction": "send",
     "paths": [
       {
           "source": "/100MB"
       }
    ]
}

Curl Command (assuming that you named your payload ats.json):

curl -ki -u xfer2:aspera -d @ats.json https://shod.demo.asperacloud.org:9092/ops/transfers

Appendix  - Other Transfer payload examples
Upload setup request for  transfer and rename

{
 "transfer_requests": [
   {
     "transfer_request": {
      "create_dir": true,
      "overwrite": "always",
      "cookie": "aspera.atp:Genomes:ATS:jay",
      "paths": [
         {
           "source": "/100MB/",
           "destination": "/NewName-100MB"
         }
       ]
     }
   }
 ]
}
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk