namespace#

State module for managing Kubernetes Namespace.

async idem_k8s.states.k8s.core.v1.namespace.present(hub, ctx, name: str, metadata: Dict, resource_id: str = None) Dict[str, Any][source]#

Create a Namespace

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

  • resource_id (str, Optional) – An identifier of the resource in the provider. Defaults to None.

  • metadata (dict) – Standard object’s metadata. More info: Kubernetes reference

Returns:

Dict[str, Any]

Examples

resource_is_present:
  k8s.core.v1.namespace.present:
  - name: idem-test
  - metadata:
      name: idem-test
      labels:
        example-label-name: example-label-value
async idem_k8s.states.k8s.core.v1.namespace.absent(hub, ctx, name: str, resource_id: str = None, timeout: Dict = None) Dict[str, Any][source]#

Delete a Namespace

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

  • resource_id (str, Optional) – An identifier of the resource in the provider. Defaults to None.

  • timeout (dict, Optional) –

    Timeout configuration for resource deletion.

    • delete (dict) – Timeout configuration for resource deletion
      • delay(int, Optional) – The amount of time in seconds to wait between attempts. Defaults to 15

      • max_attempts(int, Optional) – Customized timeout configuration containing delay and max attempts. Defaults to 40.

Returns:

Dict[str, Any]

Examples

resource_is_absent:
  k8s.core.v1.namespace.absent:
    - name: value
    - resource_id: value
async idem_k8s.states.k8s.core.v1.namespace.describe(hub, ctx) Dict[str, Dict[str, Any]][source]#

Describe the resource in a way that can be recreated/managed with the corresponding “present” function.

List or watch objects of kind Namespace.

Returns:

Dict[str, Dict[str, Any]]

Examples

$ idem describe k8s.core.v1.namespace