- Resource: Service
- IngressTraffic
- RevisionTemplate
- TrafficTarget
- TrafficTargetAllocationType
- ServiceScaling
- ScalingMode
- TrafficTargetStatus
- BuildConfig
- Methods
Resource: Service
Service acts as a top-level container that manages a set of configurations and revision templates which implement a network service. Service exists to provide a singular abstraction which can be access controlled, reasoned about, and which encapsulates software lifecycle decisions such as rollout policy and team resource ownership.
JSON representation |
---|
{ "name": string, "description": string, "uid": string, "generation": string, "labels": { string: string, ... }, "annotations": { string: string, ... }, "createTime": string, "updateTime": string, "deleteTime": string, "expireTime": string, "creator": string, "lastModifier": string, "client": string, "clientVersion": string, "ingress": enum ( |
Fields | |
---|---|
name |
The fully qualified name of this Service. In CreateServiceRequest, this field is ignored, and instead composed from CreateServiceRequest.parent and CreateServiceRequest.service_id. Format: projects/{project}/locations/{location}/services/{serviceId} |
description |
User-provided description of the Service. This field currently has a 512-character limit. |
uid |
Output only. Server assigned unique identifier for the trigger. The value is a UUID4 string and guaranteed to remain unchanged until the resource is deleted. |
generation |
Output only. A number that monotonically increases every time the user modifies the desired state. Please note that unlike v1, this is an int64 value. As with most Google APIs, its JSON representation will be a |
labels |
Optional. Unstructured key value map that can be used to organize and categorize objects. User-provided labels are shared with Google's billing system, so they can be used to filter, or break down billing charges by team, component, environment, state, etc. For more information, visit https://cloud.google.com/resource-manager/docs/creating-managing-labels or https://cloud.google.com/run/docs/configuring/labels. Cloud Run API v2 does not support labels with An object containing a list of |
annotations |
Optional. Unstructured key value map that may be set by external tools to store and arbitrary metadata. They are not queryable and should be preserved when modifying objects. Cloud Run API v2 does not support annotations with This field follows Kubernetes annotations' namespacing, limits, and rules. An object containing a list of |
create |
Output only. The creation time. Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
update |
Output only. The last-modified time. Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
delete |
Output only. The deletion time. It is only populated as a response to a Delete request. Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
expire |
Output only. For a deleted resource, the time after which it will be permanently deleted. Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
creator |
Output only. Email address of the authenticated creator. |
last |
Output only. Email address of the last authenticated modifier. |
client |
Arbitrary identifier for the API client. |
client |
Arbitrary version identifier for the API client. |
ingress |
Optional. Provides the ingress settings for this Service. On output, returns the currently observed ingress settings, or INGRESS_TRAFFIC_UNSPECIFIED if no revision is active. |
launch |
Optional. The launch stage as defined by Google Cloud Platform Launch Stages. Cloud Run supports For example, if ALPHA is provided as input, but only BETA and GA-level features are used, this field will be BETA on output. |
binary |
Optional. Settings for the Binary Authorization feature. |
template |
Required. The template used to create revisions for this Service. |
traffic[] |
Optional. Specifies how to distribute traffic over a collection of Revisions belonging to the Service. If traffic is empty or not provided, defaults to 100% traffic to the latest |
scaling |
Optional. Specifies service-level scaling settings |
invoker |
Optional. Disables IAM permission check for run.routes.invoke for callers of this service. This feature is available by invitation only. For more information, visit https://cloud.google.com/run/docs/securing/managing-access#invoker_check. |
default |
Optional. Disables public resolution of the default URI of this service. |
urls[] |
Output only. All URLs serving traffic for this Service. |
custom |
One or more custom audiences that you want this service to support. Specify each custom audience as the full URL in a string. The custom audiences are encoded in the token and used to authenticate requests. For more information, see https://cloud.google.com/run/docs/configuring/custom-audiences. |
observed |
Output only. The generation of this Service currently serving traffic. See comments in |
terminal |
Output only. The Condition of this Service, containing its readiness status, and detailed error information in case it did not reach a serving state. See comments in |
conditions[] |
Output only. The Conditions of all other associated sub-resources. They contain additional diagnostics information in case the Service does not reach its Serving state. See comments in |
latest |
Output only. Name of the latest revision that is serving traffic. See comments in |
latest |
Output only. Name of the last created revision. See comments in |
traffic |
Output only. Detailed status information for corresponding traffic targets. See comments in |
uri |
Output only. The main URI in which this Service is serving traffic. |
satisfies |
Output only. Reserved for future use. |
build |
Optional. Configuration for building a Cloud Run function. |
reconciling |
Output only. Returns true if the Service is currently being acted upon by the system to bring it into the desired state. When a new Service is created, or an existing one is updated, Cloud Run will asynchronously perform all necessary steps to bring the Service to the desired serving state. This process is called reconciliation. While reconciliation is in process, If reconciliation succeeded, the following fields will match: If reconciliation failed, |
etag |
Output only. A system-generated fingerprint for this version of the resource. May be used to detect modification conflict during updates. |
IngressTraffic
Allowed ingress traffic for the Container.
Enums | |
---|---|
INGRESS_TRAFFIC_UNSPECIFIED |
Unspecified |
INGRESS_TRAFFIC_ALL |
All inbound traffic is allowed. |
INGRESS_TRAFFIC_INTERNAL_ONLY |
Only internal traffic is allowed. |
INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER |
Both internal and Google Cloud Load Balancer traffic is allowed. |
INGRESS_TRAFFIC_NONE |
No ingress traffic is allowed. |
RevisionTemplate
RevisionTemplate describes the data a revision should have when created from a template.
JSON representation |
---|
{ "revision": string, "labels": { string: string, ... }, "annotations": { string: string, ... }, "scaling": { object ( |
Fields | |
---|---|
revision |
Optional. The unique name for the revision. If this field is omitted, it will be automatically generated based on the Service name. |
labels |
Optional. Unstructured key value map that can be used to organize and categorize objects. User-provided labels are shared with Google's billing system, so they can be used to filter, or break down billing charges by team, component, environment, state, etc. For more information, visit https://cloud.google.com/resource-manager/docs/creating-managing-labels or https://cloud.google.com/run/docs/configuring/labels. Cloud Run API v2 does not support labels with An object containing a list of |
annotations |
Optional. Unstructured key value map that may be set by external tools to store and arbitrary metadata. They are not queryable and should be preserved when modifying objects. Cloud Run API v2 does not support annotations with This field follows Kubernetes annotations' namespacing, limits, and rules. An object containing a list of |
scaling |
Optional. Scaling settings for this Revision. |
vpc |
Optional. VPC Access configuration to use for this Revision. For more information, visit https://cloud.google.com/run/docs/configuring/connecting-vpc. |
timeout |
Optional. Max allowed time for an instance to respond to a request. A duration in seconds with up to nine fractional digits, ending with ' |
service |
Optional. Email address of the IAM service account associated with the revision of the service. The service account represents the identity of the running revision, and determines what permissions the revision has. If not provided, the revision will use the project's default service account. |
containers[] |
Holds the single container that defines the unit of execution for this Revision. |
volumes[] |
Optional. A list of Volumes to make available to containers. |
execution |
Optional. The sandbox environment to host this Revision. |
encryption |
A reference to a customer managed encryption key (CMEK) to use to encrypt this container image. For more information, go to https://cloud.google.com/run/docs/securing/using-cmek |
max |
Optional. Sets the maximum number of requests that each serving instance can receive. If not specified or 0, concurrency defaults to 80 when requested |
service |
Optional. Enables service mesh connectivity. |
encryption |
Optional. The action to take if the encryption key is revoked. |
encryption |
Optional. If encryptionKeyRevocationAction is SHUTDOWN, the duration before shutting down all instances. The minimum increment is 1 hour. A duration in seconds with up to nine fractional digits, ending with ' |
session |
Optional. Enable session affinity. |
health |
Optional. Disables health checking containers during deployment. |
node |
Optional. The node selector for the revision template. |
TrafficTarget
Holds a single traffic routing entry for the Service. Allocations can be done to a specific Revision name, or pointing to the latest Ready Revision.
JSON representation |
---|
{
"type": enum ( |
Fields | |
---|---|
type |
The allocation type for this traffic target. |
revision |
Revision to which to send this portion of traffic, if traffic allocation is by revision. |
percent |
Specifies percent of the traffic to this Revision. This defaults to zero if unspecified. |
tag |
Indicates a string to be part of the URI to exclusively reference this target. |
TrafficTargetAllocationType
The type of instance allocation.
Enums | |
---|---|
TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED |
Unspecified instance allocation type. |
TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST |
Allocates instances to the Service's latest ready Revision. |
TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION |
Allocates instances to a Revision by name. |
ServiceScaling
Scaling settings applied at the service level rather than at the revision level.
JSON representation |
---|
{
"minInstanceCount": integer,
"scalingMode": enum ( |
Fields | |
---|---|
min |
Optional. total min instances for the service. This number of instances is divided among all revisions with specified traffic based on the percent of traffic they are receiving. |
scaling |
Optional. The scaling mode for the service. |
max |
Optional. total max instances for the service. This number of instances is divided among all revisions with specified traffic based on the percent of traffic they are receiving. |
manual |
Optional. total instance count for the service in manual scaling mode. This number of instances is divided among all revisions with specified traffic based on the percent of traffic they are receiving. |
ScalingMode
The scaling mode for the service. If not provided, it defaults to AUTOMATIC.
Enums | |
---|---|
SCALING_MODE_UNSPECIFIED |
Unspecified. |
AUTOMATIC |
Scale based on traffic between min and max instances. |
MANUAL |
Scale to exactly min instances and ignore max instances. |
TrafficTargetStatus
Represents the observed state of a single TrafficTarget
entry.
JSON representation |
---|
{
"type": enum ( |
Fields | |
---|---|
type |
The allocation type for this traffic target. |
revision |
Revision to which this traffic is sent. |
percent |
Specifies percent of the traffic to this Revision. |
tag |
Indicates the string used in the URI to exclusively reference this target. |
uri |
Displays the target URI. |
BuildConfig
Describes the Build step of the function that builds a container from the given source.
JSON representation |
---|
{ "name": string, "sourceLocation": string, "functionTarget": string, "imageUri": string, "baseImage": string, "enableAutomaticUpdates": boolean, "workerPool": string, "environmentVariables": { string: string, ... }, "serviceAccount": string } |
Fields | |
---|---|
name |
Output only. The Cloud Build name of the latest successful deployment of the function. |
source |
The Cloud Storage bucket URI where the function source code is located. |
function |
Optional. The name of the function (as defined in source code) that will be executed. Defaults to the resource name suffix, if not specified. For backward compatibility, if function with given name is not found, then the system will try to use function named "function". |
image |
Optional. Artifact Registry URI to store the built image. |
base |
Optional. The base image used to build the function. |
enable |
Optional. Sets whether the function will receive automatic base image updates. |
worker |
Optional. Name of the Cloud Build Custom Worker Pool that should be used to build the Cloud Run function. The format of this field is |
environment |
Optional. User-provided build-time environment variables for the function An object containing a list of |
service |
Optional. Service account to be used for building the container. The format of this field is |
Methods |
|
---|---|
|
Creates a new Service in a given project and location. |
|
Deletes a Service. |
|
Gets information about a Service. |
|
Gets the IAM Access Control policy currently in effect for the given Cloud Run Service. |
|
Lists Services. |
|
Updates a Service. |
|
Sets the IAM Access control policy for the specified Service. |
|
Returns permissions that a caller has on the specified Project. |