website/content/en/docs/reference/kubernetes-api/cluster-resources/lease-v1.md

13 KiB

api_metadata content_type description title weight auto_generated
apiVersion import kind
coordination.k8s.io/v1 k8s.io/api/coordination/v1 Lease
api_reference Lease defines a lease concept. Lease 5 true

apiVersion: coordination.k8s.io/v1

import "k8s.io/api/coordination/v1"

Lease

Lease defines a lease concept.


LeaseSpec

LeaseSpec is a specification of a Lease.


  • acquireTime (MicroTime)

    acquireTime is a time when the current lease was acquired.

    MicroTime is version of Time with microsecond level precision.

  • holderIdentity (string)

    holderIdentity contains the identity of the holder of a current lease.

  • leaseDurationSeconds (int32)

    leaseDurationSeconds is a duration that candidates for a lease need to wait to force acquire it. This is measure against time of last observed RenewTime.

  • leaseTransitions (int32)

    leaseTransitions is the number of transitions of a lease between holders.

  • renewTime (MicroTime)

    renewTime is a time when the current holder of a lease has last updated the lease.

    MicroTime is version of Time with microsecond level precision.

LeaseList

LeaseList is a list of Lease objects.


Operations


get read the specified Lease

HTTP Request

GET /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}

Parameters

  • name (in path): string, required

    name of the Lease

  • namespace (in path): string, required

    <a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace

  • pretty (in query): string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

Response

