Class: Google::Apis::RunV2::GoogleCloudRunV2Container

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

A single application container. This specifies both the container to run, the command to run in the container and the arguments to supply to it. Note that additional arguments can be supplied by the system to the container at runtime.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudRunV2Container

Returns a new instance of GoogleCloudRunV2Container.



312
313
314
# File 'lib/google/apis/run_v2/classes.rb', line 312

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

Instance Attribute Details

#argsArray<String>

Arguments to the entrypoint. The docker image's CMD is used if this is not provided. Corresponds to the JSON property args

Returns:

  • (Array<String>)


245
246
247
# File 'lib/google/apis/run_v2/classes.rb', line 245

def args
  @args
end

#commandArray<String>

Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided. Corresponds to the JSON property command

Returns:

  • (Array<String>)


251
252
253
# File 'lib/google/apis/run_v2/classes.rb', line 251

def command
  @command
end

#depends_onArray<String>

Names of the containers that must start before this container. Corresponds to the JSON property dependsOn

Returns:

  • (Array<String>)


256
257
258
# File 'lib/google/apis/run_v2/classes.rb', line 256

def depends_on
  @depends_on
end

#envArray<Google::Apis::RunV2::GoogleCloudRunV2EnvVar>

List of environment variables to set in the container. Corresponds to the JSON property env



261
262
263
# File 'lib/google/apis/run_v2/classes.rb', line 261

def env
  @env
end

#imageString

Required. Name of the container image in Dockerhub, Google Artifact Registry, or Google Container Registry. If the host is not provided, Dockerhub is assumed. Corresponds to the JSON property image

Returns:

  • (String)


268
269
270
# File 'lib/google/apis/run_v2/classes.rb', line 268

def image
  @image
end

#liveness_probeGoogle::Apis::RunV2::GoogleCloudRunV2Probe

Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic. Corresponds to the JSON property livenessProbe



274
275
276
# File 'lib/google/apis/run_v2/classes.rb', line 274

def liveness_probe
  @liveness_probe
end

#nameString

Name of the container specified as a DNS_LABEL (RFC 1123). Corresponds to the JSON property name

Returns:

  • (String)


279
280
281
# File 'lib/google/apis/run_v2/classes.rb', line 279

def name
  @name
end

#portsArray<Google::Apis::RunV2::GoogleCloudRunV2ContainerPort>

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 omitted, a port number will be chosen and passed to the container through the PORT environment variable for the container to listen on. Corresponds to the JSON property ports



288
289
290
# File 'lib/google/apis/run_v2/classes.rb', line 288

def ports
  @ports
end

#resourcesGoogle::Apis::RunV2::GoogleCloudRunV2ResourceRequirements

ResourceRequirements describes the compute resource requirements. Corresponds to the JSON property resources



293
294
295
# File 'lib/google/apis/run_v2/classes.rb', line 293

def resources
  @resources
end

#startup_probeGoogle::Apis::RunV2::GoogleCloudRunV2Probe

Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic. Corresponds to the JSON property startupProbe



299
300
301
# File 'lib/google/apis/run_v2/classes.rb', line 299

def startup_probe
  @startup_probe
end

#volume_mountsArray<Google::Apis::RunV2::GoogleCloudRunV2VolumeMount>

Volume to mount into the container's filesystem. Corresponds to the JSON property volumeMounts



304
305
306
# File 'lib/google/apis/run_v2/classes.rb', line 304

def volume_mounts
  @volume_mounts
end

#working_dirString

Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Corresponds to the JSON property workingDir

Returns:

  • (String)


310
311
312
# File 'lib/google/apis/run_v2/classes.rb', line 310

def working_dir
  @working_dir
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



317
318
319
320
321
322
323
324
325
326
327
328
329
330
# File 'lib/google/apis/run_v2/classes.rb', line 317

def update!(**args)
  @args = args[:args] if args.key?(:args)
  @command = args[:command] if args.key?(:command)
  @depends_on = args[:depends_on] if args.key?(:depends_on)
  @env = args[:env] if args.key?(:env)
  @image = args[:image] if args.key?(:image)
  @liveness_probe = args[:liveness_probe] if args.key?(:liveness_probe)
  @name = args[:name] if args.key?(:name)
  @ports = args[:ports] if args.key?(:ports)
  @resources = args[:resources] if args.key?(:resources)
  @startup_probe = args[:startup_probe] if args.key?(:startup_probe)
  @volume_mounts = args[:volume_mounts] if args.key?(:volume_mounts)
  @working_dir = args[:working_dir] if args.key?(:working_dir)
end