Show / Hide Table of Contents

Class MetaObjectLock<T>

Inheritance
object
MetaObjectLock<T>
LeaseLock
MetaObjectAnnotationLock<T>
Implements
ILock
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: k8s.LeaderElection.ResourceLock
Assembly: KubernetesClient.dll
Syntax
public abstract class MetaObjectLock<T> : ILock where T : class, IMetadata<V1ObjectMeta>, new()
Type Parameters
Name Description
T

Constructors

View Source

MetaObjectLock(IKubernetes, string, string, string)

Declaration
protected MetaObjectLock(IKubernetes client, string @namespace, string name, string identity)
Parameters
Type Name Description
IKubernetes client
string namespace
string name
string identity

Properties

View Source

Identity

the locks Identity

Declaration
public string Identity { get; }
Property Value
Type Description
string

Methods

View Source

CreateAsync(LeaderElectionRecord, CancellationToken)

Create attempts to create a LeaderElectionRecord

Declaration
public Task<bool> CreateAsync(LeaderElectionRecord record, CancellationToken cancellationToken = default)
Parameters
Type Name Description
LeaderElectionRecord record

record to create

CancellationToken cancellationToken

token to cancel the task

Returns
Type Description
Task<bool>

true if created

View Source

CreateMetaObjectAsync(IKubernetes, T, string, CancellationToken)

Declaration
protected abstract Task<T> CreateMetaObjectAsync(IKubernetes client, T obj, string namespaceParameter, CancellationToken cancellationToken)
Parameters
Type Name Description
IKubernetes client
T obj
string namespaceParameter
CancellationToken cancellationToken
Returns
Type Description
Task<T>
View Source

Describe()

Describe is used to convert details on current resource lock into a string

Declaration
public string Describe()
Returns
Type Description
string

resource lock description

View Source

GetAsync(CancellationToken)

Get returns the LeaderElectionRecord

Declaration
public Task<LeaderElectionRecord> GetAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken

token to cancel the task

Returns
Type Description
Task<LeaderElectionRecord>

the record

View Source

GetLeaderElectionRecord(T)

Declaration
protected abstract LeaderElectionRecord GetLeaderElectionRecord(T obj)
Parameters
Type Name Description
T obj
Returns
Type Description
LeaderElectionRecord
View Source

ReadMetaObjectAsync(IKubernetes, string, string, CancellationToken)

Declaration
protected abstract Task<T> ReadMetaObjectAsync(IKubernetes client, string name, string namespaceParameter, CancellationToken cancellationToken)
Parameters
Type Name Description
IKubernetes client
string name
string namespaceParameter
CancellationToken cancellationToken
Returns
Type Description
Task<T>
View Source

ReplaceMetaObjectAsync(IKubernetes, T, string, string, CancellationToken)

Declaration
protected abstract Task<T> ReplaceMetaObjectAsync(IKubernetes client, T obj, string name, string namespaceParameter, CancellationToken cancellationToken)
Parameters
Type Name Description
IKubernetes client
T obj
string name
string namespaceParameter
CancellationToken cancellationToken
Returns
Type Description
Task<T>
View Source

SetLeaderElectionRecord(LeaderElectionRecord, T)

Declaration
protected abstract T SetLeaderElectionRecord(LeaderElectionRecord record, T metaObj)
Parameters
Type Name Description
LeaderElectionRecord record
T metaObj
Returns
Type Description
T
View Source

UpdateAsync(LeaderElectionRecord, CancellationToken)

Update will update and existing LeaderElectionRecord

Declaration
public Task<bool> UpdateAsync(LeaderElectionRecord record, CancellationToken cancellationToken = default)
Parameters
Type Name Description
LeaderElectionRecord record

record to create

CancellationToken cancellationToken

token to cancel the task

Returns
Type Description
Task<bool>

true if updated

Events

View Source

OnHttpError

OnHttpError is called when there is a http operation error.

Declaration
public event Action<HttpOperationException> OnHttpError
Event Type
Type Description
Action<HttpOperationException>

Implements

ILock
  • View Source
In this article
Back to top Generated by DocFX