Data ingestion examples
Use the following example steps for data ingestion in the following scenarios.
- Data ingestion through object interface and access through file interface
- Data ingestion through file interface and access through object interface
- Data ingestion and access through object and file interfaces concurrently
- Standard REST client step: Get proper authentication token from the Authentication URL using proper credentials to authorize on further requests.
- 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.
- 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:
- User: "fileuser"
- Password: "Password6"
- Account: "admin"
- Host: specscaleswift.example.com
- 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.
- 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.
- 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.
- 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
- 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