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..b27243fc2085 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 @@ -45,7 +45,7 @@ def __init__( super(SourceControlConfigurationClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2019-11-01-preview' + self.api_version = '2021-03-01' 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..86f85f9bcb5c 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 @@ -10,6 +10,7 @@ # -------------------------------------------------------------------------- try: + from ._models_py3 import AzureEntityResource from ._models_py3 import ComplianceStatus from ._models_py3 import ErrorDefinition from ._models_py3 import ErrorResponse, ErrorResponseException @@ -20,7 +21,10 @@ from ._models_py3 import ResourceProviderOperationDisplay from ._models_py3 import Result from ._models_py3 import SourceControlConfiguration + from ._models_py3 import SystemData + from ._models_py3 import TrackedResource except (SyntaxError, ImportError): + from ._models import AzureEntityResource from ._models import ComplianceStatus from ._models import ErrorDefinition from ._models import ErrorResponse, ErrorResponseException @@ -31,18 +35,21 @@ from ._models import ResourceProviderOperationDisplay from ._models import Result from ._models import SourceControlConfiguration + from ._models import SystemData + from ._models import TrackedResource from ._paged_models import ResourceProviderOperationPaged from ._paged_models import SourceControlConfigurationPaged from ._source_control_configuration_client_enums import ( - ComplianceState, - MessageLevel, + ComplianceStateType, + MessageLevelType, OperatorType, - OperatorScope, - EnableHelmOperator, - ProvisioningState, + OperatorScopeType, + ProvisioningStateType, + CreatedByType, ) __all__ = [ + 'AzureEntityResource', 'ComplianceStatus', 'ErrorDefinition', 'ErrorResponse', 'ErrorResponseException', @@ -53,12 +60,14 @@ 'ResourceProviderOperationDisplay', 'Result', 'SourceControlConfiguration', + 'SystemData', + 'TrackedResource', 'SourceControlConfigurationPaged', 'ResourceProviderOperationPaged', - 'ComplianceState', - 'MessageLevel', + 'ComplianceStateType', + 'MessageLevelType', 'OperatorType', - 'OperatorScope', - 'EnableHelmOperator', - 'ProvisioningState', + 'OperatorScopeType', + 'ProvisioningStateType', + 'CreatedByType', ] 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..676504953e7b 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,6 +13,84 @@ from msrest.exceptions import HttpOperationError +class Resource(Model): + """Resource. + + Common fields that are returned in the response for all Azure Resource + Manager resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AzureEntityResource(Resource): + """Entity Resource. + + The resource model definition for an Azure Resource Manager resource with + an etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None + + class CloudError(Model): """CloudError. """ @@ -31,7 +109,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 +117,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 +142,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): @@ -144,50 +215,22 @@ def __init__(self, **kwargs): self.chart_values = kwargs.get('chart_values', None) -class Resource(Model): - """The Resource model definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - class ProxyResource(Resource): - """ARM proxy resource. + """Proxy Resource. + + The resource model definition for a Azure Resource Manager proxy resource. + It will not have tags and a location. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource Id + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str - :ivar name: Resource name + :ivar name: The name of the resource :vartype name: str - :ivar type: Resource type + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str """ @@ -210,23 +253,35 @@ def __init__(self, **kwargs): class ResourceProviderOperation(Model): """Supported operation of this resource provider. + Variables are only populated by the server, and will be ignored when + sending a request. + :param name: Operation name, in format of {provider}/{resource}/{operation} :type name: str :param display: Display metadata associated with the operation. :type display: ~azure.mgmt.kubernetesconfiguration.models.ResourceProviderOperationDisplay + :ivar is_data_action: The flag that indicates whether the operation + applies to data plane. + :vartype is_data_action: bool """ + _validation = { + 'is_data_action': {'readonly': True}, + } + _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, } def __init__(self, **kwargs): super(ResourceProviderOperation, self).__init__(**kwargs) self.name = kwargs.get('name', None) self.display = kwargs.get('display', None) + self.is_data_action = None class ResourceProviderOperationDisplay(Model): @@ -274,16 +329,18 @@ 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. - :ivar id: Resource Id + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str - :ivar name: Resource name + :ivar name: The name of the resource :vartype name: str - :ivar type: Resource type + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :param repository_url: Url of the SourceControl Repository. :type repository_url: str @@ -301,19 +358,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,10 +383,13 @@ 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 + :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 = { @@ -345,12 +410,15 @@ class SourceControlConfiguration(ProxyResource): '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'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } def __init__(self, **kwargs): @@ -360,9 +428,100 @@ 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 + self.system_data = kwargs.get('system_data', None) + + +class SystemData(Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. + Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + :type created_by_type: str or + ~azure.mgmt.kubernetesconfiguration.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the + resource. Possible values include: 'User', 'Application', + 'ManagedIdentity', 'Key' + :type last_modified_by_type: str or + ~azure.mgmt.kubernetesconfiguration.models.CreatedByType + :param last_modified_at: The type of identity that last modified the + resource. + :type last_modified_at: datetime + """ + + _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 = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) + + +class TrackedResource(Resource): + """Tracked Resource. + + The resource model definition for an Azure Resource Manager tracked top + level resource which has 'tags' and a 'location'. + + 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: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TrackedResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs.get('location', 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..b77227e4d974 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,6 +13,84 @@ from msrest.exceptions import HttpOperationError +class Resource(Model): + """Resource. + + Common fields that are returned in the response for all Azure Resource + Manager resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AzureEntityResource(Resource): + """Entity Resource. + + The resource model definition for an Azure Resource Manager resource with + an etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None + + class CloudError(Model): """CloudError. """ @@ -31,7 +109,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 +117,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 +142,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): @@ -144,50 +215,22 @@ def __init__(self, *, chart_version: str=None, chart_values: str=None, **kwargs) self.chart_values = chart_values -class Resource(Model): - """The Resource model definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - class ProxyResource(Resource): - """ARM proxy resource. + """Proxy Resource. + + The resource model definition for a Azure Resource Manager proxy resource. + It will not have tags and a location. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource Id + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str - :ivar name: Resource name + :ivar name: The name of the resource :vartype name: str - :ivar type: Resource type + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str """ @@ -210,23 +253,35 @@ def __init__(self, **kwargs) -> None: class ResourceProviderOperation(Model): """Supported operation of this resource provider. + Variables are only populated by the server, and will be ignored when + sending a request. + :param name: Operation name, in format of {provider}/{resource}/{operation} :type name: str :param display: Display metadata associated with the operation. :type display: ~azure.mgmt.kubernetesconfiguration.models.ResourceProviderOperationDisplay + :ivar is_data_action: The flag that indicates whether the operation + applies to data plane. + :vartype is_data_action: bool """ + _validation = { + 'is_data_action': {'readonly': True}, + } + _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, } def __init__(self, *, name: str=None, display=None, **kwargs) -> None: super(ResourceProviderOperation, self).__init__(**kwargs) self.name = name self.display = display + self.is_data_action = None class ResourceProviderOperationDisplay(Model): @@ -274,16 +329,18 @@ 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. - :ivar id: Resource Id + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str - :ivar name: Resource name + :ivar name: The name of the resource :vartype name: str - :ivar type: Resource type + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :param repository_url: Url of the SourceControl Repository. :type repository_url: str @@ -301,19 +358,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,10 +383,13 @@ 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 + :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 = { @@ -345,24 +410,118 @@ class SourceControlConfiguration(ProxyResource): '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'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } - 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: + def __init__(self, *, 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, system_data=None, **kwargs) -> None: super(SourceControlConfiguration, self).__init__(**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 + self.system_data = system_data + + +class SystemData(Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. + Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + :type created_by_type: str or + ~azure.mgmt.kubernetesconfiguration.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the + resource. Possible values include: 'User', 'Application', + 'ManagedIdentity', 'Key' + :type last_modified_by_type: str or + ~azure.mgmt.kubernetesconfiguration.models.CreatedByType + :param last_modified_at: The type of identity that last modified the + resource. + :type last_modified_at: datetime + """ + + _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, *, created_by: str=None, created_by_type=None, created_at=None, last_modified_by: str=None, last_modified_by_type=None, last_modified_at=None, **kwargs) -> None: + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + +class TrackedResource(Resource): + """Tracked Resource. + + The resource model definition for an Azure Resource Manager tracked top + level resource which has 'tags' and a 'location'. + + 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: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) + self.tags = tags + self.location = location 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..6708ac68cde1 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,22 +33,24 @@ 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" running = "Running" succeeded = "Succeeded" failed = "Failed" + + +class CreatedByType(str, Enum): + + user = "User" + application = "Application" + managed_identity = "ManagedIdentity" + key = "Key" 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..5308b8f82709 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 @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError 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: "2021-03-01". """ models = models @@ -35,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-11-01-preview" + self.api_version = "2021-03-01" self.config = config @@ -52,7 +51,8 @@ def list( :return: An iterator like instance of ResourceProviderOperation :rtype: ~azure.mgmt.kubernetesconfiguration.models.ResourceProviderOperationPaged[~azure.mgmt.kubernetesconfiguration.models.ResourceProviderOperation] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -87,9 +87,7 @@ def internal_paging(next_link=None): 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 + raise models.ErrorResponseException(self._deserialize, response) return response 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..4b4a85992620 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 @@ -26,7 +26,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: "2021-03-01". """ models = models @@ -36,7 +36,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-11-01-preview" + self.api_version = "2021-03-01" self.config = config