diff --git a/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/README.md b/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/README.md index 74605e9bbd6f..1c8afdacfd0d 100644 --- a/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/README.md +++ b/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/README.md @@ -4,6 +4,13 @@ This is the Microsoft Azure Kubernetes Configuration Management Client Library. This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8. For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). + +# Usage + +For code examples, see [Kubernetes Configuration Management](https://docs.microsoft.com/python/api/overview/azure/kubernetesconfiguration) +on docs.microsoft.com. + + # Provide Feedback If you encounter any bugs or have suggestions, please file an issue in the diff --git a/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/_configuration.py b/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/_configuration.py index 5043ed695944..dead10b77aa3 100644 --- a/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/_configuration.py +++ b/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/_configuration.py @@ -8,19 +8,17 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -from msrestazure import AzureConfiguration + +from msrest import Configuration from .version import VERSION -class SourceControlConfigurationClientConfiguration(AzureConfiguration): +class SourceControlConfigurationClientConfiguration(Configuration): """Configuration for SourceControlConfigurationClient Note that all parameters used to create this instance are saved as instance attributes. - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` :param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) :type subscription_id: str @@ -28,10 +26,8 @@ class SourceControlConfigurationClientConfiguration(AzureConfiguration): """ def __init__( - self, credentials, subscription_id, base_url=None): + self, subscription_id, base_url=None): - if credentials is None: - raise ValueError("Parameter 'credentials' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") if not base_url: @@ -43,7 +39,5 @@ def __init__( self.keep_alive = True self.add_user_agent('azure-mgmt-kubernetesconfiguration/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - self.credentials = credentials self.subscription_id = subscription_id diff --git a/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/_source_control_configuration_client.py b/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/_source_control_configuration_client.py index 004f8988387b..322f9c013c76 100644 --- a/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/_source_control_configuration_client.py +++ b/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/_source_control_configuration_client.py @@ -13,6 +13,7 @@ from msrest import Serializer, Deserializer from ._configuration import SourceControlConfigurationClientConfiguration +from msrest.exceptions import HttpOperationError from .operations import SourceControlConfigurationsOperations from .operations import Operations from . import models @@ -29,9 +30,6 @@ class SourceControlConfigurationClient(SDKClient): :ivar operations: Operations operations :vartype operations: azure.mgmt.kubernetesconfiguration.operations.Operations - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` :param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) :type subscription_id: str @@ -39,13 +37,13 @@ class SourceControlConfigurationClient(SDKClient): """ def __init__( - self, credentials, subscription_id, base_url=None): + self, subscription_id, base_url=None): - self.config = SourceControlConfigurationClientConfiguration(credentials, subscription_id, base_url) - super(SourceControlConfigurationClient, self).__init__(self.config.credentials, self.config) + self.config = SourceControlConfigurationClientConfiguration(subscription_id, base_url) + super(SourceControlConfigurationClient, self).__init__(None, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2019-11-01-preview' + self.api_version = '2020-10-01-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) diff --git a/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/models/__init__.py b/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/models/__init__.py index 3288aba428da..f797a7ea753f 100644 --- a/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/models/__init__.py +++ b/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/models/__init__.py @@ -18,8 +18,11 @@ from ._models_py3 import Resource from ._models_py3 import ResourceProviderOperation from ._models_py3 import ResourceProviderOperationDisplay + from ._models_py3 import ResourceProviderOperationList from ._models_py3 import Result from ._models_py3 import SourceControlConfiguration + from ._models_py3 import SourceControlConfigurationList + from ._models_py3 import SystemData except (SyntaxError, ImportError): from ._models import ComplianceStatus from ._models import ErrorDefinition @@ -29,17 +32,17 @@ from ._models import Resource from ._models import ResourceProviderOperation from ._models import ResourceProviderOperationDisplay + from ._models import ResourceProviderOperationList from ._models import Result from ._models import SourceControlConfiguration -from ._paged_models import ResourceProviderOperationPaged -from ._paged_models import SourceControlConfigurationPaged + from ._models import SourceControlConfigurationList + from ._models import SystemData from ._source_control_configuration_client_enums import ( - ComplianceState, - MessageLevel, + ComplianceStateType, + MessageLevelType, + OperatorScopeType, OperatorType, - OperatorScope, - EnableHelmOperator, - ProvisioningState, + ProvisioningStateType, ) __all__ = [ @@ -51,14 +54,14 @@ 'Resource', 'ResourceProviderOperation', 'ResourceProviderOperationDisplay', + 'ResourceProviderOperationList', 'Result', 'SourceControlConfiguration', - 'SourceControlConfigurationPaged', - 'ResourceProviderOperationPaged', - 'ComplianceState', - 'MessageLevel', + 'SourceControlConfigurationList', + 'SystemData', + 'ComplianceStateType', + 'MessageLevelType', 'OperatorType', - 'OperatorScope', - 'EnableHelmOperator', - 'ProvisioningState', + 'OperatorScopeType', + 'ProvisioningStateType', ] diff --git a/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/models/_models.py b/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/models/_models.py index 390ef2458747..0e0b0648af28 100644 --- a/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/models/_models.py +++ b/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/models/_models.py @@ -13,14 +13,6 @@ from msrest.exceptions import HttpOperationError -class CloudError(Model): - """CloudError. - """ - - _attribute_map = { - } - - class ComplianceStatus(Model): """Compliance Status details. @@ -31,7 +23,7 @@ class ComplianceStatus(Model): Possible values include: 'Pending', 'Compliant', 'Noncompliant', 'Installed', 'Failed' :vartype compliance_state: str or - ~azure.mgmt.kubernetesconfiguration.models.ComplianceState + ~azure.mgmt.kubernetesconfiguration.models.ComplianceStateType :param last_config_applied: Datetime the configuration was last applied. :type last_config_applied: datetime :param message: Message from when the configuration was applied. @@ -39,7 +31,7 @@ class ComplianceStatus(Model): :param message_level: Level of the message. Possible values include: 'Error', 'Warning', 'Information' :type message_level: str or - ~azure.mgmt.kubernetesconfiguration.models.MessageLevel + ~azure.mgmt.kubernetesconfiguration.models.MessageLevelType """ _validation = { @@ -64,36 +56,29 @@ def __init__(self, **kwargs): class ErrorDefinition(Model): """Error definition. - Variables are only populated by the server, and will be ignored when - sending a request. + All required parameters must be populated in order to send to Azure. - :ivar code: Service specific error code which serves as the substatus for - the HTTP error code. - :vartype code: str - :ivar message: Description of the error. - :vartype message: str - :ivar details: Internal error details. - :vartype details: - list[~azure.mgmt.kubernetesconfiguration.models.ErrorDefinition] + :param code: Required. Service specific error code which serves as the + substatus for the HTTP error code. + :type code: str + :param message: Required. Description of the error. + :type message: str """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'details': {'readonly': True}, + 'code': {'required': True}, + 'message': {'required': True}, } _attribute_map = { 'code': {'key': 'code', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDefinition]'}, } def __init__(self, **kwargs): super(ErrorDefinition, self).__init__(**kwargs) - self.code = None - self.message = None - self.details = None + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) class ErrorResponse(Model): @@ -156,6 +141,9 @@ class Resource(Model): :vartype name: str :ivar type: Resource type :vartype type: str + :param system_data: Top level metadata + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources + :type system_data: ~azure.mgmt.kubernetesconfiguration.models.SystemData """ _validation = { @@ -168,6 +156,7 @@ class Resource(Model): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } def __init__(self, **kwargs): @@ -175,6 +164,7 @@ def __init__(self, **kwargs): self.id = None self.name = None self.type = None + self.system_data = kwargs.get('system_data', None) class ProxyResource(Resource): @@ -189,6 +179,9 @@ class ProxyResource(Resource): :vartype name: str :ivar type: Resource type :vartype type: str + :param system_data: Top level metadata + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources + :type system_data: ~azure.mgmt.kubernetesconfiguration.models.SystemData """ _validation = { @@ -201,6 +194,7 @@ class ProxyResource(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } def __init__(self, **kwargs): @@ -257,6 +251,34 @@ def __init__(self, **kwargs): self.description = kwargs.get('description', None) +class ResourceProviderOperationList(Model): + """Result of the request to list operations. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: List of operations supported by this resource provider. + :type value: + list[~azure.mgmt.kubernetesconfiguration.models.ResourceProviderOperation] + :ivar next_link: URL to the next set of results, if any. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceProviderOperation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceProviderOperationList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + class Result(Model): """Sample result definition. @@ -274,7 +296,7 @@ def __init__(self, **kwargs): class SourceControlConfiguration(ProxyResource): - """The SourceControl Configuration object. + """The SourceControl Configuration object returned in Get & Put response. Variables are only populated by the server, and will be ignored when sending a request. @@ -285,6 +307,9 @@ class SourceControlConfiguration(ProxyResource): :vartype name: str :ivar type: Resource type :vartype type: str + :param system_data: Top level metadata + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources + :type system_data: ~azure.mgmt.kubernetesconfiguration.models.SystemData :param repository_url: Url of the SourceControl Repository. :type repository_url: str :param operator_namespace: The namespace to which this operator is @@ -301,19 +326,24 @@ class SourceControlConfiguration(ProxyResource): :param operator_params: Any Parameters for the Operator instance in string format. :type operator_params: str + :param configuration_protected_settings: Name-value pairs of protected + configuration settings for the configuration + :type configuration_protected_settings: dict[str, str] :param operator_scope: Scope at which the operator will be installed. Possible values include: 'cluster', 'namespace'. Default value: "cluster" . :type operator_scope: str or - ~azure.mgmt.kubernetesconfiguration.models.OperatorScope + ~azure.mgmt.kubernetesconfiguration.models.OperatorScopeType :ivar repository_public_key: Public Key associated with this SourceControl configuration (either generated within the cluster or provided by the user). :vartype repository_public_key: str + :param ssh_known_hosts_contents: Base64-encoded known_hosts contents + containing public SSH keys required to access private Git instances + :type ssh_known_hosts_contents: str :param enable_helm_operator: Option to enable Helm Operator for this git - configuration. Possible values include: 'true', 'false' - :type enable_helm_operator: str or - ~azure.mgmt.kubernetesconfiguration.models.EnableHelmOperator + configuration. + :type enable_helm_operator: bool :param helm_operator_properties: Properties for Helm operator. :type helm_operator_properties: ~azure.mgmt.kubernetesconfiguration.models.HelmOperatorProperties @@ -321,7 +351,7 @@ class SourceControlConfiguration(ProxyResource): Possible values include: 'Accepted', 'Deleting', 'Running', 'Succeeded', 'Failed' :vartype provisioning_state: str or - ~azure.mgmt.kubernetesconfiguration.models.ProvisioningState + ~azure.mgmt.kubernetesconfiguration.models.ProvisioningStateType :ivar compliance_status: Compliance Status of the Configuration :vartype compliance_status: ~azure.mgmt.kubernetesconfiguration.models.ComplianceStatus @@ -340,14 +370,17 @@ class SourceControlConfiguration(ProxyResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'repository_url': {'key': 'properties.repositoryUrl', 'type': 'str'}, 'operator_namespace': {'key': 'properties.operatorNamespace', 'type': 'str'}, 'operator_instance_name': {'key': 'properties.operatorInstanceName', 'type': 'str'}, 'operator_type': {'key': 'properties.operatorType', 'type': 'str'}, 'operator_params': {'key': 'properties.operatorParams', 'type': 'str'}, + 'configuration_protected_settings': {'key': 'properties.configurationProtectedSettings', 'type': '{str}'}, 'operator_scope': {'key': 'properties.operatorScope', 'type': 'str'}, 'repository_public_key': {'key': 'properties.repositoryPublicKey', 'type': 'str'}, - 'enable_helm_operator': {'key': 'properties.enableHelmOperator', 'type': 'str'}, + 'ssh_known_hosts_contents': {'key': 'properties.sshKnownHostsContents', 'type': 'str'}, + 'enable_helm_operator': {'key': 'properties.enableHelmOperator', 'type': 'bool'}, 'helm_operator_properties': {'key': 'properties.helmOperatorProperties', 'type': 'HelmOperatorProperties'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'compliance_status': {'key': 'properties.complianceStatus', 'type': 'ComplianceStatus'}, @@ -360,9 +393,96 @@ def __init__(self, **kwargs): self.operator_instance_name = kwargs.get('operator_instance_name', None) self.operator_type = kwargs.get('operator_type', None) self.operator_params = kwargs.get('operator_params', None) + self.configuration_protected_settings = kwargs.get('configuration_protected_settings', None) self.operator_scope = kwargs.get('operator_scope', "cluster") self.repository_public_key = None + self.ssh_known_hosts_contents = kwargs.get('ssh_known_hosts_contents', None) self.enable_helm_operator = kwargs.get('enable_helm_operator', None) self.helm_operator_properties = kwargs.get('helm_operator_properties', None) self.provisioning_state = None self.compliance_status = None + + +class SourceControlConfigurationList(Model): + """Result of the request to list Source Control Configurations. It contains a + list of SourceControlConfiguration objects and a URL link to get the next + set of results. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: List of Source Control Configurations within a Kubernetes + cluster. + :vartype value: + list[~azure.mgmt.kubernetesconfiguration.models.SourceControlConfiguration] + :ivar next_link: URL to get the next set of configuration objects, if any. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SourceControlConfiguration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SourceControlConfigurationList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class SystemData(Model): + """Top level metadata + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar created_by: A string identifier for the identity that created the + resource + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource: + user, application, managedIdentity, key + :vartype created_by_type: str + :ivar created_at: The timestamp of resource creation (UTC) + :vartype created_at: datetime + :ivar last_modified_by: A string identifier for the identity that last + modified the resource + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the + resource: user, application, managedIdentity, key + :vartype last_modified_by_type: str + :ivar last_modified_at: The timestamp of resource last modification (UTC) + :vartype last_modified_at: datetime + """ + + _validation = { + 'created_by': {'readonly': True}, + 'created_by_type': {'readonly': True}, + 'created_at': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + 'last_modified_by_type': {'readonly': True}, + 'last_modified_at': {'readonly': True}, + } + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(SystemData, self).__init__(**kwargs) + self.created_by = None + self.created_by_type = None + self.created_at = None + self.last_modified_by = None + self.last_modified_by_type = None + self.last_modified_at = None diff --git a/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/models/_models_py3.py b/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/models/_models_py3.py index 67d46fffa370..b2c4a751e872 100644 --- a/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/models/_models_py3.py +++ b/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/models/_models_py3.py @@ -13,14 +13,6 @@ from msrest.exceptions import HttpOperationError -class CloudError(Model): - """CloudError. - """ - - _attribute_map = { - } - - class ComplianceStatus(Model): """Compliance Status details. @@ -31,7 +23,7 @@ class ComplianceStatus(Model): Possible values include: 'Pending', 'Compliant', 'Noncompliant', 'Installed', 'Failed' :vartype compliance_state: str or - ~azure.mgmt.kubernetesconfiguration.models.ComplianceState + ~azure.mgmt.kubernetesconfiguration.models.ComplianceStateType :param last_config_applied: Datetime the configuration was last applied. :type last_config_applied: datetime :param message: Message from when the configuration was applied. @@ -39,7 +31,7 @@ class ComplianceStatus(Model): :param message_level: Level of the message. Possible values include: 'Error', 'Warning', 'Information' :type message_level: str or - ~azure.mgmt.kubernetesconfiguration.models.MessageLevel + ~azure.mgmt.kubernetesconfiguration.models.MessageLevelType """ _validation = { @@ -64,36 +56,29 @@ def __init__(self, *, last_config_applied=None, message: str=None, message_level class ErrorDefinition(Model): """Error definition. - Variables are only populated by the server, and will be ignored when - sending a request. + All required parameters must be populated in order to send to Azure. - :ivar code: Service specific error code which serves as the substatus for - the HTTP error code. - :vartype code: str - :ivar message: Description of the error. - :vartype message: str - :ivar details: Internal error details. - :vartype details: - list[~azure.mgmt.kubernetesconfiguration.models.ErrorDefinition] + :param code: Required. Service specific error code which serves as the + substatus for the HTTP error code. + :type code: str + :param message: Required. Description of the error. + :type message: str """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'details': {'readonly': True}, + 'code': {'required': True}, + 'message': {'required': True}, } _attribute_map = { 'code': {'key': 'code', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDefinition]'}, } - def __init__(self, **kwargs) -> None: + def __init__(self, *, code: str, message: str, **kwargs) -> None: super(ErrorDefinition, self).__init__(**kwargs) - self.code = None - self.message = None - self.details = None + self.code = code + self.message = message class ErrorResponse(Model): @@ -156,6 +141,9 @@ class Resource(Model): :vartype name: str :ivar type: Resource type :vartype type: str + :param system_data: Top level metadata + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources + :type system_data: ~azure.mgmt.kubernetesconfiguration.models.SystemData """ _validation = { @@ -168,13 +156,15 @@ class Resource(Model): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } - def __init__(self, **kwargs) -> None: + def __init__(self, *, system_data=None, **kwargs) -> None: super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None + self.system_data = system_data class ProxyResource(Resource): @@ -189,6 +179,9 @@ class ProxyResource(Resource): :vartype name: str :ivar type: Resource type :vartype type: str + :param system_data: Top level metadata + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources + :type system_data: ~azure.mgmt.kubernetesconfiguration.models.SystemData """ _validation = { @@ -201,10 +194,11 @@ class ProxyResource(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } - def __init__(self, **kwargs) -> None: - super(ProxyResource, self).__init__(**kwargs) + def __init__(self, *, system_data=None, **kwargs) -> None: + super(ProxyResource, self).__init__(system_data=system_data, **kwargs) class ResourceProviderOperation(Model): @@ -257,6 +251,34 @@ def __init__(self, *, provider: str=None, resource: str=None, operation: str=Non self.description = description +class ResourceProviderOperationList(Model): + """Result of the request to list operations. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: List of operations supported by this resource provider. + :type value: + list[~azure.mgmt.kubernetesconfiguration.models.ResourceProviderOperation] + :ivar next_link: URL to the next set of results, if any. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceProviderOperation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(ResourceProviderOperationList, self).__init__(**kwargs) + self.value = value + self.next_link = None + + class Result(Model): """Sample result definition. @@ -274,7 +296,7 @@ def __init__(self, *, sample_property: str=None, **kwargs) -> None: class SourceControlConfiguration(ProxyResource): - """The SourceControl Configuration object. + """The SourceControl Configuration object returned in Get & Put response. Variables are only populated by the server, and will be ignored when sending a request. @@ -285,6 +307,9 @@ class SourceControlConfiguration(ProxyResource): :vartype name: str :ivar type: Resource type :vartype type: str + :param system_data: Top level metadata + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources + :type system_data: ~azure.mgmt.kubernetesconfiguration.models.SystemData :param repository_url: Url of the SourceControl Repository. :type repository_url: str :param operator_namespace: The namespace to which this operator is @@ -301,19 +326,24 @@ class SourceControlConfiguration(ProxyResource): :param operator_params: Any Parameters for the Operator instance in string format. :type operator_params: str + :param configuration_protected_settings: Name-value pairs of protected + configuration settings for the configuration + :type configuration_protected_settings: dict[str, str] :param operator_scope: Scope at which the operator will be installed. Possible values include: 'cluster', 'namespace'. Default value: "cluster" . :type operator_scope: str or - ~azure.mgmt.kubernetesconfiguration.models.OperatorScope + ~azure.mgmt.kubernetesconfiguration.models.OperatorScopeType :ivar repository_public_key: Public Key associated with this SourceControl configuration (either generated within the cluster or provided by the user). :vartype repository_public_key: str + :param ssh_known_hosts_contents: Base64-encoded known_hosts contents + containing public SSH keys required to access private Git instances + :type ssh_known_hosts_contents: str :param enable_helm_operator: Option to enable Helm Operator for this git - configuration. Possible values include: 'true', 'false' - :type enable_helm_operator: str or - ~azure.mgmt.kubernetesconfiguration.models.EnableHelmOperator + configuration. + :type enable_helm_operator: bool :param helm_operator_properties: Properties for Helm operator. :type helm_operator_properties: ~azure.mgmt.kubernetesconfiguration.models.HelmOperatorProperties @@ -321,7 +351,7 @@ class SourceControlConfiguration(ProxyResource): Possible values include: 'Accepted', 'Deleting', 'Running', 'Succeeded', 'Failed' :vartype provisioning_state: str or - ~azure.mgmt.kubernetesconfiguration.models.ProvisioningState + ~azure.mgmt.kubernetesconfiguration.models.ProvisioningStateType :ivar compliance_status: Compliance Status of the Configuration :vartype compliance_status: ~azure.mgmt.kubernetesconfiguration.models.ComplianceStatus @@ -340,29 +370,119 @@ class SourceControlConfiguration(ProxyResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'repository_url': {'key': 'properties.repositoryUrl', 'type': 'str'}, 'operator_namespace': {'key': 'properties.operatorNamespace', 'type': 'str'}, 'operator_instance_name': {'key': 'properties.operatorInstanceName', 'type': 'str'}, 'operator_type': {'key': 'properties.operatorType', 'type': 'str'}, 'operator_params': {'key': 'properties.operatorParams', 'type': 'str'}, + 'configuration_protected_settings': {'key': 'properties.configurationProtectedSettings', 'type': '{str}'}, 'operator_scope': {'key': 'properties.operatorScope', 'type': 'str'}, 'repository_public_key': {'key': 'properties.repositoryPublicKey', 'type': 'str'}, - 'enable_helm_operator': {'key': 'properties.enableHelmOperator', 'type': 'str'}, + 'ssh_known_hosts_contents': {'key': 'properties.sshKnownHostsContents', 'type': 'str'}, + 'enable_helm_operator': {'key': 'properties.enableHelmOperator', 'type': 'bool'}, 'helm_operator_properties': {'key': 'properties.helmOperatorProperties', 'type': 'HelmOperatorProperties'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'compliance_status': {'key': 'properties.complianceStatus', 'type': 'ComplianceStatus'}, } - def __init__(self, *, repository_url: str=None, operator_namespace: str="default", operator_instance_name: str=None, operator_type=None, operator_params: str=None, operator_scope="cluster", enable_helm_operator=None, helm_operator_properties=None, **kwargs) -> None: - super(SourceControlConfiguration, self).__init__(**kwargs) + def __init__(self, *, system_data=None, repository_url: str=None, operator_namespace: str="default", operator_instance_name: str=None, operator_type=None, operator_params: str=None, configuration_protected_settings=None, operator_scope="cluster", ssh_known_hosts_contents: str=None, enable_helm_operator: bool=None, helm_operator_properties=None, **kwargs) -> None: + super(SourceControlConfiguration, self).__init__(system_data=system_data, **kwargs) self.repository_url = repository_url self.operator_namespace = operator_namespace self.operator_instance_name = operator_instance_name self.operator_type = operator_type self.operator_params = operator_params + self.configuration_protected_settings = configuration_protected_settings self.operator_scope = operator_scope self.repository_public_key = None + self.ssh_known_hosts_contents = ssh_known_hosts_contents self.enable_helm_operator = enable_helm_operator self.helm_operator_properties = helm_operator_properties self.provisioning_state = None self.compliance_status = None + + +class SourceControlConfigurationList(Model): + """Result of the request to list Source Control Configurations. It contains a + list of SourceControlConfiguration objects and a URL link to get the next + set of results. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: List of Source Control Configurations within a Kubernetes + cluster. + :vartype value: + list[~azure.mgmt.kubernetesconfiguration.models.SourceControlConfiguration] + :ivar next_link: URL to get the next set of configuration objects, if any. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SourceControlConfiguration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(SourceControlConfigurationList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class SystemData(Model): + """Top level metadata + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar created_by: A string identifier for the identity that created the + resource + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource: + user, application, managedIdentity, key + :vartype created_by_type: str + :ivar created_at: The timestamp of resource creation (UTC) + :vartype created_at: datetime + :ivar last_modified_by: A string identifier for the identity that last + modified the resource + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the + resource: user, application, managedIdentity, key + :vartype last_modified_by_type: str + :ivar last_modified_at: The timestamp of resource last modification (UTC) + :vartype last_modified_at: datetime + """ + + _validation = { + 'created_by': {'readonly': True}, + 'created_by_type': {'readonly': True}, + 'created_at': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + 'last_modified_by_type': {'readonly': True}, + 'last_modified_at': {'readonly': True}, + } + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs) -> None: + super(SystemData, self).__init__(**kwargs) + self.created_by = None + self.created_by_type = None + self.created_at = None + self.last_modified_by = None + self.last_modified_by_type = None + self.last_modified_at = None diff --git a/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/models/_paged_models.py b/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/models/_paged_models.py deleted file mode 100644 index da03391d8d6e..000000000000 --- a/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/models/_paged_models.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 SourceControlConfigurationPaged(Paged): - """ - A paging container for iterating over a list of :class:`SourceControlConfiguration ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[SourceControlConfiguration]'} - } - - def __init__(self, *args, **kwargs): - - super(SourceControlConfigurationPaged, self).__init__(*args, **kwargs) -class ResourceProviderOperationPaged(Paged): - """ - A paging container for iterating over a list of :class:`ResourceProviderOperation ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ResourceProviderOperation]'} - } - - def __init__(self, *args, **kwargs): - - super(ResourceProviderOperationPaged, self).__init__(*args, **kwargs) diff --git a/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/models/_source_control_configuration_client_enums.py b/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/models/_source_control_configuration_client_enums.py index 17114fbca711..a6cd232b0607 100644 --- a/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/models/_source_control_configuration_client_enums.py +++ b/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/models/_source_control_configuration_client_enums.py @@ -12,7 +12,7 @@ from enum import Enum -class ComplianceState(str, Enum): +class ComplianceStateType(str, Enum): pending = "Pending" compliant = "Compliant" @@ -21,7 +21,7 @@ class ComplianceState(str, Enum): failed = "Failed" -class MessageLevel(str, Enum): +class MessageLevelType(str, Enum): error = "Error" warning = "Warning" @@ -33,19 +33,13 @@ class OperatorType(str, Enum): flux = "Flux" -class OperatorScope(str, Enum): +class OperatorScopeType(str, Enum): cluster = "cluster" namespace = "namespace" -class EnableHelmOperator(str, Enum): - - true = "true" - false = "false" - - -class ProvisioningState(str, Enum): +class ProvisioningStateType(str, Enum): accepted = "Accepted" deleting = "Deleting" diff --git a/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/operations/_operations.py b/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/operations/_operations.py index a1ef22cadd8f..93a3e32a7916 100644 --- a/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/operations/_operations.py +++ b/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/operations/_operations.py @@ -9,9 +9,8 @@ # regenerated. # -------------------------------------------------------------------------- -import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError +from msrest.exceptions import HttpOperationError from .. import models @@ -25,7 +24,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: The API version to be used with the HTTP request. Constant value: "2019-11-01-preview". + :ivar api_version: The API version to be used with the HTTP request. Constant value: "2020-10-01-preview". """ models = models @@ -35,9 +34,9 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-11-01-preview" self.config = config + self.api_version = "2020-10-01-preview" def list( self, custom_headers=None, raw=False, **operation_config): @@ -49,55 +48,41 @@ def list( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of ResourceProviderOperation + :return: ResourceProviderOperationList or ClientRawResponse if + raw=true :rtype: - ~azure.mgmt.kubernetesconfiguration.models.ResourceProviderOperationPaged[~azure.mgmt.kubernetesconfiguration.models.ResourceProviderOperation] - :raises: :class:`CloudError` + ~azure.mgmt.kubernetesconfiguration.models.ResourceProviderOperationList + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`HttpOperationError` """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list.metadata['url'] - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None + # Construct URL + url = self.list.metadata['url'] + + # 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 custom_headers: + header_parameters.update(custom_headers) + + # 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]: + raise HttpOperationError(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ResourceProviderOperationList', response) + if raw: - header_dict = {} - deserialized = models.ResourceProviderOperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response return deserialized list.metadata = {'url': '/providers/Microsoft.KubernetesConfiguration/operations'} diff --git a/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/operations/_source_control_configurations_operations.py b/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/operations/_source_control_configurations_operations.py index 290dba8e4ace..552d62d18948 100644 --- a/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/operations/_source_control_configurations_operations.py +++ b/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/operations/_source_control_configurations_operations.py @@ -9,10 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -import uuid from msrest.pipeline import ClientRawResponse -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -26,7 +23,7 @@ class SourceControlConfigurationsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to be used with the HTTP request. Constant value: "2019-11-01-preview". + :ivar api_version: The API version to be used with the HTTP request. Constant value: "2020-10-01-preview". """ models = models @@ -36,9 +33,9 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-11-01-preview" self.config = config + self.api_version = "2020-10-01-preview" def get( self, resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, custom_headers=None, raw=False, **operation_config): @@ -92,12 +89,8 @@ def get( # 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) @@ -174,12 +167,8 @@ def create_or_update( 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(source_control_configuration, 'SourceControlConfiguration') @@ -204,9 +193,38 @@ def create_or_update( return deserialized create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} - - def _delete_initial( + def delete( self, resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, custom_headers=None, raw=False, **operation_config): + """This will delete the YAML file used to set up the Source control + configuration, thus stopping future sync from the source repo. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - either + Microsoft.ContainerService (for AKS clusters) or Microsoft.Kubernetes + (for OnPrem K8S clusters). Possible values include: + 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - + either managedClusters (for AKS clusters) or connectedClusters (for + OnPrem K8S clusters). Possible values include: 'managedClusters', + 'connectedClusters' + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :param source_control_configuration_name: Name of the Source Control + Configuration. + :type source_control_configuration_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ # Construct URL url = self.delete.metadata['url'] path_format_arguments = { @@ -225,12 +243,8 @@ def _delete_initial( # 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) @@ -242,64 +256,6 @@ def _delete_initial( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - - def delete( - self, resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, custom_headers=None, raw=False, polling=True, **operation_config): - """This will delete the YAML file used to set up the Source control - configuration, thus stopping future sync from the source repo. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param cluster_rp: The Kubernetes cluster RP - either - Microsoft.ContainerService (for AKS clusters) or Microsoft.Kubernetes - (for OnPrem K8S clusters). Possible values include: - 'Microsoft.ContainerService', 'Microsoft.Kubernetes' - :type cluster_rp: str - :param cluster_resource_name: The Kubernetes cluster resource name - - either managedClusters (for AKS clusters) or connectedClusters (for - OnPrem K8S clusters). Possible values include: 'managedClusters', - 'connectedClusters' - :type cluster_resource_name: str - :param cluster_name: The name of the kubernetes cluster. - :type cluster_name: str - :param source_control_configuration_name: Name of the Source Control - Configuration. - :type source_control_configuration_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:`ErrorResponseException` - """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - cluster_rp=cluster_rp, - cluster_resource_name=cluster_resource_name, - cluster_name=cluster_name, - source_control_configuration_name=source_control_configuration_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/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} def list( @@ -325,62 +281,49 @@ def list( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of SourceControlConfiguration + :return: SourceControlConfigurationList or ClientRawResponse if + raw=true :rtype: - ~azure.mgmt.kubernetesconfiguration.models.SourceControlConfigurationPaged[~azure.mgmt.kubernetesconfiguration.models.SourceControlConfiguration] + ~azure.mgmt.kubernetesconfiguration.models.SourceControlConfigurationList + or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_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) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - header_dict = None + # Construct URL + url = self.list.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'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_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 custom_headers: + header_parameters.update(custom_headers) + + # 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]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SourceControlConfigurationList', response) + if raw: - header_dict = {} - deserialized = models.SourceControlConfigurationPaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response return deserialized list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations'}