Cloud Run Admin API Connector Overview

The Workflows connector defines the built-in functions that can be used to access other Google Cloud products within a workflow.

This page provides an overview of the individual connector. There is no need to import or load connector libraries in a workflow—connectors work out of the box when used in a call step.

Cloud Run Admin API

Deploy and manage user provided container images that scale automatically based on incoming requests. The Cloud Run Admin API v1 follows the Knative Serving API specification, while v2 is aligned with Google Cloud AIP-based API standards, as described in https://google.aip.dev/. To learn more, see the Cloud Run Admin API documentation.

For the YAML representation of the Service and Job objects in the Cloud Run Admin API, see the Cloud Run YAML reference. Note that the YAML maps exactly to the API, and you can modify the YAML specifications to configure your Cloud Run service.

Authentication

All Cloud Run services are deployed privately by default, which means that they can't be accessed without providing authentication credentials in the request. Learn more about invoking Cloud Run and sending authenticated requests.

Container image

Learn how to build a container image like the one used in the following sample.

Cloud Run Admin connector sample

YAML

# This workflow demonstrates how to use the Cloud Run connector:
# Create a new service and then delete it
# A location must be specified
# Expected output is the `delete_service` response with a "Success" status
- init:
    assign:
      - service_name: "test-service"
      - project: ${sys.get_env("GOOGLE_CLOUD_PROJECT_ID")}
- create_service:
    call: googleapis.run.v1.namespaces.services.create
    args:
      location: "us-central1"
      parent: ${"namespaces/" + project}
      body:
        apiVersion: "serving.knative.dev/v1"
        kind: "Service"
        metadata:
          name: ${service_name}
          namespace: ${project}
        spec:
          traffic:
            latest_revision: true
            percent: 100
          template:
            metadata:
              labels:
                serving.knative.dev/type: "container"
            spec:
              containers:
                - image: "us-docker.pkg.dev/cloudrun/container/hello:latest"
    result: create_response
- get_service:
    call: googleapis.run.v1.namespaces.services.get
    args:
      name: ${"namespaces/" + project + "/services/" + service_name}
      location: "us-central1"
    result: get_response
- delete_service:
    call: googleapis.run.v1.namespaces.services.delete
    args:
      location: "us-central1"
      name: ${"namespaces/" + project + "/services/" + service_name}
    result: delete_response
- return:
    return: ${delete_response}

JSON

[
  {
    "init": {
      "assign": [
        {
          "service_name": "test-service"
        },
        {
          "project": "your-project-id"
        }
      ]
    }
  },
  {
    "create_service": {
      "call": "googleapis.run.v1.namespaces.services.create",
      "args": {
        "location": "us-central1",
        "parent": "${\"namespaces/\" + project}",
        "body": {
          "apiVersion": "serving.knative.dev/v1",
          "kind": "Service",
          "metadata": {
            "name": "${service_name}",
            "namespace": "${project}"
          },
          "spec": {
            "traffic": {
              "latest_revision": true,
              "percent": 100
            },
            "template": {
              "metadata": {
                "labels": {
                  "serving.knative.dev/type": "container"
                }
              },
              "spec": {
                "containers": [
                  {
                    "image": "us-docker.pkg.dev/cloudrun/container/hello:latest"
                  }
                ]
              }
            }
          }
        }
      },
      "result": "create_rsp"
    }
  },
  {
    "get_service": {
      "call": "googleapis.run.v1.namespaces.services.get",
      "args": {
        "name": "${\"namespaces/\" + project + \"/services/\" + service_name}",
        "location": "us-central1"
      },
      "result": "get_resp"
    }
  },
  {
    "delete_service": {
      "call": "googleapis.run.v1.namespaces.services.delete",
      "args": {
        "location": "us-central1",
        "name": "${\"namespaces/\" + project + \"/services/\" + service_name}"
      },
      "result": "delete_rsp"
    }
  },
  {
    "return": {
      "return": "${delete_rsp}"
    }
  }
]

Module: googleapis.run.v1.namespaces.authorizeddomains

Functions
list List authorized domains.

Module: googleapis.run.v1.namespaces.configurations

Functions
get Get information about a configuration.
list List configurations. Results are sorted by creation time, descending.

Module: googleapis.run.v1.namespaces.domainmappings

Functions
create Create a new domain mapping.
delete Delete a domain mapping.
get Get information about a domain mapping.
list List all domain mappings.

