Google Cloud Run
Deploy applications to Cloud Run
Sollte ich dies verwenden
Qualität und Sicherheit
Befunde (3)
- HIGH
- MEDIUMin deploy_service_from_archive
- LOWin deploy_service_from_file_contents
Basierend auf einer automatisierten Analyse der Tool-Definitionen und der Einhaltung des Protokolls.
Kontextkosten
Dies ist die ungefähre Anzahl der Tokens, die jedes Mal verbraucht werden, wenn die Tools des Servers in den Kontext eines Modells geladen werden. Höhere Werte verringern die Aufmerksamkeit, die für andere Aufgaben verfügbar ist.
Installieren
Installation mit einem Klick
Fügen Sie dies Ihrer Datei `claude_desktop_config.json` hinzu:
{
"mcpServers": {
"mcp": {
"url": "https://run.googleapis.com/mcp"
}
}
}Remote-Endpunkte
https://run.googleapis.com/mcpstreamable-httpWas es kann
Tool-Inventar
Tools (5)
🟢get_service(name, project, region)
Get info about a Cloud Run service, such as its URI and whether the deploy succeeded.
Eingabe-Schema
{
"type": "object",
"properties": {
"name": {
"description": "Required. The short name of the Service.",
"type": "string"
},
"project": {
"description": "Required. The project ID or project number to get the Service from.",
"type": "string"
},
"region": {
"description": "Required. The region to get the Service from.",
"type": "string"
}
},
"required": [
"name",
"project",
"region"
],
"description": "Request message for obtaining a Service by its full name."
}Ausgabe-Schema
{
"type": "object",
"properties": {
"createTime": {
"description": "The creation time.",
"format": "date-time",
"type": "string"
},
"creator": {
"description": "Email address of the creator.",
"type": "string"
},
"lastModifier": {
"description": "Email address of the last modifier.",
"type": "string"
},
"name": {
"description": "The fully qualified name of this Service. Format: projects/{project}/locations/{location}/services/{service_id}",
"type": "string"
},
"template": {
"$ref": "#/$defs/RevisionTemplateOutput",
"description": "The template used to create revisions for this Service."
},
"terminalCondition": {
"$ref": "#/$defs/Condition",
"description": "The terminal condition of this Service, indicating its readiness status. State CONDITION_SUCCEEDED means the service is ready. If the service is not ready, this condition will contain detailed error information."
},
"updateTime": {
"description": "The last-modified time.",
"format": "date-time",
"type": "string"
},
"uri": {
"description": "The main URI in which this Service is serving traffic.",
"type": "string"
}
},
"$defs": {
"CloudStorageSource": {
"description": "Cloud Storage source.",
"properties": {
"bucket": {
"description": "Required. The Cloud Storage bucket name.",
"type": "string"
},
"generation": {
"description": "Optional. The Cloud Storage object generation.",
"format": "int64",
"type": "string"
},
"object": {
"description": "Required. The Cloud Storage object name.",
"type": "string"
}
},
"type": "object"
},
"Condition": {
"description": "Defines a status condition for a resource.",
"properties": {
"executionReason": {
"description": "Output only. A reason for the execution condition. Only one of the following fields should be set: this field, reason, revisionReason, instanceReason.",
"enum": [
"EXECUTION_REASON_UNDEFINED",
"JOB_STATUS_SERVICE_POLLING_ERROR",
"NON_ZERO_EXIT_CODE",
"CANCELLED",
"CANCELLING",
"DELETED",
"DELAYED_START_PENDING",
"DELAYED_EXECUTION_EXCEEDING_DURATION_LIMIT"
],
"readOnly": true,
"type": "string",
"x-google-enum-descriptions": [
"Default value.",
"Internal system error getting execution status. System will retry.",
"A task reached its retry limit and the last attempt failed due to the user container exiting with a non-zero exit code.",
"The execution was cancelled by users.",
"The execution is in the process of being cancelled.",
"The execution was deleted.",
"A delayed execution is waiting for a start time.",
"A delayed execution exceeded the maximum runtime duration."
]
},
"instanceReason": {
"description": "Output only. A reason for the instance condition. Only one of the following fields should be set: this field, reason, revisionReason, executionReason.",
"enum": [
"INSTANCE_REASON_UNSPECIFIED",
"INSTANCE_DELETED",
"INSTANCE_STOPPED",
"INSTANCE_STOPPING",
"INSTANCE_NON_ZERO_EXIT_CODE"
],
"readOnly": true,
"type": "string",
"x-google-enum-descriptions": [
"Default value.",
"Instance deleted.",
"Instance stopped.",
"Instance stopping.",
"Instance exited with a non-zero exit code."
]
},
"lastTransitionTime": {
"description": "Last time the condition transitioned from one status to another.",
"format": "date-time",
"type": "string"
},
"message": {
"description": "Human readable message indicating details about the current status.",
"type": "string"
},
"reason": {
"description": "Output only. A common (service-level) reason for this condition. Only one of the following fields should be set: this field, revisionReason, executionReason, instanceReason.",
"enum": [
"COMMON_REASON_UNDEFINED",
"UNKNOWN",
"REVISION_FAILED",
"PROGRESS_DEADLINE_EXCEEDED",
"CONTAINER_MISSING",
"CONTAINER_PERMISSION_DENIED",
"CONTAINER_IMAGE_UNAUTHORIZED",
"CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED",
"ENCRYPTION_KEY_PERMISSION_DENIED",
"ENCRYPTION_KEY_CHECK_FAILED",
"SECRETS_ACCESS_CHECK_FAILED",
"WAITING_FOR_OPERATION",
"IMMEDIATE_RETRY",
"POSTPONED_RETRY",
"INTERNAL",
"VPC_NETWORK_NOT_FOUND"
],
"readOnly": true,
"type": "string",
"x-google-enum-descriptions": [
"Default value.",
"Reason unknown. Further details will be in message.",
"Revision creation process failed.",
"Timed out waiting for completion.",
"The container image path is incorrect.",
"Insufficient permissions on the container image.",
"Container image is not authorized by policy.",
"Container image policy authorization check failed.",
"Insufficient permissions on encryption key.",
"Permission check on encryption key failed.",
"At least one Access check on secrets failed.",
"Waiting for operation to complete.",
"System will retry immediately.",
"System will retry later; current attempt failed.",
"An internal error occurred. Further information may be in the message.",
"User-provided VPC network was not found."
]
},
"revisionReason": {
"description": "Output only. A reason for the revision condition. Only one of the following fields should be set: this field, reason, executionReason, instanceReason.",
"enum": [
"REVISION_REASON_UNDEFINED",
"PENDING",
"RESERVE",
"RETIRED",
"RETIRING",
"RECREATING",
"HEALTH_CHECK_CONTAINER_ERROR",
"CUSTOMIZED_PATH_RESPONSE_PENDING",
"MIN_INSTANCES_NOT_PROVISIONED",
"ACTIVE_REVISION_LIMIT_REACHED",
"NO_DEPLOYMENT",
"HEALTH_CHECK_SKIPPED",
"MIN_INSTANCES_WARMING"
],
"readOnly": true,
"type": "string",
"x-google-enum-descriptions": [
"Default value.",
"Revision in Pending state.",
"Revision is in Reserve state.",
"Revision is Retired.",
"Revision is being retired.",
"Revision is being recreated.",
"There was a health check error.",
"Health check failed due to user error from customized path of the container. System will retry.",
"A revision with min_instance_count > 0 was created and is reserved, but it was not configured to serve traffic, so it's not live. This can also happen momentarily during traffic migration.",
"The maximum allowed number of active revisions has been reached.",
"There was no deployment defined. This value is no longer used, but Services created in older versions of the API might contain this value.",
"A revision's container has no port specified since the revision is of a manually scaled service with 0 instance count",
"A revision with min_instance_count > 0 was created and is waiting for enough instances to begin a traffic migration."
]
},
"severity": {
"description": "How to interpret failures of this condition, one of Error, Warning, Info",
"enum": [
"SEVERITY_UNSPECIFIED",
"ERROR",
"WARNING",
"INFO"
],
"type": "string",
"x-google-enum-descriptions": [
"Unspecified severity",
"Error severity.",
"Warning severity.",
"Info severity."
]
},
"state": {
"description": "State of the condition.",
"enum": [
"STATE_UNSPECIFIED",
"CONDITION_PENDING",
"CONDITION_RECONCILING",
"CONDITION_FAILED",
"CONDITION_SUCCEEDED"
],
"type": "string",
"x-google-enum-descriptions": [
"The default value. This value is used if the state is omitted.",
"Transient state: Reconciliation has not started yet.",
"Transient state: reconciliation is still in progress.",
"Terminal state: Reconciliation did not succeed.",
"Terminal state: Reconciliation completed successfully."
]
},
"type": {
"description": "type is used to communicate the status of the reconciliation process. See also: https://github.com/knative/serving/blob/main/docs/spec/errors.md#error-conditions-and-reporting Types common to all resources include: * \"Ready\": True when the Resource is ready.",
"type": "string"
}
},
"type": "object"
},
"ContainerOutput": {
"description": "A single application container.",
"properties": {
"args": {
"description": "Arguments to the entrypoint.",
"items": {
"type": "string"
},
"type": "array"
},
"baseImageUri": {
"description": "Base image for this container. Only supported for services. If set, it indicates that the service is enrolled into automatic base image update.",
"type": "string"
},
"command": {
"description": "Entrypoint array. Not executed within a shell.",
"items": {
"type": "string"
},
"type": "array"
},
"env": {
"description": "List of environment variables to set in the container.",
"items": {
"$ref": "#/$defs/EnvVar"
},
"type": "array"
},
"image": {
"description": "Name of the container image in Dockerhub, Google Artifact Registry, or Google Container Registry. If the host is not provided, Dockerhub is assumed.",
"type": "string"
},
"ports": {
"description": "List of ports exposed from the container.",
"items": {
"$ref": "#/$defs/ContainerPort"
},
"type": "array"
},
"sourceCode": {
"$ref": "#/$defs/SourceCode",
"description": "The location of the source code from which this container was built."
}
},
"type": "object"
},
"ContainerPort": {
"description": "ContainerPort represents a network port in a single container.",
"properties": {
"containerPort": {
"description": "Port number the container listens on. This must be a valid TCP port number, 0 < container_port < 65536.",
"format": "int32",
"type": "integer"
},
"name": {
"description": "If specified, used to specify which protocol to use. Allowed values are \"http1\" and \"h2c\".",
"type": "string"
}
},
"type": "object"
},
"EnvVar": {
"description": "EnvVar represents an environment variable present in a Container.",
"properties": {
"name": {
"description": "Required. Name of the environment variable. Must not exceed 32768 characters.",
"type": "string"
},
"value": {
"description": "Literal value of the environment variable. Defaults to \"\", and the maximum length is 32768 bytes. Variable references are not supported in Cloud Run. Only one of this field or valueSource should be set.",
"type": "string"
},
"valueSource": {
"$ref": "#/$defs/EnvVarSource",
"description": "Source for the environment variable's value. Only one of this field or value should be set."
}
},
"type": "object"
},
"EnvVarSource": {
"description": "EnvVarSource represents a source for the value of an EnvVar.",
"properties": {
"secretKeyRef": {
"$ref": "#/$defs/SecretKeySelector",
"description": "Selects a secret and a specific version from Cloud Secret Manager."
}
},
"type": "object"
},
"InlinedSource": {
"description": "Inlined source.",
"properties": {
"sources": {
"description": "Required. Input only. The source code.",
"items": {
"$ref": "#/$defs/SourceFile"
},
"type": "array",
"writeOnly": true
}
},
"type": "object"
},
"RevisionTemplateOutput": {
"description": "RevisionTemplateOutput describes the data a revision should have when created from a template.",
"properties": {
"containers": {
"description": "Holds the containers that define this Revision.",
"items": {
"$ref": "#/$defs/ContainerOutput"
},
"type": "array"
}
},
"type": "object"
},
"SecretKeySelector": {
"description": "SecretEnvVarSource represents a source for the value of an EnvVar.",
"properties": {
"secret": {
"description": "Required. The name of the secret in Cloud Secret Manager. Format: {secret_name} if the secret is in the same project. projects/{project}/secrets/{secret_name} if the secret is in a different project.",
"type": "string"
},
"version": {
"description": "The Cloud Secret Manager secret version. Can be 'latest' for the latest version, an integer for a specific version, or a version alias.",
"type": "string"
}
},
"type": "object"
},
"SourceCode": {
"description": "Source type for the container.",
"properties": {
"cloudStorageSource": {
"$ref": "#/$defs/CloudStorageSource",
"description": "The source is a Cloud Storage bucket. Only one of this field or inlinedSource should be set."
},
"inlinedSource": {
"$ref": "#/$defs/InlinedSource",
"description": "Optional. Input only. Source code inlined in the request. Cloud Run will store the inlined_source to Cloud Storage and replace the field with cloud_storage_source. This field is only supported in Cloud Run Service. Only one of this field or cloudStorageSource should be set.",
"writeOnly": true
}
},
"type": "object"
},
"SourceFile": {
"description": "Source file.",
"properties": {
"content": {
"description": "Required. Input only. Represents the exact, literal, and complete source code of the file. Placeholders like `...` or comments such as `# [rest of code]` should NEVER be used as omission. Every character in this field will be built into the final container. Any omission will result in a broken application.",
"type": "string",
"writeOnly": true
},
"filename": {
"description": "Required. Input only. The file name for the source code. e.g., `\"index.js\"` or `\"node_modules/dependency.js\"`. The filename must be less than 255 characters and cannot contain `..`, `./`, `//`, or end with a `/`. Cloud Run will place the files in the container subdirectories, please use relative path to access the file.",
"type": "string",
"writeOnly": true
}
},
"type": "object"
}
},
"description": "The output of a managed Cloud Run Service returned by the API."
}🟢list_services(project, region)
List Cloud Run services in a given Google Cloud project and region.
Eingabe-Schema
{
"type": "object",
"properties": {
"project": {
"description": "Required. The project ID or project number to list the Services from.",
"type": "string"
},
"region": {
"description": "Required. The region to list the Services from.",
"type": "string"
}
},
"required": [
"project",
"region"
],
"description": "Request message for retrieving a list of Services."
}Ausgabe-Schema
{
"type": "object",
"properties": {
"project": {
"description": "The project where the Services are listed from.",
"type": "string"
},
"services": {
"description": "The resulting list of Services.",
"items": {
"$ref": "#/$defs/ServiceListOutput"
},
"type": "array"
}
},
"$defs": {
"ServiceListOutput": {
"description": "The output of a managed Cloud Run Service in the result of list services response. It only contains a subset of fields of the service.",
"properties": {
"createTime": {
"description": "The creation time.",
"format": "date-time",
"type": "string"
},
"creator": {
"description": "Email address of the creator.",
"type": "string"
},
"lastModifier": {
"description": "Email address of the last modifier.",
"type": "string"
},
"name": {
"description": "The fully qualified name of this Service. Format: projects/{project}/locations/{location}/services/{service_id}",
"type": "string"
},
"updateTime": {
"description": "The last-modified time.",
"format": "date-time",
"type": "string"
},
"uri": {
"description": "The main URI in which this Service is serving traffic.",
"type": "string"
}
},
"type": "object"
}
},
"description": "Response message containing a list of Services."
}🔴deploy_service_from_image(service)
Deploy a container image from Artifact Registry or Docker Hub as a Cloud Run service.
Eingabe-Schema
{
"type": "object",
"properties": {
"service": {
"$ref": "#/$defs/Service",
"description": "Required. The service to deploy."
}
},
"required": [
"service"
],
"$defs": {
"ContainerPort": {
"description": "ContainerPort represents a network port in a single container.",
"properties": {
"containerPort": {
"description": "Port number the container listens on. This must be a valid TCP port number, 0 < container_port < 65536.",
"format": "int32",
"type": "integer"
},
"name": {
"description": "If specified, used to specify which protocol to use. Allowed values are \"http1\" and \"h2c\".",
"type": "string"
}
},
"type": "object"
},
"EnvVar": {
"description": "EnvVar represents an environment variable present in a Container.",
"properties": {
"name": {
"description": "Required. Name of the environment variable. Must not exceed 32768 characters.",
"type": "string"
},
"value": {
"description": "Literal value of the environment variable. Defaults to \"\", and the maximum length is 32768 bytes. Variable references are not supported in Cloud Run. Only one of this field or valueSource should be set.",
"type": "string"
},
"valueSource": {
"$ref": "#/$defs/EnvVarSource",
"description": "Source for the environment variable's value. Only one of this field or value should be set."
}
},
"required": [
"name"
],
"type": "object"
},
"EnvVarSource": {
"description": "EnvVarSource represents a source for the value of an EnvVar.",
"properties": {
"secretKeyRef": {
"$ref": "#/$defs/SecretKeySelector",
"description": "Selects a secret and a specific version from Cloud Secret Manager."
}
},
"type": "object"
},
"ImageContainer": {
"description": "A single application container.",
"properties": {
"args": {
"description": "Optional. Arguments to the entrypoint. The docker image's CMD is used if this is not provided.",
"items": {
"type": "string"
},
"type": "array"
},
"command": {
"description": "Optional. Entrypoint array. Not executed within a shell. Defaults to the docker image's ENTRYPOINT if not provided.",
"items": {
"type": "string"
},
"type": "array"
},
"env": {
"description": "Optional. List of environment variables to set in the container.",
"items": {
"$ref": "#/$defs/EnvVar"
},
"type": "array"
},
"image": {
"description": "Required. Name of the container image in Dockerhub, Google Artifact Registry, or Google Container Registry. If the host is not provided, Dockerhub is assumed.",
"type": "string"
},
"ports": {
"description": "Optional. List of ports to expose from the container. Only a single port can be specified. The specified ports must be listening on all interfaces (0.0.0.0) within the container to be accessible. If multiple containers are specified, exactly one container must have this field set. If omitted, a port number will be chosen and passed to the container through the PORT environment variable for the container to listen on.",
"items": {
"$ref": "#/$defs/ContainerPort"
},
"type": "array"
}
},
"required": [
"image"
],
"type": "object"
},
"ImageServiceRevisionTemplate": {
"description": "The revision template for a service deployed from an image.",
"properties": {
"containers": {
"description": "Required. Holds the containers that define this Revision.",
"items": {
"$ref": "#/$defs/ImageContainer"
},
"type": "array"
}
},
"required": [
"containers"
],
"type": "object"
},
"SecretKeySelector": {
"description": "SecretEnvVarSource represents a source for the value of an EnvVar.",
"properties": {
"secret": {
"description": "Required. The name of the secret in Cloud Secret Manager. Format: {secret_name} if the secret is in the same project. projects/{project}/secrets/{secret_name} if the secret is in a different project.",
"type": "string"
},
"version": {
"description": "The Cloud Secret Manager secret version. Can be 'latest' for the latest version, an integer for a specific version, or a version alias.",
"type": "string"
}
},
"required": [
"secret"
],
"type": "object"
},
"Service": {
"description": "Service represents the configuration of a managed service.",
"properties": {
"invokerIamDisabled": {
"description": "Optional. Disables IAM permission check for run.routes.invoke for callers of this service. Set to true to make this service public and allow unauthenticated access. This field defaults to false when unset, which means the service is private and only allows access from authenticated users.",
"type": "boolean"
},
"name": {
"description": "Required. Identifier. The short name of the Service.",
"type": "string",
"x-google-identifier": true
},
"project": {
"description": "Required. Identifier. The project ID or project number to get the Service from.",
"type": "string",
"x-google-identifier": true
},
"region": {
"description": "Required. Identifier. The region to get the Service from.",
"type": "string",
"x-google-identifier": true
},
"template": {
"$ref": "#/$defs/ImageServiceRevisionTemplate",
"description": "Required. The template used to create revisions for this Service."
}
},
"required": [
"name",
"project",
"region",
"template"
],
"type": "object"
}
},
"description": "Request message for deploying a container image as a Cloud Run service."
}Ausgabe-Schema
{
"type": "object",
"properties": {
"done": {
"description": "If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.",
"type": "boolean"
},
"error": {
"$ref": "#/$defs/Status",
"description": "The error result of the operation in case of failure or cancellation. Only one of this field or response should be set."
},
"metadata": {
"additionalProperties": {
"description": "Properties of the object. Contains field @type with type URL."
},
"description": "Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.",
"type": "object"
},
"name": {
"description": "The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.",
"type": "string"
},
"response": {
"additionalProperties": {
"description": "Properties of the object. Contains field @type with type URL."
},
"description": "The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. Only one of this field or error should be set.",
"type": "object"
}
},
"$defs": {
"Status": {
"description": "The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).",
"properties": {
"code": {
"description": "The status code, which should be an enum value of google.rpc.Code.",
"format": "int32",
"type": "integer"
},
"details": {
"description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
"items": {
"additionalProperties": {
"description": "Properties of the object. Contains field @type with type URL."
},
"type": "object"
},
"type": "array"
},
"message": {
"description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.",
"type": "string"
}
},
"type": "object"
}
},
"description": "This resource represents a long-running operation that is the result of a network API call."
}🔴deploy_service_from_archive(service)
Deploy a Cloud Run service directly from a self-contained source code archive (.tar.gz), skipping the container image build step for faster deployment. The archive must include all dependencies: - For compiled languages (Go, Java), include pre-compiled binaries. - For scripting languages (Python, Node.js), include pre-installed libraries (e.g., vendor/, node_modules/). Deployment steps: 1. Package source code and dependencies into a .tar.gz archive (max 250MiB). It's recommended to create archive from the root of the application's source directory. 2. Upload the archive to a Google Cloud Storage bucket, preferably in the same region as the service. 3. Deploy to Cloud Run using this tool, specifying: - source_code: Google Cloud Storage object path to the archive (e.g., gs://bucket/object). - command: Command to start the application. - base_image_uri: Base image for the container (e.g., go124, nodejs24, python314). See https://docs.cloud.google.com/run/docs/configuring/services/runtime-base-images for options. The runtime picked should match the local environment. - args: (Optional) Arguments for the command. - env: (Optional) Environment variables (e.g., name: `PYTHONPATH`, value: `./vendor`). - ports: (Optional) Container ports to expose (defaults to 8080).
Eingabe-Schema
{
"type": "object",
"properties": {
"service": {
"$ref": "#/$defs/SourceService",
"description": "Required. The service to deploy."
}
},
"required": [
"service"
],
"$defs": {
"CloudStorageSource": {
"description": "Cloud Storage source.",
"properties": {
"bucket": {
"description": "Required. The Cloud Storage bucket name.",
"type": "string"
},
"generation": {
"description": "Optional. The Cloud Storage object generation.",
"format": "int64",
"type": "string"
},
"object": {
"description": "Required. The Cloud Storage object name.",
"type": "string"
}
},
"required": [
"bucket",
"object"
],
"type": "object"
},
"ContainerPort": {
"description": "ContainerPort represents a network port in a single container.",
"properties": {
"containerPort": {
"description": "Port number the container listens on. This must be a valid TCP port number, 0 < container_port < 65536.",
"format": "int32",
"type": "integer"
},
"name": {
"description": "If specified, used to specify which protocol to use. Allowed values are \"http1\" and \"h2c\".",
"type": "string"
}
},
"type": "object"
},
"EnvVar": {
"description": "EnvVar represents an environment variable present in a Container.",
"properties": {
"name": {
"description": "Required. Name of the environment variable. Must not exceed 32768 characters.",
"type": "string"
},
"value": {
"description": "Literal value of the environment variable. Defaults to \"\", and the maximum length is 32768 bytes. Variable references are not supported in Cloud Run. Only one of this field or valueSource should be set.",
"type": "string"
},
"valueSource": {
"$ref": "#/$defs/EnvVarSource",
"description": "Source for the environment variable's value. Only one of this field or value should be set."
}
},
"required": [
"name"
],
"type": "object"
},
"EnvVarSource": {
"description": "EnvVarSource represents a source for the value of an EnvVar.",
"properties": {
"secretKeyRef": {
"$ref": "#/$defs/SecretKeySelector",
"description": "Selects a secret and a specific version from Cloud Secret Manager."
}
},
"type": "object"
},
"InlinedSource": {
"description": "Inlined source.",
"properties": {
"sources": {
"description": "Required. Input only. The source code.",
"items": {
"$ref": "#/$defs/SourceFile"
},
"type": "array",
"writeOnly": true
}
},
"required": [
"sources"
],
"type": "object"
},
"SecretKeySelector": {
"description": "SecretEnvVarSource represents a source for the value of an EnvVar.",
"properties": {
"secret": {
"description": "Required. The name of the secret in Cloud Secret Manager. Format: {secret_name} if the secret is in the same project. projects/{project}/secrets/{secret_name} if the secret is in a different project.",
"type": "string"
},
"version": {
"description": "The Cloud Secret Manager secret version. Can be 'latest' for the latest version, an integer for a specific version, or a version alias.",
"type": "string"
}
},
"required": [
"secret"
],
"type": "object"
},
"SourceCode": {
"description": "Source type for the container.",
"properties": {
"cloudStorageSource": {
"$ref": "#/$defs/CloudStorageSource",
"description": "The source is a Cloud Storage bucket. Only one of this field or inlinedSource should be set."
},
"inlinedSource": {
"$ref": "#/$defs/InlinedSource",
"description": "Optional. Input only. Source code inlined in the request. Cloud Run will store the inlined_source to Cloud Storage and replace the field with cloud_storage_source. This field is only supported in Cloud Run Service. Only one of this field or cloudStorageSource should be set.",
"writeOnly": true
}
},
"type": "object"
},
"SourceContainer": {
"description": "A single application container.",
"properties": {
"args": {
"description": "Optional. Arguments to the entrypoint.",
"items": {
"type": "string"
},
"type": "array"
},
"baseImageUri": {
"description": "Required. Base image URI to use for the container. The full list of images can be found in https://docs.cloud.google.com/run/docs/configuring/services/runtime-base-images, i.e. nodejs24. The runtime picked should match the local environment.",
"type": "string"
},
"command": {
"description": "Required. Entrypoint array to start the app.",
"items": {
"type": "string"
},
"type": "array"
},
"env": {
"description": "Optional. List of environment variables to set in the container.",
"items": {
"$ref": "#/$defs/EnvVar"
},
"type": "array"
},
"ports": {
"description": "Optional. List of ports to expose from the container. Only a single port can be specified. The specified ports must be listening on all interfaces (0.0.0.0) within the container to be accessible. If multiple containers are specified, exactly one container must have this field set. If omitted, a port number will be chosen and passed to the container through the PORT environment variable for the container to listen on.",
"items": {
"$ref": "#/$defs/ContainerPort"
},
"type": "array"
},
"sourceCode": {
"$ref": "#/$defs/SourceCode",
"description": "Required. The location of the source code to be used for the container. This can be either source code inlined as text or source code as a Cloud Storage object."
}
},
"required": [
"sourceCode",
"command",
"baseImageUri"
],
"type": "object"
},
"SourceFile": {
"description": "Source file.",
"properties": {
"content": {
"description": "Required. Input only. Represents the exact, literal, and complete source code of the file. Placeholders like `...` or comments such as `# [rest of code]` should NEVER be used as omission. Every character in this field will be built into the final container. Any omission will result in a broken application.",
"type": "string",
"writeOnly": true
},
"filename": {
"description": "Required. Input only. The file name for the source code. e.g., `\"index.js\"` or `\"node_modules/dependency.js\"`. The filename must be less than 255 characters and cannot contain `..`, `./`, `//`, or end with a `/`. Cloud Run will place the files in the container subdirectories, please use relative path to access the file.",
"type": "string",
"writeOnly": true
}
},
"required": [
"filename",
"content"
],
"type": "object"
},
"SourceService": {
"description": "Service represents the configuration of a managed service.",
"properties": {
"invokerIamDisabled": {
"description": "Optional. Disables IAM permission check for run.routes.invoke for callers of this service. Set to true to make this service public and allow unauthenticated access. This field defaults to false when unset, which means the service is private and only allows access from authenticated users.",
"type": "boolean"
},
"name": {
"description": "Required. Identifier. The short name of the Service.",
"type": "string",
"x-google-identifier": true
},
"project": {
"description": "Required. Identifier. The project ID or project number to get the Service from.",
"type": "string",
"x-google-identifier": true
},
"region": {
"description": "Required. Identifier. The region to get the Service from.",
"type": "string",
"x-google-identifier": true
},
"template": {
"$ref": "#/$defs/SourceServiceRevisionTemplate",
"description": "Required. The template used to create revisions for this Service."
}
},
"required": [
"name",
"project",
"region",
"template"
],
"type": "object"
},
"SourceServiceRevisionTemplate": {
"description": "The revision template for a service deployed from source code.",
"properties": {
"containers": {
"description": "Required. Holds the containers that define this Revision.",
"items": {
"$ref": "#/$defs/SourceContainer"
},
"type": "array"
}
},
"required": [
"containers"
],
"type": "object"
}
},
"description": "Request message for deploying source code as a Cloud Run service."
}Ausgabe-Schema
{
"type": "object",
"properties": {
"done": {
"description": "If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.",
"type": "boolean"
},
"error": {
"$ref": "#/$defs/Status",
"description": "The error result of the operation in case of failure or cancellation. Only one of this field or response should be set."
},
"metadata": {
"additionalProperties": {
"description": "Properties of the object. Contains field @type with type URL."
},
"description": "Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.",
"type": "object"
},
"name": {
"description": "The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.",
"type": "string"
},
"response": {
"additionalProperties": {
"description": "Properties of the object. Contains field @type with type URL."
},
"description": "The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. Only one of this field or error should be set.",
"type": "object"
}
},
"$defs": {
"Status": {
"description": "The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).",
"properties": {
"code": {
"description": "The status code, which should be an enum value of google.rpc.Code.",
"format": "int32",
"type": "integer"
},
"details": {
"description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
"items": {
"additionalProperties": {
"description": "Properties of the object. Contains field @type with type URL."
},
"type": "object"
},
"type": "array"
},
"message": {
"description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.",
"type": "string"
}
},
"type": "object"
}
},
"description": "This resource represents a long-running operation that is the result of a network API call."
}🔴deploy_service_from_file_contents(service)
Deploys a Cloud Run service directly from local source files. This method is suitable for scripting languages like Python and Node.js, of which the source code can be embedded in the request. This is ideal for quick tests and development feedback loops. You must include all necessary dependencies within the source files because it skips the build step for faster deployment. **Key Requirements:** 1. source_code: Should set to sourceCode.inlinedSource.sources with array of source files, each having `filename` and `content`. 2. Size limit: you are subject to total request size limit of 50MiB.
Eingabe-Schema
{
"type": "object",
"properties": {
"service": {
"$ref": "#/$defs/SourceService",
"description": "Required. The service to deploy."
}
},
"required": [
"service"
],
"$defs": {
"CloudStorageSource": {
"description": "Cloud Storage source.",
"properties": {
"bucket": {
"description": "Required. The Cloud Storage bucket name.",
"type": "string"
},
"generation": {
"description": "Optional. The Cloud Storage object generation.",
"format": "int64",
"type": "string"
},
"object": {
"description": "Required. The Cloud Storage object name.",
"type": "string"
}
},
"required": [
"bucket",
"object"
],
"type": "object"
},
"ContainerPort": {
"description": "ContainerPort represents a network port in a single container.",
"properties": {
"containerPort": {
"description": "Port number the container listens on. This must be a valid TCP port number, 0 < container_port < 65536.",
"format": "int32",
"type": "integer"
},
"name": {
"description": "If specified, used to specify which protocol to use. Allowed values are \"http1\" and \"h2c\".",
"type": "string"
}
},
"type": "object"
},
"EnvVar": {
"description": "EnvVar represents an environment variable present in a Container.",
"properties": {
"name": {
"description": "Required. Name of the environment variable. Must not exceed 32768 characters.",
"type": "string"
},
"value": {
"description": "Literal value of the environment variable. Defaults to \"\", and the maximum length is 32768 bytes. Variable references are not supported in Cloud Run. Only one of this field or valueSource should be set.",
"type": "string"
},
"valueSource": {
"$ref": "#/$defs/EnvVarSource",
"description": "Source for the environment variable's value. Only one of this field or value should be set."
}
},
"required": [
"name"
],
"type": "object"
},
"EnvVarSource": {
"description": "EnvVarSource represents a source for the value of an EnvVar.",
"properties": {
"secretKeyRef": {
"$ref": "#/$defs/SecretKeySelector",
"description": "Selects a secret and a specific version from Cloud Secret Manager."
}
},
"type": "object"
},
"InlinedSource": {
"description": "Inlined source.",
"properties": {
"sources": {
"description": "Required. Input only. The source code.",
"items": {
"$ref": "#/$defs/SourceFile"
},
"type": "array",
"writeOnly": true
}
},
"required": [
"sources"
],
"type": "object"
},
"SecretKeySelector": {
"description": "SecretEnvVarSource represents a source for the value of an EnvVar.",
"properties": {
"secret": {
"description": "Required. The name of the secret in Cloud Secret Manager. Format: {secret_name} if the secret is in the same project. projects/{project}/secrets/{secret_name} if the secret is in a different project.",
"type": "string"
},
"version": {
"description": "The Cloud Secret Manager secret version. Can be 'latest' for the latest version, an integer for a specific version, or a version alias.",
"type": "string"
}
},
"required": [
"secret"
],
"type": "object"
},
"SourceCode": {
"description": "Source type for the container.",
"properties": {
"cloudStorageSource": {
"$ref": "#/$defs/CloudStorageSource",
"description": "The source is a Cloud Storage bucket. Only one of this field or inlinedSource should be set."
},
"inlinedSource": {
"$ref": "#/$defs/InlinedSource",
"description": "Optional. Input only. Source code inlined in the request. Cloud Run will store the inlined_source to Cloud Storage and replace the field with cloud_storage_source. This field is only supported in Cloud Run Service. Only one of this field or cloudStorageSource should be set.",
"writeOnly": true
}
},
"type": "object"
},
"SourceContainer": {
"description": "A single application container.",
"properties": {
"args": {
"description": "Optional. Arguments to the entrypoint.",
"items": {
"type": "string"
},
"type": "array"
},
"baseImageUri": {
"description": "Required. Base image URI to use for the container. The full list of images can be found in https://docs.cloud.google.com/run/docs/configuring/services/runtime-base-images, i.e. nodejs24. The runtime picked should match the local environment.",
"type": "string"
},
"command": {
"description": "Required. Entrypoint array to start the app.",
"items": {
"type": "string"
},
"type": "array"
},
"env": {
"description": "Optional. List of environment variables to set in the container.",
"items": {
"$ref": "#/$defs/EnvVar"
},
"type": "array"
},
"ports": {
"description": "Optional. List of ports to expose from the container. Only a single port can be specified. The specified ports must be listening on all interfaces (0.0.0.0) within the container to be accessible. If multiple containers are specified, exactly one container must have this field set. If omitted, a port number will be chosen and passed to the container through the PORT environment variable for the container to listen on.",
"items": {
"$ref": "#/$defs/ContainerPort"
},
"type": "array"
},
"sourceCode": {
"$ref": "#/$defs/SourceCode",
"description": "Required. The location of the source code to be used for the container. This can be either source code inlined as text or source code as a Cloud Storage object."
}
},
"required": [
"sourceCode",
"command",
"baseImageUri"
],
"type": "object"
},
"SourceFile": {
"description": "Source file.",
"properties": {
"content": {
"description": "Required. Input only. Represents the exact, literal, and complete source code of the file. Placeholders like `...` or comments such as `# [rest of code]` should NEVER be used as omission. Every character in this field will be built into the final container. Any omission will result in a broken application.",
"type": "string",
"writeOnly": true
},
"filename": {
"description": "Required. Input only. The file name for the source code. e.g., `\"index.js\"` or `\"node_modules/dependency.js\"`. The filename must be less than 255 characters and cannot contain `..`, `./`, `//`, or end with a `/`. Cloud Run will place the files in the container subdirectories, please use relative path to access the file.",
"type": "string",
"writeOnly": true
}
},
"required": [
"filename",
"content"
],
"type": "object"
},
"SourceService": {
"description": "Service represents the configuration of a managed service.",
"properties": {
"invokerIamDisabled": {
"description": "Optional. Disables IAM permission check for run.routes.invoke for callers of this service. Set to true to make this service public and allow unauthenticated access. This field defaults to false when unset, which means the service is private and only allows access from authenticated users.",
"type": "boolean"
},
"name": {
"description": "Required. Identifier. The short name of the Service.",
"type": "string",
"x-google-identifier": true
},
"project": {
"description": "Required. Identifier. The project ID or project number to get the Service from.",
"type": "string",
"x-google-identifier": true
},
"region": {
"description": "Required. Identifier. The region to get the Service from.",
"type": "string",
"x-google-identifier": true
},
"template": {
"$ref": "#/$defs/SourceServiceRevisionTemplate",
"description": "Required. The template used to create revisions for this Service."
}
},
"required": [
"name",
"project",
"region",
"template"
],
"type": "object"
},
"SourceServiceRevisionTemplate": {
"description": "The revision template for a service deployed from source code.",
"properties": {
"containers": {
"description": "Required. Holds the containers that define this Revision.",
"items": {
"$ref": "#/$defs/SourceContainer"
},
"type": "array"
}
},
"required": [
"containers"
],
"type": "object"
}
},
"description": "Request message for deploying source code as a Cloud Run service."
}Ausgabe-Schema
{
"type": "object",
"properties": {
"done": {
"description": "If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.",
"type": "boolean"
},
"error": {
"$ref": "#/$defs/Status",
"description": "The error result of the operation in case of failure or cancellation. Only one of this field or response should be set."
},
"metadata": {
"additionalProperties": {
"description": "Properties of the object. Contains field @type with type URL."
},
"description": "Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.",
"type": "object"
},
"name": {
"description": "The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.",
"type": "string"
},
"response": {
"additionalProperties": {
"description": "Properties of the object. Contains field @type with type URL."
},
"description": "The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. Only one of this field or error should be set.",
"type": "object"
}
},
"$defs": {
"Status": {
"description": "The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).",
"properties": {
"code": {
"description": "The status code, which should be an enum value of google.rpc.Code.",
"format": "int32",
"type": "integer"
},
"details": {
"description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
"items": {
"additionalProperties": {
"description": "Properties of the object. Contains field @type with type URL."
},
"type": "object"
},
"type": "array"
},
"message": {
"description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.",
"type": "string"
}
},
"type": "object"
}
},
"description": "This resource represents a long-running operation that is the result of a network API call."
}Community
Nachweis