projects

PATCH /v2/projects/{projectsId}/locations/{locationsId}/services/{servicesId}

Changed on

Updates a Service.

Request

  • Base URL
    https://run.googleapis.com
  • Auth
    • OAuth 2 and OAuth 2
      Implicithttps://accounts.google.com/o/oauth2/auth
      Scopeshttps://www.googleapis.com/auth/cloud-platform
      Authorization codehttps://accounts.google.com/o/oauth2/auth
      Token URLhttps://accounts.google.com/o/oauth2/token
      Scopeshttps://www.googleapis.com/auth/cloud-platform
    • or OAuth 2 and OAuth 2
      Implicithttps://accounts.google.com/o/oauth2/auth
      Scopeshttps://www.googleapis.com/auth/run
      Authorization codehttps://accounts.google.com/o/oauth2/auth
      Token URLhttps://accounts.google.com/o/oauth2/token
      Scopeshttps://www.googleapis.com/auth/run

Path parameters

projectsId, string required
locationsId, string required
servicesId, string required

Query parameters

$.xgafv, '1' | '2'

V1 error format.

access_token, string

OAuth access token.

alt, 'json' | 'media' | 'proto'

Data format for response.

callback, string

JSONP

fields, string

Selector specifying which fields to include in a partial response.

key, string

API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

oauth_token, string

OAuth 2.0 token for the current user.

prettyPrint, boolean

Returns response with indentations and line breaks.

quotaUser, string

Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

uploadType, string

Legacy upload protocol for media (e.g. "media", "multipart").

upload_protocol, string

Upload protocol for media (e.g. "raw", "multipart").

allowMissing, boolean

Optional. If set to true, and if the Service does not exist, it will create a new one. The caller must have 'run.services.create' permissions if this is set to true and the Service does not exist.

forceNewRevision, boolean

Optional. If set to true, a new revision will be created from the template even if the system doesn't detect any changes from the previously deployed revision. This may be useful for cases where the underlying resources need to be recreated or reinitialized. For example if the image is specified by label, but the underlying image digest has changed) or if the container performs deployment initialization work that needs to be performed again.

updateMask, string google-fieldmask

Optional. The list of fields to be updated.

validateOnly, boolean

Indicates that the request should be validated and default values populated, without persisting the request or updating any resources.

Request body

GoogleCloudRunV2Service required

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.

annotations, object

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 run.googleapis.com, cloud.googleapis.com, serving.knative.dev, or autoscaling.knative.dev namespaces, and they will be rejected in new resources. All system annotations in v1 now have a corresponding field in v2 Service. This field follows Kubernetes annotations' namespacing, limits, and rules.

binaryAuthorization, GoogleCloudRunV2BinaryAuthorization

Settings for Binary Authorization feature.

buildConfig, GoogleCloudRunV2BuildConfig

Describes the Build step of the function that builds a container from the given source.

client, string

Arbitrary identifier for the API client.

clientVersion, string

Arbitrary version identifier for the API client.

conditions, GoogleCloudRunV2Condition[]

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 reconciling for additional information on reconciliation process in Cloud Run.

createTime, string google-datetime

Output only. The creation time.

creator, string

Output only. Email address of the authenticated creator.

customAudiences, string[]

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.

defaultUriDisabled, boolean

Optional. Disables public resolution of the default URI of this service.

deleteTime, string google-datetime

Output only. The deletion time. It is only populated as a response to a Delete request.

description, string

User-provided description of the Service. This field currently has a 512-character limit.

etag, string

Optional. A system-generated fingerprint for this version of the resource. May be used to detect modification conflict during updates.

expireTime, string google-datetime

Output only. For a deleted resource, the time after which it will be permanently deleted.

functionalType, 'FUNCTIONAL_TYPE_UNSPECIFIED' | 'FUNCTIONAL_TYPE_AGENT' | 'FUNCTIONAL_TYPE_MCP_SERVER'

Optional. The functional type of the Service.

generation, string int64

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 string instead of an integer.

iapEnabled, boolean

Optional. IAP settings on the Service.

ingress, 'INGRESS_TRAFFIC_UNSPECIFIED' | 'INGRESS_TRAFFIC_ALL' | 'INGRESS_TRAFFIC_INTERNAL_ONLY' | 'INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER' | 'INGRESS_TRAFFIC_NONE'

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.

