TaskGOOGLE
class tasks.task_google.TaskGOOGLE
Interact with Google APIs
This task enables you to access any Google API. See The official Python client library for Google's discovery based APIs or The Google API Explorer for a description of available APIs and their collections and requests.
Inputs
Name | Type | Default | Description |
---|---|---|---|
api_name | str | The name of the API to use | |
api_params | dict | None | Additional parameters to pass to the API build call |
api_version | str | The version of the API to use | |
args | list | None | Positional arguments to pass to the method call |
collection | str | The collection of the API to use. Can take the form of <resource>.<subresource>[...] | |
grant | str | None | the name of an oauth grant to use for authentication |
key | dict | None | The content of the key file of the service account to use |
kwargs | dict | None | Keyword arguments to pass to the method call |
params | dict | None | Deprecated. Additional parameters to pass to the request call |
request | str | The request to use | |
scopes | list | None | Oauth2 scopes to request |
Outputs
Name | Type | Default | Description |
---|---|---|---|
result | dict | ||
execution_id | int | The ID of the task execution | |
message | str | The ended message for the task. If the task ended with an error, the message will contain information about what went wrong | |
status | str | The ended status for the task. Either "success" or "error". |
Constants
input_list = ['api_name', 'api_params', 'api_version', 'args', 'collection', 'grant', 'key', 'kwargs', 'params', 'request', 'scopes']output_list = ['result']version = 1Methods
run ()
Example
import flow_apidef handler(system: flow_api.System, this: flow_api.Execution):this.task('GOOGLE',name='launch instance',api_name='compute',api_version='v1',collection='instances',request='insert',kwargs={'body': instance_config,'project': project_id,'zone': 'europe-west3-b',}key=key,scopes=['https://www.googleapis.com/auth/compute'],)this.log('instance was started')return this.success('all done')