200 (<a href="{{< ref "../cluster-resources/lease-v1#Lease" >}}">Lease): OK

401: Unauthorized

list list or watch objects of kind Lease

HTTP Request

GET /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases

Parameters

  • namespace (in path): string, required

    <a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace

  • allowWatchBookmarks (in query): boolean

    <a href="{{< ref "../common-parameters/common-parameters#allowWatchBookmarks" >}}">allowWatchBookmarks

  • continue (in query): string

    <a href="{{< ref "../common-parameters/common-parameters#continue" >}}">continue

  • fieldSelector (in query): string

    <a href="{{< ref "../common-parameters/common-parameters#fieldSelector" >}}">fieldSelector

  • labelSelector (in query): string

    <a href="{{< ref "../common-parameters/common-parameters#labelSelector" >}}">labelSelector

  • limit (in query): integer

    <a href="{{< ref "../common-parameters/common-parameters#limit" >}}">limit

  • pretty (in query): string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

  • resourceVersion (in query): string

    <a href="{{< ref "../common-parameters/common-parameters#resourceVersion" >}}">resourceVersion

  • resourceVersionMatch (in query): string

    <a href="{{< ref "../common-parameters/common-parameters#resourceVersionMatch" >}}">resourceVersionMatch

  • timeoutSeconds (in query): integer

    <a href="{{< ref "../common-parameters/common-parameters#timeoutSeconds" >}}">timeoutSeconds

  • watch (in query): boolean

    <a href="{{< ref "../common-parameters/common-parameters#watch" >}}">watch

Response

200 (<a href="{{< ref "../cluster-resources/lease-v1#LeaseList" >}}">LeaseList): OK

401: Unauthorized

list list or watch objects of kind Lease

HTTP Request

GET /apis/coordination.k8s.io/v1/leases

Parameters

  • allowWatchBookmarks (in query): boolean

    <a href="{{< ref "../common-parameters/common-parameters#allowWatchBookmarks" >}}">allowWatchBookmarks

  • continue (in query): string

    <a href="{{< ref "../common-parameters/common-parameters#continue" >}}">continue

  • fieldSelector (in query): string

    <a href="{{< ref "../common-parameters/common-parameters#fieldSelector" >}}">fieldSelector

  • labelSelector (in query): string

    <a href="{{< ref "../common-parameters/common-parameters#labelSelector" >}}">labelSelector

  • limit (in query): integer

    <a href="{{< ref "../common-parameters/common-parameters#limit" >}}">limit

  • pretty (in query): string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

  • resourceVersion (in query): string

    <a href="{{< ref "../common-parameters/common-parameters#resourceVersion" >}}">resourceVersion

  • resourceVersionMatch (in query): string

    <a href="{{< ref "../common-parameters/common-parameters#resourceVersionMatch" >}}">resourceVersionMatch

  • timeoutSeconds (in query): integer

    <a href="{{< ref "../common-parameters/common-parameters#timeoutSeconds" >}}">timeoutSeconds

  • watch (in query): boolean

    <a href="{{< ref "../common-parameters/common-parameters#watch" >}}">watch

Response

200 (<a href="{{< ref "../cluster-resources/lease-v1#LeaseList" >}}">LeaseList): OK

401: Unauthorized

create create a Lease

HTTP Request

POST /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases

Parameters

  • namespace (in path): string, required

    <a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace

  • body: <a href="{{< ref "../cluster-resources/lease-v1#Lease" >}}">Lease, required

  • dryRun (in query): string

    <a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun

  • fieldManager (in query): string

    <a href="{{< ref "../common-parameters/common-parameters#fieldManager" >}}">fieldManager

  • pretty (in query): string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

Response

200 (<a href="{{< ref "../cluster-resources/lease-v1#Lease" >}}">Lease): OK

201 (<a href="{{< ref "../cluster-resources/lease-v1#Lease" >}}">Lease): Created

202 (<a href="{{< ref "../cluster-resources/lease-v1#Lease" >}}">Lease): Accepted

401: Unauthorized

update replace the specified Lease

HTTP Request

PUT /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}

Parameters

  • name (in path): string, required

    name of the Lease

  • namespace (in path): string, required

    <a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace

  • body: <a href="{{< ref "../cluster-resources/lease-v1#Lease" >}}">Lease, required

  • dryRun (in query): string

    <a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun

  • fieldManager (in query): string

    <a href="{{< ref "../common-parameters/common-parameters#fieldManager" >}}">fieldManager

  • pretty (in query): string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

Response

200 (<a href="{{< ref "../cluster-resources/lease-v1#Lease" >}}">Lease): OK

201 (<a href="{{< ref "../cluster-resources/lease-v1#Lease" >}}">Lease): Created

401: Unauthorized

patch partially update the specified Lease

HTTP Request

PATCH /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}

Parameters

  • name (in path): string, required

    name of the Lease

  • namespace (in path): string, required

    <a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace

  • body: <a href="{{< ref "../common-definitions/patch#Patch" >}}">Patch, required

  • dryRun (in query): string

    <a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun

  • fieldManager (in query): string

    <a href="{{< ref "../common-parameters/common-parameters#fieldManager" >}}">fieldManager

  • force (in query): boolean

    <a href="{{< ref "../common-parameters/common-parameters#force" >}}">force

  • pretty (in query): string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

Response

200 (<a href="{{< ref "../cluster-resources/lease-v1#Lease" >}}">Lease): OK

401: Unauthorized

delete delete a Lease

HTTP Request

DELETE /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}

Parameters

  • name (in path): string, required

    name of the Lease

  • namespace (in path): string, required

    <a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace

  • body: <a href="{{< ref "../common-definitions/delete-options#DeleteOptions" >}}">DeleteOptions

  • dryRun (in query): string

    <a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun

  • gracePeriodSeconds (in query): integer

    <a href="{{< ref "../common-parameters/common-parameters#gracePeriodSeconds" >}}">gracePeriodSeconds

  • pretty (in query): string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

  • propagationPolicy (in query): string

    <a href="{{< ref "../common-parameters/common-parameters#propagationPolicy" >}}">propagationPolicy

Response

200 (<a href="{{< ref "../common-definitions/status#Status" >}}">Status): OK

202 (<a href="{{< ref "../common-definitions/status#Status" >}}">Status): Accepted

401: Unauthorized

deletecollection delete collection of Lease

HTTP Request

DELETE /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases

Parameters

  • namespace (in path): string, required

    <a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace

  • body: <a href="{{< ref "../common-definitions/delete-options#DeleteOptions" >}}">DeleteOptions

  • continue (in query): string

    <a href="{{< ref "../common-parameters/common-parameters#continue" >}}">continue

  • dryRun (in query): string

    <a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun

  • fieldSelector (in query): string

    <a href="{{< ref "../common-parameters/common-parameters#fieldSelector" >}}">fieldSelector

  • gracePeriodSeconds (in query): integer

    <a href="{{< ref "../common-parameters/common-parameters#gracePeriodSeconds" >}}">gracePeriodSeconds

  • labelSelector (in query): string

    <a href="{{< ref "../common-parameters/common-parameters#labelSelector" >}}">labelSelector

  • limit (in query): integer

    <a href="{{< ref "../common-parameters/common-parameters#limit" >}}">limit

  • pretty (in query): string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

  • propagationPolicy (in query): string

    <a href="{{< ref "../common-parameters/common-parameters#propagationPolicy" >}}">propagationPolicy

  • resourceVersion (in query): string

    <a href="{{< ref "../common-parameters/common-parameters#resourceVersion" >}}">resourceVersion

  • resourceVersionMatch (in query): string

    <a href="{{< ref "../common-parameters/common-parameters#resourceVersionMatch" >}}">resourceVersionMatch

  • timeoutSeconds (in query): integer

    <a href="{{< ref "../common-parameters/common-parameters#timeoutSeconds" >}}">timeoutSeconds

Response

200 (<a href="{{< ref "../common-definitions/status#Status" >}}">Status): OK

401: Unauthorized