Module: googleapis.run.v1.namespaces.executions

Functions
cancel Cancel an execution.
delete Delete an execution.
get Get information about an execution.
list List executions. Results are sorted by creation time, descending.

Module: googleapis.run.v1.namespaces.jobs

Functions
create Create a job.
delete Delete a job.
get Get information about a job.
list List jobs. Results are sorted by creation time, descending.
replaceJob Replace a job. Only the spec and metadata labels and annotations are modifiable. After the Replace request, Cloud Run will work to make the 'status' match the requested 'spec'. May provide metadata.resourceVersion to enforce update from last read for optimistic concurrency control.
run Trigger creation of a new execution of this job.

Module: googleapis.run.v1.namespaces.revisions

Functions
delete Delete a revision.
get Get information about a revision.
list List revisions. Results are sorted by creation time, descending.

Module: googleapis.run.v1.namespaces.routes

Functions
get Get information about a route.
list List routes. Results are sorted by creation time, descending.

Module: googleapis.run.v1.namespaces.services

Functions
create Creates a new Service. Service creation will trigger a new deployment. Use GetService, and check service.status to determine if the Service is ready.
delete Deletes the provided service. This will cause the Service to stop serving traffic and will delete all associated Revisions.
get Gets information about a service.
list Lists services for the given project and region. Results are sorted by creation time, descending.
replaceService Replaces a service. Only the spec and metadata labels and annotations are modifiable. After the Update request, Cloud Run will work to make the 'status' match the requested 'spec'. May provide metadata.resourceVersion to enforce update from last read for optimistic concurrency control.

Module: googleapis.run.v1.namespaces.tasks

Functions
get Get information about a task.
list List tasks.

Module: googleapis.run.v1.projects.locations

Functions
list Lists information about the supported locations for this service.

Module: googleapis.run.v1.projects.locations.jobs

Functions
getIamPolicy Get the IAM Access Control policy currently in effect for the given job. This result does not include any inherited policies.
setIamPolicy Sets the IAM Access control policy for the specified job. Overwrites any existing policy.
testIamPermissions Returns permissions that a caller has on the specified job. There are no permissions required for making this API call.

Module: googleapis.run.v1.projects.locations.services

Functions
getIamPolicy Gets the IAM Access Control policy currently in effect for the given Cloud Run service. This result does not include any inherited policies.
setIamPolicy Sets the IAM Access control policy for the specified Service. Overwrites any existing policy.
testIamPermissions Returns permissions that a caller has on the specified Project. There are no permissions required for making this API call.

Module: googleapis.run.v2.projects.locations.jobs

Functions
create Creates a Job.
delete Deletes a Job.
get Gets information about a Job.
getIamPolicy Gets the IAM Access Control policy currently in effect for the given Job. This result does not include any inherited policies.
list Lists Jobs. Results are sorted by creation time, descending.
patch Updates a Job.
run Triggers creation of a new Execution of this Job.
setIamPolicy Sets the IAM Access control policy for the specified Job. Overwrites any existing policy.
testIamPermissions Returns permissions that a caller has on the specified Project. There are no permissions required for making this API call.

Module: googleapis.run.v2.projects.locations.jobs.executions

Functions
cancel Cancels an Execution.
delete Deletes an Execution.
get Gets information about an Execution.
list Lists Executions from a Job. Results are sorted by creation time, descending.

Module: googleapis.run.v2.projects.locations.jobs.executions.tasks

Functions
get Gets information about a Task.
list Lists Tasks from an Execution of a Job.

Module: googleapis.run.v2.projects.locations.operations

Functions
delete Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED.
get Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
list Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.

Module: googleapis.run.v2.projects.locations.services

Functions
create Creates a new Service in a given project and location.
delete Deletes a Service. This will cause the Service to stop serving traffic and will delete all revisions.
get Gets information about a Service.
getIamPolicy Gets the IAM Access Control policy currently in effect for the given Cloud Run Service. This result does not include any inherited policies.
list Lists Services. Results are sorted by creation time, descending.
patch Updates a Service.
setIamPolicy Sets the IAM Access control policy for the specified Service. Overwrites any existing policy.
testIamPermissions Returns permissions that a caller has on the specified Project. There are no permissions required for making this API call.

Module: googleapis.run.v2.projects.locations.services.revisions

Functions
delete Deletes a Revision.
get Gets information about a Revision.
list Lists Revisions from a given Service, or from a given location. Results are sorted by creation time, descending.