Skip to main content

CLI tool for creating a serverles api with API Gateway and Cloud Functions

Project description

shopcloud-serverless-cli

Serverless API

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>
  • Scheduler?

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 hello_world

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 MB
  • runtime: runtime of the function "python310"
  • trigger: http or pubsub the value is the name of the topic

for development you can use the functions-framework

$ cd endpoints
$ functions-framework --source="hello_world.py" --target main --debug --port=8080

then deploy the function

$ serverless endpoints deploy hello_world

FAQ

special dependencies

add to the endpoint.yaml file the dependencies

memory: 128MB
trigger: http
dependencies:
  - "google-cloud-bigquery"

Anforderung:

  • erst api.yaml erzeugen dann endpunkte anlegen
  • memorystore in project anlegen können

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shopcloud-serverless-2.1.0.tar.gz (10.3 kB view hashes)

Uploaded Source

Built Distributions

shopcloud_serverless-2.1.0-py3.11.egg (38.6 kB view hashes)

Uploaded Source

shopcloud_serverless-2.1.0-py3-none-any.whl (13.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page