Data ingestion examples

Use the following example steps for data ingestion in the following scenarios.

  1. Standard REST client step: Get proper authentication token from the Authentication URL using proper credentials to authorize on further requests.
  2. Standard REST client step: Using token obtained in the previous step perform PUT, POST, DELETE, COPY (object only), HEAD operations for objects under container created with unified file and object access storage policy.
  3. Standard file client step: Mount SMB or NFS exports on respective NFS or SMB clients with regular mount commands or interface available with file clients. For example:
    mount -t cifs -o username=STORAGE5TEST\\fileuser1,password=Passw0rd5,vers=3.0 //192.0.2.4/unified_access /mnt/unified_access

Data ingestion using curl

In the following data ingestion example steps performed using curl, this setup is assumed:

  1. Obtain the auth token using the following command:
    curl -s -i -H "Content-Type: application/json" 
    -d '{ "auth": {"identity": {"methods": ["password"],"password": {"user": {"name": "fileuser","domain": 
    { "name": "Default" },"password": "Passw0rd6"}}},"scope": {"project": {"name": "admin","domain": { "name": "Default" }}}}}' 
    http://specscaleswift.example.com:35357/v3/auth/tokens

    The auth token obtained in this step is stored in the $AUTH_TOKEN variable.

  2. Obtain the project list using the following command:
    curl -s -H "X-Auth-Token:  $AUTH_TOKEN" http://specscaleswift.example.com:35357/v3/projects 

    The project ID obtained in this step is stored in the $AUTH_ID variable.

  3. Perform a PUT operation using the following command:
    curl -i -s -X PUT --data @/tmp/file.txt -H "X-Auth-Token:  
    $AUTH_TOKEN"http://specscaleswift.example.com:8080/v1/AUTH_$AUTH_ID/RootLevelContainer/TestObj.txt

    This command uploads the /tmp/file.txt file.

  4. Set up the metadata age of the uploaded object using the following command:
    curl -i -s -X POST -H "X-Auth-Token: $AUTH_TOKEN" -H 
    X-Container-Meta-Age:21 http://specscaleswift.example.com:8080/v1/AUTH_$AUTH_ID/RootLevelContainer/TestObj.txt 
  5. Read the metadata using the following command:
    curl -i -s --head -H  "X-Auth-Token: $AUTH_TOKEN"
    http://specscaleswift.example.com:8080/v1/AUTH_$AUTH_ID/RootLevelContainer/TestObj.txt