googleinvoke

command module
v0.0.0-...-8835833 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

README


{ "image": "direktiv/googleinvoke", "desc": "Executes a cloud function on google using a client authenticated via a service account key." }

GoogleInvoke

Executes a cloud function on google using a client authenticated via a service account key.

Direktiv

id: invoke-function
functions:
- id: invoke
  image: direktiv/googleinvoke:v1
description: "Invokes a cloud function based on the given details"
states:
- id: invoke-cloud
  type: action
  action:
    function: invoke
    input: jq(.)

Input

The following input is needed for the cloud function to be invoked successfully.

input:
  region: "us-east1"
  function: "helloworld"
  serviceAccountKey: jq(.secrets.SERVICE_ACCOUNT_KEY)
  method: "POST"
  body: 
    message: "hello"

NOTE: The body field is optional.

Output

The output will be the response of the cloud function json marshalled for the ability to jq the response.

Error

In the case that an error is encountered, it will present in the following format:

{
    "errorCode": "com.googleinvoke.error",
    "errorMsg": "Something went wrong"
}

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL