From 8e19db2111193072a540efbfa2261a7f396295f5 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 23 Mar 2021 03:26:10 +0000 Subject: [PATCH] CodeGen from PR 13562 in Azure/azure-rest-api-specs Merge b95c4de769c624e137e344940878f236a82da78a into 2db34d9bfb885d51439dfdb7409aedd7547c8caf --- .../_source_control_configuration_client.py | 9 +- .../models/__init__.py | 37 +- .../kubernetesconfiguration/models/_models.py | 555 +++++++++++------ .../models/_models_py3.py | 565 ++++++++++++------ .../models/_paged_models.py | 13 + ...urce_control_configuration_client_enums.py | 28 +- .../operations/__init__.py | 2 + .../operations/_extensions_operations.py | 431 +++++++++++++ .../operations/_operations.py | 4 +- ...ource_control_configurations_operations.py | 4 +- 10 files changed, 1261 insertions(+), 387 deletions(-) create mode 100644 sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/operations/_extensions_operations.py 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 b27243fc2085..b98d3ff31338 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,17 +13,20 @@ from msrest import Serializer, Deserializer from ._configuration import SourceControlConfigurationClientConfiguration +from .operations import ExtensionsOperations from .operations import SourceControlConfigurationsOperations from .operations import Operations from . import models class SourceControlConfigurationClient(SDKClient): - """Use these APIs to create Source Control Configuration resources through ARM, for Kubernetes Clusters. + """KubernetesConfiguration Client :ivar config: Configuration for client. :vartype config: SourceControlConfigurationClientConfiguration + :ivar extensions: Extensions operations + :vartype extensions: azure.mgmt.kubernetesconfiguration.operations.ExtensionsOperations :ivar source_control_configurations: SourceControlConfigurations operations :vartype source_control_configurations: azure.mgmt.kubernetesconfiguration.operations.SourceControlConfigurationsOperations :ivar operations: Operations operations @@ -45,10 +48,12 @@ 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 = '2021-03-01' + self.api_version = '2021-05-01-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) + self.extensions = ExtensionsOperations( + self._client, self.config, self._serialize, self._deserialize) self.source_control_configurations = SourceControlConfigurationsOperations( self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( 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 86f85f9bcb5c..e73f7ef83018 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,64 +10,85 @@ # -------------------------------------------------------------------------- try: - from ._models_py3 import AzureEntityResource from ._models_py3 import ComplianceStatus + from ._models_py3 import ConfigurationIdentity from ._models_py3 import ErrorDefinition from ._models_py3 import ErrorResponse, ErrorResponseException + from ._models_py3 import ExtensionInstance + from ._models_py3 import ExtensionInstanceUpdate + from ._models_py3 import ExtensionStatus from ._models_py3 import HelmOperatorProperties from ._models_py3 import ProxyResource from ._models_py3 import Resource from ._models_py3 import ResourceProviderOperation from ._models_py3 import ResourceProviderOperationDisplay from ._models_py3 import Result + from ._models_py3 import Scope + from ._models_py3 import ScopeCluster + from ._models_py3 import ScopeNamespace 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 ConfigurationIdentity from ._models import ErrorDefinition from ._models import ErrorResponse, ErrorResponseException + from ._models import ExtensionInstance + from ._models import ExtensionInstanceUpdate + from ._models import ExtensionStatus from ._models import HelmOperatorProperties from ._models import ProxyResource from ._models import Resource from ._models import ResourceProviderOperation from ._models import ResourceProviderOperationDisplay from ._models import Result + from ._models import Scope + from ._models import ScopeCluster + from ._models import ScopeNamespace from ._models import SourceControlConfiguration from ._models import SystemData - from ._models import TrackedResource +from ._paged_models import ExtensionInstancePaged from ._paged_models import ResourceProviderOperationPaged from ._paged_models import SourceControlConfigurationPaged from ._source_control_configuration_client_enums import ( + InstallStateType, + LevelType, + ResourceIdentityType, ComplianceStateType, MessageLevelType, OperatorType, OperatorScopeType, ProvisioningStateType, - CreatedByType, ) __all__ = [ - 'AzureEntityResource', 'ComplianceStatus', + 'ConfigurationIdentity', 'ErrorDefinition', 'ErrorResponse', 'ErrorResponseException', + 'ExtensionInstance', + 'ExtensionInstanceUpdate', + 'ExtensionStatus', 'HelmOperatorProperties', 'ProxyResource', 'Resource', 'ResourceProviderOperation', 'ResourceProviderOperationDisplay', 'Result', + 'Scope', + 'ScopeCluster', + 'ScopeNamespace', 'SourceControlConfiguration', 'SystemData', - 'TrackedResource', + 'ExtensionInstancePaged', 'SourceControlConfigurationPaged', 'ResourceProviderOperationPaged', + 'InstallStateType', + 'LevelType', + 'ResourceIdentityType', 'ComplianceStateType', 'MessageLevelType', 'OperatorType', '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 676504953e7b..da1b94606cd1 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,84 +13,6 @@ 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. """ @@ -139,6 +61,44 @@ def __init__(self, **kwargs): self.message_level = kwargs.get('message_level', None) +class ConfigurationIdentity(Model): + """Identity for the managed cluster. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal id of the system assigned identity which + is used by the configuration. + :vartype principal_id: str + :ivar tenant_id: The tenant id of the system assigned identity which is + used by the configuration. + :vartype tenant_id: str + :param type: The type of identity used for the configuration. Type + 'SystemAssigned' will use an implicitly created identity. Type 'None' will + not use Managed Identity for the configuration. Possible values include: + 'SystemAssigned', 'None' + :type type: str or + ~azure.mgmt.kubernetesconfiguration.models.ResourceIdentityType + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + } + + def __init__(self, **kwargs): + super(ConfigurationIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = kwargs.get('type', None) + + class ErrorDefinition(Model): """Error definition. @@ -195,43 +155,59 @@ def __init__(self, deserialize, response, *args): super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) -class HelmOperatorProperties(Model): - """Properties for Helm operator. +class Resource(Model): + """The Resource model definition. - :param chart_version: Version of the operator Helm chart. - :type chart_version: str - :param chart_values: Values override for the operator Helm chart. - :type chart_values: str + 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 + :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 = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + _attribute_map = { - 'chart_version': {'key': 'chartVersion', 'type': 'str'}, - 'chart_values': {'key': 'chartValues', 'type': 'str'}, + '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): - super(HelmOperatorProperties, self).__init__(**kwargs) - self.chart_version = kwargs.get('chart_version', None) - self.chart_values = kwargs.get('chart_values', None) + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.system_data = kwargs.get('system_data', None) class ProxyResource(Resource): - """Proxy Resource. - - The resource model definition for a Azure Resource Manager proxy resource. - It will not have tags and a location. + """ARM proxy resource. 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} + :ivar id: Resource Id :vartype id: str - :ivar name: The name of the resource + :ivar name: Resource name :vartype name: str - :ivar type: The type of the resource. E.g. - "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :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 = { @@ -244,12 +220,210 @@ 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): super(ProxyResource, self).__init__(**kwargs) +class ExtensionInstance(ProxyResource): + """The Extension Instance object. + + 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 + :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 extension_type: Type of the Extension, of which this resource is an + instance of. It must be one of the Extension Types registered with + Microsoft.KubernetesConfiguration by the Extension publisher. + :type extension_type: str + :param auto_upgrade_minor_version: Flag to note if this instance + participates in auto upgrade of minor version, or not. + :type auto_upgrade_minor_version: bool + :param release_train: ReleaseTrain this extension instance participates in + for auto-upgrade (e.g. Stable, Preview, etc.) - only if + autoUpgradeMinorVersion is 'true'. + :type release_train: str + :param version: Version of the extension for this extension instance, if + it is 'pinned' to a specific version. autoUpgradeMinorVersion must be + 'false'. + :type version: str + :param scope: Scope at which the extension instance is installed. + :type scope: ~azure.mgmt.kubernetesconfiguration.models.Scope + :param configuration_settings: Configuration settings, as name-value pairs + for configuring this instance of the extension. + :type configuration_settings: dict[str, str] + :param configuration_protected_settings: Configuration settings that are + sensitive, as name-value pairs for configuring this instance of the + extension. + :type configuration_protected_settings: dict[str, str] + :param install_state: Status of installation of this instance of the + extension. Possible values include: 'Pending', 'Installed', 'Failed' + :type install_state: str or + ~azure.mgmt.kubernetesconfiguration.models.InstallStateType + :param statuses: Status from this instance of the extension. + :type statuses: + list[~azure.mgmt.kubernetesconfiguration.models.ExtensionStatus] + :ivar creation_time: DateLiteral (per ISO8601) noting the time the + resource was created by the client (user). + :vartype creation_time: str + :ivar last_modified_time: DateLiteral (per ISO8601) noting the time the + resource was modified by the client (user). + :vartype last_modified_time: str + :ivar last_status_time: DateLiteral (per ISO8601) noting the time of last + status from the agent. + :vartype last_status_time: str + :ivar error_info: Error information from the Agent - e.g. errors during + installation. + :vartype error_info: + ~azure.mgmt.kubernetesconfiguration.models.ErrorDefinition + :param identity: The identity of the configuration. + :type identity: + ~azure.mgmt.kubernetesconfiguration.models.ConfigurationIdentity + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'last_status_time': {'readonly': True}, + 'error_info': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'extension_type': {'key': 'properties.extensionType', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, + 'release_train': {'key': 'properties.releaseTrain', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'Scope'}, + 'configuration_settings': {'key': 'properties.configurationSettings', 'type': '{str}'}, + 'configuration_protected_settings': {'key': 'properties.configurationProtectedSettings', 'type': '{str}'}, + 'install_state': {'key': 'properties.installState', 'type': 'str'}, + 'statuses': {'key': 'properties.statuses', 'type': '[ExtensionStatus]'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'str'}, + 'last_status_time': {'key': 'properties.lastStatusTime', 'type': 'str'}, + 'error_info': {'key': 'properties.errorInfo', 'type': 'ErrorDefinition'}, + 'identity': {'key': 'properties.identity', 'type': 'ConfigurationIdentity'}, + } + + def __init__(self, **kwargs): + super(ExtensionInstance, self).__init__(**kwargs) + self.extension_type = kwargs.get('extension_type', None) + self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', None) + self.release_train = kwargs.get('release_train', None) + self.version = kwargs.get('version', None) + self.scope = kwargs.get('scope', None) + self.configuration_settings = kwargs.get('configuration_settings', None) + self.configuration_protected_settings = kwargs.get('configuration_protected_settings', None) + self.install_state = kwargs.get('install_state', None) + self.statuses = kwargs.get('statuses', None) + self.creation_time = None + self.last_modified_time = None + self.last_status_time = None + self.error_info = None + self.identity = kwargs.get('identity', None) + + +class ExtensionInstanceUpdate(Model): + """Update Extension Instance request object. + + :param auto_upgrade_minor_version: Flag to note if this instance + participates in Extension Lifecycle Management or not. + :type auto_upgrade_minor_version: bool + :param release_train: ReleaseTrain this extension instance participates in + for auto-upgrade (e.g. Stable, Preview, etc.) - only if + autoUpgradeMinorVersion is 'true'. + :type release_train: str + :param version: Version number of extension, to 'pin' to a specific + version. autoUpgradeMinorVersion must be 'false'. + :type version: str + """ + + _attribute_map = { + 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, + 'release_train': {'key': 'properties.releaseTrain', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ExtensionInstanceUpdate, self).__init__(**kwargs) + self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', None) + self.release_train = kwargs.get('release_train', None) + self.version = kwargs.get('version', None) + + +class ExtensionStatus(Model): + """Status from this instance of the extension. + + :param code: Status code provided by the Extension + :type code: str + :param display_status: Short description of status of this instance of the + extension. + :type display_status: str + :param level: Level of the status. Possible values include: 'Error', + 'Warning', 'Information'. Default value: "Information" . + :type level: str or ~azure.mgmt.kubernetesconfiguration.models.LevelType + :param message: Detailed message of the status from the Extension + instance. + :type message: str + :param time: DateLiteral (per ISO8601) noting the time of installation + status. + :type time: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'display_status': {'key': 'displayStatus', 'type': 'str'}, + 'level': {'key': 'level', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'time': {'key': 'time', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ExtensionStatus, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.display_status = kwargs.get('display_status', None) + self.level = kwargs.get('level', "Information") + self.message = kwargs.get('message', None) + self.time = kwargs.get('time', None) + + +class HelmOperatorProperties(Model): + """Properties for Helm operator. + + :param chart_version: Version of the operator Helm chart. + :type chart_version: str + :param chart_values: Values override for the operator Helm chart. + :type chart_values: str + """ + + _attribute_map = { + 'chart_version': {'key': 'chartVersion', 'type': 'str'}, + 'chart_values': {'key': 'chartValues', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(HelmOperatorProperties, self).__init__(**kwargs) + self.chart_version = kwargs.get('chart_version', None) + self.chart_values = kwargs.get('chart_values', None) + + class ResourceProviderOperation(Model): """Supported operation of this resource provider. @@ -328,20 +502,80 @@ def __init__(self, **kwargs): self.sample_property = kwargs.get('sample_property', None) +class Scope(Model): + """Scope of the extensionInstance. It can be either Cluster or Namespace; but + not both. + + :param cluster: Specifies that the scope of the extensionInstance is + Cluster + :type cluster: ~azure.mgmt.kubernetesconfiguration.models.ScopeCluster + :param namespace: Specifies that the scope of the extensionInstance is + Namespace + :type namespace: ~azure.mgmt.kubernetesconfiguration.models.ScopeNamespace + """ + + _attribute_map = { + 'cluster': {'key': 'cluster', 'type': 'ScopeCluster'}, + 'namespace': {'key': 'namespace', 'type': 'ScopeNamespace'}, + } + + def __init__(self, **kwargs): + super(Scope, self).__init__(**kwargs) + self.cluster = kwargs.get('cluster', None) + self.namespace = kwargs.get('namespace', None) + + +class ScopeCluster(Model): + """Specifies that the scope of the extensionInstance is Cluster. + + :param release_namespace: Namespace where the extension Release must be + placed, for a Cluster scoped extensionInstance. If this namespace does + not exist, it will be created + :type release_namespace: str + """ + + _attribute_map = { + 'release_namespace': {'key': 'releaseNamespace', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ScopeCluster, self).__init__(**kwargs) + self.release_namespace = kwargs.get('release_namespace', None) + + +class ScopeNamespace(Model): + """Specifies that the scope of the extensionInstance is Namespace. + + :param target_namespace: Namespace where the extensionInstance will be + created for an Namespace scoped extensionInstance. If this namespace does + not exist, it will be created + :type target_namespace: str + """ + + _attribute_map = { + 'target_namespace': {'key': 'targetNamespace', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ScopeNamespace, self).__init__(**kwargs) + self.target_namespace = kwargs.get('target_namespace', None) + + class SourceControlConfiguration(ProxyResource): """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: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :ivar id: Resource Id :vartype id: str - :ivar name: The name of the resource + :ivar name: Resource name :vartype name: str - :ivar type: The type of the resource. E.g. - "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :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 @@ -387,9 +621,6 @@ class SourceControlConfiguration(ProxyResource): :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 = { @@ -405,6 +636,7 @@ 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'}, @@ -418,7 +650,6 @@ class SourceControlConfiguration(ProxyResource): '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): @@ -436,92 +667,56 @@ def __init__(self, **kwargs): 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'. + """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. - 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 + :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 = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, + '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 = { - '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'}, + '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(TrackedResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.location = kwargs.get('location', 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/_models_py3.py b/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/models/_models_py3.py index b77227e4d974..36fe12c02ce9 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,84 +13,6 @@ 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. """ @@ -139,6 +61,44 @@ def __init__(self, *, last_config_applied=None, message: str=None, message_level self.message_level = message_level +class ConfigurationIdentity(Model): + """Identity for the managed cluster. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal id of the system assigned identity which + is used by the configuration. + :vartype principal_id: str + :ivar tenant_id: The tenant id of the system assigned identity which is + used by the configuration. + :vartype tenant_id: str + :param type: The type of identity used for the configuration. Type + 'SystemAssigned' will use an implicitly created identity. Type 'None' will + not use Managed Identity for the configuration. Possible values include: + 'SystemAssigned', 'None' + :type type: str or + ~azure.mgmt.kubernetesconfiguration.models.ResourceIdentityType + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + } + + def __init__(self, *, type=None, **kwargs) -> None: + super(ConfigurationIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + + class ErrorDefinition(Model): """Error definition. @@ -195,59 +155,273 @@ def __init__(self, deserialize, response, *args): super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) -class HelmOperatorProperties(Model): - """Properties for Helm operator. +class Resource(Model): + """The Resource model definition. - :param chart_version: Version of the operator Helm chart. - :type chart_version: str - :param chart_values: Values override for the operator Helm chart. - :type chart_values: str + 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 + :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 = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + _attribute_map = { - 'chart_version': {'key': 'chartVersion', 'type': 'str'}, - 'chart_values': {'key': 'chartValues', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } - def __init__(self, *, chart_version: str=None, chart_values: str=None, **kwargs) -> None: - super(HelmOperatorProperties, self).__init__(**kwargs) - self.chart_version = chart_version - self.chart_values = chart_values + 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): - """Proxy Resource. + """ARM proxy resource. + + 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 + :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 = { + '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'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__(self, *, system_data=None, **kwargs) -> None: + super(ProxyResource, self).__init__(system_data=system_data, **kwargs) - The resource model definition for a Azure Resource Manager proxy resource. - It will not have tags and a location. + +class ExtensionInstance(ProxyResource): + """The Extension Instance object. 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} + :ivar id: Resource Id :vartype id: str - :ivar name: The name of the resource + :ivar name: Resource name :vartype name: str - :ivar type: The type of the resource. E.g. - "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :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 extension_type: Type of the Extension, of which this resource is an + instance of. It must be one of the Extension Types registered with + Microsoft.KubernetesConfiguration by the Extension publisher. + :type extension_type: str + :param auto_upgrade_minor_version: Flag to note if this instance + participates in auto upgrade of minor version, or not. + :type auto_upgrade_minor_version: bool + :param release_train: ReleaseTrain this extension instance participates in + for auto-upgrade (e.g. Stable, Preview, etc.) - only if + autoUpgradeMinorVersion is 'true'. + :type release_train: str + :param version: Version of the extension for this extension instance, if + it is 'pinned' to a specific version. autoUpgradeMinorVersion must be + 'false'. + :type version: str + :param scope: Scope at which the extension instance is installed. + :type scope: ~azure.mgmt.kubernetesconfiguration.models.Scope + :param configuration_settings: Configuration settings, as name-value pairs + for configuring this instance of the extension. + :type configuration_settings: dict[str, str] + :param configuration_protected_settings: Configuration settings that are + sensitive, as name-value pairs for configuring this instance of the + extension. + :type configuration_protected_settings: dict[str, str] + :param install_state: Status of installation of this instance of the + extension. Possible values include: 'Pending', 'Installed', 'Failed' + :type install_state: str or + ~azure.mgmt.kubernetesconfiguration.models.InstallStateType + :param statuses: Status from this instance of the extension. + :type statuses: + list[~azure.mgmt.kubernetesconfiguration.models.ExtensionStatus] + :ivar creation_time: DateLiteral (per ISO8601) noting the time the + resource was created by the client (user). + :vartype creation_time: str + :ivar last_modified_time: DateLiteral (per ISO8601) noting the time the + resource was modified by the client (user). + :vartype last_modified_time: str + :ivar last_status_time: DateLiteral (per ISO8601) noting the time of last + status from the agent. + :vartype last_status_time: str + :ivar error_info: Error information from the Agent - e.g. errors during + installation. + :vartype error_info: + ~azure.mgmt.kubernetesconfiguration.models.ErrorDefinition + :param identity: The identity of the configuration. + :type identity: + ~azure.mgmt.kubernetesconfiguration.models.ConfigurationIdentity """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'last_status_time': {'readonly': True}, + 'error_info': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'extension_type': {'key': 'properties.extensionType', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, + 'release_train': {'key': 'properties.releaseTrain', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'Scope'}, + 'configuration_settings': {'key': 'properties.configurationSettings', 'type': '{str}'}, + 'configuration_protected_settings': {'key': 'properties.configurationProtectedSettings', 'type': '{str}'}, + 'install_state': {'key': 'properties.installState', 'type': 'str'}, + 'statuses': {'key': 'properties.statuses', 'type': '[ExtensionStatus]'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'str'}, + 'last_status_time': {'key': 'properties.lastStatusTime', 'type': 'str'}, + 'error_info': {'key': 'properties.errorInfo', 'type': 'ErrorDefinition'}, + 'identity': {'key': 'properties.identity', 'type': 'ConfigurationIdentity'}, } - def __init__(self, **kwargs) -> None: - super(ProxyResource, self).__init__(**kwargs) + def __init__(self, *, system_data=None, extension_type: str=None, auto_upgrade_minor_version: bool=None, release_train: str=None, version: str=None, scope=None, configuration_settings=None, configuration_protected_settings=None, install_state=None, statuses=None, identity=None, **kwargs) -> None: + super(ExtensionInstance, self).__init__(system_data=system_data, **kwargs) + self.extension_type = extension_type + self.auto_upgrade_minor_version = auto_upgrade_minor_version + self.release_train = release_train + self.version = version + self.scope = scope + self.configuration_settings = configuration_settings + self.configuration_protected_settings = configuration_protected_settings + self.install_state = install_state + self.statuses = statuses + self.creation_time = None + self.last_modified_time = None + self.last_status_time = None + self.error_info = None + self.identity = identity + + +class ExtensionInstanceUpdate(Model): + """Update Extension Instance request object. + + :param auto_upgrade_minor_version: Flag to note if this instance + participates in Extension Lifecycle Management or not. + :type auto_upgrade_minor_version: bool + :param release_train: ReleaseTrain this extension instance participates in + for auto-upgrade (e.g. Stable, Preview, etc.) - only if + autoUpgradeMinorVersion is 'true'. + :type release_train: str + :param version: Version number of extension, to 'pin' to a specific + version. autoUpgradeMinorVersion must be 'false'. + :type version: str + """ + + _attribute_map = { + 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, + 'release_train': {'key': 'properties.releaseTrain', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + } + + def __init__(self, *, auto_upgrade_minor_version: bool=None, release_train: str=None, version: str=None, **kwargs) -> None: + super(ExtensionInstanceUpdate, self).__init__(**kwargs) + self.auto_upgrade_minor_version = auto_upgrade_minor_version + self.release_train = release_train + self.version = version + + +class ExtensionStatus(Model): + """Status from this instance of the extension. + + :param code: Status code provided by the Extension + :type code: str + :param display_status: Short description of status of this instance of the + extension. + :type display_status: str + :param level: Level of the status. Possible values include: 'Error', + 'Warning', 'Information'. Default value: "Information" . + :type level: str or ~azure.mgmt.kubernetesconfiguration.models.LevelType + :param message: Detailed message of the status from the Extension + instance. + :type message: str + :param time: DateLiteral (per ISO8601) noting the time of installation + status. + :type time: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'display_status': {'key': 'displayStatus', 'type': 'str'}, + 'level': {'key': 'level', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'time': {'key': 'time', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, display_status: str=None, level="Information", message: str=None, time: str=None, **kwargs) -> None: + super(ExtensionStatus, self).__init__(**kwargs) + self.code = code + self.display_status = display_status + self.level = level + self.message = message + self.time = time + + +class HelmOperatorProperties(Model): + """Properties for Helm operator. + + :param chart_version: Version of the operator Helm chart. + :type chart_version: str + :param chart_values: Values override for the operator Helm chart. + :type chart_values: str + """ + + _attribute_map = { + 'chart_version': {'key': 'chartVersion', 'type': 'str'}, + 'chart_values': {'key': 'chartValues', 'type': 'str'}, + } + + def __init__(self, *, chart_version: str=None, chart_values: str=None, **kwargs) -> None: + super(HelmOperatorProperties, self).__init__(**kwargs) + self.chart_version = chart_version + self.chart_values = chart_values class ResourceProviderOperation(Model): @@ -328,20 +502,80 @@ def __init__(self, *, sample_property: str=None, **kwargs) -> None: self.sample_property = sample_property +class Scope(Model): + """Scope of the extensionInstance. It can be either Cluster or Namespace; but + not both. + + :param cluster: Specifies that the scope of the extensionInstance is + Cluster + :type cluster: ~azure.mgmt.kubernetesconfiguration.models.ScopeCluster + :param namespace: Specifies that the scope of the extensionInstance is + Namespace + :type namespace: ~azure.mgmt.kubernetesconfiguration.models.ScopeNamespace + """ + + _attribute_map = { + 'cluster': {'key': 'cluster', 'type': 'ScopeCluster'}, + 'namespace': {'key': 'namespace', 'type': 'ScopeNamespace'}, + } + + def __init__(self, *, cluster=None, namespace=None, **kwargs) -> None: + super(Scope, self).__init__(**kwargs) + self.cluster = cluster + self.namespace = namespace + + +class ScopeCluster(Model): + """Specifies that the scope of the extensionInstance is Cluster. + + :param release_namespace: Namespace where the extension Release must be + placed, for a Cluster scoped extensionInstance. If this namespace does + not exist, it will be created + :type release_namespace: str + """ + + _attribute_map = { + 'release_namespace': {'key': 'releaseNamespace', 'type': 'str'}, + } + + def __init__(self, *, release_namespace: str=None, **kwargs) -> None: + super(ScopeCluster, self).__init__(**kwargs) + self.release_namespace = release_namespace + + +class ScopeNamespace(Model): + """Specifies that the scope of the extensionInstance is Namespace. + + :param target_namespace: Namespace where the extensionInstance will be + created for an Namespace scoped extensionInstance. If this namespace does + not exist, it will be created + :type target_namespace: str + """ + + _attribute_map = { + 'target_namespace': {'key': 'targetNamespace', 'type': 'str'}, + } + + def __init__(self, *, target_namespace: str=None, **kwargs) -> None: + super(ScopeNamespace, self).__init__(**kwargs) + self.target_namespace = target_namespace + + class SourceControlConfiguration(ProxyResource): """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: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :ivar id: Resource Id :vartype id: str - :ivar name: The name of the resource + :ivar name: Resource name :vartype name: str - :ivar type: The type of the resource. E.g. - "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :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 @@ -387,9 +621,6 @@ class SourceControlConfiguration(ProxyResource): :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 = { @@ -405,6 +636,7 @@ 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'}, @@ -418,11 +650,10 @@ class SourceControlConfiguration(ProxyResource): '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, 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) + 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 @@ -436,92 +667,56 @@ def __init__(self, *, repository_url: str=None, operator_namespace: str="default 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'. + """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. - 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 + :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 = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, + '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 = { - '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'}, + '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, *, location: str, tags=None, **kwargs) -> None: - super(TrackedResource, self).__init__(**kwargs) - self.tags = tags - self.location = location + 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 index da03391d8d6e..8958c950299f 100644 --- 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 @@ -12,6 +12,19 @@ from msrest.paging import Paged +class ExtensionInstancePaged(Paged): + """ + A paging container for iterating over a list of :class:`ExtensionInstance ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ExtensionInstance]'} + } + + def __init__(self, *args, **kwargs): + + super(ExtensionInstancePaged, self).__init__(*args, **kwargs) class SourceControlConfigurationPaged(Paged): """ A paging container for iterating over a list of :class:`SourceControlConfiguration ` object 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 6708ac68cde1..085b03d7ff33 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,6 +12,26 @@ from enum import Enum +class InstallStateType(str, Enum): + + pending = "Pending" + installed = "Installed" + failed = "Failed" + + +class LevelType(str, Enum): + + error = "Error" + warning = "Warning" + information = "Information" + + +class ResourceIdentityType(str, Enum): + + system_assigned = "SystemAssigned" + none = "None" + + class ComplianceStateType(str, Enum): pending = "Pending" @@ -46,11 +66,3 @@ class ProvisioningStateType(str, Enum): 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/__init__.py b/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/operations/__init__.py index b6c0858d9a74..749d7992c5d7 100644 --- a/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/operations/__init__.py +++ b/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/operations/__init__.py @@ -9,10 +9,12 @@ # regenerated. # -------------------------------------------------------------------------- +from ._extensions_operations import ExtensionsOperations from ._source_control_configurations_operations import SourceControlConfigurationsOperations from ._operations import Operations __all__ = [ + 'ExtensionsOperations', 'SourceControlConfigurationsOperations', 'Operations', ] diff --git a/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/operations/_extensions_operations.py b/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/operations/_extensions_operations.py new file mode 100644 index 000000000000..2fcc899ce9c2 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/operations/_extensions_operations.py @@ -0,0 +1,431 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ExtensionsOperations(object): + """ExtensionsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to be used with the HTTP request. Constant value: "2021-05-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-05-01-preview" + + self.config = config + + def create( + self, resource_group_name, cluster_rp, cluster_resource_name, cluster_name, extension_instance_name, extension_instance, custom_headers=None, raw=False, **operation_config): + """Create a new Kubernetes Cluster Extension Instance. + + :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 extension_instance_name: Name of an instance of the Extension. + :type extension_instance_name: str + :param extension_instance: Properties necessary to Create an Extension + Instance. + :type extension_instance: + ~azure.mgmt.kubernetesconfiguration.models.ExtensionInstance + :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: ExtensionInstance or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.kubernetesconfiguration.models.ExtensionInstance + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create.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'), + 'extensionInstanceName': self._serialize.url("extension_instance_name", extension_instance_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(extension_instance, 'ExtensionInstance') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ExtensionInstance', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionInstanceName}'} + + def get( + self, resource_group_name, cluster_rp, cluster_resource_name, cluster_name, extension_instance_name, custom_headers=None, raw=False, **operation_config): + """Gets details of the Kubernetes Cluster Extension Instance. + + :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 extension_instance_name: Name of an instance of the Extension. + :type extension_instance_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: ExtensionInstance or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.kubernetesconfiguration.models.ExtensionInstance + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + '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'), + 'extensionInstanceName': self._serialize.url("extension_instance_name", extension_instance_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ExtensionInstance', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionInstanceName}'} + + def update( + self, resource_group_name, cluster_rp, cluster_resource_name, cluster_name, extension_instance_name, extension_instance, custom_headers=None, raw=False, **operation_config): + """Update an existing Kubernetes Cluster Extension Instance. + + :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 extension_instance_name: Name of an instance of the Extension. + :type extension_instance_name: str + :param extension_instance: Properties to Update in the Extension + Instance. + :type extension_instance: + ~azure.mgmt.kubernetesconfiguration.models.ExtensionInstanceUpdate + :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: ExtensionInstance or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.kubernetesconfiguration.models.ExtensionInstance + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + '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'), + 'extensionInstanceName': self._serialize.url("extension_instance_name", extension_instance_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(extension_instance, 'ExtensionInstanceUpdate') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ExtensionInstance', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionInstanceName}'} + + def delete( + self, resource_group_name, cluster_rp, cluster_resource_name, cluster_name, extension_instance_name, custom_headers=None, raw=False, **operation_config): + """Delete a Kubernetes Cluster Extension Instance. This will cause the + Agent to Uninstall the extension instance from the cluster. + + :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 extension_instance_name: Name of an instance of the Extension. + :type extension_instance_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 = { + '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'), + 'extensionInstanceName': self._serialize.url("extension_instance_name", extension_instance_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionInstanceName}'} + + def list( + self, resource_group_name, cluster_rp, cluster_resource_name, cluster_name, custom_headers=None, raw=False, **operation_config): + """List all Source Control Configurations. + + :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 dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ExtensionInstance + :rtype: + ~azure.mgmt.kubernetesconfiguration.models.ExtensionInstancePaged[~azure.mgmt.kubernetesconfiguration.models.ExtensionInstance] + :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 + if raw: + header_dict = {} + deserialized = models.ExtensionInstancePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions'} 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 5308b8f82709..f1d66b1a280e 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 @@ -24,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: "2021-03-01". + :ivar api_version: The API version to be used with the HTTP request. Constant value: "2021-05-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2021-03-01" + self.api_version = "2021-05-01-preview" self.config = config 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 4b4a85992620..8024c1f271a7 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: "2021-03-01". + :ivar api_version: The API version to be used with the HTTP request. Constant value: "2021-05-01-preview". """ 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 = "2021-03-01" + self.api_version = "2021-05-01-preview" self.config = config