当前位置: 首页>>代码示例>>Python>>正文


Python client.ApiextensionsV1beta1Api方法代码示例

本文整理汇总了Python中kubernetes.client.ApiextensionsV1beta1Api方法的典型用法代码示例。如果您正苦于以下问题:Python client.ApiextensionsV1beta1Api方法的具体用法?Python client.ApiextensionsV1beta1Api怎么用?Python client.ApiextensionsV1beta1Api使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在kubernetes.client的用法示例。


在下文中一共展示了client.ApiextensionsV1beta1Api方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from kubernetes import client [as 别名]
# 或者: from kubernetes.client import ApiextensionsV1beta1Api [as 别名]
def __init__(self) -> None:
        kube_config.load_kube_config(
            config_file=os.environ.get("KUBECONFIG", KUBE_CONFIG_PATH),
            context=os.environ.get("KUBECONTEXT"),
        )
        models.V1beta1PodDisruptionBudgetStatus.disrupted_pods = property(
            fget=lambda *args, **kwargs: models.V1beta1PodDisruptionBudgetStatus.disrupted_pods(
                *args, **kwargs
            ),
            fset=_set_disrupted_pods,
        )
        self.deployments = kube_client.AppsV1Api()
        self.core = kube_client.CoreV1Api()
        self.policy = kube_client.PolicyV1beta1Api()
        self.apiextensions = kube_client.ApiextensionsV1beta1Api()
        self.custom = kube_client.CustomObjectsApi()
        self.autoscaling = kube_client.AutoscalingV2beta1Api()
        self.request = kube_client.ApiClient().request 
开发者ID:Yelp,项目名称:paasta,代码行数:20,代码来源:kubernetes_tools.py

示例2: __init__

# 需要导入模块: from kubernetes import client [as 别名]
# 或者: from kubernetes.client import ApiextensionsV1beta1Api [as 别名]
def __init__(self, bearer_token=None):
        '''
        Initialize connection to Kubernetes
        '''
        self.bearer_token = bearer_token
        api_client = None

        try:
            config.load_incluster_config()
        except config.config_exception.ConfigException:
            config.load_kube_config()

        if self.bearer_token:
            # Configure API key authorization: Bearer Token
            configuration = client.Configuration()
            configuration.api_key_prefix['authorization'] = 'Bearer'
            configuration.api_key['authorization'] = self.bearer_token
            api_client = client.ApiClient(configuration)

        self.client = client.CoreV1Api(api_client)
        self.batch_api = client.BatchV1Api(api_client)
        self.batch_v1beta1_api = client.BatchV1beta1Api(api_client)
        self.custom_objects = client.CustomObjectsApi(api_client)
        self.api_extensions = client.ApiextensionsV1beta1Api(api_client)
        self.extension_api = client.ExtensionsV1beta1Api(api_client)
        self.apps_v1_api = client.AppsV1Api(api_client) 
开发者ID:airshipit,项目名称:armada,代码行数:28,代码来源:k8s.py

示例3: __init__

# 需要导入模块: from kubernetes import client [as 别名]
# 或者: from kubernetes.client import ApiextensionsV1beta1Api [as 别名]
def __init__(self):
        # Create Kubernetes config.
        load_incluster_config()
        config = Configuration()
        config.debug = Settings.KUBERNETES_SERVICE_DEBUG
        self.api_client = client.ApiClient(config)

        # Re-usable API client instances.
        self.core_api = client.CoreV1Api(self.api_client)
        self.custom_objects_api = client.CustomObjectsApi(self.api_client)
        self.extensions_api = client.ApiextensionsV1beta1Api(self.api_client)
        self.apps_api = client.AppsV1beta1Api(self.api_client) 
开发者ID:Ultimaker,项目名称:k8s-mongo-operator,代码行数:14,代码来源:KubernetesService.py

示例4: get_status_update_method

# 需要导入模块: from kubernetes import client [as 别名]
# 或者: from kubernetes.client import ApiextensionsV1beta1Api [as 别名]
def get_status_update_method(self) -> None:
        """
        Get status update method from CRD.

        Depends on status subresource is set or unset in CRD.
        """
        name = '{}.{}'.format(self.plural, self.group)
        self.status_update_method = self.co_api.patch_namespaced_custom_object
        try:
            api_response = self.crd_api.read_custom_resource_definition(name)
        except ApiException as err:
            _LOGGER.error(
                '%s/%s: Exception when calling ApiextensionsV1beta1Api->'
                'read_custom_resource_definition: %s', self.group, self.plural, err)
            raise
        else:
            _LOGGER.debug(
                '%s/%s: Successfully read custom resource definition %s', self.group, self.plural,
                name)
            if api_response.spec.subresources is not None:
                if api_response.spec.subresources.status is not None:
                    self.status_update_method = self.co_api.patch_namespaced_custom_object_status
                    _LOGGER.info('There is a status subresource defined in CRD %s', name)
                    return

            _LOGGER.info('There is no status subresource defined in CRD %s', name) 
开发者ID:SAP,项目名称:ewm-cloud-robotics,代码行数:28,代码来源:k8scrhandler.py


注:本文中的kubernetes.client.ApiextensionsV1beta1Api方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。