Ejemplo n.º 1
0
 def __init__(
     self,
     metadata: "ObjectMeta" = None,
     spec: "CertificateSigningRequestSpec" = None,
     status: "CertificateSigningRequestStatus" = None,
 ):
     """Create CertificateSigningRequest instance."""
     super(CertificateSigningRequest,
           self).__init__(api_version="certificates/v1beta1",
                          kind="CertificateSigningRequest")
     self._properties = {
         "metadata":
         metadata if metadata is not None else ObjectMeta(),
         "spec":
         spec if spec is not None else CertificateSigningRequestSpec(),
         "status":
         status
         if status is not None else CertificateSigningRequestStatus(),
     }
     self._types = {
         "apiVersion": (str, None),
         "kind": (str, None),
         "metadata": (ObjectMeta, None),
         "spec": (CertificateSigningRequestSpec, None),
         "status": (CertificateSigningRequestStatus, None),
     }
Ejemplo n.º 2
0
 def __init__(
     self,
     capacity: typing.Union[str, int, None] = None,
     maximum_volume_size: typing.Union[str, int, None] = None,
     metadata: "ObjectMeta" = None,
     node_topology: "LabelSelector" = None,
     storage_class_name: str = None,
 ):
     """Create CSIStorageCapacity instance."""
     super(CSIStorageCapacity,
           self).__init__(api_version="storage/v1alpha1",
                          kind="CSIStorageCapacity")
     self._properties = {
         "capacity":
         capacity if capacity is not None else None,
         "maximumVolumeSize":
         maximum_volume_size if maximum_volume_size is not None else None,
         "metadata":
         metadata if metadata is not None else ObjectMeta(),
         "nodeTopology":
         node_topology if node_topology is not None else LabelSelector(),
         "storageClassName":
         storage_class_name if storage_class_name is not None else "",
     }
     self._types = {
         "apiVersion": (str, None),
         "capacity": (_types.integer_or_string, None),
         "kind": (str, None),
         "maximumVolumeSize": (_types.integer_or_string, None),
         "metadata": (ObjectMeta, None),
         "nodeTopology": (LabelSelector, None),
         "storageClassName": (str, None),
     }
Ejemplo n.º 3
0
 def __init__(
     self,
     handler: str = None,
     metadata: "ObjectMeta" = None,
     overhead: "Overhead" = None,
     scheduling: "Scheduling" = None,
 ):
     """Create RuntimeClass instance."""
     super(RuntimeClass, self).__init__(api_version="node/v1beta1",
                                        kind="RuntimeClass")
     self._properties = {
         "handler": handler if handler is not None else "",
         "metadata": metadata if metadata is not None else ObjectMeta(),
         "overhead": overhead if overhead is not None else Overhead(),
         "scheduling":
         scheduling if scheduling is not None else Scheduling(),
     }
     self._types = {
         "apiVersion": (str, None),
         "handler": (str, None),
         "kind": (str, None),
         "metadata": (ObjectMeta, None),
         "overhead": (Overhead, None),
         "scheduling": (Scheduling, None),
     }
Ejemplo n.º 4
0
 def __init__(
     self,
     api_version: str = None,
     kind: str = None,
     metadata: "ObjectMeta" = None,
     spec: dict = None,
     status: dict = None,
 ):
     """Create CustomObject instance."""
     super(CustomObject, self).__init__(
         api_version=api_version or "custom/v1",
         kind=kind or "CustomObject",
     )
     self._properties = {
         "apiVersion": api_version if api_version is not None else "",
         "kind": kind if kind is not None else "",
         "metadata": metadata if metadata is not None else ObjectMeta(),
         "spec": spec if spec is not None else {},
         "status": status if status is not None else {},
     }
     self._types = {
         "apiVersion": (str, None),
         "kind": (str, None),
         "metadata": (ObjectMeta, None),
         "spec": (dict, None),
         "status": (dict, None),
     }
