Google Cloud Run V2 Client - Class Instance (1.12.0)

Reference documentation and code samples for the Google Cloud Run V2 Client class Instance.

A Cloud Run Instance represents a single group of containers running in a region.

Generated from protobuf message google.cloud.run.v2.Instance

Namespace

Google \ Cloud \ Run \ V2

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ name string

The fully qualified name of this Instance. In CreateInstanceRequest, this field is ignored, and instead composed from CreateInstanceRequest.parent and CreateInstanceRequest.instance_id. Format: projects/{project}/locations/{location}/instances/{instance_id}

↳ description string

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

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

↳ generation int|string

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.

↳ labels array|Google\Protobuf\Internal\MapField
↳ annotations array|Google\Protobuf\Internal\MapField
↳ create_time Google\Protobuf\Timestamp

Output only. The creation time.

↳ update_time Google\Protobuf\Timestamp

Output only. The last-modified time.

↳ delete_time Google\Protobuf\Timestamp

Output only. The deletion time.

↳ expire_time Google\Protobuf\Timestamp

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

↳ creator string

Output only. Email address of the authenticated creator.

↳ last_modifier string

Output only. Email address of the last authenticated modifier.

↳ client string

Arbitrary identifier for the API client.

↳ client_version string

Arbitrary version identifier for the API client.

↳ launch_stage int

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.

↳ binary_authorization BinaryAuthorization

Settings for the Binary Authorization feature.

↳ vpc_access VpcAccess

Optional. VPC Access configuration to use for this Revision. For more information, visit https://cloud.google.com/run/docs/configuring/connecting-vpc.

↳ service_account string
↳ containers array<Container>

Required. Holds the single container that defines the unit of execution for this Instance.

↳ volumes array<Volume>

A list of Volumes to make available to containers.

↳ encryption_key string

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

↳ encryption_key_revocation_action int

The action to take if the encryption key is revoked.

↳ encryption_key_shutdown_duration Google\Protobuf\Duration

If encryption_key_revocation_action is SHUTDOWN, the duration before shutting down all instances. The minimum increment is 1 hour.

↳ node_selector NodeSelector

Optional. The node selector for the instance.

↳ gpu_zonal_redundancy_disabled bool

Optional. True if GPU zonal redundancy is disabled on this instance.

↳ ingress int

Optional. Provides the ingress settings for this Instance. On output, returns the currently observed ingress settings, or INGRESS_TRAFFIC_UNSPECIFIED if no revision is active.

↳ invoker_iam_disabled bool

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

↳ iap_enabled bool

Optional. IAP settings on the Instance.

↳ observed_generation int|string

Output only. The generation of this Instance 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.

↳ log_uri string

Output only. The Google Console URI to obtain logs for the Instance.

↳ terminal_condition Condition

Output only. The Condition of this Instance, containing its readiness status, and detailed error information in case it did not reach a serving state. See comments in reconciling for additional information on reconciliation process in Cloud Run.

↳ conditions array<Condition>

Output only. The Conditions of all other associated sub-resources. They contain additional diagnostics information in case the Instance does not reach its Serving state. See comments in reconciling for additional information on reconciliation process in Cloud Run.

↳ container_statuses array<ContainerStatus>

Output only. Status information for each of the specified containers. The status includes the resolved digest for specified images.

↳ satisfies_pzs bool

Output only. Reserved for future use.

↳ urls array

Output only. All URLs serving traffic for this Instance.

↳ reconciling bool

Output only. Returns true if the Instance is currently being acted upon by the system to bring it into the desired state. When a new Instance is created, or an existing one is updated, Cloud Run will asynchronously perform all necessary steps to bring the Instance to the desired serving state. This process is called reconciliation. While reconciliation is in process, observed_generation will have a transient value 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 Instance, or there was an error, and reconciliation failed. This state can be found in terminal_condition.state.

↳ etag string

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

getName

The fully qualified name of this Instance. In CreateInstanceRequest, this field is ignored, and instead composed from CreateInstanceRequest.parent and CreateInstanceRequest.instance_id.

Format: projects/{project}/locations/{location}/instances/{instance_id}

Returns
Type Description
string

setName

The fully qualified name of this Instance. In CreateInstanceRequest, this field is ignored, and instead composed from CreateInstanceRequest.parent and CreateInstanceRequest.instance_id.

Format: projects/{project}/locations/{location}/instances/{instance_id}

Parameter
Name Description
var string
Returns
Type Description
$this

getDescription

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

Returns
Type Description
string

setDescription

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

Parameter
Name Description
var string
Returns
Type Description
$this

getUid

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.

Returns
Type Description
string

setUid

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.

Parameter
Name Description
var string
Returns
Type Description
$this

getGeneration

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.

Returns
Type Description
int|string

setGeneration

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.

Parameter
Name Description
var int|string
Returns
Type Description
$this

getLabels

Generated from protobuf field map<string, string> labels = 6;

Returns
Type Description
Google\Protobuf\Internal\MapField