invokerIamDisabled, boolean

Optional. Disables IAM permission check for run.routes.invoke for callers of this service. For more information, visit https://cloud.google.com/run/docs/securing/managing-access#invoker_check.

labels, object

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 run.googleapis.com, cloud.googleapis.com, serving.knative.dev, or autoscaling.knative.dev namespaces, and they will be rejected. All system labels in v1 now have a corresponding field in v2 Service.

lastModifier, string

Output only. Email address of the last authenticated modifier.

latestCreatedRevision, string

Output only. Name of the last created revision. See comments in reconciling for additional information on reconciliation process in Cloud Run.

latestReadyRevision, string

Output only. Name of the latest revision that is serving traffic. See comments in reconciling for additional information on reconciliation process in Cloud Run.

launchStage, 'LAUNCH_STAGE_UNSPECIFIED' | 'UNIMPLEMENTED' | 'PRELAUNCH' | 'EARLY_ACCESS' | 'ALPHA' | 'BETA' | 'GA' | 'DEPRECATED'

Optional. The launch stage as defined by Google Cloud Platform Launch Stages. Cloud Run supports ALPHA, BETA, and GA. If no value is specified, GA is assumed. Set the launch stage to a preview stage on input to allow use of preview features in that stage. On read (or output), describes whether the resource uses preview features. For example, if ALPHA is provided as input, but only BETA and GA-level features are used, this field will be BETA on output.

multiRegionSettings, GoogleCloudRunV2MultiRegionSettings

Settings for multi-region deployment.

name, string

Identifier. 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/{service_id}

observedGeneration, string int64

Output only. The generation of this Service currently serving traffic. See comments in reconciling for additional information on reconciliation process in Cloud Run. Please note that unlike v1, this is an int64 value. As with most Google APIs, its JSON representation will be a string instead of an integer.

reconciling, boolean

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, observed_generation, latest_ready_revision, traffic_statuses, and uri will have transient values that might mismatch the intended state: Once reconciliation is over (and this field is false), there are two possible outcomes: reconciliation succeeded and the serving state matches the Service, or there was an error, and reconciliation failed. This state can be found in terminal_condition.state. If reconciliation succeeded, the following fields will match: traffic and traffic_statuses, observed_generation and generation, latest_ready_revision and latest_created_revision. If reconciliation failed, traffic_statuses, observed_generation, and latest_ready_revision will have the state of the last serving revision, or empty for newly created Services. Additional information on the failure can be found in terminal_condition and conditions.

satisfiesPzs, boolean

Output only. Reserved for future use.

scaling, GoogleCloudRunV2ServiceScaling

Scaling settings applied at the service level rather than at the revision level.

sshEnabled, boolean

Optional. Enables SSH access to the Service.

template, GoogleCloudRunV2RevisionTemplate

RevisionTemplate describes the data a revision should have when created from a template.

terminalCondition, GoogleCloudRunV2Condition

Defines a status condition for a resource.

threatDetectionEnabled, boolean

Output only. True if Cloud Run Threat Detection monitoring is enabled for the parent project of this Service.

traffic, GoogleCloudRunV2TrafficTarget[]

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 Ready Revision.

trafficStatuses, GoogleCloudRunV2TrafficTargetStatus[]

Output only. Detailed status information for corresponding traffic targets. See comments in reconciling for additional information on reconciliation process in Cloud Run.

uid, string

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.

updateTime, string google-datetime

Output only. The last-modified time.

uri, string

Output only. The main URI in which this Service is serving traffic.

urls, string[]

Output only. All URLs serving traffic for this Service.

Response

Successful response

GoogleLongrunningOperation required

This resource represents a long-running operation that is the result of a network API call.

done, boolean

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.

error, GoogleRpcStatus

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. 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.

metadata, object

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.

name, string

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}.

response, object

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.

Changes

    • info

      the security scope https://www.googleapis.com/auth/cloud-platform was added to the endpoint's security scheme Oauth2

    • info

      the security scope https://www.googleapis.com/auth/cloud-platform was added to the endpoint's security scheme Oauth2c

    • info

      the security scope https://www.googleapis.com/auth/run was removed from the endpoint's security scheme Oauth2

    1 more change in this revision