Ejemplo n.º 5
0
 def __init__(
     self,
     description: str = None,
     global_default: bool = None,
     metadata: "ObjectMeta" = None,
     preemption_policy: str = None,
     value: int = None,
 ):
     """Create PriorityClass instance."""
     super(PriorityClass, self).__init__(
         api_version="scheduling/v1", kind="PriorityClass"
     )
     self._properties = {
         "description": description if description is not None else "",
         "globalDefault": global_default if global_default is not None else None,
         "metadata": metadata if metadata is not None else ObjectMeta(),
         "preemptionPolicy": preemption_policy
         if preemption_policy is not None
         else "",
         "value": value if value is not None else None,
     }
     self._types = {
         "apiVersion": (str, None),
         "description": (str, None),
         "globalDefault": (bool, None),
         "kind": (str, None),
         "metadata": (ObjectMeta, None),
         "preemptionPolicy": (str, None),
         "value": (int, None),
     }
Ejemplo n.º 6
0
 def __init__(
     self,
     metadata: "ObjectMeta" = None,
     spec: "HorizontalPodAutoscalerSpec" = None,
     status: "HorizontalPodAutoscalerStatus" = None,
 ):
     """Create HorizontalPodAutoscaler instance."""
     super(HorizontalPodAutoscaler,
           self).__init__(api_version="autoscaling/v1",
                          kind="HorizontalPodAutoscaler")
     self._properties = {
         "metadata":
         metadata if metadata is not None else ObjectMeta(),
         "spec":
         spec if spec is not None else HorizontalPodAutoscalerSpec(),
         "status":
         status if status is not None else HorizontalPodAutoscalerStatus(),
     }
     self._types = {
         "apiVersion": (str, None),
         "kind": (str, None),
         "metadata": (ObjectMeta, None),
         "spec": (HorizontalPodAutoscalerSpec, None),
         "status": (HorizontalPodAutoscalerStatus, None),
     }
Ejemplo n.º 7
0
 def metadata(self, value: typing.Union["ObjectMeta", dict]):
     """ """
     if isinstance(value, dict):
         value = typing.cast(
             ObjectMeta,
             ObjectMeta().from_dict(value),
         )
     self._properties["metadata"] = value
Ejemplo n.º 8
0
 def metadata(self, value: typing.Union["ObjectMeta", dict]):
     """
     Standard object's metadata. More info:
     https://git.k8s.io/community/contributors/devel/api-
     conventions.md#metadata
     """
     if isinstance(value, dict):
         value = typing.cast(
             ObjectMeta,
             ObjectMeta().from_dict(value),
         )
     self._properties["metadata"] = value
Ejemplo n.º 9
0
 def __init__(
     self,
     metadata: "ObjectMeta" = None,
     spec: "JobSpec" = None,
 ):
     """Create JobTemplateSpec instance."""
     super(JobTemplateSpec, self).__init__(api_version="batch/v1beta1",
                                           kind="JobTemplateSpec")
     self._properties = {
         "metadata": metadata if metadata is not None else ObjectMeta(),
         "spec": spec if spec is not None else JobSpec(),
     }
     self._types = {
         "metadata": (ObjectMeta, None),
         "spec": (JobSpec, None),
     }
Ejemplo n.º 10
0
 def __init__(
     self,
     metadata: "ObjectMeta" = None,
     spec: "LeaseSpec" = None,
 ):
     """Create Lease instance."""
     super(Lease, self).__init__(api_version="coordination/v1", kind="Lease")
     self._properties = {
         "metadata": metadata if metadata is not None else ObjectMeta(),
         "spec": spec if spec is not None else LeaseSpec(),
     }
     self._types = {
         "apiVersion": (str, None),
         "kind": (str, None),
         "metadata": (ObjectMeta, None),
         "spec": (LeaseSpec, None),
     }
