persistent_volume_claim#

Exec module for managing Kubernetes PersistentVolumeClaim(s).

async idem_k8s.exec.k8s.core.v1.persistent_volume_claim.get(hub, ctx, name: str, resource_id: str = None, namespace: str = 'default') Dict[str, Any][source]#

Retrieves a Kubernetes CoreV1 PersistentVolumeClaim.

Parameters:
  • name (str) – An Idem name of the resource.

  • resource_id (str) – The metadata.name of the Kubernetes CoreV1 PersistentVolumeClaim.

  • namespace (str, Optional) – The Kubernetes namespace in which CoreV1 PersistentVolumeClaim was created. Defaults to ‘default’ namespace in case None.

Returns:

Return a CoreV1 PersistentVolumeClaim in a given namespace.

Return type:

Dict[str, Any]

Examples

Calling this exec module function from the cli:

idem exec k8s.core.v1.persistent_volume_claim.get name='pvc-name' resource_id='pvc-12' namespace='default'

Using in a state:

my-kubernetes-pvc:
  exec.run:
    - path: k8s.core.v1.persistent_volume_claim.get
    - kwargs:
        name: 'pvc-name'
        resource_id: 'pvc-12'
        namespace: 'default'
async idem_k8s.exec.k8s.core.v1.persistent_volume_claim.list_(hub, ctx, name) Dict[source]#

Retrieves list of Kubernetes CoreV1 PersistentVolumeClaims.

Parameters:

name (str, Optional) – The name of the Idem state.

Return type:

Dict[bool, list, dict or None]

Examples

Calling this exec module function from the cli

idem exec k8s.core.v1.persistent_volume_claim.list name="idem_name"

Using in a state:

my_unmanaged_resource:
  exec.run:
    - path: k8s.core.v1.persistent_volume_claim.list
    - kwargs:
        name: my_resource