setLabels

Generated from protobuf field map<string, string> labels = 6;

Parameter
Name Description
var array|Google\Protobuf\Internal\MapField
Returns
Type Description
$this

getAnnotations

Generated from protobuf field map<string, string> annotations = 7;

Returns
Type Description
Google\Protobuf\Internal\MapField

setAnnotations

Generated from protobuf field map<string, string> annotations = 7;

Parameter
Name Description
var array|Google\Protobuf\Internal\MapField
Returns
Type Description
$this

getCreateTime

Output only. The creation time.

Returns
Type Description
Google\Protobuf\Timestamp|null

hasCreateTime

clearCreateTime

setCreateTime

Output only. The creation time.

Parameter
Name Description
var Google\Protobuf\Timestamp
Returns
Type Description
$this

getUpdateTime

Output only. The last-modified time.

Returns
Type Description
Google\Protobuf\Timestamp|null

hasUpdateTime

clearUpdateTime

setUpdateTime

Output only. The last-modified time.

Parameter
Name Description
var Google\Protobuf\Timestamp
Returns
Type Description
$this

getDeleteTime

Output only. The deletion time.

Returns
Type Description
Google\Protobuf\Timestamp|null

hasDeleteTime

clearDeleteTime

setDeleteTime

Output only. The deletion time.

Parameter
Name Description
var Google\Protobuf\Timestamp
Returns
Type Description
$this

getExpireTime

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

Returns
Type Description
Google\Protobuf\Timestamp|null

hasExpireTime

clearExpireTime

setExpireTime

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

Parameter
Name Description
var Google\Protobuf\Timestamp
Returns
Type Description
$this

getCreator

Output only. Email address of the authenticated creator.

Returns
Type Description
string

setCreator

Output only. Email address of the authenticated creator.

Parameter
Name Description
var string
Returns
Type Description
$this

getLastModifier

Output only. Email address of the last authenticated modifier.

Returns
Type Description
string

setLastModifier

Output only. Email address of the last authenticated modifier.

Parameter
Name Description
var string
Returns
Type Description
$this

getClient

Arbitrary identifier for the API client.

Returns
Type Description
string

setClient

Arbitrary identifier for the API client.

Parameter
Name Description
var string
Returns
Type Description
$this

getClientVersion

Arbitrary version identifier for the API client.

Returns
Type Description
string

setClientVersion

Arbitrary version identifier for the API client.

Parameter
Name Description
var string
Returns
Type Description
$this

getLaunchStage

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.

Returns
Type Description
int Enum of type LaunchStage.

setLaunchStage

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.

Parameter
Name Description
var int

Enum of type LaunchStage.

Returns
Type Description
$this

getBinaryAuthorization

Settings for the Binary Authorization feature.

Returns
Type Description
BinaryAuthorization|null

hasBinaryAuthorization

clearBinaryAuthorization

setBinaryAuthorization

Settings for the Binary Authorization feature.

Parameter
Name Description
var BinaryAuthorization
Returns
Type Description
$this

getVpcAccess

Optional. VPC Access configuration to use for this Revision. For more information, visit https://cloud.google.com/run/docs/configuring/connecting-vpc.

Returns
Type Description
VpcAccess|null

hasVpcAccess

clearVpcAccess

setVpcAccess

Optional. VPC Access configuration to use for this Revision. For more information, visit https://cloud.google.com/run/docs/configuring/connecting-vpc.

Parameter
Name Description
var VpcAccess
Returns
Type Description
$this

getServiceAccount

Generated from protobuf field string service_account = 19;

Returns
Type Description
string

setServiceAccount

Generated from protobuf field string service_account = 19;

Parameter
Name Description
var string
Returns
Type Description
$this

getContainers

Required. Holds the single container that defines the unit of execution for this Instance.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setContainers

Required. Holds the single container that defines the unit of execution for this Instance.

Parameter
Name Description
var array<Container>
Returns
Type Description
$this

getVolumes

A list of Volumes to make available to containers.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setVolumes

A list of Volumes to make available to containers.

Parameter
Name Description
var array<Volume>
Returns
Type Description
$this

getEncryptionKey

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

Returns
Type Description
string

setEncryptionKey

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

Parameter
Name Description
var string
Returns
Type Description
$this

getEncryptionKeyRevocationAction

The action to take if the encryption key is revoked.

Returns
Type Description
int Enum of type EncryptionKeyRevocationAction.

setEncryptionKeyRevocationAction

The action to take if the encryption key is revoked.

Parameter
Name Description
var int

Enum of type EncryptionKeyRevocationAction.

Returns
Type Description
$this

getEncryptionKeyShutdownDuration

If encryption_key_revocation_action is SHUTDOWN, the duration before shutting down all instances. The minimum increment is 1 hour.

Returns
Type Description
Google\Protobuf\Duration|null

hasEncryptionKeyShutdownDuration

clearEncryptionKeyShutdownDuration

setEncryptionKeyShutdownDuration

