Class: Google::Apis::RunV1::InstanceSplit

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

Overview

Holds a single instance split entry for the Worker. Allocations can be done to a specific Revision name, or pointing to the latest Ready Revision.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ InstanceSplit

Returns a new instance of InstanceSplit.



3814
3815
3816
# File 'lib/google/apis/run_v1/classes.rb', line 3814

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

Instance Attribute Details

#latest_revisionBoolean Also known as: latest_revision?

Uses the "status.latestReadyRevisionName" to determine the instance split target. When it changes, workloads will automatically migrate from the prior " latest ready" revision to the new one. Corresponds to the JSON property latestRevision

Returns:

  • (Boolean)


3800
3801
3802
# File 'lib/google/apis/run_v1/classes.rb', line 3800

def latest_revision
  @latest_revision
end

#percentFixnum

Optional. Specifies percent of the instance split to this Revision. This defaults to zero if unspecified. Corresponds to the JSON property percent

Returns:

  • (Fixnum)


3807
3808
3809
# File 'lib/google/apis/run_v1/classes.rb', line 3807

def percent
  @percent
end

#revision_nameString

Revision to which to assign this portion of instances. Corresponds to the JSON property revisionName

Returns:

  • (String)


3812
3813
3814
# File 'lib/google/apis/run_v1/classes.rb', line 3812

def revision_name
  @revision_name
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



3819
3820
3821
3822
3823
# File 'lib/google/apis/run_v1/classes.rb', line 3819

def update!(**args)
  @latest_revision = args[:latest_revision] if args.key?(:latest_revision)
  @percent = args[:percent] if args.key?(:percent)
  @revision_name = args[:revision_name] if args.key?(:revision_name)
end