diff --git a/sdk/containerservice/azure-mgmt-containerservice/CHANGELOG.md b/sdk/containerservice/azure-mgmt-containerservice/CHANGELOG.md index c44dceab950e..b8b8226392a2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/CHANGELOG.md +++ b/sdk/containerservice/azure-mgmt-containerservice/CHANGELOG.md @@ -1,5 +1,19 @@ # Release History +## 9.0.0 (2020-03-17) + +**Features** + +- Model OpenShiftManagedClusterMasterPoolProfile has a new parameter api_properties +- Model OpenShiftManagedCluster has a new parameter refresh_cluster +- Model NetworkProfile has a new parameter management_subnet_cidr + +**Breaking changes** + +- Model OpenShiftManagedClusterMasterPoolProfile no longer has parameter name +- Model OpenShiftManagedClusterMasterPoolProfile no longer has parameter os_type +- Model NetworkProfile no longer has parameter peer_vnet_id + ## 8.3.0 (2020-02-14) **Features** diff --git a/sdk/containerservice/azure-mgmt-containerservice/README.md b/sdk/containerservice/azure-mgmt-containerservice/README.md index ee4f83e78c42..34717104b758 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/README.md +++ b/sdk/containerservice/azure-mgmt-containerservice/README.md @@ -1,29 +1,21 @@ -## Microsoft Azure SDK for Python +# Microsoft Azure SDK for Python This is the Microsoft Azure Container Service Management Client Library. - -Azure Resource Manager (ARM) is the next generation of management APIs -that replace the old Azure Service Management (ASM). - This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8. +For a more complete view of Azure libraries, see the [Github repo](https://github.com/Azure/azure-sdk-for-python/) -For the older Azure Service Management (ASM) libraries, see -[azure-servicemanagement-legacy](https://pypi.python.org/pypi/azure-servicemanagement-legacy) -library. - -For a more complete set of Azure libraries, see the -[azure](https://pypi.python.org/pypi/azure) bundle package. -## Usage +# Usage -For code examples, see [Container Service -Management](https://docs.microsoft.com/python/api/overview/azure/containerservice) +For code examples, see [Container Service Management](https://docs.microsoft.com/python/api/overview/azure/containerservice) on docs.microsoft.com. -## Provide Feedback -If you encounter any bugs or have suggestions, please file an issue in -the [Issues](https://github.com/Azure/azure-sdk-for-python/issues) +# Provide Feedback + +If you encounter any bugs or have suggestions, please file an issue in the +[Issues](https://github.com/Azure/azure-sdk-for-python/issues) section of the project. -![image](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-containerservice%2FREADME.png) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-containerservice%2FREADME.png) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_container_service_client.py index 252c57908fb9..f3ce34a883a1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_container_service_client.py @@ -85,6 +85,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2019-08-01: :mod:`v2019_08_01.models` * 2019-09-30-preview: :mod:`v2019_09_30_preview.models` * 2019-10-01: :mod:`v2019_10_01.models` + * 2019-10-27-preview: :mod:`v2019_10_27_preview.models` * 2019-11-01: :mod:`v2019_11_01.models` * 2020-01-01: :mod:`v2020_01_01.models` * 2020-02-01: :mod:`v2020_02_01.models` @@ -122,6 +123,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2019-10-01': from .v2019_10_01 import models return models + elif api_version == '2019-10-27-preview': + from .v2019_10_27_preview import models + return models elif api_version == '2019-11-01': from .v2019_11_01 import models return models @@ -227,6 +231,7 @@ def open_shift_managed_clusters(self): * 2018-09-30-preview: :class:`OpenShiftManagedClustersOperations` * 2019-04-30: :class:`OpenShiftManagedClustersOperations` * 2019-09-30-preview: :class:`OpenShiftManagedClustersOperations` + * 2019-10-27-preview: :class:`OpenShiftManagedClustersOperations` """ api_version = self._get_api_version('open_shift_managed_clusters') if api_version == '2018-09-30-preview': @@ -235,6 +240,8 @@ def open_shift_managed_clusters(self): from .v2019_04_30.operations import OpenShiftManagedClustersOperations as OperationClass elif api_version == '2019-09-30-preview': from .v2019_09_30_preview.operations import OpenShiftManagedClustersOperations as OperationClass + elif api_version == '2019-10-27-preview': + from .v2019_10_27_preview.operations import OpenShiftManagedClustersOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/__init__.py new file mode 100644 index 000000000000..b7cb9d01cb16 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from ._configuration import ContainerServiceClientConfiguration +from ._container_service_client import ContainerServiceClient +__all__ = ['ContainerServiceClient', 'ContainerServiceClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/_configuration.py new file mode 100644 index 000000000000..e94fbc7005d9 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/_configuration.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +from msrestazure import AzureConfiguration + +from .version import VERSION + + +class ContainerServiceClientConfiguration(AzureConfiguration): + """Configuration for ContainerServiceClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Subscription credentials which uniquely identify + Microsoft Azure subscription. The subscription ID forms part of the URI + for every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(ContainerServiceClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-containerservice/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/_container_service_client.py new file mode 100644 index 000000000000..af2740e28852 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/_container_service_client.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.service_client import SDKClient +from msrest import Serializer, Deserializer + +from ._configuration import ContainerServiceClientConfiguration +from .operations import OpenShiftManagedClustersOperations +from . import models + + +class ContainerServiceClient(SDKClient): + """The Container Service Client. + + :ivar config: Configuration for client. + :vartype config: ContainerServiceClientConfiguration + + :ivar open_shift_managed_clusters: OpenShiftManagedClusters operations + :vartype open_shift_managed_clusters: azure.mgmt.containerservice.v2019_10_27_preview.operations.OpenShiftManagedClustersOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Subscription credentials which uniquely identify + Microsoft Azure subscription. The subscription ID forms part of the URI + for every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = ContainerServiceClientConfiguration(credentials, subscription_id, base_url) + super(ContainerServiceClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2019-10-27-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.open_shift_managed_clusters = OpenShiftManagedClustersOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/models/__init__.py new file mode 100644 index 000000000000..25c8d66e04bb --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/models/__init__.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import NetworkProfile + from ._models_py3 import OpenShiftAPIProperties + from ._models_py3 import OpenShiftManagedCluster + from ._models_py3 import OpenShiftManagedClusterAADIdentityProvider + from ._models_py3 import OpenShiftManagedClusterAgentPoolProfile + from ._models_py3 import OpenShiftManagedClusterAuthProfile + from ._models_py3 import OpenShiftManagedClusterBaseIdentityProvider + from ._models_py3 import OpenShiftManagedClusterIdentityProvider + from ._models_py3 import OpenShiftManagedClusterMasterPoolProfile + from ._models_py3 import OpenShiftManagedClusterMonitorProfile + from ._models_py3 import OpenShiftRouterProfile + from ._models_py3 import PurchasePlan + from ._models_py3 import Resource + from ._models_py3 import TagsObject +except (SyntaxError, ImportError): + from ._models import NetworkProfile + from ._models import OpenShiftAPIProperties + from ._models import OpenShiftManagedCluster + from ._models import OpenShiftManagedClusterAADIdentityProvider + from ._models import OpenShiftManagedClusterAgentPoolProfile + from ._models import OpenShiftManagedClusterAuthProfile + from ._models import OpenShiftManagedClusterBaseIdentityProvider + from ._models import OpenShiftManagedClusterIdentityProvider + from ._models import OpenShiftManagedClusterMasterPoolProfile + from ._models import OpenShiftManagedClusterMonitorProfile + from ._models import OpenShiftRouterProfile + from ._models import PurchasePlan + from ._models import Resource + from ._models import TagsObject +from ._paged_models import OpenShiftManagedClusterPaged +from ._container_service_client_enums import ( + OSType, + OpenShiftContainerServiceVMSize, + OpenShiftAgentPoolProfileRole, +) + +__all__ = [ + 'NetworkProfile', + 'OpenShiftAPIProperties', + 'OpenShiftManagedCluster', + 'OpenShiftManagedClusterAADIdentityProvider', + 'OpenShiftManagedClusterAgentPoolProfile', + 'OpenShiftManagedClusterAuthProfile', + 'OpenShiftManagedClusterBaseIdentityProvider', + 'OpenShiftManagedClusterIdentityProvider', + 'OpenShiftManagedClusterMasterPoolProfile', + 'OpenShiftManagedClusterMonitorProfile', + 'OpenShiftRouterProfile', + 'PurchasePlan', + 'Resource', + 'TagsObject', + 'OpenShiftManagedClusterPaged', + 'OSType', + 'OpenShiftContainerServiceVMSize', + 'OpenShiftAgentPoolProfileRole', +] diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/models/_container_service_client_enums.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/models/_container_service_client_enums.py new file mode 100644 index 000000000000..237179cc909e --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/models/_container_service_client_enums.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class OSType(str, Enum): + + linux = "Linux" + windows = "Windows" + + +class OpenShiftContainerServiceVMSize(str, Enum): + + standard_d2s_v3 = "Standard_D2s_v3" + standard_d4s_v3 = "Standard_D4s_v3" + standard_d8s_v3 = "Standard_D8s_v3" + standard_d16s_v3 = "Standard_D16s_v3" + standard_d32s_v3 = "Standard_D32s_v3" + standard_d64s_v3 = "Standard_D64s_v3" + standard_ds4_v2 = "Standard_DS4_v2" + standard_ds5_v2 = "Standard_DS5_v2" + standard_f8s_v2 = "Standard_F8s_v2" + standard_f16s_v2 = "Standard_F16s_v2" + standard_f32s_v2 = "Standard_F32s_v2" + standard_f64s_v2 = "Standard_F64s_v2" + standard_f72s_v2 = "Standard_F72s_v2" + standard_f8s = "Standard_F8s" + standard_f16s = "Standard_F16s" + standard_e4s_v3 = "Standard_E4s_v3" + standard_e8s_v3 = "Standard_E8s_v3" + standard_e16s_v3 = "Standard_E16s_v3" + standard_e20s_v3 = "Standard_E20s_v3" + standard_e32s_v3 = "Standard_E32s_v3" + standard_e64s_v3 = "Standard_E64s_v3" + standard_gs2 = "Standard_GS2" + standard_gs3 = "Standard_GS3" + standard_gs4 = "Standard_GS4" + standard_gs5 = "Standard_GS5" + standard_ds12_v2 = "Standard_DS12_v2" + standard_ds13_v2 = "Standard_DS13_v2" + standard_ds14_v2 = "Standard_DS14_v2" + standard_ds15_v2 = "Standard_DS15_v2" + standard_l4s = "Standard_L4s" + standard_l8s = "Standard_L8s" + standard_l16s = "Standard_L16s" + standard_l32s = "Standard_L32s" + + +class OpenShiftAgentPoolProfileRole(str, Enum): + + compute = "compute" + infra = "infra" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/models/_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/models/_models.py new file mode 100644 index 000000000000..af0a0bd17b9b --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/models/_models.py @@ -0,0 +1,587 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class CloudError(Model): + """An error response from the Container service. + + :param error: Details about the error. + :type error: + ~azure.mgmt.containerservice.v2019_10_27_preview.models.CloudErrorBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'CloudErrorBody'}, + } + + def __init__(self, **kwargs): + super(CloudError, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class CloudErrorException(HttpOperationError): + """Server responsed with exception of type: 'CloudError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + + +class CloudErrorBody(Model): + """An error response from the Container service. + + :param code: An identifier for the error. Codes are invariant and are + intended to be consumed programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable + for display in a user interface. + :type message: str + :param target: The target of the particular error. For example, the name + of the property in error. + :type target: str + :param details: A list of additional details about the error. + :type details: + list[~azure.mgmt.containerservice.v2019_10_27_preview.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__(self, **kwargs): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + + +class NetworkProfile(Model): + """Represents the OpenShift networking configuration. + + :param vnet_cidr: CIDR for the OpenShift Vnet. Default value: "10.0.0.0/8" + . + :type vnet_cidr: str + :param management_subnet_cidr: CIDR of subnet used to create PLS needed + for management of the cluster + :type management_subnet_cidr: str + :param vnet_id: ID of the Vnet created for OSA cluster. + :type vnet_id: str + """ + + _attribute_map = { + 'vnet_cidr': {'key': 'vnetCidr', 'type': 'str'}, + 'management_subnet_cidr': {'key': 'managementSubnetCidr', 'type': 'str'}, + 'vnet_id': {'key': 'vnetId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NetworkProfile, self).__init__(**kwargs) + self.vnet_cidr = kwargs.get('vnet_cidr', "10.0.0.0/8") + self.management_subnet_cidr = kwargs.get('management_subnet_cidr', None) + self.vnet_id = kwargs.get('vnet_id', None) + + +class OpenShiftAPIProperties(Model): + """Defines further properties on the API. + + :param private_api_server: Specifies if API server is public or private. + :type private_api_server: bool + """ + + _attribute_map = { + 'private_api_server': {'key': 'privateApiServer', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(OpenShiftAPIProperties, self).__init__(**kwargs) + self.private_api_server = kwargs.get('private_api_server', None) + + +class Resource(Model): + """The Resource model definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + + +class OpenShiftManagedCluster(Resource): + """OpenShift Managed cluster. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: Define the resource plan as required by ARM for billing + purposes + :type plan: + ~azure.mgmt.containerservice.v2019_10_27_preview.models.PurchasePlan + :ivar provisioning_state: The current deployment or provisioning state, + which only appears in the response. + :vartype provisioning_state: str + :param open_shift_version: Required. Version of OpenShift specified when + creating the cluster. + :type open_shift_version: str + :ivar cluster_version: Version of OpenShift specified when creating the + cluster. + :vartype cluster_version: str + :ivar public_hostname: Service generated FQDN or private IP for OpenShift + API server. + :vartype public_hostname: str + :ivar fqdn: Service generated FQDN for OpenShift API server loadbalancer + internal hostname. + :vartype fqdn: str + :param network_profile: Configuration for OpenShift networking. + :type network_profile: + ~azure.mgmt.containerservice.v2019_10_27_preview.models.NetworkProfile + :param router_profiles: Configuration for OpenShift router(s). + :type router_profiles: + list[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftRouterProfile] + :param master_pool_profile: Configuration for OpenShift master VMs. + :type master_pool_profile: + ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterMasterPoolProfile + :param agent_pool_profiles: Configuration of OpenShift cluster VMs. + :type agent_pool_profiles: + list[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterAgentPoolProfile] + :param auth_profile: Configures OpenShift authentication. + :type auth_profile: + ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterAuthProfile + :param monitor_profile: Configures Log Analytics integration. + :type monitor_profile: + ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterMonitorProfile + :param refresh_cluster: Allows node rotation + :type refresh_cluster: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'open_shift_version': {'required': True}, + 'cluster_version': {'readonly': True}, + 'public_hostname': {'readonly': True}, + 'fqdn': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'PurchasePlan'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'open_shift_version': {'key': 'properties.openShiftVersion', 'type': 'str'}, + 'cluster_version': {'key': 'properties.clusterVersion', 'type': 'str'}, + 'public_hostname': {'key': 'properties.publicHostname', 'type': 'str'}, + 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, + 'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'}, + 'router_profiles': {'key': 'properties.routerProfiles', 'type': '[OpenShiftRouterProfile]'}, + 'master_pool_profile': {'key': 'properties.masterPoolProfile', 'type': 'OpenShiftManagedClusterMasterPoolProfile'}, + 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[OpenShiftManagedClusterAgentPoolProfile]'}, + 'auth_profile': {'key': 'properties.authProfile', 'type': 'OpenShiftManagedClusterAuthProfile'}, + 'monitor_profile': {'key': 'properties.monitorProfile', 'type': 'OpenShiftManagedClusterMonitorProfile'}, + 'refresh_cluster': {'key': 'properties.refreshCluster', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(OpenShiftManagedCluster, self).__init__(**kwargs) + self.plan = kwargs.get('plan', None) + self.provisioning_state = None + self.open_shift_version = kwargs.get('open_shift_version', None) + self.cluster_version = None + self.public_hostname = None + self.fqdn = None + self.network_profile = kwargs.get('network_profile', None) + self.router_profiles = kwargs.get('router_profiles', None) + self.master_pool_profile = kwargs.get('master_pool_profile', None) + self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) + self.auth_profile = kwargs.get('auth_profile', None) + self.monitor_profile = kwargs.get('monitor_profile', None) + self.refresh_cluster = kwargs.get('refresh_cluster', None) + + +class OpenShiftManagedClusterBaseIdentityProvider(Model): + """Structure for any Identity provider. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: OpenShiftManagedClusterAADIdentityProvider + + All required parameters must be populated in order to send to Azure. + + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'kind': {'required': True}, + } + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'AADIdentityProvider': 'OpenShiftManagedClusterAADIdentityProvider'} + } + + def __init__(self, **kwargs): + super(OpenShiftManagedClusterBaseIdentityProvider, self).__init__(**kwargs) + self.kind = None + + +class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIdentityProvider): + """Defines the Identity provider for MS AAD. + + All required parameters must be populated in order to send to Azure. + + :param kind: Required. Constant filled by server. + :type kind: str + :param client_id: The clientId password associated with the provider. + :type client_id: str + :param secret: The secret password associated with the provider. + :type secret: str + :param tenant_id: The tenantId associated with the provider. + :type tenant_id: str + :param customer_admin_group_id: The groupId to be granted cluster admin + role. + :type customer_admin_group_id: str + """ + + _validation = { + 'kind': {'required': True}, + } + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'secret': {'key': 'secret', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'customer_admin_group_id': {'key': 'customerAdminGroupId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OpenShiftManagedClusterAADIdentityProvider, self).__init__(**kwargs) + self.client_id = kwargs.get('client_id', None) + self.secret = kwargs.get('secret', None) + self.tenant_id = kwargs.get('tenant_id', None) + self.customer_admin_group_id = kwargs.get('customer_admin_group_id', None) + self.kind = 'AADIdentityProvider' + + +class OpenShiftManagedClusterAgentPoolProfile(Model): + """Defines the configuration of the OpenShift cluster VMs. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Unique name of the pool profile in the context of + the subscription and resource group. + :type name: str + :param count: Required. Number of agents (VMs) to host docker containers. + :type count: int + :param vm_size: Required. Size of agent VMs. Possible values include: + 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3', + 'Standard_D16s_v3', 'Standard_D32s_v3', 'Standard_D64s_v3', + 'Standard_DS4_v2', 'Standard_DS5_v2', 'Standard_F8s_v2', + 'Standard_F16s_v2', 'Standard_F32s_v2', 'Standard_F64s_v2', + 'Standard_F72s_v2', 'Standard_F8s', 'Standard_F16s', 'Standard_E4s_v3', + 'Standard_E8s_v3', 'Standard_E16s_v3', 'Standard_E20s_v3', + 'Standard_E32s_v3', 'Standard_E64s_v3', 'Standard_GS2', 'Standard_GS3', + 'Standard_GS4', 'Standard_GS5', 'Standard_DS12_v2', 'Standard_DS13_v2', + 'Standard_DS14_v2', 'Standard_DS15_v2', 'Standard_L4s', 'Standard_L8s', + 'Standard_L16s', 'Standard_L32s' + :type vm_size: str or + ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftContainerServiceVMSize + :param subnet_cidr: Subnet CIDR for the peering. Default value: + "10.0.0.0/24" . + :type subnet_cidr: str + :param os_type: OsType to be used to specify os type. Choose from Linux + and Windows. Default to Linux. Possible values include: 'Linux', + 'Windows'. Default value: "Linux" . + :type os_type: str or + ~azure.mgmt.containerservice.v2019_10_27_preview.models.OSType + :param role: Define the role of the AgentPoolProfile. Possible values + include: 'compute', 'infra' + :type role: str or + ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftAgentPoolProfileRole + """ + + _validation = { + 'name': {'required': True}, + 'count': {'required': True}, + 'vm_size': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'int'}, + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'subnet_cidr': {'key': 'subnetCidr', 'type': 'str'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'role': {'key': 'role', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OpenShiftManagedClusterAgentPoolProfile, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.count = kwargs.get('count', None) + self.vm_size = kwargs.get('vm_size', None) + self.subnet_cidr = kwargs.get('subnet_cidr', "10.0.0.0/24") + self.os_type = kwargs.get('os_type', "Linux") + self.role = kwargs.get('role', None) + + +class OpenShiftManagedClusterAuthProfile(Model): + """Defines all possible authentication profiles for the OpenShift cluster. + + :param identity_providers: Type of authentication profile to use. + :type identity_providers: + list[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterIdentityProvider] + """ + + _attribute_map = { + 'identity_providers': {'key': 'identityProviders', 'type': '[OpenShiftManagedClusterIdentityProvider]'}, + } + + def __init__(self, **kwargs): + super(OpenShiftManagedClusterAuthProfile, self).__init__(**kwargs) + self.identity_providers = kwargs.get('identity_providers', None) + + +class OpenShiftManagedClusterIdentityProvider(Model): + """Defines the configuration of the identity providers to be used in the + OpenShift cluster. + + :param name: Name of the provider. + :type name: str + :param provider: Configuration of the provider. + :type provider: + ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterBaseIdentityProvider + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'OpenShiftManagedClusterBaseIdentityProvider'}, + } + + def __init__(self, **kwargs): + super(OpenShiftManagedClusterIdentityProvider, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.provider = kwargs.get('provider', None) + + +class OpenShiftManagedClusterMasterPoolProfile(Model): + """OpenShiftManagedClusterMaterPoolProfile contains configuration for + OpenShift master VMs. + + All required parameters must be populated in order to send to Azure. + + :param count: Required. Number of masters (VMs) to host docker containers. + The default value is 3. + :type count: int + :param vm_size: Required. Size of agent VMs. Possible values include: + 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3', + 'Standard_D16s_v3', 'Standard_D32s_v3', 'Standard_D64s_v3', + 'Standard_DS4_v2', 'Standard_DS5_v2', 'Standard_F8s_v2', + 'Standard_F16s_v2', 'Standard_F32s_v2', 'Standard_F64s_v2', + 'Standard_F72s_v2', 'Standard_F8s', 'Standard_F16s', 'Standard_E4s_v3', + 'Standard_E8s_v3', 'Standard_E16s_v3', 'Standard_E20s_v3', + 'Standard_E32s_v3', 'Standard_E64s_v3', 'Standard_GS2', 'Standard_GS3', + 'Standard_GS4', 'Standard_GS5', 'Standard_DS12_v2', 'Standard_DS13_v2', + 'Standard_DS14_v2', 'Standard_DS15_v2', 'Standard_L4s', 'Standard_L8s', + 'Standard_L16s', 'Standard_L32s' + :type vm_size: str or + ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftContainerServiceVMSize + :param subnet_cidr: Subnet CIDR for the peering. + :type subnet_cidr: str + :param api_properties: Defines further properties on the API. + :type api_properties: + ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftAPIProperties + """ + + _validation = { + 'count': {'required': True}, + 'vm_size': {'required': True}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'subnet_cidr': {'key': 'subnetCidr', 'type': 'str'}, + 'api_properties': {'key': 'apiProperties', 'type': 'OpenShiftAPIProperties'}, + } + + def __init__(self, **kwargs): + super(OpenShiftManagedClusterMasterPoolProfile, self).__init__(**kwargs) + self.count = kwargs.get('count', None) + self.vm_size = kwargs.get('vm_size', None) + self.subnet_cidr = kwargs.get('subnet_cidr', None) + self.api_properties = kwargs.get('api_properties', None) + + +class OpenShiftManagedClusterMonitorProfile(Model): + """Defines the configuration for Log Analytics integration. + + :param workspace_resource_id: Azure Resource Manager Resource ID for the + Log Analytics workspace to integrate with. + :type workspace_resource_id: str + :param enabled: If the Log analytics integration should be turned on or + off + :type enabled: bool + """ + + _attribute_map = { + 'workspace_resource_id': {'key': 'workspaceResourceID', 'type': 'str'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(OpenShiftManagedClusterMonitorProfile, self).__init__(**kwargs) + self.workspace_resource_id = kwargs.get('workspace_resource_id', None) + self.enabled = kwargs.get('enabled', None) + + +class OpenShiftRouterProfile(Model): + """Represents an OpenShift router. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param name: Name of the router profile. + :type name: str + :ivar public_subdomain: DNS subdomain for OpenShift router. + :vartype public_subdomain: str + :ivar fqdn: Auto-allocated FQDN for the OpenShift router. + :vartype fqdn: str + """ + + _validation = { + 'public_subdomain': {'readonly': True}, + 'fqdn': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'public_subdomain': {'key': 'publicSubdomain', 'type': 'str'}, + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OpenShiftRouterProfile, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.public_subdomain = None + self.fqdn = None + + +class PurchasePlan(Model): + """Used for establishing the purchase context of any 3rd Party artifact + through MarketPlace. + + :param name: The plan ID. + :type name: str + :param product: Specifies the product of the image from the marketplace. + This is the same value as Offer under the imageReference element. + :type product: str + :param promotion_code: The promotion code. + :type promotion_code: str + :param publisher: The plan ID. + :type publisher: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PurchasePlan, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.product = kwargs.get('product', None) + self.promotion_code = kwargs.get('promotion_code', None) + self.publisher = kwargs.get('publisher', None) + + +class TagsObject(Model): + """Tags object for patch operations. + + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(TagsObject, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/models/_models_py3.py new file mode 100644 index 000000000000..b5ba6c7e9c61 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/models/_models_py3.py @@ -0,0 +1,587 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class CloudError(Model): + """An error response from the Container service. + + :param error: Details about the error. + :type error: + ~azure.mgmt.containerservice.v2019_10_27_preview.models.CloudErrorBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'CloudErrorBody'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(CloudError, self).__init__(**kwargs) + self.error = error + + +class CloudErrorException(HttpOperationError): + """Server responsed with exception of type: 'CloudError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + + +class CloudErrorBody(Model): + """An error response from the Container service. + + :param code: An identifier for the error. Codes are invariant and are + intended to be consumed programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable + for display in a user interface. + :type message: str + :param target: The target of the particular error. For example, the name + of the property in error. + :type target: str + :param details: A list of additional details about the error. + :type details: + list[~azure.mgmt.containerservice.v2019_10_27_preview.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, **kwargs) -> None: + super(CloudErrorBody, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class NetworkProfile(Model): + """Represents the OpenShift networking configuration. + + :param vnet_cidr: CIDR for the OpenShift Vnet. Default value: "10.0.0.0/8" + . + :type vnet_cidr: str + :param management_subnet_cidr: CIDR of subnet used to create PLS needed + for management of the cluster + :type management_subnet_cidr: str + :param vnet_id: ID of the Vnet created for OSA cluster. + :type vnet_id: str + """ + + _attribute_map = { + 'vnet_cidr': {'key': 'vnetCidr', 'type': 'str'}, + 'management_subnet_cidr': {'key': 'managementSubnetCidr', 'type': 'str'}, + 'vnet_id': {'key': 'vnetId', 'type': 'str'}, + } + + def __init__(self, *, vnet_cidr: str="10.0.0.0/8", management_subnet_cidr: str=None, vnet_id: str=None, **kwargs) -> None: + super(NetworkProfile, self).__init__(**kwargs) + self.vnet_cidr = vnet_cidr + self.management_subnet_cidr = management_subnet_cidr + self.vnet_id = vnet_id + + +class OpenShiftAPIProperties(Model): + """Defines further properties on the API. + + :param private_api_server: Specifies if API server is public or private. + :type private_api_server: bool + """ + + _attribute_map = { + 'private_api_server': {'key': 'privateApiServer', 'type': 'bool'}, + } + + def __init__(self, *, private_api_server: bool=None, **kwargs) -> None: + super(OpenShiftAPIProperties, self).__init__(**kwargs) + self.private_api_server = private_api_server + + +class Resource(Model): + """The Resource model definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + + +class OpenShiftManagedCluster(Resource): + """OpenShift Managed cluster. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: Define the resource plan as required by ARM for billing + purposes + :type plan: + ~azure.mgmt.containerservice.v2019_10_27_preview.models.PurchasePlan + :ivar provisioning_state: The current deployment or provisioning state, + which only appears in the response. + :vartype provisioning_state: str + :param open_shift_version: Required. Version of OpenShift specified when + creating the cluster. + :type open_shift_version: str + :ivar cluster_version: Version of OpenShift specified when creating the + cluster. + :vartype cluster_version: str + :ivar public_hostname: Service generated FQDN or private IP for OpenShift + API server. + :vartype public_hostname: str + :ivar fqdn: Service generated FQDN for OpenShift API server loadbalancer + internal hostname. + :vartype fqdn: str + :param network_profile: Configuration for OpenShift networking. + :type network_profile: + ~azure.mgmt.containerservice.v2019_10_27_preview.models.NetworkProfile + :param router_profiles: Configuration for OpenShift router(s). + :type router_profiles: + list[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftRouterProfile] + :param master_pool_profile: Configuration for OpenShift master VMs. + :type master_pool_profile: + ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterMasterPoolProfile + :param agent_pool_profiles: Configuration of OpenShift cluster VMs. + :type agent_pool_profiles: + list[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterAgentPoolProfile] + :param auth_profile: Configures OpenShift authentication. + :type auth_profile: + ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterAuthProfile + :param monitor_profile: Configures Log Analytics integration. + :type monitor_profile: + ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterMonitorProfile + :param refresh_cluster: Allows node rotation + :type refresh_cluster: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'open_shift_version': {'required': True}, + 'cluster_version': {'readonly': True}, + 'public_hostname': {'readonly': True}, + 'fqdn': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'PurchasePlan'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'open_shift_version': {'key': 'properties.openShiftVersion', 'type': 'str'}, + 'cluster_version': {'key': 'properties.clusterVersion', 'type': 'str'}, + 'public_hostname': {'key': 'properties.publicHostname', 'type': 'str'}, + 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, + 'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'}, + 'router_profiles': {'key': 'properties.routerProfiles', 'type': '[OpenShiftRouterProfile]'}, + 'master_pool_profile': {'key': 'properties.masterPoolProfile', 'type': 'OpenShiftManagedClusterMasterPoolProfile'}, + 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[OpenShiftManagedClusterAgentPoolProfile]'}, + 'auth_profile': {'key': 'properties.authProfile', 'type': 'OpenShiftManagedClusterAuthProfile'}, + 'monitor_profile': {'key': 'properties.monitorProfile', 'type': 'OpenShiftManagedClusterMonitorProfile'}, + 'refresh_cluster': {'key': 'properties.refreshCluster', 'type': 'bool'}, + } + + def __init__(self, *, location: str, open_shift_version: str, tags=None, plan=None, network_profile=None, router_profiles=None, master_pool_profile=None, agent_pool_profiles=None, auth_profile=None, monitor_profile=None, refresh_cluster: bool=None, **kwargs) -> None: + super(OpenShiftManagedCluster, self).__init__(location=location, tags=tags, **kwargs) + self.plan = plan + self.provisioning_state = None + self.open_shift_version = open_shift_version + self.cluster_version = None + self.public_hostname = None + self.fqdn = None + self.network_profile = network_profile + self.router_profiles = router_profiles + self.master_pool_profile = master_pool_profile + self.agent_pool_profiles = agent_pool_profiles + self.auth_profile = auth_profile + self.monitor_profile = monitor_profile + self.refresh_cluster = refresh_cluster + + +class OpenShiftManagedClusterBaseIdentityProvider(Model): + """Structure for any Identity provider. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: OpenShiftManagedClusterAADIdentityProvider + + All required parameters must be populated in order to send to Azure. + + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'kind': {'required': True}, + } + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'AADIdentityProvider': 'OpenShiftManagedClusterAADIdentityProvider'} + } + + def __init__(self, **kwargs) -> None: + super(OpenShiftManagedClusterBaseIdentityProvider, self).__init__(**kwargs) + self.kind = None + + +class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIdentityProvider): + """Defines the Identity provider for MS AAD. + + All required parameters must be populated in order to send to Azure. + + :param kind: Required. Constant filled by server. + :type kind: str + :param client_id: The clientId password associated with the provider. + :type client_id: str + :param secret: The secret password associated with the provider. + :type secret: str + :param tenant_id: The tenantId associated with the provider. + :type tenant_id: str + :param customer_admin_group_id: The groupId to be granted cluster admin + role. + :type customer_admin_group_id: str + """ + + _validation = { + 'kind': {'required': True}, + } + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'secret': {'key': 'secret', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'customer_admin_group_id': {'key': 'customerAdminGroupId', 'type': 'str'}, + } + + def __init__(self, *, client_id: str=None, secret: str=None, tenant_id: str=None, customer_admin_group_id: str=None, **kwargs) -> None: + super(OpenShiftManagedClusterAADIdentityProvider, self).__init__(**kwargs) + self.client_id = client_id + self.secret = secret + self.tenant_id = tenant_id + self.customer_admin_group_id = customer_admin_group_id + self.kind = 'AADIdentityProvider' + + +class OpenShiftManagedClusterAgentPoolProfile(Model): + """Defines the configuration of the OpenShift cluster VMs. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Unique name of the pool profile in the context of + the subscription and resource group. + :type name: str + :param count: Required. Number of agents (VMs) to host docker containers. + :type count: int + :param vm_size: Required. Size of agent VMs. Possible values include: + 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3', + 'Standard_D16s_v3', 'Standard_D32s_v3', 'Standard_D64s_v3', + 'Standard_DS4_v2', 'Standard_DS5_v2', 'Standard_F8s_v2', + 'Standard_F16s_v2', 'Standard_F32s_v2', 'Standard_F64s_v2', + 'Standard_F72s_v2', 'Standard_F8s', 'Standard_F16s', 'Standard_E4s_v3', + 'Standard_E8s_v3', 'Standard_E16s_v3', 'Standard_E20s_v3', + 'Standard_E32s_v3', 'Standard_E64s_v3', 'Standard_GS2', 'Standard_GS3', + 'Standard_GS4', 'Standard_GS5', 'Standard_DS12_v2', 'Standard_DS13_v2', + 'Standard_DS14_v2', 'Standard_DS15_v2', 'Standard_L4s', 'Standard_L8s', + 'Standard_L16s', 'Standard_L32s' + :type vm_size: str or + ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftContainerServiceVMSize + :param subnet_cidr: Subnet CIDR for the peering. Default value: + "10.0.0.0/24" . + :type subnet_cidr: str + :param os_type: OsType to be used to specify os type. Choose from Linux + and Windows. Default to Linux. Possible values include: 'Linux', + 'Windows'. Default value: "Linux" . + :type os_type: str or + ~azure.mgmt.containerservice.v2019_10_27_preview.models.OSType + :param role: Define the role of the AgentPoolProfile. Possible values + include: 'compute', 'infra' + :type role: str or + ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftAgentPoolProfileRole + """ + + _validation = { + 'name': {'required': True}, + 'count': {'required': True}, + 'vm_size': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'int'}, + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'subnet_cidr': {'key': 'subnetCidr', 'type': 'str'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'role': {'key': 'role', 'type': 'str'}, + } + + def __init__(self, *, name: str, count: int, vm_size, subnet_cidr: str="10.0.0.0/24", os_type="Linux", role=None, **kwargs) -> None: + super(OpenShiftManagedClusterAgentPoolProfile, self).__init__(**kwargs) + self.name = name + self.count = count + self.vm_size = vm_size + self.subnet_cidr = subnet_cidr + self.os_type = os_type + self.role = role + + +class OpenShiftManagedClusterAuthProfile(Model): + """Defines all possible authentication profiles for the OpenShift cluster. + + :param identity_providers: Type of authentication profile to use. + :type identity_providers: + list[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterIdentityProvider] + """ + + _attribute_map = { + 'identity_providers': {'key': 'identityProviders', 'type': '[OpenShiftManagedClusterIdentityProvider]'}, + } + + def __init__(self, *, identity_providers=None, **kwargs) -> None: + super(OpenShiftManagedClusterAuthProfile, self).__init__(**kwargs) + self.identity_providers = identity_providers + + +class OpenShiftManagedClusterIdentityProvider(Model): + """Defines the configuration of the identity providers to be used in the + OpenShift cluster. + + :param name: Name of the provider. + :type name: str + :param provider: Configuration of the provider. + :type provider: + ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterBaseIdentityProvider + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'OpenShiftManagedClusterBaseIdentityProvider'}, + } + + def __init__(self, *, name: str=None, provider=None, **kwargs) -> None: + super(OpenShiftManagedClusterIdentityProvider, self).__init__(**kwargs) + self.name = name + self.provider = provider + + +class OpenShiftManagedClusterMasterPoolProfile(Model): + """OpenShiftManagedClusterMaterPoolProfile contains configuration for + OpenShift master VMs. + + All required parameters must be populated in order to send to Azure. + + :param count: Required. Number of masters (VMs) to host docker containers. + The default value is 3. + :type count: int + :param vm_size: Required. Size of agent VMs. Possible values include: + 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3', + 'Standard_D16s_v3', 'Standard_D32s_v3', 'Standard_D64s_v3', + 'Standard_DS4_v2', 'Standard_DS5_v2', 'Standard_F8s_v2', + 'Standard_F16s_v2', 'Standard_F32s_v2', 'Standard_F64s_v2', + 'Standard_F72s_v2', 'Standard_F8s', 'Standard_F16s', 'Standard_E4s_v3', + 'Standard_E8s_v3', 'Standard_E16s_v3', 'Standard_E20s_v3', + 'Standard_E32s_v3', 'Standard_E64s_v3', 'Standard_GS2', 'Standard_GS3', + 'Standard_GS4', 'Standard_GS5', 'Standard_DS12_v2', 'Standard_DS13_v2', + 'Standard_DS14_v2', 'Standard_DS15_v2', 'Standard_L4s', 'Standard_L8s', + 'Standard_L16s', 'Standard_L32s' + :type vm_size: str or + ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftContainerServiceVMSize + :param subnet_cidr: Subnet CIDR for the peering. + :type subnet_cidr: str + :param api_properties: Defines further properties on the API. + :type api_properties: + ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftAPIProperties + """ + + _validation = { + 'count': {'required': True}, + 'vm_size': {'required': True}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'subnet_cidr': {'key': 'subnetCidr', 'type': 'str'}, + 'api_properties': {'key': 'apiProperties', 'type': 'OpenShiftAPIProperties'}, + } + + def __init__(self, *, count: int, vm_size, subnet_cidr: str=None, api_properties=None, **kwargs) -> None: + super(OpenShiftManagedClusterMasterPoolProfile, self).__init__(**kwargs) + self.count = count + self.vm_size = vm_size + self.subnet_cidr = subnet_cidr + self.api_properties = api_properties + + +class OpenShiftManagedClusterMonitorProfile(Model): + """Defines the configuration for Log Analytics integration. + + :param workspace_resource_id: Azure Resource Manager Resource ID for the + Log Analytics workspace to integrate with. + :type workspace_resource_id: str + :param enabled: If the Log analytics integration should be turned on or + off + :type enabled: bool + """ + + _attribute_map = { + 'workspace_resource_id': {'key': 'workspaceResourceID', 'type': 'str'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, *, workspace_resource_id: str=None, enabled: bool=None, **kwargs) -> None: + super(OpenShiftManagedClusterMonitorProfile, self).__init__(**kwargs) + self.workspace_resource_id = workspace_resource_id + self.enabled = enabled + + +class OpenShiftRouterProfile(Model): + """Represents an OpenShift router. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param name: Name of the router profile. + :type name: str + :ivar public_subdomain: DNS subdomain for OpenShift router. + :vartype public_subdomain: str + :ivar fqdn: Auto-allocated FQDN for the OpenShift router. + :vartype fqdn: str + """ + + _validation = { + 'public_subdomain': {'readonly': True}, + 'fqdn': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'public_subdomain': {'key': 'publicSubdomain', 'type': 'str'}, + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, **kwargs) -> None: + super(OpenShiftRouterProfile, self).__init__(**kwargs) + self.name = name + self.public_subdomain = None + self.fqdn = None + + +class PurchasePlan(Model): + """Used for establishing the purchase context of any 3rd Party artifact + through MarketPlace. + + :param name: The plan ID. + :type name: str + :param product: Specifies the product of the image from the marketplace. + This is the same value as Offer under the imageReference element. + :type product: str + :param promotion_code: The promotion code. + :type promotion_code: str + :param publisher: The plan ID. + :type publisher: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, product: str=None, promotion_code: str=None, publisher: str=None, **kwargs) -> None: + super(PurchasePlan, self).__init__(**kwargs) + self.name = name + self.product = product + self.promotion_code = promotion_code + self.publisher = publisher + + +class TagsObject(Model): + """Tags object for patch operations. + + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(TagsObject, self).__init__(**kwargs) + self.tags = tags diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/models/_paged_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/models/_paged_models.py new file mode 100644 index 000000000000..c19244216ccd --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/models/_paged_models.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class OpenShiftManagedClusterPaged(Paged): + """ + A paging container for iterating over a list of :class:`OpenShiftManagedCluster ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[OpenShiftManagedCluster]'} + } + + def __init__(self, *args, **kwargs): + + super(OpenShiftManagedClusterPaged, self).__init__(*args, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/operations/__init__.py new file mode 100644 index 000000000000..fa983c289926 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/operations/__init__.py @@ -0,0 +1,16 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from ._open_shift_managed_clusters_operations import OpenShiftManagedClustersOperations + +__all__ = [ + 'OpenShiftManagedClustersOperations', +] diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/operations/_open_shift_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/operations/_open_shift_managed_clusters_operations.py new file mode 100644 index 000000000000..25754a9c01f6 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/operations/_open_shift_managed_clusters_operations.py @@ -0,0 +1,549 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class OpenShiftManagedClustersOperations(object): + """OpenShiftManagedClustersOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2019-10-27-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-10-27-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets a list of OpenShift managed clusters in the specified + subscription. + + Gets a list of OpenShift managed clusters in the specified + subscription. The operation returns properties of each OpenShift + managed cluster. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of OpenShiftManagedCluster + :rtype: + ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterPaged[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedCluster] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.OpenShiftManagedClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/openShiftManagedClusters'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Lists OpenShift managed clusters in the specified subscription and + resource group. + + Lists OpenShift managed clusters in the specified subscription and + resource group. The operation returns properties of each OpenShift + managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of OpenShiftManagedCluster + :rtype: + ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterPaged[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedCluster] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.OpenShiftManagedClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters'} + + def get( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Gets a OpenShift managed cluster. + + Gets the details of the managed OpenShift cluster with a specified + resource group and name. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the OpenShift managed cluster + resource. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OpenShiftManagedCluster or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedCluster + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OpenShiftManagedCluster', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} + + + def _create_or_update_initial( + self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'OpenShiftManagedCluster') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OpenShiftManagedCluster', response) + if response.status_code == 201: + deserialized = self._deserialize('OpenShiftManagedCluster', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates an OpenShift managed cluster. + + Creates or updates a OpenShift managed cluster with the specified + configuration for agents and OpenShift version. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the OpenShift managed cluster + resource. + :type resource_name: str + :param parameters: Parameters supplied to the Create or Update an + OpenShift Managed Cluster operation. + :type parameters: + ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedCluster + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OpenShiftManagedCluster + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedCluster] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedCluster]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('OpenShiftManagedCluster', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} + + + def _update_tags_initial( + self, resource_group_name, resource_name, tags=None, custom_headers=None, raw=False, **operation_config): + parameters = models.TagsObject(tags=tags) + + # Construct URL + url = self.update_tags.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'TagsObject') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OpenShiftManagedCluster', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_tags( + self, resource_group_name, resource_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates tags on an OpenShift managed cluster. + + Updates an OpenShift managed cluster with the specified tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the OpenShift managed cluster + resource. + :type resource_name: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OpenShiftManagedCluster + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedCluster] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedCluster]] + :raises: :class:`CloudError` + """ + raw_result = self._update_tags_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('OpenShiftManagedCluster', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} + + + def _delete_initial( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes an OpenShift managed cluster. + + Deletes the OpenShift managed cluster with a specified resource group + and name. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the OpenShift managed cluster + resource. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/version.py new file mode 100644 index 000000000000..41b1c18201ad --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/version.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +VERSION = "2019-10-27-preview" + diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/version.py index 84bac37ec72a..8d7fdbfd5156 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/version.py @@ -9,4 +9,4 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "8.3.0" +VERSION = "9.0.0"