Class V1LeaseSpec
java.lang.Object
io.kubernetes.client.openapi.models.V1LeaseSpec
@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen",
date="2024-10-04T19:37:38.574271Z[Etc/UTC]",
comments="Generator version: 7.6.0")
public class V1LeaseSpec
extends Object
LeaseSpec is a specification of a Lease.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionacquireTime
(OffsetDateTime acquireTime) boolean
static V1LeaseSpec
Create an instance of V1LeaseSpec given an JSON stringacquireTime is a time when the current lease was acquired.holderIdentity contains the identity of the holder of a current lease.leaseDurationSeconds is a duration that candidates for a lease need to wait to force acquire it.leaseTransitions is the number of transitions of a lease between holders.PreferredHolder signals to a lease holder that the lease has a more optimal holder and should be given up.renewTime is a time when the current holder of a lease has last updated the lease.Strategy indicates the strategy for picking the leader for coordinated leader election.int
hashCode()
holderIdentity
(String holderIdentity) leaseDurationSeconds
(Integer leaseDurationSeconds) leaseTransitions
(Integer leaseTransitions) preferredHolder
(String preferredHolder) renewTime
(OffsetDateTime renewTime) void
setAcquireTime
(OffsetDateTime acquireTime) void
setHolderIdentity
(String holderIdentity) void
setLeaseDurationSeconds
(Integer leaseDurationSeconds) void
setLeaseTransitions
(Integer leaseTransitions) void
setPreferredHolder
(String preferredHolder) void
setRenewTime
(OffsetDateTime renewTime) void
setStrategy
(String strategy) toJson()
Convert an instance of V1LeaseSpec to an JSON stringtoString()
static void
validateJsonElement
(com.google.gson.JsonElement jsonElement) Validates the JSON Element and throws an exception if issues found
-
Field Details
-
SERIALIZED_NAME_ACQUIRE_TIME
- See Also:
-
SERIALIZED_NAME_HOLDER_IDENTITY
- See Also:
-
SERIALIZED_NAME_LEASE_DURATION_SECONDS
- See Also:
-
SERIALIZED_NAME_LEASE_TRANSITIONS
- See Also:
-
SERIALIZED_NAME_PREFERRED_HOLDER
- See Also:
-
SERIALIZED_NAME_RENEW_TIME
- See Also:
-
SERIALIZED_NAME_STRATEGY
- See Also:
-
openapiFields
-
openapiRequiredFields
-
-
Constructor Details
-
V1LeaseSpec
public V1LeaseSpec()
-
-
Method Details
-
acquireTime
-
getAcquireTime
acquireTime is a time when the current lease was acquired.- Returns:
- acquireTime
-
setAcquireTime
-
holderIdentity
-
getHolderIdentity
holderIdentity contains the identity of the holder of a current lease. If Coordinated Leader Election is used, the holder identity must be equal to the elected LeaseCandidate.metadata.name field.- Returns:
- holderIdentity
-
setHolderIdentity
-
leaseDurationSeconds
-
getLeaseDurationSeconds
leaseDurationSeconds is a duration that candidates for a lease need to wait to force acquire it. This is measured against the time of last observed renewTime.- Returns:
- leaseDurationSeconds
-
setLeaseDurationSeconds
-
leaseTransitions
-
getLeaseTransitions
leaseTransitions is the number of transitions of a lease between holders.- Returns:
- leaseTransitions
-
setLeaseTransitions
-
preferredHolder
-
getPreferredHolder
PreferredHolder signals to a lease holder that the lease has a more optimal holder and should be given up. This field can only be set if Strategy is also set.- Returns:
- preferredHolder
-
setPreferredHolder
-
renewTime
-
getRenewTime
renewTime is a time when the current holder of a lease has last updated the lease.- Returns:
- renewTime
-
setRenewTime
-
strategy
-
getStrategy
Strategy indicates the strategy for picking the leader for coordinated leader election. If the field is not specified, there is no active coordination for this lease. (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled.- Returns:
- strategy
-
setStrategy
-
equals
-
hashCode
public int hashCode() -
toString
-
validateJsonElement
Validates the JSON Element and throws an exception if issues found- Parameters:
jsonElement
- JSON Element- Throws:
IOException
- if the JSON Element is invalid with respect to V1LeaseSpec
-
fromJson
Create an instance of V1LeaseSpec given an JSON string- Parameters:
jsonString
- JSON string- Returns:
- An instance of V1LeaseSpec
- Throws:
IOException
- if the JSON string is invalid with respect to V1LeaseSpec
-
toJson
Convert an instance of V1LeaseSpec to an JSON string- Returns:
- JSON string
-