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..66198f2bc0e7 100644 --- a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/__init__.py +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/__init__.py @@ -10,7 +10,16 @@ # -------------------------------------------------------------------------- try: + from .operation_value_py3 import OperationValue from .resource_py3 import Resource + from .purchase_plan_py3 import PurchasePlan + from .open_shift_router_profile_py3 import OpenShiftRouterProfile + 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_identity_providers_py3 import OpenShiftManagedClusterIdentityProviders + from .open_shift_managed_cluster_py3 import OpenShiftManagedCluster + from .open_shift_managed_cluster_service_aad_identity_provider_py3 import OpenShiftManagedClusterServiceAADIdentityProvider + 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 @@ -24,8 +33,6 @@ from .container_service_vm_diagnostics_py3 import ContainerServiceVMDiagnostics 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 @@ -41,7 +48,16 @@ from .orchestrator_version_profile_py3 import OrchestratorVersionProfile from .orchestrator_version_profile_list_result_py3 import OrchestratorVersionProfileListResult except (SyntaxError, ImportError): + from .operation_value import OperationValue from .resource import Resource + from .purchase_plan import PurchasePlan + from .open_shift_router_profile import OpenShiftRouterProfile + 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_identity_providers import OpenShiftManagedClusterIdentityProviders + from .open_shift_managed_cluster import OpenShiftManagedCluster + from .open_shift_managed_cluster_service_aad_identity_provider import OpenShiftManagedClusterServiceAADIdentityProvider + 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 @@ -55,8 +71,6 @@ from .container_service_vm_diagnostics import ContainerServiceVMDiagnostics 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 @@ -71,20 +85,32 @@ from .credential_results import CredentialResults from .orchestrator_version_profile import OrchestratorVersionProfile from .orchestrator_version_profile_list_result import OrchestratorVersionProfileListResult +from .open_shift_managed_cluster_paged import OpenShiftManagedClusterPaged from .container_service_paged import ContainerServicePaged 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, NetworkPlugin, NetworkPolicy, ) __all__ = [ + 'OperationValue', 'Resource', + 'PurchasePlan', + 'OpenShiftRouterProfile', + 'OpenShiftManagedClusterMasterPoolProfile', + 'OpenShiftManagedClusterAgentPoolProfile', + 'OpenShiftManagedClusterIdentityProviders', + 'OpenShiftManagedCluster', + 'OpenShiftManagedClusterServiceAADIdentityProvider', + 'TagsObject', 'ContainerServiceCustomProfile', 'KeyVaultSecretRef', 'ContainerServiceServicePrincipalProfile', @@ -98,8 +124,6 @@ 'ContainerServiceVMDiagnostics', 'ContainerServiceDiagnosticsProfile', 'ContainerService', - 'OperationValue', - 'TagsObject', 'ManagedClusterServicePrincipalProfile', 'ManagedClusterAgentPoolProfile', 'ContainerServiceNetworkProfile', @@ -114,13 +138,16 @@ 'CredentialResults', 'OrchestratorVersionProfile', 'OrchestratorVersionProfileListResult', + 'OpenShiftManagedClusterPaged', 'ContainerServicePaged', 'OperationValuePaged', 'ManagedClusterPaged', + 'OSType', + 'OpenShiftContainerServiceVMSize', + 'OpenShiftAgentPoolProfileRole', 'ContainerServiceStorageProfileTypes', 'ContainerServiceVMSizeTypes', 'ContainerServiceOrchestratorTypes', - 'OSType', '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..82e952a3ae56 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,12 +223,6 @@ class ContainerServiceOrchestratorTypes(str, Enum): custom = "Custom" -class OSType(str, Enum): - - linux = "Linux" - windows = "Windows" - - class NetworkPlugin(str, Enum): azure = "azure" 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 f7c50b26a586..502abb1807da 100644 --- a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/managed_cluster.py +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/managed_cluster.py @@ -40,7 +40,8 @@ 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. + :param agent_pool_profiles: Properties of the agent pool. Currently only + one agent pool can exist. :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_py3.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/managed_cluster_py3.py index 3f1534d09ae1..295ef9894cc9 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,7 +40,8 @@ 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. + :param agent_pool_profiles: Properties of the agent pool. Currently only + one agent pool can exist. :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/open_shift_managed_cluster.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster.py new file mode 100644 index 000000000000..93f3987e7119 --- /dev/null +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster.py @@ -0,0 +1,98 @@ +# 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 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: + list[~azure.mgmt.containerservice.models.OpenShiftManagedClusterIdentityProviders] + """ + + _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'}, + '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': '[OpenShiftManagedClusterIdentityProviders]'}, + } + + 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.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_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..4bf8e6c9f6c2 --- /dev/null +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_agent_pool_profile.py @@ -0,0 +1,67 @@ +# 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): + """OpenShiftManagedClusterAgentPoolProfile represents configuration of + 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 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_D2s_v3', 'Standard_D4s_v3' + :type vm_size: str or + ~azure.mgmt.containerservice.models.OpenShiftContainerServiceVMSize + :param vnet_subnet_id: VNet SubnetID specifies the vnet's subnet + identifier. + :type vnet_subnet_id: 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': 100, 'minimum': 1}, + 'vm_size': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'int'}, + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'vnet_subnet_id': {'key': 'vnetSubnetID', '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', 1) + self.vm_size = kwargs.get('vm_size', None) + self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) + 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..6df96f99a266 --- /dev/null +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_agent_pool_profile_py3.py @@ -0,0 +1,67 @@ +# 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): + """OpenShiftManagedClusterAgentPoolProfile represents configuration of + 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 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_D2s_v3', 'Standard_D4s_v3' + :type vm_size: str or + ~azure.mgmt.containerservice.models.OpenShiftContainerServiceVMSize + :param vnet_subnet_id: VNet SubnetID specifies the vnet's subnet + identifier. + :type vnet_subnet_id: 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': 100, 'minimum': 1}, + 'vm_size': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'int'}, + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'role': {'key': 'role', 'type': 'str'}, + } + + def __init__(self, *, name: str, vm_size, count: int=1, vnet_subnet_id: str=None, os_type="Linux", role=None, **kwargs) -> None: + super(OpenShiftManagedClusterAgentPoolProfile, self).__init__(**kwargs) + self.name = name + self.count = count + self.vm_size = vm_size + self.vnet_subnet_id = vnet_subnet_id + self.os_type = os_type + self.role = role diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_identity_providers.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_identity_providers.py new file mode 100644 index 000000000000..efeecc706e6a --- /dev/null +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_identity_providers.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 OpenShiftManagedClusterIdentityProviders(Model): + """OpenShiftManagedClusterIdentityProvider is heavily cut down equivalent to + IdentityProvider in the upstream. + + :param name: Name of the provider. + :type name: str + :param provider: Configuration of the provider. + :type provider: object + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(OpenShiftManagedClusterIdentityProviders, 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_providers_py3.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_identity_providers_py3.py new file mode 100644 index 000000000000..a8567c3a14a5 --- /dev/null +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_identity_providers_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 OpenShiftManagedClusterIdentityProviders(Model): + """OpenShiftManagedClusterIdentityProvider is heavily cut down equivalent to + IdentityProvider in the upstream. + + :param name: Name of the provider. + :type name: str + :param provider: Configuration of the provider. + :type provider: object + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'object'}, + } + + def __init__(self, *, name: str=None, provider=None, **kwargs) -> None: + super(OpenShiftManagedClusterIdentityProviders, 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..fdf2e840a55b --- /dev/null +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_master_pool_profile.py @@ -0,0 +1,60 @@ +# 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: Required. 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 vnet_subnet_id: VNet SubnetID specifies the vnet's subnet + identifier. + :type vnet_subnet_id: 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 = { + 'name': {'required': True}, + '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'}, + 'vnet_subnet_id': {'key': 'vnetSubnetID', '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.vnet_subnet_id = kwargs.get('vnet_subnet_id', 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..2685cdbd9c6f --- /dev/null +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_master_pool_profile_py3.py @@ -0,0 +1,60 @@ +# 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: Required. 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 vnet_subnet_id: VNet SubnetID specifies the vnet's subnet + identifier. + :type vnet_subnet_id: 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 = { + 'name': {'required': True}, + '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'}, + 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + } + + def __init__(self, *, name: str, vm_size, count: int=3, vnet_subnet_id: str=None, os_type="Linux", **kwargs) -> None: + super(OpenShiftManagedClusterMasterPoolProfile, self).__init__(**kwargs) + self.name = name + self.count = count + self.vm_size = vm_size + self.vnet_subnet_id = vnet_subnet_id + self.os_type = os_type diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_paged.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_paged.py new file mode 100644 index 000000000000..c96f741a4948 --- /dev/null +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_paged.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/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..5dac6bd788a3 --- /dev/null +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_py3.py @@ -0,0 +1,98 @@ +# 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 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: + list[~azure.mgmt.containerservice.models.OpenShiftManagedClusterIdentityProviders] + """ + + _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'}, + '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': '[OpenShiftManagedClusterIdentityProviders]'}, + } + + def __init__(self, *, location: str, open_shift_version: str, tags=None, plan=None, public_hostname: str=None, fqdn: str=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.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_managed_cluster_service_aad_identity_provider.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_service_aad_identity_provider.py new file mode 100644 index 000000000000..8d72c61be268 --- /dev/null +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_service_aad_identity_provider.py @@ -0,0 +1,40 @@ +# 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 OpenShiftManagedClusterServiceAADIdentityProvider(Model): + """AADIdentityProvider defines Identity provider for MS AAD. + + :param kind: The kind of the provider. + :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 + """ + + _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(OpenShiftManagedClusterServiceAADIdentityProvider, self).__init__(**kwargs) + self.kind = kwargs.get('kind', None) + self.client_id = kwargs.get('client_id', None) + self.secret = kwargs.get('secret', None) + self.tenant_id = kwargs.get('tenant_id', None) diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_service_aad_identity_provider_py3.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_service_aad_identity_provider_py3.py new file mode 100644 index 000000000000..c931fa9d75e3 --- /dev/null +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/open_shift_managed_cluster_service_aad_identity_provider_py3.py @@ -0,0 +1,40 @@ +# 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 OpenShiftManagedClusterServiceAADIdentityProvider(Model): + """AADIdentityProvider defines Identity provider for MS AAD. + + :param kind: The kind of the provider. + :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 + """ + + _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, *, kind: str=None, client_id: str=None, secret: str=None, tenant_id: str=None, **kwargs) -> None: + super(OpenShiftManagedClusterServiceAADIdentityProvider, self).__init__(**kwargs) + self.kind = kind + self.client_id = client_id + self.secret = secret + self.tenant_id = tenant_id 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/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..57a5b48fc12c --- /dev/null +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/open_shift_managed_clusters_operations.py @@ -0,0 +1,543 @@ +# 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 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.models.OpenShiftManagedClusterPaged[~azure.mgmt.containerservice.models.OpenShiftManagedCluster] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + 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) + 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 + deserialized = models.OpenShiftManagedClusterPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OpenShiftManagedClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + 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 of openshift managed clusters in the specified subscription and + resource group. + + Lists of 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.models.OpenShiftManagedClusterPaged[~azure.mgmt.containerservice.models.OpenShiftManagedCluster] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + 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') + } + 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) + 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 + deserialized = models.OpenShiftManagedClusterPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OpenShiftManagedClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + 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.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 a 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 a 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}'}