diff --git a/azure-mgmt-containerservice/MANIFEST.in b/azure-mgmt-containerservice/MANIFEST.in index 9ecaeb15de50..6ceb27f7a96e 100644 --- a/azure-mgmt-containerservice/MANIFEST.in +++ b/azure-mgmt-containerservice/MANIFEST.in @@ -1,2 +1,4 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/azure-mgmt-containerservice/azure/__init__.py b/azure-mgmt-containerservice/azure/__init__.py index de40ea7ca058..0260537a02bb 100644 --- a/azure-mgmt-containerservice/azure/__init__.py +++ b/azure-mgmt-containerservice/azure/__init__.py @@ -1 +1 @@ -__import__('pkg_resources').declare_namespace(__name__) +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-containerservice/azure/mgmt/__init__.py b/azure-mgmt-containerservice/azure/mgmt/__init__.py index de40ea7ca058..0260537a02bb 100644 --- a/azure-mgmt-containerservice/azure/mgmt/__init__.py +++ b/azure-mgmt-containerservice/azure/mgmt/__init__.py @@ -1 +1 @@ -__import__('pkg_resources').declare_namespace(__name__) +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/container_service_client.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/container_service_client.py index a5d7eb651da6..e23d3c72421d 100644 --- a/azure-mgmt-containerservice/azure/mgmt/containerservice/container_service_client.py +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/container_service_client.py @@ -13,6 +13,7 @@ from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION +from .operations.open_shift_managed_clusters_operations import OpenShiftManagedClustersOperations from .operations.container_services_operations import ContainerServicesOperations from .operations.operations import Operations from .operations.managed_clusters_operations import ManagedClustersOperations @@ -59,6 +60,8 @@ class ContainerServiceClient(SDKClient): :ivar config: Configuration for client. :vartype config: ContainerServiceClientConfiguration + :ivar open_shift_managed_clusters: OpenShiftManagedClusters operations + :vartype open_shift_managed_clusters: azure.mgmt.containerservice.operations.OpenShiftManagedClustersOperations :ivar container_services: ContainerServices operations :vartype container_services: azure.mgmt.containerservice.operations.ContainerServicesOperations :ivar operations: Operations operations @@ -86,6 +89,8 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) + self.open_shift_managed_clusters = OpenShiftManagedClustersOperations( + self._client, self.config, self._serialize, self._deserialize) self.container_services = ContainerServicesOperations( self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/__init__.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/__init__.py index f188b0d88cf6..0caf5a5b1450 100644 --- a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/__init__.py +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/__init__.py @@ -11,6 +11,17 @@ try: from .resource_py3 import Resource + from .purchase_plan_py3 import PurchasePlan + from .open_shift_router_profile_py3 import OpenShiftRouterProfile + from .network_profile_py3 import NetworkProfile + from .open_shift_managed_cluster_master_pool_profile_py3 import OpenShiftManagedClusterMasterPoolProfile + from .open_shift_managed_cluster_agent_pool_profile_py3 import OpenShiftManagedClusterAgentPoolProfile + from .open_shift_managed_cluster_base_identity_provider_py3 import OpenShiftManagedClusterBaseIdentityProvider + from .open_shift_managed_cluster_identity_provider_py3 import OpenShiftManagedClusterIdentityProvider + from .open_shift_managed_cluster_auth_profile_py3 import OpenShiftManagedClusterAuthProfile + from .open_shift_managed_cluster_py3 import OpenShiftManagedCluster + from .open_shift_managed_cluster_aad_identity_provider_py3 import OpenShiftManagedClusterAADIdentityProvider + from .tags_object_py3 import TagsObject from .container_service_custom_profile_py3 import ContainerServiceCustomProfile from .key_vault_secret_ref_py3 import KeyVaultSecretRef from .container_service_service_principal_profile_py3 import ContainerServiceServicePrincipalProfile @@ -25,7 +36,6 @@ from .container_service_diagnostics_profile_py3 import ContainerServiceDiagnosticsProfile from .container_service_py3 import ContainerService from .operation_value_py3 import OperationValue - from .tags_object_py3 import TagsObject from .managed_cluster_service_principal_profile_py3 import ManagedClusterServicePrincipalProfile from .managed_cluster_agent_pool_profile_py3 import ManagedClusterAgentPoolProfile from .container_service_network_profile_py3 import ContainerServiceNetworkProfile @@ -42,6 +52,17 @@ from .orchestrator_version_profile_list_result_py3 import OrchestratorVersionProfileListResult except (SyntaxError, ImportError): from .resource import Resource + from .purchase_plan import PurchasePlan + from .open_shift_router_profile import OpenShiftRouterProfile + from .network_profile import NetworkProfile + from .open_shift_managed_cluster_master_pool_profile import OpenShiftManagedClusterMasterPoolProfile + from .open_shift_managed_cluster_agent_pool_profile import OpenShiftManagedClusterAgentPoolProfile + from .open_shift_managed_cluster_base_identity_provider import OpenShiftManagedClusterBaseIdentityProvider + from .open_shift_managed_cluster_identity_provider import OpenShiftManagedClusterIdentityProvider + from .open_shift_managed_cluster_auth_profile import OpenShiftManagedClusterAuthProfile + from .open_shift_managed_cluster import OpenShiftManagedCluster + from .open_shift_managed_cluster_aad_identity_provider import OpenShiftManagedClusterAADIdentityProvider + from .tags_object import TagsObject from .container_service_custom_profile import ContainerServiceCustomProfile from .key_vault_secret_ref import KeyVaultSecretRef from .container_service_service_principal_profile import ContainerServiceServicePrincipalProfile @@ -56,7 +77,6 @@ from .container_service_diagnostics_profile import ContainerServiceDiagnosticsProfile from .container_service import ContainerService from .operation_value import OperationValue - from .tags_object import TagsObject from .managed_cluster_service_principal_profile import ManagedClusterServicePrincipalProfile from .managed_cluster_agent_pool_profile import ManagedClusterAgentPoolProfile from .container_service_network_profile import ContainerServiceNetworkProfile @@ -75,16 +95,30 @@ from .operation_value_paged import OperationValuePaged from .managed_cluster_paged import ManagedClusterPaged from .container_service_client_enums import ( + OSType, + OpenShiftContainerServiceVMSize, + OpenShiftAgentPoolProfileRole, ContainerServiceStorageProfileTypes, ContainerServiceVMSizeTypes, ContainerServiceOrchestratorTypes, - OSType, + AgentPoolType, NetworkPlugin, NetworkPolicy, ) __all__ = [ 'Resource', + 'PurchasePlan', + 'OpenShiftRouterProfile', + 'NetworkProfile', + 'OpenShiftManagedClusterMasterPoolProfile', + 'OpenShiftManagedClusterAgentPoolProfile', + 'OpenShiftManagedClusterBaseIdentityProvider', + 'OpenShiftManagedClusterIdentityProvider', + 'OpenShiftManagedClusterAuthProfile', + 'OpenShiftManagedCluster', + 'OpenShiftManagedClusterAADIdentityProvider', + 'TagsObject', 'ContainerServiceCustomProfile', 'KeyVaultSecretRef', 'ContainerServiceServicePrincipalProfile', @@ -99,7 +133,6 @@ 'ContainerServiceDiagnosticsProfile', 'ContainerService', 'OperationValue', - 'TagsObject', 'ManagedClusterServicePrincipalProfile', 'ManagedClusterAgentPoolProfile', 'ContainerServiceNetworkProfile', @@ -117,10 +150,13 @@ 'ContainerServicePaged', 'OperationValuePaged', 'ManagedClusterPaged', + 'OSType', + 'OpenShiftContainerServiceVMSize', + 'OpenShiftAgentPoolProfileRole', 'ContainerServiceStorageProfileTypes', 'ContainerServiceVMSizeTypes', 'ContainerServiceOrchestratorTypes', - 'OSType', + 'AgentPoolType', 'NetworkPlugin', 'NetworkPolicy', ] diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/container_service_client_enums.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/container_service_client_enums.py index 4fe56768c577..3ffb16163a31 100644 --- a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/container_service_client_enums.py +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/container_service_client_enums.py @@ -12,6 +12,24 @@ 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" + + +class OpenShiftAgentPoolProfileRole(str, Enum): + + compute = "compute" + infra = "infra" + + class ContainerServiceStorageProfileTypes(str, Enum): storage_account = "StorageAccount" @@ -205,10 +223,10 @@ class ContainerServiceOrchestratorTypes(str, Enum): custom = "Custom" -class OSType(str, Enum): +class AgentPoolType(str, Enum): - linux = "Linux" - windows = "Windows" + virtual_machine_scale_sets = "VirtualMachineScaleSets" + availability_set = "AvailabilitySet" class NetworkPlugin(str, Enum): diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/managed_cluster.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/managed_cluster.py index 502abb1807da..f7c50b26a586 100644 --- a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/managed_cluster.py +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/managed_cluster.py @@ -40,8 +40,7 @@ class ManagedCluster(Resource): :type dns_prefix: str :ivar fqdn: FDQN for the master pool. :vartype fqdn: str - :param agent_pool_profiles: Properties of the agent pool. Currently only - one agent pool can exist. + :param agent_pool_profiles: Properties of the agent pool. :type agent_pool_profiles: list[~azure.mgmt.containerservice.models.ManagedClusterAgentPoolProfile] :param linux_profile: Profile for Linux VMs in the container service diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/managed_cluster_agent_pool_profile.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/managed_cluster_agent_pool_profile.py index b3213bf8b328..b63a2b136c9e 100644 --- a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/managed_cluster_agent_pool_profile.py +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/managed_cluster_agent_pool_profile.py @@ -15,17 +15,14 @@ class ManagedClusterAgentPoolProfile(Model): """Profile for the container service agent pool. - 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. :param name: Required. Unique name of the agent pool profile in the context of the subscription and resource group. :type name: str - :param count: Number of agents (VMs) to host docker containers. Allowed - values must be in the range of 1 to 100 (inclusive). The default value is - 1. . Default value: 1 . + :param count: Required. Number of agents (VMs) to host docker containers. + Allowed values must be in the range of 1 to 100 (inclusive). The default + value is 1. . Default value: 1 . :type count: int :param vm_size: Required. Size of agent VMs. Possible values include: 'Standard_A1', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', @@ -84,11 +81,6 @@ class ManagedClusterAgentPoolProfile(Model): size for every machine in this master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. :type os_disk_size_gb: int - :ivar storage_profile: Storage profile specifies what kind of storage - used. Defaults to ManagedDisks. Possible values include: 'StorageAccount', - 'ManagedDisks' - :vartype storage_profile: str or - ~azure.mgmt.containerservice.models.ContainerServiceStorageProfileTypes :param vnet_subnet_id: VNet SubnetID specifies the vnet's subnet identifier. :type vnet_subnet_id: str @@ -98,13 +90,21 @@ class ManagedClusterAgentPoolProfile(Model): and Windows. Default to Linux. Possible values include: 'Linux', 'Windows'. Default value: "Linux" . :type os_type: str or ~azure.mgmt.containerservice.models.OSType + :param max_count: Maximum number of nodes for auto-scaling + :type max_count: int + :param min_count: Minimum number of nodes for auto-scaling + :type min_count: int + :param enable_auto_scaling: Whether to enable auto-scaler + :type enable_auto_scaling: bool + :param type: AgentPoolType represents types of agentpool. Possible values + include: 'VirtualMachineScaleSets', 'AvailabilitySet' + :type type: str or ~azure.mgmt.containerservice.models.AgentPoolType """ _validation = { 'name': {'required': True}, - 'count': {'maximum': 100, 'minimum': 1}, + 'count': {'required': True, 'maximum': 100, 'minimum': 1}, 'vm_size': {'required': True}, - 'storage_profile': {'readonly': True}, } _attribute_map = { @@ -112,10 +112,13 @@ class ManagedClusterAgentPoolProfile(Model): 'count': {'key': 'count', 'type': 'int'}, 'vm_size': {'key': 'vmSize', 'type': 'str'}, 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'storage_profile': {'key': 'storageProfile', 'type': 'str'}, 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, 'max_pods': {'key': 'maxPods', 'type': 'int'}, 'os_type': {'key': 'osType', 'type': 'str'}, + 'max_count': {'key': 'maxCount', 'type': 'int'}, + 'min_count': {'key': 'minCount', 'type': 'int'}, + 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'str'}, } def __init__(self, **kwargs): @@ -124,7 +127,10 @@ def __init__(self, **kwargs): self.count = kwargs.get('count', 1) self.vm_size = kwargs.get('vm_size', None) self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) - self.storage_profile = None self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) self.max_pods = kwargs.get('max_pods', None) self.os_type = kwargs.get('os_type', "Linux") + self.max_count = kwargs.get('max_count', None) + self.min_count = kwargs.get('min_count', None) + self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/managed_cluster_agent_pool_profile_py3.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/managed_cluster_agent_pool_profile_py3.py index c545cccfeac1..70e1d365a51a 100644 --- a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/managed_cluster_agent_pool_profile_py3.py +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/managed_cluster_agent_pool_profile_py3.py @@ -15,17 +15,14 @@ class ManagedClusterAgentPoolProfile(Model): """Profile for the container service agent pool. - 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. :param name: Required. Unique name of the agent pool profile in the context of the subscription and resource group. :type name: str - :param count: Number of agents (VMs) to host docker containers. Allowed - values must be in the range of 1 to 100 (inclusive). The default value is - 1. . Default value: 1 . + :param count: Required. Number of agents (VMs) to host docker containers. + Allowed values must be in the range of 1 to 100 (inclusive). The default + value is 1. . Default value: 1 . :type count: int :param vm_size: Required. Size of agent VMs. Possible values include: 'Standard_A1', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', @@ -84,11 +81,6 @@ class ManagedClusterAgentPoolProfile(Model): size for every machine in this master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. :type os_disk_size_gb: int - :ivar storage_profile: Storage profile specifies what kind of storage - used. Defaults to ManagedDisks. Possible values include: 'StorageAccount', - 'ManagedDisks' - :vartype storage_profile: str or - ~azure.mgmt.containerservice.models.ContainerServiceStorageProfileTypes :param vnet_subnet_id: VNet SubnetID specifies the vnet's subnet identifier. :type vnet_subnet_id: str @@ -98,13 +90,21 @@ class ManagedClusterAgentPoolProfile(Model): and Windows. Default to Linux. Possible values include: 'Linux', 'Windows'. Default value: "Linux" . :type os_type: str or ~azure.mgmt.containerservice.models.OSType + :param max_count: Maximum number of nodes for auto-scaling + :type max_count: int + :param min_count: Minimum number of nodes for auto-scaling + :type min_count: int + :param enable_auto_scaling: Whether to enable auto-scaler + :type enable_auto_scaling: bool + :param type: AgentPoolType represents types of agentpool. Possible values + include: 'VirtualMachineScaleSets', 'AvailabilitySet' + :type type: str or ~azure.mgmt.containerservice.models.AgentPoolType """ _validation = { 'name': {'required': True}, - 'count': {'maximum': 100, 'minimum': 1}, + 'count': {'required': True, 'maximum': 100, 'minimum': 1}, 'vm_size': {'required': True}, - 'storage_profile': {'readonly': True}, } _attribute_map = { @@ -112,19 +112,25 @@ class ManagedClusterAgentPoolProfile(Model): 'count': {'key': 'count', 'type': 'int'}, 'vm_size': {'key': 'vmSize', 'type': 'str'}, 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, - 'storage_profile': {'key': 'storageProfile', 'type': 'str'}, 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, 'max_pods': {'key': 'maxPods', 'type': 'int'}, 'os_type': {'key': 'osType', 'type': 'str'}, + 'max_count': {'key': 'maxCount', 'type': 'int'}, + 'min_count': {'key': 'minCount', 'type': 'int'}, + 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, *, name: str, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_subnet_id: str=None, max_pods: int=None, os_type="Linux", **kwargs) -> None: + def __init__(self, *, name: str, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_subnet_id: str=None, max_pods: int=None, os_type="Linux", max_count: int=None, min_count: int=None, enable_auto_scaling: bool=None, type=None, **kwargs) -> None: super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) self.name = name self.count = count self.vm_size = vm_size self.os_disk_size_gb = os_disk_size_gb - self.storage_profile = None self.vnet_subnet_id = vnet_subnet_id self.max_pods = max_pods self.os_type = os_type + self.max_count = max_count + self.min_count = min_count + self.enable_auto_scaling = enable_auto_scaling + self.type = type diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/managed_cluster_py3.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/managed_cluster_py3.py index 295ef9894cc9..3f1534d09ae1 100644 --- a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/managed_cluster_py3.py +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/managed_cluster_py3.py @@ -40,8 +40,7 @@ class ManagedCluster(Resource): :type dns_prefix: str :ivar fqdn: FDQN for the master pool. :vartype fqdn: str - :param agent_pool_profiles: Properties of the agent pool. Currently only - one agent pool can exist. + :param agent_pool_profiles: Properties of the agent pool. :type agent_pool_profiles: list[~azure.mgmt.containerservice.models.ManagedClusterAgentPoolProfile] :param linux_profile: Profile for Linux VMs in the container service diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/network_profile.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/network_profile.py new file mode 100644 index 000000000000..bb1f3c403e5d --- /dev/null +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/network_profile.py @@ -0,0 +1,33 @@ +# 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 + + +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 peer_vnet_id: CIDR of the Vnet to peer. + :type peer_vnet_id: str + """ + + _attribute_map = { + 'vnet_cidr': {'key': 'vnetCidr', 'type': 'str'}, + 'peer_vnet_id': {'key': 'peerVnetId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NetworkProfile, self).__init__(**kwargs) + self.vnet_cidr = kwargs.get('vnet_cidr', "10.0.0.0/8") + self.peer_vnet_id = kwargs.get('peer_vnet_id', None) diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/network_profile_py3.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/network_profile_py3.py new file mode 100644 index 000000000000..886d8941f2c5 --- /dev/null +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/network_profile_py3.py @@ -0,0 +1,33 @@ +# 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 + + +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 peer_vnet_id: CIDR of the Vnet to peer. + :type peer_vnet_id: str + """ + + _attribute_map = { + 'vnet_cidr': {'key': 'vnetCidr', 'type': 'str'}, + 'peer_vnet_id': {'key': 'peerVnetId', 'type': 'str'}, + } + + def __init__(self, *, vnet_cidr: str="10.0.0.0/8", peer_vnet_id: str=None, **kwargs) -> None: + super(NetworkProfile, self).__init__(**kwargs) + self.vnet_cidr = vnet_cidr + self.peer_vnet_id = peer_vnet_id diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster.py new file mode 100644 index 000000000000..592ca64dfa41 --- /dev/null +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster.py @@ -0,0 +1,102 @@ +# 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 .resource import Resource + + +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.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 + :param public_hostname: Optional user-specified FQDN for OpenShift API + server. + :type public_hostname: str + :param fqdn: User-specified FQDN for OpenShift API server loadbalancer + internal hostname. + :type fqdn: str + :param network_profile: Configuration for OpenShift networking. + :type network_profile: ~azure.mgmt.containerservice.models.NetworkProfile + :param router_profiles: Configuration for OpenShift router(s). + :type router_profiles: + list[~azure.mgmt.containerservice.models.OpenShiftRouterProfile] + :param master_pool_profile: Configuration for OpenShift master VMs. + :type master_pool_profile: + ~azure.mgmt.containerservice.models.OpenShiftManagedClusterMasterPoolProfile + :param agent_pool_profiles: Configuration of OpenShift cluster VMs. + :type agent_pool_profiles: + list[~azure.mgmt.containerservice.models.OpenShiftManagedClusterAgentPoolProfile] + :param auth_profile: Configures OpenShift authentication. + :type auth_profile: + ~azure.mgmt.containerservice.models.OpenShiftManagedClusterAuthProfile + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'open_shift_version': {'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}'}, + 'plan': {'key': 'plan', 'type': 'PurchasePlan'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'open_shift_version': {'key': 'properties.openShiftVersion', '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'}, + } + + 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.public_hostname = kwargs.get('public_hostname', None) + self.fqdn = kwargs.get('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) diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_aad_identity_provider.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_aad_identity_provider.py new file mode 100644 index 000000000000..0241ca8dbfad --- /dev/null +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_aad_identity_provider.py @@ -0,0 +1,46 @@ +# 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_cluster_base_identity_provider import OpenShiftManagedClusterBaseIdentityProvider + + +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 + """ + + _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'}, + } + + 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.kind = 'AADIdentityProvider' diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_aad_identity_provider_py3.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_aad_identity_provider_py3.py new file mode 100644 index 000000000000..d0f258de6231 --- /dev/null +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_aad_identity_provider_py3.py @@ -0,0 +1,46 @@ +# 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_cluster_base_identity_provider_py3 import OpenShiftManagedClusterBaseIdentityProvider + + +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 + """ + + _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'}, + } + + def __init__(self, *, client_id: str=None, secret: str=None, tenant_id: str=None, **kwargs) -> None: + super(OpenShiftManagedClusterAADIdentityProvider, self).__init__(**kwargs) + self.client_id = client_id + self.secret = secret + self.tenant_id = tenant_id + self.kind = 'AADIdentityProvider' diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_agent_pool_profile.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_agent_pool_profile.py new file mode 100644 index 000000000000..465a1afb7c76 --- /dev/null +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_agent_pool_profile.py @@ -0,0 +1,66 @@ +# 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 + + +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. + Allowed values must be in the range of 1 to 5 (inclusive). The default + value is 2. . Default value: 2 . + :type count: int + :param vm_size: Required. Size of agent VMs. Possible values include: + 'Standard_D2s_v3', 'Standard_D4s_v3' + :type vm_size: str or + ~azure.mgmt.containerservice.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.models.OSType + :param role: Define the role of the AgentPoolProfile. Possible values + include: 'compute', 'infra' + :type role: str or + ~azure.mgmt.containerservice.models.OpenShiftAgentPoolProfileRole + """ + + _validation = { + 'name': {'required': True}, + 'count': {'required': True, 'maximum': 5, 'minimum': 1}, + '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', 2) + 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) diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_agent_pool_profile_py3.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_agent_pool_profile_py3.py new file mode 100644 index 000000000000..c7828312c5ae --- /dev/null +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_agent_pool_profile_py3.py @@ -0,0 +1,66 @@ +# 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 + + +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. + Allowed values must be in the range of 1 to 5 (inclusive). The default + value is 2. . Default value: 2 . + :type count: int + :param vm_size: Required. Size of agent VMs. Possible values include: + 'Standard_D2s_v3', 'Standard_D4s_v3' + :type vm_size: str or + ~azure.mgmt.containerservice.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.models.OSType + :param role: Define the role of the AgentPoolProfile. Possible values + include: 'compute', 'infra' + :type role: str or + ~azure.mgmt.containerservice.models.OpenShiftAgentPoolProfileRole + """ + + _validation = { + 'name': {'required': True}, + 'count': {'required': True, 'maximum': 5, 'minimum': 1}, + '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, vm_size, count: int=2, 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 diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_auth_profile.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_auth_profile.py new file mode 100644 index 000000000000..c18deb0483d8 --- /dev/null +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_auth_profile.py @@ -0,0 +1,29 @@ +# 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 + + +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.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) diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_auth_profile_py3.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_auth_profile_py3.py new file mode 100644 index 000000000000..96f4bcf9610b --- /dev/null +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_auth_profile_py3.py @@ -0,0 +1,29 @@ +# 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 + + +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.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 diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_base_identity_provider.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_base_identity_provider.py new file mode 100644 index 000000000000..c6b92691d5a0 --- /dev/null +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_base_identity_provider.py @@ -0,0 +1,41 @@ +# 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 + + +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 diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_base_identity_provider_py3.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_base_identity_provider_py3.py new file mode 100644 index 000000000000..91ef9f1b5f13 --- /dev/null +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_base_identity_provider_py3.py @@ -0,0 +1,41 @@ +# 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 + + +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 diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_identity_provider.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_identity_provider.py new file mode 100644 index 000000000000..cfbadbf7df6a --- /dev/null +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_identity_provider.py @@ -0,0 +1,34 @@ +# 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 + + +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.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) diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_identity_provider_py3.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_identity_provider_py3.py new file mode 100644 index 000000000000..cce416555d52 --- /dev/null +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_identity_provider_py3.py @@ -0,0 +1,34 @@ +# 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 + + +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.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 diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_master_pool_profile.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_master_pool_profile.py new file mode 100644 index 000000000000..a686165cf311 --- /dev/null +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_master_pool_profile.py @@ -0,0 +1,58 @@ +# 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 + + +class OpenShiftManagedClusterMasterPoolProfile(Model): + """OpenShiftManagedClusterMaterPoolProfile contains configuration for + OpenShift master VMs. + + All required parameters must be populated in order to send to Azure. + + :param name: Unique name of the master pool profile in the context of the + subscription and resource group. + :type name: str + :param count: Required. Number of masters (VMs) to host docker containers. + The default value is 3. Default value: 3 . + :type count: int + :param vm_size: Required. Size of agent VMs. Possible values include: + 'Standard_D2s_v3', 'Standard_D4s_v3' + :type vm_size: str or + ~azure.mgmt.containerservice.models.OpenShiftContainerServiceVMSize + :param subnet_cidr: Subnet CIDR for the peering. + :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.models.OSType + """ + + _validation = { + 'count': {'required': True, 'maximum': 10, 'minimum': 1}, + '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'}, + } + + def __init__(self, **kwargs): + super(OpenShiftManagedClusterMasterPoolProfile, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.count = kwargs.get('count', 3) + self.vm_size = kwargs.get('vm_size', None) + self.subnet_cidr = kwargs.get('subnet_cidr', None) + self.os_type = kwargs.get('os_type', "Linux") diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_master_pool_profile_py3.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_master_pool_profile_py3.py new file mode 100644 index 000000000000..fda15cd57015 --- /dev/null +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_master_pool_profile_py3.py @@ -0,0 +1,58 @@ +# 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 + + +class OpenShiftManagedClusterMasterPoolProfile(Model): + """OpenShiftManagedClusterMaterPoolProfile contains configuration for + OpenShift master VMs. + + All required parameters must be populated in order to send to Azure. + + :param name: Unique name of the master pool profile in the context of the + subscription and resource group. + :type name: str + :param count: Required. Number of masters (VMs) to host docker containers. + The default value is 3. Default value: 3 . + :type count: int + :param vm_size: Required. Size of agent VMs. Possible values include: + 'Standard_D2s_v3', 'Standard_D4s_v3' + :type vm_size: str or + ~azure.mgmt.containerservice.models.OpenShiftContainerServiceVMSize + :param subnet_cidr: Subnet CIDR for the peering. + :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.models.OSType + """ + + _validation = { + 'count': {'required': True, 'maximum': 10, 'minimum': 1}, + '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'}, + } + + def __init__(self, *, vm_size, name: str=None, count: int=3, subnet_cidr: str=None, os_type="Linux", **kwargs) -> None: + super(OpenShiftManagedClusterMasterPoolProfile, self).__init__(**kwargs) + self.name = name + self.count = count + self.vm_size = vm_size + self.subnet_cidr = subnet_cidr + self.os_type = os_type diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_py3.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_py3.py new file mode 100644 index 000000000000..12dde5177438 --- /dev/null +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_py3.py @@ -0,0 +1,102 @@ +# 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 .resource_py3 import Resource + + +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.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 + :param public_hostname: Optional user-specified FQDN for OpenShift API + server. + :type public_hostname: str + :param fqdn: User-specified FQDN for OpenShift API server loadbalancer + internal hostname. + :type fqdn: str + :param network_profile: Configuration for OpenShift networking. + :type network_profile: ~azure.mgmt.containerservice.models.NetworkProfile + :param router_profiles: Configuration for OpenShift router(s). + :type router_profiles: + list[~azure.mgmt.containerservice.models.OpenShiftRouterProfile] + :param master_pool_profile: Configuration for OpenShift master VMs. + :type master_pool_profile: + ~azure.mgmt.containerservice.models.OpenShiftManagedClusterMasterPoolProfile + :param agent_pool_profiles: Configuration of OpenShift cluster VMs. + :type agent_pool_profiles: + list[~azure.mgmt.containerservice.models.OpenShiftManagedClusterAgentPoolProfile] + :param auth_profile: Configures OpenShift authentication. + :type auth_profile: + ~azure.mgmt.containerservice.models.OpenShiftManagedClusterAuthProfile + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'open_shift_version': {'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}'}, + 'plan': {'key': 'plan', 'type': 'PurchasePlan'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'open_shift_version': {'key': 'properties.openShiftVersion', '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'}, + } + + def __init__(self, *, location: str, open_shift_version: str, tags=None, plan=None, public_hostname: str=None, fqdn: str=None, network_profile=None, router_profiles=None, master_pool_profile=None, agent_pool_profiles=None, auth_profile=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.public_hostname = public_hostname + self.fqdn = fqdn + 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 diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_router_profile.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_router_profile.py new file mode 100644 index 000000000000..f11707f25044 --- /dev/null +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_router_profile.py @@ -0,0 +1,43 @@ +# 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 + + +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 + :param public_subdomain: DNS subdomain for openshift router. + :type public_subdomain: str + :ivar fqdn: Auto-allocated FQDN for the OpenShift router. + :vartype fqdn: str + """ + + _validation = { + '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 = kwargs.get('public_subdomain', None) + self.fqdn = None diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_router_profile_py3.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_router_profile_py3.py new file mode 100644 index 000000000000..d3057ec0292a --- /dev/null +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_router_profile_py3.py @@ -0,0 +1,43 @@ +# 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 + + +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 + :param public_subdomain: DNS subdomain for openshift router. + :type public_subdomain: str + :ivar fqdn: Auto-allocated FQDN for the OpenShift router. + :vartype fqdn: str + """ + + _validation = { + '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, public_subdomain: str=None, **kwargs) -> None: + super(OpenShiftRouterProfile, self).__init__(**kwargs) + self.name = name + self.public_subdomain = public_subdomain + self.fqdn = None diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/purchase_plan.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/purchase_plan.py new file mode 100644 index 000000000000..d3a749eafd1a --- /dev/null +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/purchase_plan.py @@ -0,0 +1,42 @@ +# 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 + + +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) diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/purchase_plan_py3.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/purchase_plan_py3.py new file mode 100644 index 000000000000..5ba5d6c85cea --- /dev/null +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/purchase_plan_py3.py @@ -0,0 +1,42 @@ +# 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 + + +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 diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/__init__.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/__init__.py index 551547c5317b..e6e24ea46de5 100644 --- a/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/__init__.py +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/__init__.py @@ -9,11 +9,13 @@ # regenerated. # -------------------------------------------------------------------------- +from .open_shift_managed_clusters_operations import OpenShiftManagedClustersOperations from .container_services_operations import ContainerServicesOperations from .operations import Operations from .managed_clusters_operations import ManagedClustersOperations __all__ = [ + 'OpenShiftManagedClustersOperations', 'ContainerServicesOperations', 'Operations', 'ManagedClustersOperations', diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/managed_clusters_operations.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/managed_clusters_operations.py index ee38a71b40e3..dbb8d71242ea 100644 --- a/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/managed_clusters_operations.py +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/managed_clusters_operations.py @@ -25,7 +25,7 @@ class ManagedClustersOperations(object): :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: "2018-03-31". + :ivar api_version: Client Api Version. Constant value: "2018-08-01-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-03-31" + self.api_version = "2018-08-01-preview" self.config = config diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/open_shift_managed_clusters_operations.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/open_shift_managed_clusters_operations.py new file mode 100644 index 000000000000..fd03132b8bd1 --- /dev/null +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/open_shift_managed_clusters_operations.py @@ -0,0 +1,402 @@ +# 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. + + :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: "2018-09-30-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-09-30-preview" + + self.config = config + + 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.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'), + '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'), + '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.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.models.OpenShiftManagedCluster] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.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'), + '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.models.OpenShiftManagedCluster] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.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'), + '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/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/operations.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/operations.py index a43ead3a313c..4e5a7aed4399 100644 --- a/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/operations.py +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/operations.py @@ -23,7 +23,7 @@ class Operations(object): :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: "2018-03-31". + :ivar api_version: Client Api Version. Constant value: "2018-08-01-preview". """ models = models @@ -33,7 +33,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-03-31" + self.api_version = "2018-08-01-preview" self.config = config diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/version.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/version.py index 204d7f82b78a..711323a905f4 100644 --- a/azure-mgmt-containerservice/azure/mgmt/containerservice/version.py +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "4.1.0" +VERSION = "4.3.1" diff --git a/azure-mgmt-containerservice/azure_bdist_wheel.py b/azure-mgmt-containerservice/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b61775..000000000000 --- a/azure-mgmt-containerservice/azure_bdist_wheel.py +++ /dev/null @@ -1,54 +0,0 @@ -#------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -#-------------------------------------------------------------------------- - -from distutils import log as logger -import os.path - -from wheel.bdist_wheel import bdist_wheel -class azure_bdist_wheel(bdist_wheel): - """The purpose of this class is to build wheel a little differently than the sdist, - without requiring to build the wheel from the sdist (i.e. you can build the wheel - directly from source). - """ - - description = "Create an Azure wheel distribution" - - user_options = bdist_wheel.user_options + \ - [('azure-namespace-package=', None, - "Name of the deepest nspkg used")] - - def initialize_options(self): - bdist_wheel.initialize_options(self) - self.azure_namespace_package = None - - def finalize_options(self): - bdist_wheel.finalize_options(self) - if self.azure_namespace_package and not self.azure_namespace_package.endswith("-nspkg"): - raise ValueError("azure_namespace_package must finish by -nspkg") - - def run(self): - if not self.distribution.install_requires: - self.distribution.install_requires = [] - self.distribution.install_requires.append( - "{}>=2.0.0".format(self.azure_namespace_package)) - bdist_wheel.run(self) - - def write_record(self, bdist_dir, distinfo_dir): - if self.azure_namespace_package: - # Split and remove last part, assuming it's "nspkg" - subparts = self.azure_namespace_package.split('-')[0:-1] - folder_with_init = [os.path.join(*subparts[0:i+1]) for i in range(len(subparts))] - for azure_sub_package in folder_with_init: - init_file = os.path.join(bdist_dir, azure_sub_package, '__init__.py') - if os.path.isfile(init_file): - logger.info("manually remove {} while building the wheel".format(init_file)) - os.remove(init_file) - else: - raise ValueError("Unable to find {}. Are you sure of your namespace package?".format(init_file)) - bdist_wheel.write_record(self, bdist_dir, distinfo_dir) -cmdclass = { - 'bdist_wheel': azure_bdist_wheel, -} diff --git a/azure-mgmt-containerservice/setup.cfg b/azure-mgmt-containerservice/setup.cfg index 856f4164982c..3c6e79cf31da 100644 --- a/azure-mgmt-containerservice/setup.cfg +++ b/azure-mgmt-containerservice/setup.cfg @@ -1,3 +1,2 @@ [bdist_wheel] universal=1 -azure-namespace-package=azure-mgmt-nspkg \ No newline at end of file diff --git a/azure-mgmt-containerservice/setup.py b/azure-mgmt-containerservice/setup.py index eb48b95424f6..647197cde70e 100644 --- a/azure-mgmt-containerservice/setup.py +++ b/azure-mgmt-containerservice/setup.py @@ -10,12 +10,6 @@ import os.path from io import open from setuptools import find_packages, setup -try: - from azure_bdist_wheel import cmdclass -except ImportError: - from distutils import log as logger - logger.warn("Wheel is not available, disabling bdist_wheel hook") - cmdclass = {} # Change the PACKAGE_NAME only to change folder and different name PACKAGE_NAME = "azure-mgmt-containerservice" @@ -76,11 +70,18 @@ 'License :: OSI Approved :: MIT License', ], zip_safe=False, - packages=find_packages(exclude=["tests"]), + packages=find_packages(exclude=[ + 'tests', + # Exclude packages that will be covered by PEP420 or nspkg + 'azure', + 'azure.mgmt', + ]), install_requires=[ 'msrest>=0.5.0', 'msrestazure>=0.4.32,<2.0.0', 'azure-common~=1.1', ], - cmdclass=cmdclass + extras_require={ + ":python_version<'3.0'": ['azure-mgmt-nspkg'], + } )