feat: Implement storage with naas-python
Closed this issue ยท 3 comments
We need to implement the Object Storage API for both the CLI and the SDK.
We should leverage boto3 as must as possible to deal with the uploads rather than our own endpoint if possible.
The naas-python cli must handle AWS credentials silently, so we could use the file ~/.naas/credentials
to store AWS credentials of a specific workspace/storage pair.
For example:
{
"jwt_token": "...",
"storage": {
"cfda6ebb-1ea9-4668-a7e5-c599a66caf8c": {
"test": {
"REGION_NAME": "...",
"AWS_ACCESS_KEY_ID": "...",
"AWS_SECRET_ACCESS_KEY": "...",
"AWS_SESSION_TOKEN": "..."
}
}
}
}
The command to put an object should be:
naas-python storage put-object -w=cfda6ebb-1ea9-4668-a7e5-c599a66caf8c -s=test /home/myuser/monfichier.txt /my/custom/directory/monfichier.txt
Bonus:
It would be awesome, to be able to select the active workspace, likes Kubectl/oc are doing, by running:
naas-python workspace use cfda6ebb-1ea9-4668-a7e5-c599a66caf8c
So it should be possible to do the following:
naas-python workspace cfda6ebb-1ea9-4668-a7e5-c599a66caf8c
naas-python storage put-object -s=test /home/myuser/monfichier.txt /my/custom/directory/monfichier.txt
Now I don't have to specify the workspace everytime.
๐ This issue has been resolved in version 1.2.0-dev.7 ๐
The release is available on:
- GitHub release
v1.2.0-dev.7
Your semantic-release bot ๐ฆ๐
๐ This issue has been resolved in version 1.4.0-dev.1 ๐
The release is available on:
- GitHub release
v1.4.0-dev.1
Your semantic-release bot ๐ฆ๐
๐ This issue has been resolved in version 1.4.0 ๐
The release is available on:
- GitHub release
v1.4.0
Your semantic-release bot ๐ฆ๐