Close
    logoCloudomation Docs

    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

    NameTypeDefaultDescription
    api_namestrThe name of the API to use
    api_paramsdictNoneAdditional parameters to pass to the API build call
    api_versionstrThe version of the API to use
    argslistNonePositional arguments to pass to the method call
    collectionstrThe collection of the API to use. Can take the form of <resource>.<subresource>[...]
    grantstrNonethe name of an oauth grant to use for authentication
    keydictNoneThe content of the key file of the service account to use
    kwargsdictNoneKeyword arguments to pass to the method call
    paramsdictNoneDeprecated. Additional parameters to pass to the request call
    requeststrThe request to use
    scopeslistNoneOauth2 scopes to request

    Outputs

    NameTypeDefaultDescription
    resultdict
    execution_idintThe ID of the task execution
    messagestrThe ended message for the task. If the task ended with an error, the message will contain information about what went wrong
    statusstrThe 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 = 1

    Methods

    run ()

    Example

    import flow_api
    def 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')
    Previous
    TaskGIT
    Next
    TaskIMAP