If encryption_key_revocation_action is SHUTDOWN, the duration before shutting down all instances. The minimum increment is 1 hour.

Parameter
Name Description
var Google\Protobuf\Duration
Returns
Type Description
$this

getNodeSelector

Optional. The node selector for the instance.

Returns
Type Description
NodeSelector|null

hasNodeSelector

clearNodeSelector

setNodeSelector

Optional. The node selector for the instance.

Parameter
Name Description
var NodeSelector
Returns
Type Description
$this

getGpuZonalRedundancyDisabled

Optional. True if GPU zonal redundancy is disabled on this instance.

Returns
Type Description
bool

hasGpuZonalRedundancyDisabled

clearGpuZonalRedundancyDisabled

setGpuZonalRedundancyDisabled

Optional. True if GPU zonal redundancy is disabled on this instance.

Parameter
Name Description
var bool
Returns
Type Description
$this

getIngress

Optional. Provides the ingress settings for this Instance. On output, returns the currently observed ingress settings, or INGRESS_TRAFFIC_UNSPECIFIED if no revision is active.

Returns
Type Description
int Enum of type IngressTraffic.

setIngress

Optional. Provides the ingress settings for this Instance. On output, returns the currently observed ingress settings, or INGRESS_TRAFFIC_UNSPECIFIED if no revision is active.

Parameter
Name Description
var int

Enum of type IngressTraffic.

Returns
Type Description
$this

getInvokerIamDisabled

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

Returns
Type Description
bool

setInvokerIamDisabled

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

Parameter
Name Description
var bool
Returns
Type Description
$this

getIapEnabled

Optional. IAP settings on the Instance.

Returns
Type Description
bool

setIapEnabled

Optional. IAP settings on the Instance.

Parameter
Name Description
var bool
Returns
Type Description
$this

getObservedGeneration

Output only. The generation of this Instance 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.

Returns
Type Description
int|string

setObservedGeneration

Output only. The generation of this Instance 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.

Parameter
Name Description
var int|string
Returns
Type Description
$this

getLogUri

Output only. The Google Console URI to obtain logs for the Instance.

Returns
Type Description
string

setLogUri

Output only. The Google Console URI to obtain logs for the Instance.

Parameter
Name Description
var string
Returns
Type Description
$this

getTerminalCondition

Output only. The Condition of this Instance, containing its readiness status, and detailed error information in case it did not reach a serving state. See comments in reconciling for additional information on reconciliation process in Cloud Run.

Returns
Type Description
Condition|null

hasTerminalCondition

clearTerminalCondition

setTerminalCondition

Output only. The Condition of this Instance, containing its readiness status, and detailed error information in case it did not reach a serving state. See comments in reconciling for additional information on reconciliation process in Cloud Run.

Parameter
Name Description
var Condition
Returns
Type Description
$this

getConditions

Output only. The Conditions of all other associated sub-resources. They contain additional diagnostics information in case the Instance does not reach its Serving state. See comments in reconciling for additional information on reconciliation process in Cloud Run.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setConditions

Output only. The Conditions of all other associated sub-resources. They contain additional diagnostics information in case the Instance does not reach its Serving state. See comments in reconciling for additional information on reconciliation process in Cloud Run.

Parameter
Name Description
var array<Condition>
Returns
Type Description
$this

getContainerStatuses

Output only. Status information for each of the specified containers. The status includes the resolved digest for specified images.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setContainerStatuses

Output only. Status information for each of the specified containers. The status includes the resolved digest for specified images.

Parameter
Name Description
var array<ContainerStatus>
Returns
Type Description
$this

getSatisfiesPzs

Output only. Reserved for future use.

Returns
Type Description
bool

setSatisfiesPzs

Output only. Reserved for future use.

Parameter
Name Description
var bool
Returns
Type Description
$this

getUrls

Output only. All URLs serving traffic for this Instance.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setUrls

Output only. All URLs serving traffic for this Instance.

Parameter
Name Description
var string[]
Returns
Type Description
$this

getReconciling

Output only. Returns true if the Instance is currently being acted upon by the system to bring it into the desired state.

When a new Instance is created, or an existing one is updated, Cloud Run will asynchronously perform all necessary steps to bring the Instance to the desired serving state. This process is called reconciliation. While reconciliation is in process, observed_generation will have a transient value 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 Instance, or there was an error, and reconciliation failed. This state can be found in terminal_condition.state.

Returns
Type Description
bool

setReconciling

Output only. Returns true if the Instance is currently being acted upon by the system to bring it into the desired state.

When a new Instance is created, or an existing one is updated, Cloud Run will asynchronously perform all necessary steps to bring the Instance to the desired serving state. This process is called reconciliation. While reconciliation is in process, observed_generation will have a transient value 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 Instance, or there was an error, and reconciliation failed. This state can be found in terminal_condition.state.

Parameter
Name Description
var bool
Returns
Type Description
$this

getEtag

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

Returns
Type Description
string

setEtag

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

Parameter
Name Description
var string
Returns
Type Description
$this