CLI tool for creating a serverles api with API Gateway and Cloud Functions
Project description
Serverless CLI
Serverless tool for the Google Cloud. You need the gcloud
installed.
Install
$ pip install shopcloud-serverless
$ serverless init
Jobs
$ serverless jobs init
$ serverless jobs create <job-name>
$ serverless jobs deploy <job-name>
$ serverless jobs run <job-name>
Secrets:
Secrets can you write in the .env.temp
file with the SecretHub syntax.
Gateway
The main entrypoint for you serverless endpoint api is the gateway.
Init the gateway with the function and then deploy the endpoints and then you can deploy the api.yaml file with gateway deploy endpoint.
$ serverless gateway init
$ serverless gateway deploy
Endpoints
Create a new endpoint for every path.
$ serverless endpoints init
$ serverless endpoints create health
Add the Endpoint in the api.yaml
the operation_id
must be unqie and is the identifier for the library.
You can change the <endpoint-name>.yaml
with the parameters
memory
: memory in MBruntime
: runtime of the function "python311"trigger
: http or pubsub the value is the name of thetopic
dependencies
: as string array
for development in the background we use functions-framework
$ serverless endpoints serve health
then deploy the function
$ serverless endpoints deploy health
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for shopcloud-serverless-4.16.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7fdd6efffe8d79de4809ae7c2800212dec747c263f3820a5330f79113ce9bd9 |
|
MD5 | 26982d10ee132b5fd13310d8a705888e |
|
BLAKE2b-256 | c633eb07fec92889a87db32c70bd2317eea25769d1c0ed7f3913addaa5685a67 |
Hashes for shopcloud_serverless-4.16.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a78fd94ce44d39cb4027c37649273cb3c6cc252192e0fcc8af38fe2bbeaf47a |
|
MD5 | e7d4613a0b06c0e6daf713e2510c2a7f |
|
BLAKE2b-256 | 9251c927f1a3be59fbf873ae949e61655209facab6f3d37acce9743c7071c339 |