diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_kusto_management_client.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_kusto_management_client.py index 9015ffbf96eb..d78e346ae980 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_kusto_management_client.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_kusto_management_client.py @@ -14,7 +14,9 @@ from ._configuration import KustoManagementClientConfiguration from .operations import ClustersOperations +from .operations import ClusterPrincipalAssignmentsOperations from .operations import DatabasesOperations +from .operations import DatabasePrincipalAssignmentsOperations from .operations import AttachedDatabaseConfigurationsOperations from .operations import DataConnectionsOperations from .operations import Operations @@ -29,8 +31,12 @@ class KustoManagementClient(SDKClient): :ivar clusters: Clusters operations :vartype clusters: azure.mgmt.kusto.operations.ClustersOperations + :ivar cluster_principal_assignments: ClusterPrincipalAssignments operations + :vartype cluster_principal_assignments: azure.mgmt.kusto.operations.ClusterPrincipalAssignmentsOperations :ivar databases: Databases operations :vartype databases: azure.mgmt.kusto.operations.DatabasesOperations + :ivar database_principal_assignments: DatabasePrincipalAssignments operations + :vartype database_principal_assignments: azure.mgmt.kusto.operations.DatabasePrincipalAssignmentsOperations :ivar attached_database_configurations: AttachedDatabaseConfigurations operations :vartype attached_database_configurations: azure.mgmt.kusto.operations.AttachedDatabaseConfigurationsOperations :ivar data_connections: DataConnections operations @@ -55,14 +61,18 @@ def __init__( super(KustoManagementClient, 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-09-07' + self.api_version = '2019-11-09' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self.clusters = ClustersOperations( self._client, self.config, self._serialize, self._deserialize) + self.cluster_principal_assignments = ClusterPrincipalAssignmentsOperations( + self._client, self.config, self._serialize, self._deserialize) self.databases = DatabasesOperations( self._client, self.config, self._serialize, self._deserialize) + self.database_principal_assignments = DatabasePrincipalAssignmentsOperations( + self._client, self.config, self._serialize, self._deserialize) self.attached_database_configurations = AttachedDatabaseConfigurationsOperations( self._client, self.config, self._serialize, self._deserialize) self.data_connections = DataConnectionsOperations( diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/__init__.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/__init__.py index 8bb2947d1ab8..0f9b411d698f 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/__init__.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/__init__.py @@ -19,9 +19,13 @@ from ._models_py3 import CheckNameResult from ._models_py3 import Cluster from ._models_py3 import ClusterCheckNameRequest + from ._models_py3 import ClusterPrincipalAssignment + from ._models_py3 import ClusterPrincipalAssignmentCheckNameRequest from ._models_py3 import ClusterUpdate from ._models_py3 import Database from ._models_py3 import DatabasePrincipal + from ._models_py3 import DatabasePrincipalAssignment + from ._models_py3 import DatabasePrincipalAssignmentCheckNameRequest from ._models_py3 import DatabasePrincipalListRequest from ._models_py3 import DatabasePrincipalListResult from ._models_py3 import DatabaseStatistics @@ -30,6 +34,7 @@ from ._models_py3 import DataConnectionValidation from ._models_py3 import DataConnectionValidationListResult from ._models_py3 import DataConnectionValidationResult + from ._models_py3 import DiagnoseVirtualNetworkResult from ._models_py3 import EventGridDataConnection from ._models_py3 import EventHubDataConnection from ._models_py3 import FollowerDatabaseDefinition @@ -59,9 +64,13 @@ from ._models import CheckNameResult from ._models import Cluster from ._models import ClusterCheckNameRequest + from ._models import ClusterPrincipalAssignment + from ._models import ClusterPrincipalAssignmentCheckNameRequest from ._models import ClusterUpdate from ._models import Database from ._models import DatabasePrincipal + from ._models import DatabasePrincipalAssignment + from ._models import DatabasePrincipalAssignmentCheckNameRequest from ._models import DatabasePrincipalListRequest from ._models import DatabasePrincipalListResult from ._models import DatabaseStatistics @@ -70,6 +79,7 @@ from ._models import DataConnectionValidation from ._models import DataConnectionValidationListResult from ._models import DataConnectionValidationResult + from ._models import DiagnoseVirtualNetworkResult from ._models import EventGridDataConnection from ._models import EventHubDataConnection from ._models import FollowerDatabaseDefinition @@ -92,7 +102,9 @@ from ._paged_models import AttachedDatabaseConfigurationPaged from ._paged_models import AzureResourceSkuPaged from ._paged_models import ClusterPaged +from ._paged_models import ClusterPrincipalAssignmentPaged from ._paged_models import DatabasePaged +from ._paged_models import DatabasePrincipalAssignmentPaged from ._paged_models import DatabasePrincipalPaged from ._paged_models import DataConnectionPaged from ._paged_models import FollowerDatabaseDefinitionPaged @@ -106,10 +118,15 @@ AzureScaleType, DefaultPrincipalsModificationKind, PrincipalsModificationKind, - DataFormat, + EventHubDataFormat, + Compression, + IotHubDataFormat, + EventGridDataFormat, IdentityType, DatabasePrincipalRole, DatabasePrincipalType, + PrincipalType, + ClusterPrincipalRole, Type, Reason, ) @@ -124,9 +141,13 @@ 'CheckNameResult', 'Cluster', 'ClusterCheckNameRequest', + 'ClusterPrincipalAssignment', + 'ClusterPrincipalAssignmentCheckNameRequest', 'ClusterUpdate', 'Database', 'DatabasePrincipal', + 'DatabasePrincipalAssignment', + 'DatabasePrincipalAssignmentCheckNameRequest', 'DatabasePrincipalListRequest', 'DatabasePrincipalListResult', 'DatabaseStatistics', @@ -135,6 +156,7 @@ 'DataConnectionValidation', 'DataConnectionValidationListResult', 'DataConnectionValidationResult', + 'DiagnoseVirtualNetworkResult', 'EventGridDataConnection', 'EventHubDataConnection', 'FollowerDatabaseDefinition', @@ -158,8 +180,10 @@ 'ClusterPaged', 'SkuDescriptionPaged', 'AzureResourceSkuPaged', + 'ClusterPrincipalAssignmentPaged', 'DatabasePaged', 'DatabasePrincipalPaged', + 'DatabasePrincipalAssignmentPaged', 'AttachedDatabaseConfigurationPaged', 'DataConnectionPaged', 'OperationPaged', @@ -170,10 +194,15 @@ 'AzureScaleType', 'DefaultPrincipalsModificationKind', 'PrincipalsModificationKind', - 'DataFormat', + 'EventHubDataFormat', + 'Compression', + 'IotHubDataFormat', + 'EventGridDataFormat', 'IdentityType', 'DatabasePrincipalRole', 'DatabasePrincipalType', + 'PrincipalType', + 'ClusterPrincipalRole', 'Type', 'Reason', ] diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/_kusto_management_client_enums.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/_kusto_management_client_enums.py index 8f34ce88248b..d9d07ddc6a59 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/_kusto_management_client_enums.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/_kusto_management_client_enums.py @@ -78,7 +78,7 @@ class PrincipalsModificationKind(str, Enum): none = "None" -class DataFormat(str, Enum): +class EventHubDataFormat(str, Enum): multijson = "MULTIJSON" json = "JSON" @@ -92,6 +92,50 @@ class DataFormat(str, Enum): singlejson = "SINGLEJSON" avro = "AVRO" tsve = "TSVE" + parquet = "PARQUET" + orc = "ORC" + + +class Compression(str, Enum): + + none = "None" + gzip = "GZip" + + +class IotHubDataFormat(str, Enum): + + multijson = "MULTIJSON" + json = "JSON" + csv = "CSV" + tsv = "TSV" + scsv = "SCSV" + sohsv = "SOHSV" + psv = "PSV" + txt = "TXT" + raw = "RAW" + singlejson = "SINGLEJSON" + avro = "AVRO" + tsve = "TSVE" + parquet = "PARQUET" + orc = "ORC" + + +class EventGridDataFormat(str, Enum): + + multijson = "MULTIJSON" + json = "JSON" + csv = "CSV" + tsv = "TSV" + scsv = "SCSV" + sohsv = "SOHSV" + psv = "PSV" + txt = "TXT" + raw = "RAW" + singlejson = "SINGLEJSON" + avro = "AVRO" + tsve = "TSVE" + parquet = "PARQUET" + orc = "ORC" class IdentityType(str, Enum): @@ -117,6 +161,19 @@ class DatabasePrincipalType(str, Enum): user = "User" +class PrincipalType(str, Enum): + + app = "App" + group = "Group" + user = "User" + + +class ClusterPrincipalRole(str, Enum): + + all_databases_admin = "AllDatabasesAdmin" + all_databases_viewer = "AllDatabasesViewer" + + class Type(str, Enum): microsoft_kustoclustersdatabases = "Microsoft.Kusto/clusters/databases" diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/_models.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/_models.py index 22690e034688..19341e13ec4e 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/_models.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/_models.py @@ -492,6 +492,8 @@ class Cluster(TrackedResource): :vartype uri: str :ivar data_ingestion_uri: The cluster data ingestion URI. :vartype data_ingestion_uri: str + :ivar state_reason: The reason for the cluster's current state. + :vartype state_reason: str :param trusted_external_tenants: The cluster's external tenants. :type trusted_external_tenants: list[~azure.mgmt.kusto.models.TrustedExternalTenant] @@ -521,6 +523,7 @@ class Cluster(TrackedResource): 'provisioning_state': {'readonly': True}, 'uri': {'readonly': True}, 'data_ingestion_uri': {'readonly': True}, + 'state_reason': {'readonly': True}, } _attribute_map = { @@ -536,6 +539,7 @@ class Cluster(TrackedResource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'uri': {'key': 'properties.uri', 'type': 'str'}, 'data_ingestion_uri': {'key': 'properties.dataIngestionUri', 'type': 'str'}, + 'state_reason': {'key': 'properties.stateReason', 'type': 'str'}, 'trusted_external_tenants': {'key': 'properties.trustedExternalTenants', 'type': '[TrustedExternalTenant]'}, 'optimized_autoscale': {'key': 'properties.optimizedAutoscale', 'type': 'OptimizedAutoscale'}, 'enable_disk_encryption': {'key': 'properties.enableDiskEncryption', 'type': 'bool'}, @@ -553,6 +557,7 @@ def __init__(self, **kwargs): self.provisioning_state = None self.uri = None self.data_ingestion_uri = None + self.state_reason = None self.trusted_external_tenants = kwargs.get('trusted_external_tenants', None) self.optimized_autoscale = kwargs.get('optimized_autoscale', None) self.enable_disk_encryption = kwargs.get('enable_disk_encryption', None) @@ -593,6 +598,113 @@ def __init__(self, **kwargs): self.name = kwargs.get('name', None) +class ClusterPrincipalAssignment(ProxyResource): + """Class representing a cluster principal assignment. + + 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. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param principal_id: Required. The principal ID assigned to the cluster + principal. It can be a user email, application ID, or security group name. + :type principal_id: str + :param role: Required. Cluster principal role. Possible values include: + 'AllDatabasesAdmin', 'AllDatabasesViewer' + :type role: str or ~azure.mgmt.kusto.models.ClusterPrincipalRole + :param tenant_id: The tenant id of the principal + :type tenant_id: str + :param principal_type: Required. Principal type. Possible values include: + 'App', 'Group', 'User' + :type principal_type: str or ~azure.mgmt.kusto.models.PrincipalType + :ivar tenant_name: The tenant name of the principal + :vartype tenant_name: str + :ivar principal_name: The principal name + :vartype principal_name: str + :ivar provisioning_state: The provisioned state of the resource. Possible + values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', + 'Moving' + :vartype provisioning_state: str or + ~azure.mgmt.kusto.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'principal_id': {'required': True}, + 'role': {'required': True}, + 'principal_type': {'required': True}, + 'tenant_name': {'readonly': True}, + 'principal_name': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'properties.principalId', 'type': 'str'}, + 'role': {'key': 'properties.role', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'principal_type': {'key': 'properties.principalType', 'type': 'str'}, + 'tenant_name': {'key': 'properties.tenantName', 'type': 'str'}, + 'principal_name': {'key': 'properties.principalName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ClusterPrincipalAssignment, self).__init__(**kwargs) + self.principal_id = kwargs.get('principal_id', None) + self.role = kwargs.get('role', None) + self.tenant_id = kwargs.get('tenant_id', None) + self.principal_type = kwargs.get('principal_type', None) + self.tenant_name = None + self.principal_name = None + self.provisioning_state = None + + +class ClusterPrincipalAssignmentCheckNameRequest(Model): + """A principal assignment check name availability request. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Principal Assignment resource name. + :type name: str + :ivar type: Required. The type of resource, + Microsoft.Kusto/clusters/principalAssignments. Default value: + "Microsoft.Kusto/clusters/principalAssignments" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Kusto/clusters/principalAssignments" + + def __init__(self, **kwargs): + super(ClusterPrincipalAssignmentCheckNameRequest, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + class ClusterUpdate(Resource): """Class representing an update to a Kusto cluster. @@ -628,6 +740,8 @@ class ClusterUpdate(Resource): :vartype uri: str :ivar data_ingestion_uri: The cluster data ingestion URI. :vartype data_ingestion_uri: str + :ivar state_reason: The reason for the cluster's current state. + :vartype state_reason: str :param trusted_external_tenants: The cluster's external tenants. :type trusted_external_tenants: list[~azure.mgmt.kusto.models.TrustedExternalTenant] @@ -655,6 +769,7 @@ class ClusterUpdate(Resource): 'provisioning_state': {'readonly': True}, 'uri': {'readonly': True}, 'data_ingestion_uri': {'readonly': True}, + 'state_reason': {'readonly': True}, } _attribute_map = { @@ -669,6 +784,7 @@ class ClusterUpdate(Resource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'uri': {'key': 'properties.uri', 'type': 'str'}, 'data_ingestion_uri': {'key': 'properties.dataIngestionUri', 'type': 'str'}, + 'state_reason': {'key': 'properties.stateReason', 'type': 'str'}, 'trusted_external_tenants': {'key': 'properties.trustedExternalTenants', 'type': '[TrustedExternalTenant]'}, 'optimized_autoscale': {'key': 'properties.optimizedAutoscale', 'type': 'OptimizedAutoscale'}, 'enable_disk_encryption': {'key': 'properties.enableDiskEncryption', 'type': 'bool'}, @@ -687,6 +803,7 @@ def __init__(self, **kwargs): self.provisioning_state = None self.uri = None self.data_ingestion_uri = None + self.state_reason = None self.trusted_external_tenants = kwargs.get('trusted_external_tenants', None) self.optimized_autoscale = kwargs.get('optimized_autoscale', None) self.enable_disk_encryption = kwargs.get('enable_disk_encryption', None) @@ -801,6 +918,113 @@ def __init__(self, **kwargs): self.tenant_name = None +class DatabasePrincipalAssignment(ProxyResource): + """Class representing a database principal assignment. + + 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. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param principal_id: Required. The principal ID assigned to the database + principal. It can be a user email, application ID, or security group name. + :type principal_id: str + :param role: Required. Database principal role. Possible values include: + 'Admin', 'Ingestor', 'Monitor', 'User', 'UnrestrictedViewers', 'Viewer' + :type role: str or ~azure.mgmt.kusto.models.DatabasePrincipalRole + :param tenant_id: The tenant id of the principal + :type tenant_id: str + :param principal_type: Required. Principal type. Possible values include: + 'App', 'Group', 'User' + :type principal_type: str or ~azure.mgmt.kusto.models.PrincipalType + :ivar tenant_name: The tenant name of the principal + :vartype tenant_name: str + :ivar principal_name: The principal name + :vartype principal_name: str + :ivar provisioning_state: The provisioned state of the resource. Possible + values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', + 'Moving' + :vartype provisioning_state: str or + ~azure.mgmt.kusto.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'principal_id': {'required': True}, + 'role': {'required': True}, + 'principal_type': {'required': True}, + 'tenant_name': {'readonly': True}, + 'principal_name': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'properties.principalId', 'type': 'str'}, + 'role': {'key': 'properties.role', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'principal_type': {'key': 'properties.principalType', 'type': 'str'}, + 'tenant_name': {'key': 'properties.tenantName', 'type': 'str'}, + 'principal_name': {'key': 'properties.principalName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DatabasePrincipalAssignment, self).__init__(**kwargs) + self.principal_id = kwargs.get('principal_id', None) + self.role = kwargs.get('role', None) + self.tenant_id = kwargs.get('tenant_id', None) + self.principal_type = kwargs.get('principal_type', None) + self.tenant_name = None + self.principal_name = None + self.provisioning_state = None + + +class DatabasePrincipalAssignmentCheckNameRequest(Model): + """A principal assignment check name availability request. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Principal Assignment resource name. + :type name: str + :ivar type: Required. The type of resource, + Microsoft.Kusto/clusters/databases/principalAssignments. Default value: + "Microsoft.Kusto/clusters/databases/principalAssignments" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Kusto/clusters/databases/principalAssignments" + + def __init__(self, **kwargs): + super(DatabasePrincipalAssignmentCheckNameRequest, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + class DatabasePrincipalListRequest(Model): """The list Kusto database principals operation request. @@ -903,8 +1127,7 @@ def __init__(self, **kwargs): class DataConnectionCheckNameRequest(Model): - """The result returned from a data connections check name availability - request. + """A data connection check name availability request. Variables are only populated by the server, and will be ignored when sending a request. @@ -989,6 +1212,22 @@ def __init__(self, **kwargs): self.error_message = kwargs.get('error_message', None) +class DiagnoseVirtualNetworkResult(Model): + """DiagnoseVirtualNetworkResult. + + :param findings: The list of network connectivity diagnostic finding + :type findings: list[str] + """ + + _attribute_map = { + 'findings': {'key': 'findings', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(DiagnoseVirtualNetworkResult, self).__init__(**kwargs) + self.findings = kwargs.get('findings', None) + + class EventGridDataConnection(DataConnection): """Class representing an Event Grid data connection. @@ -1026,8 +1265,8 @@ class EventGridDataConnection(DataConnection): :param data_format: Required. The data format of the message. Optionally the data format can be added to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', - 'SINGLEJSON', 'AVRO', 'TSVE' - :type data_format: str or ~azure.mgmt.kusto.models.DataFormat + 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC' + :type data_format: str or ~azure.mgmt.kusto.models.EventGridDataFormat """ _validation = { @@ -1101,10 +1340,13 @@ class EventHubDataConnection(DataConnection): :param data_format: The data format of the message. Optionally the data format can be added to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', - 'AVRO', 'TSVE' - :type data_format: str or ~azure.mgmt.kusto.models.DataFormat + 'AVRO', 'TSVE', 'PARQUET', 'ORC' + :type data_format: str or ~azure.mgmt.kusto.models.EventHubDataFormat :param event_system_properties: System properties of the event hub :type event_system_properties: list[str] + :param compression: The event hub messages compression type. Possible + values include: 'None', 'GZip' + :type compression: str or ~azure.mgmt.kusto.models.Compression """ _validation = { @@ -1128,6 +1370,7 @@ class EventHubDataConnection(DataConnection): 'mapping_rule_name': {'key': 'properties.mappingRuleName', 'type': 'str'}, 'data_format': {'key': 'properties.dataFormat', 'type': 'str'}, 'event_system_properties': {'key': 'properties.eventSystemProperties', 'type': '[str]'}, + 'compression': {'key': 'properties.compression', 'type': 'str'}, } def __init__(self, **kwargs): @@ -1138,6 +1381,7 @@ def __init__(self, **kwargs): self.mapping_rule_name = kwargs.get('mapping_rule_name', None) self.data_format = kwargs.get('data_format', None) self.event_system_properties = kwargs.get('event_system_properties', None) + self.compression = kwargs.get('compression', None) self.kind = 'EventHub' @@ -1285,12 +1529,12 @@ class IotHubDataConnection(DataConnection): :param data_format: The data format of the message. Optionally the data format can be added to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', - 'AVRO', 'TSVE' - :type data_format: str or ~azure.mgmt.kusto.models.DataFormat + 'AVRO', 'TSVE', 'PARQUET', 'ORC' + :type data_format: str or ~azure.mgmt.kusto.models.IotHubDataFormat :param event_system_properties: System properties of the iot hub :type event_system_properties: list[str] :param shared_access_policy_name: Required. The name of the share access - policy name + policy :type shared_access_policy_name: str """ @@ -1575,6 +1819,8 @@ class ReadWriteDatabase(Database): :type hot_cache_period: timedelta :param statistics: The statistics of the database. :type statistics: ~azure.mgmt.kusto.models.DatabaseStatistics + :ivar is_followed: Indicates whether the database is followed. + :vartype is_followed: str """ _validation = { @@ -1583,6 +1829,7 @@ class ReadWriteDatabase(Database): 'type': {'readonly': True}, 'kind': {'required': True}, 'provisioning_state': {'readonly': True}, + 'is_followed': {'readonly': True}, } _attribute_map = { @@ -1595,6 +1842,7 @@ class ReadWriteDatabase(Database): 'soft_delete_period': {'key': 'properties.softDeletePeriod', 'type': 'duration'}, 'hot_cache_period': {'key': 'properties.hotCachePeriod', 'type': 'duration'}, 'statistics': {'key': 'properties.statistics', 'type': 'DatabaseStatistics'}, + 'is_followed': {'key': 'properties.isFollowed', 'type': 'str'}, } def __init__(self, **kwargs): @@ -1603,6 +1851,7 @@ def __init__(self, **kwargs): self.soft_delete_period = kwargs.get('soft_delete_period', None) self.hot_cache_period = kwargs.get('hot_cache_period', None) self.statistics = kwargs.get('statistics', None) + self.is_followed = None self.kind = 'ReadWrite' diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/_models_py3.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/_models_py3.py index 888ba23cc2ed..81bc114d2fa7 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/_models_py3.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/_models_py3.py @@ -492,6 +492,8 @@ class Cluster(TrackedResource): :vartype uri: str :ivar data_ingestion_uri: The cluster data ingestion URI. :vartype data_ingestion_uri: str + :ivar state_reason: The reason for the cluster's current state. + :vartype state_reason: str :param trusted_external_tenants: The cluster's external tenants. :type trusted_external_tenants: list[~azure.mgmt.kusto.models.TrustedExternalTenant] @@ -521,6 +523,7 @@ class Cluster(TrackedResource): 'provisioning_state': {'readonly': True}, 'uri': {'readonly': True}, 'data_ingestion_uri': {'readonly': True}, + 'state_reason': {'readonly': True}, } _attribute_map = { @@ -536,6 +539,7 @@ class Cluster(TrackedResource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'uri': {'key': 'properties.uri', 'type': 'str'}, 'data_ingestion_uri': {'key': 'properties.dataIngestionUri', 'type': 'str'}, + 'state_reason': {'key': 'properties.stateReason', 'type': 'str'}, 'trusted_external_tenants': {'key': 'properties.trustedExternalTenants', 'type': '[TrustedExternalTenant]'}, 'optimized_autoscale': {'key': 'properties.optimizedAutoscale', 'type': 'OptimizedAutoscale'}, 'enable_disk_encryption': {'key': 'properties.enableDiskEncryption', 'type': 'bool'}, @@ -553,6 +557,7 @@ def __init__(self, *, location: str, sku, tags=None, zones=None, identity=None, self.provisioning_state = None self.uri = None self.data_ingestion_uri = None + self.state_reason = None self.trusted_external_tenants = trusted_external_tenants self.optimized_autoscale = optimized_autoscale self.enable_disk_encryption = enable_disk_encryption @@ -593,6 +598,113 @@ def __init__(self, *, name: str, **kwargs) -> None: self.name = name +class ClusterPrincipalAssignment(ProxyResource): + """Class representing a cluster principal assignment. + + 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. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param principal_id: Required. The principal ID assigned to the cluster + principal. It can be a user email, application ID, or security group name. + :type principal_id: str + :param role: Required. Cluster principal role. Possible values include: + 'AllDatabasesAdmin', 'AllDatabasesViewer' + :type role: str or ~azure.mgmt.kusto.models.ClusterPrincipalRole + :param tenant_id: The tenant id of the principal + :type tenant_id: str + :param principal_type: Required. Principal type. Possible values include: + 'App', 'Group', 'User' + :type principal_type: str or ~azure.mgmt.kusto.models.PrincipalType + :ivar tenant_name: The tenant name of the principal + :vartype tenant_name: str + :ivar principal_name: The principal name + :vartype principal_name: str + :ivar provisioning_state: The provisioned state of the resource. Possible + values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', + 'Moving' + :vartype provisioning_state: str or + ~azure.mgmt.kusto.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'principal_id': {'required': True}, + 'role': {'required': True}, + 'principal_type': {'required': True}, + 'tenant_name': {'readonly': True}, + 'principal_name': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'properties.principalId', 'type': 'str'}, + 'role': {'key': 'properties.role', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'principal_type': {'key': 'properties.principalType', 'type': 'str'}, + 'tenant_name': {'key': 'properties.tenantName', 'type': 'str'}, + 'principal_name': {'key': 'properties.principalName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, principal_id: str, role, principal_type, tenant_id: str=None, **kwargs) -> None: + super(ClusterPrincipalAssignment, self).__init__(**kwargs) + self.principal_id = principal_id + self.role = role + self.tenant_id = tenant_id + self.principal_type = principal_type + self.tenant_name = None + self.principal_name = None + self.provisioning_state = None + + +class ClusterPrincipalAssignmentCheckNameRequest(Model): + """A principal assignment check name availability request. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Principal Assignment resource name. + :type name: str + :ivar type: Required. The type of resource, + Microsoft.Kusto/clusters/principalAssignments. Default value: + "Microsoft.Kusto/clusters/principalAssignments" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Kusto/clusters/principalAssignments" + + def __init__(self, *, name: str, **kwargs) -> None: + super(ClusterPrincipalAssignmentCheckNameRequest, self).__init__(**kwargs) + self.name = name + + class ClusterUpdate(Resource): """Class representing an update to a Kusto cluster. @@ -628,6 +740,8 @@ class ClusterUpdate(Resource): :vartype uri: str :ivar data_ingestion_uri: The cluster data ingestion URI. :vartype data_ingestion_uri: str + :ivar state_reason: The reason for the cluster's current state. + :vartype state_reason: str :param trusted_external_tenants: The cluster's external tenants. :type trusted_external_tenants: list[~azure.mgmt.kusto.models.TrustedExternalTenant] @@ -655,6 +769,7 @@ class ClusterUpdate(Resource): 'provisioning_state': {'readonly': True}, 'uri': {'readonly': True}, 'data_ingestion_uri': {'readonly': True}, + 'state_reason': {'readonly': True}, } _attribute_map = { @@ -669,6 +784,7 @@ class ClusterUpdate(Resource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'uri': {'key': 'properties.uri', 'type': 'str'}, 'data_ingestion_uri': {'key': 'properties.dataIngestionUri', 'type': 'str'}, + 'state_reason': {'key': 'properties.stateReason', 'type': 'str'}, 'trusted_external_tenants': {'key': 'properties.trustedExternalTenants', 'type': '[TrustedExternalTenant]'}, 'optimized_autoscale': {'key': 'properties.optimizedAutoscale', 'type': 'OptimizedAutoscale'}, 'enable_disk_encryption': {'key': 'properties.enableDiskEncryption', 'type': 'bool'}, @@ -687,6 +803,7 @@ def __init__(self, *, tags=None, location: str=None, sku=None, identity=None, tr self.provisioning_state = None self.uri = None self.data_ingestion_uri = None + self.state_reason = None self.trusted_external_tenants = trusted_external_tenants self.optimized_autoscale = optimized_autoscale self.enable_disk_encryption = enable_disk_encryption @@ -801,6 +918,113 @@ def __init__(self, *, role, name: str, type, fqn: str=None, email: str=None, app self.tenant_name = None +class DatabasePrincipalAssignment(ProxyResource): + """Class representing a database principal assignment. + + 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. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param principal_id: Required. The principal ID assigned to the database + principal. It can be a user email, application ID, or security group name. + :type principal_id: str + :param role: Required. Database principal role. Possible values include: + 'Admin', 'Ingestor', 'Monitor', 'User', 'UnrestrictedViewers', 'Viewer' + :type role: str or ~azure.mgmt.kusto.models.DatabasePrincipalRole + :param tenant_id: The tenant id of the principal + :type tenant_id: str + :param principal_type: Required. Principal type. Possible values include: + 'App', 'Group', 'User' + :type principal_type: str or ~azure.mgmt.kusto.models.PrincipalType + :ivar tenant_name: The tenant name of the principal + :vartype tenant_name: str + :ivar principal_name: The principal name + :vartype principal_name: str + :ivar provisioning_state: The provisioned state of the resource. Possible + values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', + 'Moving' + :vartype provisioning_state: str or + ~azure.mgmt.kusto.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'principal_id': {'required': True}, + 'role': {'required': True}, + 'principal_type': {'required': True}, + 'tenant_name': {'readonly': True}, + 'principal_name': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'properties.principalId', 'type': 'str'}, + 'role': {'key': 'properties.role', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'principal_type': {'key': 'properties.principalType', 'type': 'str'}, + 'tenant_name': {'key': 'properties.tenantName', 'type': 'str'}, + 'principal_name': {'key': 'properties.principalName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, principal_id: str, role, principal_type, tenant_id: str=None, **kwargs) -> None: + super(DatabasePrincipalAssignment, self).__init__(**kwargs) + self.principal_id = principal_id + self.role = role + self.tenant_id = tenant_id + self.principal_type = principal_type + self.tenant_name = None + self.principal_name = None + self.provisioning_state = None + + +class DatabasePrincipalAssignmentCheckNameRequest(Model): + """A principal assignment check name availability request. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Principal Assignment resource name. + :type name: str + :ivar type: Required. The type of resource, + Microsoft.Kusto/clusters/databases/principalAssignments. Default value: + "Microsoft.Kusto/clusters/databases/principalAssignments" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Kusto/clusters/databases/principalAssignments" + + def __init__(self, *, name: str, **kwargs) -> None: + super(DatabasePrincipalAssignmentCheckNameRequest, self).__init__(**kwargs) + self.name = name + + class DatabasePrincipalListRequest(Model): """The list Kusto database principals operation request. @@ -903,8 +1127,7 @@ def __init__(self, *, location: str=None, **kwargs) -> None: class DataConnectionCheckNameRequest(Model): - """The result returned from a data connections check name availability - request. + """A data connection check name availability request. Variables are only populated by the server, and will be ignored when sending a request. @@ -989,6 +1212,22 @@ def __init__(self, *, error_message: str=None, **kwargs) -> None: self.error_message = error_message +class DiagnoseVirtualNetworkResult(Model): + """DiagnoseVirtualNetworkResult. + + :param findings: The list of network connectivity diagnostic finding + :type findings: list[str] + """ + + _attribute_map = { + 'findings': {'key': 'findings', 'type': '[str]'}, + } + + def __init__(self, *, findings=None, **kwargs) -> None: + super(DiagnoseVirtualNetworkResult, self).__init__(**kwargs) + self.findings = findings + + class EventGridDataConnection(DataConnection): """Class representing an Event Grid data connection. @@ -1026,8 +1265,8 @@ class EventGridDataConnection(DataConnection): :param data_format: Required. The data format of the message. Optionally the data format can be added to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', - 'SINGLEJSON', 'AVRO', 'TSVE' - :type data_format: str or ~azure.mgmt.kusto.models.DataFormat + 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC' + :type data_format: str or ~azure.mgmt.kusto.models.EventGridDataFormat """ _validation = { @@ -1101,10 +1340,13 @@ class EventHubDataConnection(DataConnection): :param data_format: The data format of the message. Optionally the data format can be added to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', - 'AVRO', 'TSVE' - :type data_format: str or ~azure.mgmt.kusto.models.DataFormat + 'AVRO', 'TSVE', 'PARQUET', 'ORC' + :type data_format: str or ~azure.mgmt.kusto.models.EventHubDataFormat :param event_system_properties: System properties of the event hub :type event_system_properties: list[str] + :param compression: The event hub messages compression type. Possible + values include: 'None', 'GZip' + :type compression: str or ~azure.mgmt.kusto.models.Compression """ _validation = { @@ -1128,9 +1370,10 @@ class EventHubDataConnection(DataConnection): 'mapping_rule_name': {'key': 'properties.mappingRuleName', 'type': 'str'}, 'data_format': {'key': 'properties.dataFormat', 'type': 'str'}, 'event_system_properties': {'key': 'properties.eventSystemProperties', 'type': '[str]'}, + 'compression': {'key': 'properties.compression', 'type': 'str'}, } - def __init__(self, *, event_hub_resource_id: str, consumer_group: str, location: str=None, table_name: str=None, mapping_rule_name: str=None, data_format=None, event_system_properties=None, **kwargs) -> None: + def __init__(self, *, event_hub_resource_id: str, consumer_group: str, location: str=None, table_name: str=None, mapping_rule_name: str=None, data_format=None, event_system_properties=None, compression=None, **kwargs) -> None: super(EventHubDataConnection, self).__init__(location=location, **kwargs) self.event_hub_resource_id = event_hub_resource_id self.consumer_group = consumer_group @@ -1138,6 +1381,7 @@ def __init__(self, *, event_hub_resource_id: str, consumer_group: str, location: self.mapping_rule_name = mapping_rule_name self.data_format = data_format self.event_system_properties = event_system_properties + self.compression = compression self.kind = 'EventHub' @@ -1285,12 +1529,12 @@ class IotHubDataConnection(DataConnection): :param data_format: The data format of the message. Optionally the data format can be added to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', - 'AVRO', 'TSVE' - :type data_format: str or ~azure.mgmt.kusto.models.DataFormat + 'AVRO', 'TSVE', 'PARQUET', 'ORC' + :type data_format: str or ~azure.mgmt.kusto.models.IotHubDataFormat :param event_system_properties: System properties of the iot hub :type event_system_properties: list[str] :param shared_access_policy_name: Required. The name of the share access - policy name + policy :type shared_access_policy_name: str """ @@ -1575,6 +1819,8 @@ class ReadWriteDatabase(Database): :type hot_cache_period: timedelta :param statistics: The statistics of the database. :type statistics: ~azure.mgmt.kusto.models.DatabaseStatistics + :ivar is_followed: Indicates whether the database is followed. + :vartype is_followed: str """ _validation = { @@ -1583,6 +1829,7 @@ class ReadWriteDatabase(Database): 'type': {'readonly': True}, 'kind': {'required': True}, 'provisioning_state': {'readonly': True}, + 'is_followed': {'readonly': True}, } _attribute_map = { @@ -1595,6 +1842,7 @@ class ReadWriteDatabase(Database): 'soft_delete_period': {'key': 'properties.softDeletePeriod', 'type': 'duration'}, 'hot_cache_period': {'key': 'properties.hotCachePeriod', 'type': 'duration'}, 'statistics': {'key': 'properties.statistics', 'type': 'DatabaseStatistics'}, + 'is_followed': {'key': 'properties.isFollowed', 'type': 'str'}, } def __init__(self, *, location: str=None, soft_delete_period=None, hot_cache_period=None, statistics=None, **kwargs) -> None: @@ -1603,6 +1851,7 @@ def __init__(self, *, location: str=None, soft_delete_period=None, hot_cache_per self.soft_delete_period = soft_delete_period self.hot_cache_period = hot_cache_period self.statistics = statistics + self.is_followed = None self.kind = 'ReadWrite' diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/_paged_models.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/_paged_models.py index 326b581fd46b..a0bcc63dbb36 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/_paged_models.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/models/_paged_models.py @@ -64,6 +64,19 @@ class AzureResourceSkuPaged(Paged): def __init__(self, *args, **kwargs): super(AzureResourceSkuPaged, self).__init__(*args, **kwargs) +class ClusterPrincipalAssignmentPaged(Paged): + """ + A paging container for iterating over a list of :class:`ClusterPrincipalAssignment ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ClusterPrincipalAssignment]'} + } + + def __init__(self, *args, **kwargs): + + super(ClusterPrincipalAssignmentPaged, self).__init__(*args, **kwargs) class DatabasePaged(Paged): """ A paging container for iterating over a list of :class:`Database ` object @@ -90,6 +103,19 @@ class DatabasePrincipalPaged(Paged): def __init__(self, *args, **kwargs): super(DatabasePrincipalPaged, self).__init__(*args, **kwargs) +class DatabasePrincipalAssignmentPaged(Paged): + """ + A paging container for iterating over a list of :class:`DatabasePrincipalAssignment ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DatabasePrincipalAssignment]'} + } + + def __init__(self, *args, **kwargs): + + super(DatabasePrincipalAssignmentPaged, self).__init__(*args, **kwargs) class AttachedDatabaseConfigurationPaged(Paged): """ A paging container for iterating over a list of :class:`AttachedDatabaseConfiguration ` object diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/__init__.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/__init__.py index 9f5475ee05e1..fb3a90ec8393 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/__init__.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/__init__.py @@ -10,14 +10,18 @@ # -------------------------------------------------------------------------- from ._clusters_operations import ClustersOperations +from ._cluster_principal_assignments_operations import ClusterPrincipalAssignmentsOperations from ._databases_operations import DatabasesOperations +from ._database_principal_assignments_operations import DatabasePrincipalAssignmentsOperations from ._attached_database_configurations_operations import AttachedDatabaseConfigurationsOperations from ._data_connections_operations import DataConnectionsOperations from ._operations import Operations __all__ = [ 'ClustersOperations', + 'ClusterPrincipalAssignmentsOperations', 'DatabasesOperations', + 'DatabasePrincipalAssignmentsOperations', 'AttachedDatabaseConfigurationsOperations', 'DataConnectionsOperations', 'Operations', diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_attached_database_configurations_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_attached_database_configurations_operations.py index 05ff061d21e3..fa6a608e66ec 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_attached_database_configurations_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_attached_database_configurations_operations.py @@ -27,7 +27,7 @@ class AttachedDatabaseConfigurationsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client API Version. Constant value: "2019-09-07". + :ivar api_version: Client API Version. Constant value: "2019-11-09". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-09-07" + self.api_version = "2019-11-09" self.config = config diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_cluster_principal_assignments_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_cluster_principal_assignments_operations.py new file mode 100644 index 000000000000..2151ca53cd87 --- /dev/null +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_cluster_principal_assignments_operations.py @@ -0,0 +1,447 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class ClusterPrincipalAssignmentsOperations(object): + """ClusterPrincipalAssignmentsOperations 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: Client API Version. Constant value: "2019-11-09". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-11-09" + + self.config = config + + def check_name_availability( + self, resource_group_name, cluster_name, name, custom_headers=None, raw=False, **operation_config): + """Checks that the principal assignment name is valid and is not already + in use. + + :param resource_group_name: The name of the resource group containing + the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param name: Principal Assignment resource name. + :type 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: CheckNameResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.kusto.models.CheckNameResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + principal_assignment_name = models.ClusterPrincipalAssignmentCheckNameRequest(name=name) + + # Construct URL + url = self.check_name_availability.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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(principal_assignment_name, 'ClusterPrincipalAssignmentCheckNameRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CheckNameResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/checkPrincipalAssignmentNameAvailability'} + + def get( + self, resource_group_name, cluster_name, principal_assignment_name, custom_headers=None, raw=False, **operation_config): + """Gets a Kusto cluster principalAssignment. + + :param resource_group_name: The name of the resource group containing + the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param principal_assignment_name: The name of the Kusto + principalAssignment. + :type principal_assignment_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: ClusterPrincipalAssignment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.kusto.models.ClusterPrincipalAssignment or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'principalAssignmentName': self._serialize.url("principal_assignment_name", principal_assignment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ClusterPrincipalAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} + + + def _create_or_update_initial( + self, resource_group_name, cluster_name, principal_assignment_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'principalAssignmentName': self._serialize.url("principal_assignment_name", principal_assignment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ClusterPrincipalAssignment') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ClusterPrincipalAssignment', response) + if response.status_code == 201: + deserialized = self._deserialize('ClusterPrincipalAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, cluster_name, principal_assignment_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Create a Kusto cluster principalAssignment. + + :param resource_group_name: The name of the resource group containing + the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param principal_assignment_name: The name of the Kusto + principalAssignment. + :type principal_assignment_name: str + :param parameters: The Kusto cluster principalAssignment's parameters + supplied for the operation. + :type parameters: ~azure.mgmt.kusto.models.ClusterPrincipalAssignment + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ClusterPrincipalAssignment or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.kusto.models.ClusterPrincipalAssignment] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.kusto.models.ClusterPrincipalAssignment]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + principal_assignment_name=principal_assignment_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ClusterPrincipalAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} + + + def _delete_initial( + self, resource_group_name, cluster_name, principal_assignment_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'principalAssignmentName': self._serialize.url("principal_assignment_name", principal_assignment_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, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, cluster_name, principal_assignment_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a Kusto cluster principalAssignment. + + :param resource_group_name: The name of the resource group containing + the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param principal_assignment_name: The name of the Kusto + principalAssignment. + :type principal_assignment_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + principal_assignment_name=principal_assignment_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} + + def list( + self, resource_group_name, cluster_name, custom_headers=None, raw=False, **operation_config): + """Lists all Kusto cluster principalAssignments. + + :param resource_group_name: The name of the resource group containing + the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto 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 ClusterPrincipalAssignment + :rtype: + ~azure.mgmt.kusto.models.ClusterPrincipalAssignmentPaged[~azure.mgmt.kusto.models.ClusterPrincipalAssignment] + :raises: :class:`CloudError` + """ + 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'), + '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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ClusterPrincipalAssignmentPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments'} diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_clusters_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_clusters_operations.py index 91f51fd70e45..473c378af5e2 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_clusters_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_clusters_operations.py @@ -27,7 +27,7 @@ class ClustersOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client API Version. Constant value: "2019-09-07". + :ivar api_version: Client API Version. Constant value: "2019-11-09". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-09-07" + self.api_version = "2019-11-09" self.config = config @@ -721,6 +721,102 @@ def get_long_running_output(response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) detach_follower_databases.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/detachFollowerDatabases'} + + def _diagnose_virtual_network_initial( + self, resource_group_name, cluster_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.diagnose_virtual_network.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DiagnoseVirtualNetworkResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def diagnose_virtual_network( + self, resource_group_name, cluster_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Diagnoses network connectivity status for external resources on which + the service is dependent on. + + :param resource_group_name: The name of the resource group containing + the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + DiagnoseVirtualNetworkResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.kusto.models.DiagnoseVirtualNetworkResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.kusto.models.DiagnoseVirtualNetworkResult]] + :raises: :class:`CloudError` + """ + raw_result = self._diagnose_virtual_network_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DiagnoseVirtualNetworkResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + diagnose_virtual_network.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/diagnoseVirtualNetwork'} + def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): """Lists all Kusto clusters within a resource group. diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_data_connections_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_data_connections_operations.py index 5fe2df10be1b..dadcd830e0d1 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_data_connections_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_data_connections_operations.py @@ -27,7 +27,7 @@ class DataConnectionsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client API Version. Constant value: "2019-09-07". + :ivar api_version: Client API Version. Constant value: "2019-11-09". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-09-07" + self.api_version = "2019-11-09" self.config = config diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_database_principal_assignments_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_database_principal_assignments_operations.py new file mode 100644 index 000000000000..e31567b5e1ea --- /dev/null +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_database_principal_assignments_operations.py @@ -0,0 +1,464 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class DatabasePrincipalAssignmentsOperations(object): + """DatabasePrincipalAssignmentsOperations 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: Client API Version. Constant value: "2019-11-09". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-11-09" + + self.config = config + + def check_name_availability( + self, resource_group_name, cluster_name, database_name, name, custom_headers=None, raw=False, **operation_config): + """Checks that the database principal assignment is valid and is not + already in use. + + :param resource_group_name: The name of the resource group containing + the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param name: Principal Assignment resource name. + :type 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: CheckNameResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.kusto.models.CheckNameResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + principal_assignment_name = models.DatabasePrincipalAssignmentCheckNameRequest(name=name) + + # Construct URL + url = self.check_name_availability.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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(principal_assignment_name, 'DatabasePrincipalAssignmentCheckNameRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CheckNameResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/checkPrincipalAssignmentNameAvailability'} + + def get( + self, resource_group_name, cluster_name, database_name, principal_assignment_name, custom_headers=None, raw=False, **operation_config): + """Gets a Kusto cluster database principalAssignment. + + :param resource_group_name: The name of the resource group containing + the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param principal_assignment_name: The name of the Kusto + principalAssignment. + :type principal_assignment_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: DatabasePrincipalAssignment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.kusto.models.DatabasePrincipalAssignment or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'principalAssignmentName': self._serialize.url("principal_assignment_name", principal_assignment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DatabasePrincipalAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} + + + def _create_or_update_initial( + self, resource_group_name, cluster_name, database_name, principal_assignment_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'principalAssignmentName': self._serialize.url("principal_assignment_name", principal_assignment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'DatabasePrincipalAssignment') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DatabasePrincipalAssignment', response) + if response.status_code == 201: + deserialized = self._deserialize('DatabasePrincipalAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, cluster_name, database_name, principal_assignment_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a Kusto cluster database principalAssignment. + + :param resource_group_name: The name of the resource group containing + the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param principal_assignment_name: The name of the Kusto + principalAssignment. + :type principal_assignment_name: str + :param parameters: The Kusto principalAssignments parameters supplied + for the operation. + :type parameters: ~azure.mgmt.kusto.models.DatabasePrincipalAssignment + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + DatabasePrincipalAssignment or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.kusto.models.DatabasePrincipalAssignment] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.kusto.models.DatabasePrincipalAssignment]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + principal_assignment_name=principal_assignment_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DatabasePrincipalAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} + + + def _delete_initial( + self, resource_group_name, cluster_name, database_name, principal_assignment_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'principalAssignmentName': self._serialize.url("principal_assignment_name", principal_assignment_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, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, cluster_name, database_name, principal_assignment_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a Kusto principalAssignment. + + :param resource_group_name: The name of the resource group containing + the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param principal_assignment_name: The name of the Kusto + principalAssignment. + :type principal_assignment_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + principal_assignment_name=principal_assignment_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} + + def list( + self, resource_group_name, cluster_name, database_name, custom_headers=None, raw=False, **operation_config): + """Lists all Kusto cluster database principalAssignments. + + :param resource_group_name: The name of the resource group containing + the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_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 DatabasePrincipalAssignment + :rtype: + ~azure.mgmt.kusto.models.DatabasePrincipalAssignmentPaged[~azure.mgmt.kusto.models.DatabasePrincipalAssignment] + :raises: :class:`CloudError` + """ + 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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DatabasePrincipalAssignmentPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments'} diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_databases_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_databases_operations.py index b206b2ec40f5..77d40b84ad29 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_databases_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_databases_operations.py @@ -27,7 +27,7 @@ class DatabasesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client API Version. Constant value: "2019-09-07". + :ivar api_version: Client API Version. Constant value: "2019-11-09". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-09-07" + self.api_version = "2019-11-09" self.config = config diff --git a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_operations.py b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_operations.py index 482c43707c41..444db1b77143 100644 --- a/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_operations.py +++ b/sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_operations.py @@ -25,7 +25,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client API Version. Constant value: "2019-09-07". + :ivar api_version: Client API Version. Constant value: "2019-11-09". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-09-07" + self.api_version = "2019-11-09" self.config = config