Ejemplo n.º 11
0
 def __init__(
     self,
     metadata: "ObjectMeta" = None,
     spec: "RuntimeClassSpec" = None,
 ):
     """Create RuntimeClass instance."""
     super(RuntimeClass, self).__init__(api_version="node/v1alpha1",
                                        kind="RuntimeClass")
     self._properties = {
         "metadata": metadata if metadata is not None else ObjectMeta(),
         "spec": spec if spec is not None else RuntimeClassSpec(),
     }
     self._types = {
         "apiVersion": (str, None),
         "kind": (str, None),
         "metadata": (ObjectMeta, None),
         "spec": (RuntimeClassSpec, None),
     }
Ejemplo n.º 12
0
 def __init__(
     self,
     metadata: "ObjectMeta" = None,
     rules: typing.List["PolicyRule"] = None,
 ):
     """Create Role instance."""
     super(Role, self).__init__(
         api_version="rbac.authorization.k8s.io/v1", kind="Role"
     )
     self._properties = {
         "metadata": metadata if metadata is not None else ObjectMeta(),
         "rules": rules if rules is not None else [],
     }
     self._types = {
         "apiVersion": (str, None),
         "kind": (str, None),
         "metadata": (ObjectMeta, None),
         "rules": (list, PolicyRule),
     }
Ejemplo n.º 13
0
 def __init__(
     self,
     metadata: "ObjectMeta" = None,
     spec: "IngressSpec" = None,
     status: "IngressStatus" = None,
 ):
     """Create Ingress instance."""
     super(Ingress, self).__init__(api_version="extensions/v1beta1", kind="Ingress")
     self._properties = {
         "metadata": metadata if metadata is not None else ObjectMeta(),
         "spec": spec if spec is not None else IngressSpec(),
         "status": status if status is not None else IngressStatus(),
     }
     self._types = {
         "apiVersion": (str, None),
         "kind": (str, None),
         "metadata": (ObjectMeta, None),
         "spec": (IngressSpec, None),
         "status": (IngressStatus, None),
     }
Ejemplo n.º 14
0
 def __init__(
     self,
     metadata: "ObjectMeta" = None,
     spec: "TokenReviewSpec" = None,
     status: "TokenReviewStatus" = None,
 ):
     """Create TokenReview instance."""
     super(TokenReview, self).__init__(api_version="authentication/v1",
                                       kind="TokenReview")
     self._properties = {
         "metadata": metadata if metadata is not None else ObjectMeta(),
         "spec": spec if spec is not None else TokenReviewSpec(),
         "status": status if status is not None else TokenReviewStatus(),
     }
     self._types = {
         "apiVersion": (str, None),
         "kind": (str, None),
         "metadata": (ObjectMeta, None),
         "spec": (TokenReviewSpec, None),
         "status": (TokenReviewStatus, None),
     }
Ejemplo n.º 15
0
 def __init__(
     self,
     metadata: "ObjectMeta" = None,
     spec: "CronJobSpec" = None,
     status: "CronJobStatus" = None,
 ):
     """Create CronJob instance."""
     super(CronJob, self).__init__(api_version="batch/v1beta1",
                                   kind="CronJob")
     self._properties = {
         "metadata": metadata if metadata is not None else ObjectMeta(),
         "spec": spec if spec is not None else CronJobSpec(),
         "status": status if status is not None else CronJobStatus(),
     }
     self._types = {
         "apiVersion": (str, None),
         "kind": (str, None),
         "metadata": (ObjectMeta, None),
         "spec": (CronJobSpec, None),
         "status": (CronJobStatus, None),
     }
Ejemplo n.º 16
0
    def metadata(self, value: typing.Union["ObjectMeta", dict]):
        """
        Standard object's metadata. The name has no particular
        meaning. It must be be a DNS subdomain (dots allowed, 253
        characters). To ensure that there are no conflicts with
        other CSI drivers on the cluster, the recommendation is to
        use csisc-<uuid>, a generated name, or a reverse-domain name
        which ends with the unique CSI driver name.

        Objects are namespaced.

        More info:
        https://git.k8s.io/community/contributors/devel/sig-
        architecture/api-conventions.md#metadata
        """
        if isinstance(value, dict):
            value = typing.cast(
                ObjectMeta,
                ObjectMeta().from_dict(value),
            )
        self._properties["metadata"] = value
