nimbella / nimbella-sdk-python Goto Github PK
View Code? Open in Web Editor NEWNimbella SDK for Python serverless functions.
Home Page: https://nimbella.com
License: Apache License 2.0
Nimbella SDK for Python serverless functions.
Home Page: https://nimbella.com
License: Apache License 2.0
Replicate work done here in the Node.js SDK to de-couple storage API from a single storage provider. Python SDK should also support pluggable storage providers. Introduce S3 storage provider alongside exsting GCP store.
If you want to use the S3 storage client with a newer region - we need to explicitly set the endpoint_url
parameter in the client config. This is an undocumented "feature" of the S3 service. boto/boto3#2728
We should also change the presigned url API parameters to be more generic. Rather than having an explicit "ContentType" - allow users to pass in any parameters they want. This will make it easier to decouple the implementation of the storage API from the providers API.
Is your feature request related to a problem? Please describe.
To lineup with nomenclature used through out the cli and docs, .redis()
should be aliase to .kv()
.
Finishing the implementation for the storage providers - I struggled to get the website methods to work despite calling the underlying SDK methods correctly. Need to go back and investigate this and write a new integration test to verify it works.
If you try to generate a signed url you get an error message
README.md should contain basic overview of the new storage functionality. Also maybe generate proper Python docs from the code comments.
Run this SDK in a Nimbella platform instance and execute a series of actions using it. Check it works as expected.
Describe the bug
If nimbella is deployed in AWS in a generic region (for example eu-south-1
) you get an error
An error occurred (IllegalLocationConstraintException) when calling the PutObject operation: The eu-south-1 location constraint is incompatible for the region specific endpoint this request was sent to.
To Reproduce
Steps to reproduce the behavior:
def main(arg):
try:
bucket = nimbella.storage()
filename = "test.txt"
file = bucket.file(filename)
file.save('Expected %s contents' % filename, 'text/plain')
return { "ok": True}
except Exception as e:
return { "error": str(e) }
Expected behavior
ok: True
Screenshots
If applicable, add screenshots to help explain your problem.
Extra informations:
This is what the __NIM_STORAGE_KEY looks like (stripped down of credentials)
NIM_STORAGE_KEY="{\"provider\":\"@nimbella/storage-s3\",\"region\":\"eu-south-1\",\"endpoint\":\"\",\"weburl\":\"https://iogw-eksitaly.nimbella.io\",\"cloudfrontId\":\"XXXX\",\"iamUser\":\"app-buckets-iogw-Y0avZmVH\",\"policyArn\":\"arn:aws:iam::332320267357:policy/app-buckets-iogw-Y0avZmVH\",\"credentials\":{\"accessKeyId\":\"XXX\",\"secretAccessKey\":\"jXXX"}}"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.