k8s-object-present

Description

n/a

Variables

Name Type Default Description

resource_definition

dict --

Provide a valid YAML definition for an object when creating or updating. NOTE: kind, api_version, name, and namespace will be overwritten by corresponding values found in the provided resource_definition. Required

api_version

string v1

Use to specify the API version. Use to create, delete, or discover an object without providing a full resource definition. Use in conjunction with kind, name, and namespace to identify a specific object.

kind

string --

Use to specify an object model. Use to create, delete, or discover an object without providing a full resource definition. Use in conjunction with api_version, name, and namespace to identify a specific object.

name

string --

Use to specify an object name. Use to create, delete, or discover an object without providing a full resource definition. Use in conjunction with api_version, kind and namespace to identify a specific object. If resource definition is provided, the metadata.name value from the resource_definition will override this option.

namespace

string --

Use to specify an object namespace. Useful when creating, deleting, or discovering an object. Use in conjunction with api_version, kind, and name to identify a specfic object.

Code

args:
  api_version:
    doc:
      short_help: The API version.
      help: |
        Use to specify the API version. Use to create, delete, or discover an object without providing a full resource definition. Use in conjunction with kind, name, and namespace to identify a specific object.
    type: string
    required: false
    default: v1
  name:
    doc:
      short_help: The name of the namespace.
      help: |
        Use to specify an object name. Use to create, delete, or discover an object without providing a full resource definition. Use in conjunction with api_version, kind and namespace to identify a specific object. If resource definition is provided, the metadata.name value from the resource_definition will override this option.
    type: string
    required: false
  namespace:
    doc:
      short_help: The namespace where the object lives.
      help: |
        Use to specify an object namespace. Useful when creating, deleting, or discovering an object. Use in conjunction with api_version, kind, and name to identify a specfic object.
    type: string
    required: false
  kind:
    doc:
      short_help: The object model type.
      help: |
        Use to specify an object model. Use to create, delete, or discover an object without providing a full resource definition. Use in conjunction with api_version, name, and namespace to identify a specific object.
    type: string
    required: false
  resource_definition:
    doc:
      short_help: The resource data.
      help: |
        Provide a valid YAML definition for an object when creating or updating. NOTE: kind, api_version, name, and namespace will be overwritten by corresponding values found in the provided resource_definition.
    type: dict
    empty: false

frecklets:
- frecklet:
    name: k8s
    type: ansible-module
    properties:
      idempotent: true
      elevated: false
    resources:
      python-package:
      - openshift
      - requests
    desc:
      short: creating k8s resource
  task:
    become: false
    delegate_to: localhost
  vars:
    api_version: '{{:: api_version ::}}'
    kind: '{{:: kind ::}}'
    name: '{{:: name ::}}'
    namespace: '{{:: namespace ::}}'
    state: present
    resource_definition: '{{:: resource_definition ::}}'
frecklecute k8s-object-present --help

Usage: frecklecute k8s-object-present [OPTIONS]

  n/a

Options:
  --resource-definition RESOURCE_DEFINITION
                                  The resource data.  [required]
  --api-version API_VERSION       The API version.
  --kind KIND                     The object model type.
  --name NAME                     The name of the namespace.
  --namespace NAMESPACE           The namespace where the object lives.
  --help                          Show this message and exit.
# -*- coding: utf-8 -*-


#
# module path: pycklets.k8s_object_present.K8sObjectPresent
#


from dataclasses import dataclass
from pyckles import AutoPycklet
from typing import *    # noqa

@dataclass
class K8sObjectPresent(AutoPycklet):
    """No documentation available.

       Args:
         api_version: The API version.
         kind: The object model type.
         name: The name of the namespace.
         namespace: The namespace where the object lives.
         resource_definition: The resource data.

    """

    FRECKLET_ID = "k8s-object-present"

    api_version: str = None
    kind: str = None
    name: str = None
    namespace: str = None
    resource_definition: Dict = None


    def __post_init__(self):
        super(K8sObjectPresent, self).__init__(var_names=["api_version", "kind", "name", "namespace", "resource_definition"])


frecklet_class = K8sObjectPresent
# -*- coding: utf-8 -*-


#
# module path: pycklets.k8s_object_present.K8sObjectPresent
#


from pyckles import AutoPycklet

class K8sObjectPresent(AutoPycklet):
    """No documentation available.

       Args:
         api_version: The API version.
         kind: The object model type.
         name: The name of the namespace.
         namespace: The namespace where the object lives.
         resource_definition: The resource data.

    """

    FRECKLET_ID = "k8s-object-present"

    def __init__(self, api_version="v1", kind=None, name=None, namespace=None, resource_definition=None):

        super(K8sObjectPresent, self).__init__(var_names=["api_version", "kind", "name", "namespace", "resource_definition"])
        self._api_version = api_version
        self._kind = kind
        self._name = name
        self._namespace = namespace
        self._resource_definition = resource_definition

    @property
    def api_version(self):
        return self._api_version

    @api_version.setter
    def api_version(self, api_version):
        self._api_version = api_version

    @property
    def kind(self):
        return self._kind

    @kind.setter
    def kind(self, kind):
        self._kind = kind

    @property
    def name(self):
        return self._name

    @name.setter
    def name(self, name):
        self._name = name

    @property
    def namespace(self):
        return self._namespace

    @namespace.setter
    def namespace(self, namespace):
        self._namespace = namespace

    @property
    def resource_definition(self):
        return self._resource_definition

    @resource_definition.setter
    def resource_definition(self, resource_definition):
        self._resource_definition = resource_definition



frecklet_class = K8sObjectPresent