Ejemplo n.º 17
0
 def __init__(
     self,
     metadata: "ObjectMeta" = None,
     spec: "APIServiceSpec" = None,
     status: "APIServiceStatus" = None,
 ):
     """Create APIService instance."""
     super(APIService,
           self).__init__(api_version="apiregistration.k8s.io/v1beta1",
                          kind="APIService")
     self._properties = {
         "metadata": metadata if metadata is not None else ObjectMeta(),
         "spec": spec if spec is not None else APIServiceSpec(),
         "status": status if status is not None else APIServiceStatus(),
     }
     self._types = {
         "apiVersion": (str, None),
         "kind": (str, None),
         "metadata": (ObjectMeta, None),
         "spec": (APIServiceSpec, None),
         "status": (APIServiceStatus, None),
     }
Ejemplo n.º 18
0
 def __init__(
     self,
     metadata: "ObjectMeta" = None,
     spec: "VolumeAttachmentSpec" = None,
     status: "VolumeAttachmentStatus" = None,
 ):
     """Create VolumeAttachment instance."""
     super(VolumeAttachment, self).__init__(api_version="storage/v1alpha1",
                                            kind="VolumeAttachment")
     self._properties = {
         "metadata": metadata if metadata is not None else ObjectMeta(),
         "spec": spec if spec is not None else VolumeAttachmentSpec(),
         "status":
         status if status is not None else VolumeAttachmentStatus(),
     }
     self._types = {
         "apiVersion": (str, None),
         "kind": (str, None),
         "metadata": (ObjectMeta, None),
         "spec": (VolumeAttachmentSpec, None),
         "status": (VolumeAttachmentStatus, None),
     }
Ejemplo n.º 19
0
 def __init__(
     self,
     metadata: "ObjectMeta" = None,
     role_ref: "RoleRef" = None,
     subjects: typing.List["Subject"] = None,
 ):
     """Create ClusterRoleBinding instance."""
     super(ClusterRoleBinding, self).__init__(
         api_version="rbac.authorization.k8s.io/v1", kind="ClusterRoleBinding"
     )
     self._properties = {
         "metadata": metadata if metadata is not None else ObjectMeta(),
         "roleRef": role_ref if role_ref is not None else RoleRef(),
         "subjects": subjects if subjects is not None else [],
     }
     self._types = {
         "apiVersion": (str, None),
         "kind": (str, None),
         "metadata": (ObjectMeta, None),
         "roleRef": (RoleRef, None),
         "subjects": (list, Subject),
     }
Ejemplo n.º 20
0
 def __init__(
     self,
     metadata: "ObjectMeta" = None,
     spec: "StorageVersionSpec" = None,
     status: "StorageVersionStatus" = None,
 ):
     """Create StorageVersion instance."""
     super(StorageVersion, self).__init__(
         api_version="apiserverinternal/v1alpha1", kind="StorageVersion"
     )
     self._properties = {
         "metadata": metadata if metadata is not None else ObjectMeta(),
         "spec": spec if spec is not None else StorageVersionSpec(),
         "status": status if status is not None else StorageVersionStatus(),
     }
     self._types = {
         "apiVersion": (str, None),
         "kind": (str, None),
         "metadata": (ObjectMeta, None),
         "spec": (StorageVersionSpec, None),
         "status": (StorageVersionStatus, None),
     }
