Class: Google::Apis::RunV2::GoogleCloudRunV2Service

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/run_v2/classes.rb,
lib/google/apis/run_v2/representations.rb,
lib/google/apis/run_v2/representations.rb

Overview

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.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudRunV2Service

Returns a new instance of GoogleCloudRunV2Service.



2126
2127
2128
# File 'lib/google/apis/run_v2/classes.rb', line 2126

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#annotationsHash<String,String>

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. Corresponds to the JSON property annotations

Returns:

  • (Hash<String,String>)


1911
1912
1913
# File 'lib/google/apis/run_v2/classes.rb', line 1911

def annotations
  @annotations
end

#binary_authorizationGoogle::Apis::RunV2::GoogleCloudRunV2BinaryAuthorization

Settings for Binary Authorization feature. Corresponds to the JSON property binaryAuthorization



1916
1917
1918
# File 'lib/google/apis/run_v2/classes.rb', line 1916

def binary_authorization
  @binary_authorization
end

#clientString

Arbitrary identifier for the API client. Corresponds to the JSON property client

Returns:

  • (String)


1921
1922
1923
# File 'lib/google/apis/run_v2/classes.rb', line 1921

def client
  @client
end

#client_versionString

Arbitrary version identifier for the API client. Corresponds to the JSON property clientVersion

Returns:

  • (String)


1926
1927
1928
# File 'lib/google/apis/run_v2/classes.rb', line 1926

def client_version
  @client_version
end

#conditionsArray<Google::Apis::RunV2::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. Corresponds to the JSON property conditions



1934
1935
1936
# File 'lib/google/apis/run_v2/classes.rb', line 1934

def conditions
  @conditions
end

#create_timeString

Output only. The creation time. Corresponds to the JSON property createTime

Returns:

  • (String)


1939
1940
1941
# File 'lib/google/apis/run_v2/classes.rb', line 1939

def create_time
  @create_time
end

#creatorString

Output only. Email address of the authenticated creator. Corresponds to the JSON property creator

Returns:

  • (String)


1944
1945
1946
# File 'lib/google/apis/run_v2/classes.rb', line 1944

def creator
  @creator
end

#custom_audiencesArray<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. Corresponds to the JSON property customAudiences

Returns:

  • (Array<String>)


1952
1953
1954
# File 'lib/google/apis/run_v2/classes.rb', line 1952

def custom_audiences
  @custom_audiences
end

#delete_timeString

Output only. The deletion time. Corresponds to the JSON property deleteTime

Returns:

  • (String)


1957
1958
1959
# File 'lib/google/apis/run_v2/classes.rb', line 1957

def delete_time
  @delete_time
end

#descriptionString

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

Returns:

  • (String)


1963
1964
1965
# File 'lib/google/apis/run_v2/classes.rb', line 1963

def description
  @description
end

#etagString

Output only. A system-generated fingerprint for this version of the resource. May be used to detect modification conflict during updates. Corresponds to the JSON property etag

Returns:

  • (String)


1969
1970
1971
# File 'lib/google/apis/run_v2/classes.rb', line 1969

def etag
  @etag
end

#expire_timeString

Output only. For a deleted resource, the time after which it will be permamently deleted. Corresponds to the JSON property expireTime

Returns:

  • (String)


1975
1976
1977
# File 'lib/google/apis/run_v2/classes.rb', line 1975

def expire_time
  @expire_time
end

#generationFixnum

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. Corresponds to the JSON property generation

Returns:

  • (Fixnum)


1983
1984
1985
# File 'lib/google/apis/run_v2/classes.rb', line 1983

def generation
  @generation
end

#ingressString

Provides the ingress settings for this Service. On output, returns the currently observed ingress settings, or INGRESS_TRAFFIC_UNSPECIFIED if no revision is active. Corresponds to the JSON property ingress

Returns:

  • (String)


1990
1991
1992
# File 'lib/google/apis/run_v2/classes.rb', line 1990

def ingress
  @ingress
end

#labelsHash<String,String>

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. Corresponds to the JSON property labels

Returns:

  • (Hash<String,String>)


2003
2004
2005
# File 'lib/google/apis/run_v2/classes.rb', line 2003

def labels
  @labels
end

#last_modifierString

Output only. Email address of the last authenticated modifier. Corresponds to the JSON property lastModifier

Returns:

  • (String)


2008
2009
2010
# File 'lib/google/apis/run_v2/classes.rb', line 2008

def last_modifier
  @last_modifier
end

#latest_created_revisionString

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

Returns:

  • (String)


2014
2015
2016
# File 'lib/google/apis/run_v2/classes.rb', line 2014

def latest_created_revision
  @latest_created_revision
end

#latest_ready_revisionString

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

Returns:

  • (String)


2021
2022
2023
# File 'lib/google/apis/run_v2/classes.rb', line 2021

def latest_ready_revision
  @latest_ready_revision
end

#launch_stageString

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. Corresponds to the JSON property launchStage

Returns:

  • (String)


2032
2033
2034
# File 'lib/google/apis/run_v2/classes.rb', line 2032

def launch_stage
  @launch_stage
end

#nameString

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 Corresponds to the JSON property name

Returns:

  • (String)


2040
2041
2042
# File 'lib/google/apis/run_v2/classes.rb', line 2040

def name
  @name
end

#observed_generationFixnum

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 . Corresponds to the JSON property observedGeneration

