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.



3715
3716
3717
# File 'lib/google/apis/run_v1/classes.rb', line 3715

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)


3701
3702
3703
# File 'lib/google/apis/run_v1/classes.rb', line 3701

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)


3708
3709
3710
# File 'lib/google/apis/run_v1/classes.rb', line 3708

def percent
  @percent
end

#revision_nameString

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

Returns:

  • (String)


3713
3714
3715
# File 'lib/google/apis/run_v1/classes.rb', line 3713

def revision_name
  @revision_name
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



3720
3721
3722
3723
3724
# File 'lib/google/apis/run_v1/classes.rb', line 3720

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