Ejemplo n.º 21
0
 def __init__(
     self,
     address_type: str = None,
     endpoints: typing.List["Endpoint"] = None,
     metadata: "ObjectMeta" = None,
     ports: typing.List["EndpointPort"] = None,
 ):
     """Create EndpointSlice instance."""
     super(EndpointSlice, self).__init__(api_version="discovery/v1",
                                         kind="EndpointSlice")
     self._properties = {
         "addressType": address_type if address_type is not None else "",
         "endpoints": endpoints if endpoints is not None else [],
         "metadata": metadata if metadata is not None else ObjectMeta(),
         "ports": ports if ports is not None else [],
     }
     self._types = {
         "addressType": (str, None),
         "apiVersion": (str, None),
         "endpoints": (list, Endpoint),
         "kind": (str, None),
         "metadata": (ObjectMeta, None),
         "ports": (list, EndpointPort),
     }
Ejemplo n.º 22
0
 def __init__(
     self,
     metadata: "ObjectMeta" = None,
     spec: "PodDisruptionBudgetSpec" = None,
     status: "PodDisruptionBudgetStatus" = None,
 ):
     """Create PodDisruptionBudget instance."""
     super(PodDisruptionBudget, self).__init__(api_version="policy/v1",
                                               kind="PodDisruptionBudget")
     self._properties = {
         "metadata":
         metadata if metadata is not None else ObjectMeta(),
         "spec":
         spec if spec is not None else PodDisruptionBudgetSpec(),
         "status":
         status if status is not None else PodDisruptionBudgetStatus(),
     }
     self._types = {
         "apiVersion": (str, None),
         "kind": (str, None),
         "metadata": (ObjectMeta, None),
         "spec": (PodDisruptionBudgetSpec, None),
         "status": (PodDisruptionBudgetStatus, None),
     }
Ejemplo n.º 23
0
 def __init__(
     self,
     action: str = None,
     deprecated_count: int = None,
     deprecated_first_timestamp: str = None,
     deprecated_last_timestamp: str = None,
     deprecated_source: "EventSource" = None,
     event_time: "MicroTime" = None,
     metadata: "ObjectMeta" = None,
     note: str = None,
     reason: str = None,
     regarding: "ObjectReference" = None,
     related: "ObjectReference" = None,
     reporting_controller: str = None,
     reporting_instance: str = None,
     series: "EventSeries" = None,
     type_: str = None,
 ):
     """Create Event instance."""
     super(Event, self).__init__(api_version="events/v1", kind="Event")
     self._properties = {
         "action":
         action if action is not None else "",
         "deprecatedCount":
         deprecated_count if deprecated_count is not None else None,
         "deprecatedFirstTimestamp":
         deprecated_first_timestamp
         if deprecated_first_timestamp is not None else None,
         "deprecatedLastTimestamp":
         deprecated_last_timestamp
         if deprecated_last_timestamp is not None else None,
         "deprecatedSource":
         deprecated_source
         if deprecated_source is not None else EventSource(),
         "eventTime":
         event_time if event_time is not None else MicroTime(),
         "metadata":
         metadata if metadata is not None else ObjectMeta(),
         "note":
         note if note is not None else "",
         "reason":
         reason if reason is not None else "",
         "regarding":
         regarding if regarding is not None else ObjectReference(),
         "related":
         related if related is not None else ObjectReference(),
         "reportingController":
         reporting_controller if reporting_controller is not None else "",
         "reportingInstance":
         reporting_instance if reporting_instance is not None else "",
         "series":
         series if series is not None else EventSeries(),
         "type":
         type_ if type_ is not None else "",
     }
     self._types = {
         "action": (str, None),
         "apiVersion": (str, None),
         "deprecatedCount": (int, None),
         "deprecatedFirstTimestamp": (str, None),
         "deprecatedLastTimestamp": (str, None),
         "deprecatedSource": (EventSource, None),
         "eventTime": (MicroTime, None),
         "kind": (str, None),
         "metadata": (ObjectMeta, None),
         "note": (str, None),
         "reason": (str, None),
         "regarding": (ObjectReference, None),
         "related": (ObjectReference, None),
         "reportingController": (str, None),
         "reportingInstance": (str, None),
         "series": (EventSeries, None),
         "type": (str, None),
     }