Returns:

  • (Fixnum)


2049
2050
2051
# File 'lib/google/apis/run_v2/classes.rb', line 2049

def observed_generation
  @observed_generation
end

#reconcilingBoolean Also known as: 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, observed_generation, latest_ready_revison, 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. Corresponds to the JSON property reconciling

Returns:

  • (Boolean)


2070
2071
2072
# File 'lib/google/apis/run_v2/classes.rb', line 2070

def reconciling
  @reconciling
end

#satisfies_pzsBoolean Also known as: satisfies_pzs?

Output only. Reserved for future use. Corresponds to the JSON property satisfiesPzs

Returns:

  • (Boolean)


2076
2077
2078
# File 'lib/google/apis/run_v2/classes.rb', line 2076

def satisfies_pzs
  @satisfies_pzs
end

#scalingGoogle::Apis::RunV2::GoogleCloudRunV2ServiceScaling

Scaling settings applied at the service level rather than at the revision level. Corresponds to the JSON property scaling



2083
2084
2085
# File 'lib/google/apis/run_v2/classes.rb', line 2083

def scaling
  @scaling
end

#templateGoogle::Apis::RunV2::GoogleCloudRunV2RevisionTemplate

RevisionTemplate describes the data a revision should have when created from a template. Corresponds to the JSON property template



2089
2090
2091
# File 'lib/google/apis/run_v2/classes.rb', line 2089

def template
  @template
end

#terminal_conditionGoogle::Apis::RunV2::GoogleCloudRunV2Condition

Defines a status condition for a resource. Corresponds to the JSON property terminalCondition



2094
2095
2096
# File 'lib/google/apis/run_v2/classes.rb', line 2094

def terminal_condition
  @terminal_condition
end

#trafficArray<Google::Apis::RunV2::GoogleCloudRunV2TrafficTarget>

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. Corresponds to the JSON property traffic



2101
2102
2103
# File 'lib/google/apis/run_v2/classes.rb', line 2101

def traffic
  @traffic
end

#traffic_statusesArray<Google::Apis::RunV2::GoogleCloudRunV2TrafficTargetStatus>

Output only. Detailed status information for corresponding traffic targets. See comments in reconciling for additional information on reconciliation process in Cloud Run. Corresponds to the JSON property trafficStatuses



2108
2109
2110
# File 'lib/google/apis/run_v2/classes.rb', line 2108

def traffic_statuses
  @traffic_statuses
end

#uidString

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. Corresponds to the JSON property uid

Returns:

  • (String)


2114
2115
2116
# File 'lib/google/apis/run_v2/classes.rb', line 2114

def uid
  @uid
end

#update_timeString

Output only. The last-modified time. Corresponds to the JSON property updateTime

Returns:

  • (String)


2119
2120
2121
# File 'lib/google/apis/run_v2/classes.rb', line 2119

def update_time
  @update_time
end

#uriString

Output only. The main URI in which this Service is serving traffic. Corresponds to the JSON property uri

Returns:

  • (String)


2124
2125
2126
# File 'lib/google/apis/run_v2/classes.rb', line 2124

def uri
  @uri
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
# File 'lib/google/apis/run_v2/classes.rb', line 2131

def update!(**args)
  @annotations = args[:annotations] if args.key?(:annotations)
  @binary_authorization = args[:binary_authorization] if args.key?(:binary_authorization)
  @client = args[:client] if args.key?(:client)
  @client_version = args[:client_version] if args.key?(:client_version)
  @conditions = args[:conditions] if args.key?(:conditions)
  @create_time = args[:create_time] if args.key?(:create_time)
  @creator = args[:creator] if args.key?(:creator)
  @custom_audiences = args[:custom_audiences] if args.key?(:custom_audiences)
  @delete_time = args[:delete_time] if args.key?(:delete_time)
  @description = args[:description] if args.key?(:description)
  @etag = args[:etag] if args.key?(:etag)
  @expire_time = args[:expire_time] if args.key?(:expire_time)
  @generation = args[:generation] if args.key?(:generation)
  @ingress = args[:ingress] if args.key?(:ingress)
  @labels = args[:labels] if args.key?(:labels)
  @last_modifier = args[:last_modifier] if args.key?(:last_modifier)
  @latest_created_revision = args[:latest_created_revision] if args.key?(:latest_created_revision)
  @latest_ready_revision = args[:latest_ready_revision] if args.key?(:latest_ready_revision)
  @launch_stage = args[:launch_stage] if args.key?(:launch_stage)
  @name = args[:name] if args.key?(:name)
  @observed_generation = args[:observed_generation] if args.key?(:observed_generation)
  @reconciling = args[:reconciling] if args.key?(:reconciling)
  @satisfies_pzs = args[:satisfies_pzs] if args.key?(:satisfies_pzs)
  @scaling = args[:scaling] if args.key?(:scaling)
  @template = args[:template] if args.key?(:template)
  @terminal_condition = args[:terminal_condition] if args.key?(:terminal_condition)
  @traffic = args[:traffic] if args.key?(:traffic)
  @traffic_statuses = args[:traffic_statuses] if args.key?(:traffic_statuses)
  @uid = args[:uid] if args.key?(:uid)
  @update_time = args[:update_time] if args.key?(:update_time)
  @uri = args[:uri] if args.key?(:uri)
end