interface Leases {
    create(
        namespace: NamespaceName,
        leaseName: string,
        holderName: string,
        durationSeconds: number,
    ): Promise<V1Lease>;
    delete(namespace: NamespaceName, name: string): Promise<V1Status>;
    read(
        namespace: NamespaceName,
        leaseName: string,
        timesCalled?: number,
    ): Promise<any>;
    renew(
        namespace: NamespaceName,
        leaseName: string,
        lease: V1Lease,
    ): Promise<V1Lease>;
    transfer(lease: V1Lease, newHolderName: string): Promise<V1Lease>;
}

Implemented by

Methods

  • Create a new lease

    Parameters

    • namespace: NamespaceName

      the namespace to create the lease in

    • leaseName: string

      the name of the lease

    • holderName: string

      the name of the lease holder

    • durationSeconds: number

      the duration of the lease in seconds\

    Returns Promise<V1Lease>

    the created lease

  • Returns the lease with the specified name

    Parameters

    • namespace: NamespaceName

      the namespace to list leases in

    • leaseName: string

      the name of the lease

    • OptionaltimesCalled: number

      the number of times this function has been called

    Returns Promise<any>

    a list of lease names

  • Renew a lease

    Parameters

    • namespace: NamespaceName

      the namespace of the lease

    • leaseName: string

      the name of the lease

    • lease: V1Lease

      the lease object

    Returns Promise<V1Lease>

    the renewed lease

  • Transfer a lease

    Parameters

    • lease: V1Lease

      the lease object

    • newHolderName: string

      the name of the new lease holder

    Returns Promise<V1Lease>

    the transferred lease