Source code for azure.mgmt.datalake.analytics.catalog.operations.catalog_operations

# 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 .. import models


[docs]class CatalogOperations(object): """CatalogOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2016-11-01". """ models = models def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer self.api_version = "2016-11-01" self.config = config
[docs] def create_secret( self, account_name, database_name, secret_name, password, uri=None, custom_headers=None, raw=False, **operation_config): """Creates the specified secret for use with external data sources in the specified database. This is deprecated and will be removed in the next release. Please use CreateCredential instead. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database in which to create the secret. :type database_name: str :param secret_name: The name of the secret. :type secret_name: str :param password: the password for the secret to pass in :type password: str :param uri: the URI identifier for the secret in the format <hostname>:<port> :type uri: 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<msrest:optionsforoperations>`. :return: None or ClientRawResponse if raw=true :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ parameters = models.DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters(password=password, uri=uri) # Construct URL url = self.create_secret.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str'), 'secretName': self._serialize.url("secret_name", secret_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['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, 'DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters') # Construct and send request request = self._client.put(url, query_parameters) response = self._client.send( request, header_parameters, body_content, 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 if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response
create_secret.metadata = {'url': '/catalog/usql/databases/{databaseName}/secrets/{secretName}'}
[docs] def get_secret( self, account_name, database_name, secret_name, custom_headers=None, raw=False, **operation_config): """Gets the specified secret in the specified database. This is deprecated and will be removed in the next release. Please use GetCredential instead. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database containing the secret. :type database_name: str :param secret_name: The name of the secret to get :type secret_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<msrest:optionsforoperations>`. :return: USqlSecret or ClientRawResponse if raw=true :rtype: ~azure.mgmt.datalake.analytics.catalog.models.USqlSecret or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = self.get_secret.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str'), 'secretName': self._serialize.url("secret_name", secret_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['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 and send request request = self._client.get(url, query_parameters) response = self._client.send(request, header_parameters, 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('USqlSecret', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized
get_secret.metadata = {'url': '/catalog/usql/databases/{databaseName}/secrets/{secretName}'}
[docs] def update_secret( self, account_name, database_name, secret_name, password, uri=None, custom_headers=None, raw=False, **operation_config): """Modifies the specified secret for use with external data sources in the specified database. This is deprecated and will be removed in the next release. Please use UpdateCredential instead. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database containing the secret. :type database_name: str :param secret_name: The name of the secret. :type secret_name: str :param password: the password for the secret to pass in :type password: str :param uri: the URI identifier for the secret in the format <hostname>:<port> :type uri: 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<msrest:optionsforoperations>`. :return: None or ClientRawResponse if raw=true :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ parameters = models.DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters(password=password, uri=uri) # Construct URL url = self.update_secret.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str'), 'secretName': self._serialize.url("secret_name", secret_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['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, 'DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters') # Construct and send request request = self._client.patch(url, query_parameters) response = self._client.send( request, header_parameters, body_content, 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 if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response
update_secret.metadata = {'url': '/catalog/usql/databases/{databaseName}/secrets/{secretName}'}
[docs] def delete_secret( self, account_name, database_name, secret_name, custom_headers=None, raw=False, **operation_config): """Deletes the specified secret in the specified database. This is deprecated and will be removed in the next release. Please use DeleteCredential instead. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database containing the secret. :type database_name: str :param secret_name: The name of the secret to delete :type secret_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<msrest:optionsforoperations>`. :return: None or ClientRawResponse if raw=true :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = self.delete_secret.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str'), 'secretName': self._serialize.url("secret_name", secret_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['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 and send request request = self._client.delete(url, query_parameters) response = self._client.send(request, header_parameters, 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 if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response
delete_secret.metadata = {'url': '/catalog/usql/databases/{databaseName}/secrets/{secretName}'}
[docs] def delete_all_secrets( self, account_name, database_name, custom_headers=None, raw=False, **operation_config): """Deletes all secrets in the specified database. This is deprecated and will be removed in the next release. In the future, please only drop individual credentials using DeleteCredential. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database containing the secret. :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<msrest:optionsforoperations>`. :return: None or ClientRawResponse if raw=true :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = self.delete_all_secrets.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), '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') # Construct headers header_parameters = {} 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 and send request request = self._client.delete(url, query_parameters) response = self._client.send(request, header_parameters, 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 if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response
delete_all_secrets.metadata = {'url': '/catalog/usql/databases/{databaseName}/secrets'}
[docs] def create_credential( self, account_name, database_name, credential_name, parameters, custom_headers=None, raw=False, **operation_config): """Creates the specified credential for use with external data sources in the specified database. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database in which to create the credential. Note: This is NOT an external database name, but the name of an existing U-SQL database that should contain the new credential object. :type database_name: str :param credential_name: The name of the credential. :type credential_name: str :param parameters: The parameters required to create the credential (name and password) :type parameters: ~azure.mgmt.datalake.analytics.catalog.models.DataLakeAnalyticsCatalogCredentialCreateParameters :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<msrest:optionsforoperations>`. :return: None or ClientRawResponse if raw=true :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = self.create_credential.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str'), 'credentialName': self._serialize.url("credential_name", credential_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['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, 'DataLakeAnalyticsCatalogCredentialCreateParameters') # Construct and send request request = self._client.put(url, query_parameters) response = self._client.send( request, header_parameters, body_content, 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 if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response
create_credential.metadata = {'url': '/catalog/usql/databases/{databaseName}/credentials/{credentialName}'}
[docs] def get_credential( self, account_name, database_name, credential_name, custom_headers=None, raw=False, **operation_config): """Retrieves the specified credential from the Data Lake Analytics catalog. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database containing the schema. :type database_name: str :param credential_name: The name of the credential. :type credential_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<msrest:optionsforoperations>`. :return: USqlCredential or ClientRawResponse if raw=true :rtype: ~azure.mgmt.datalake.analytics.catalog.models.USqlCredential or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = self.get_credential.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str'), 'credentialName': self._serialize.url("credential_name", credential_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['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 and send request request = self._client.get(url, query_parameters) response = self._client.send(request, header_parameters, 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('USqlCredential', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized
get_credential.metadata = {'url': '/catalog/usql/databases/{databaseName}/credentials/{credentialName}'}
[docs] def update_credential( self, account_name, database_name, credential_name, parameters, custom_headers=None, raw=False, **operation_config): """Modifies the specified credential for use with external data sources in the specified database. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database containing the credential. :type database_name: str :param credential_name: The name of the credential. :type credential_name: str :param parameters: The parameters required to modify the credential (name and password) :type parameters: ~azure.mgmt.datalake.analytics.catalog.models.DataLakeAnalyticsCatalogCredentialUpdateParameters :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<msrest:optionsforoperations>`. :return: None or ClientRawResponse if raw=true :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = self.update_credential.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str'), 'credentialName': self._serialize.url("credential_name", credential_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['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, 'DataLakeAnalyticsCatalogCredentialUpdateParameters') # Construct and send request request = self._client.patch(url, query_parameters) response = self._client.send( request, header_parameters, body_content, 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 if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response
update_credential.metadata = {'url': '/catalog/usql/databases/{databaseName}/credentials/{credentialName}'}
[docs] def delete_credential( self, account_name, database_name, credential_name, cascade=False, password=None, custom_headers=None, raw=False, **operation_config): """Deletes the specified credential in the specified database. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database containing the credential. :type database_name: str :param credential_name: The name of the credential to delete :type credential_name: str :param cascade: Indicates if the delete should be a cascading delete (which deletes all resources dependent on the credential as well as the credential) or not. If false will fail if there are any resources relying on the credential. :type cascade: bool :param password: the current password for the credential and user with access to the data source. This is required if the requester is not the account owner. :type password: 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<msrest:optionsforoperations>`. :return: None or ClientRawResponse if raw=true :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ parameters = None if password is not None: parameters = models.DataLakeAnalyticsCatalogCredentialDeleteParameters(password=password) # Construct URL url = self.delete_credential.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str'), 'credentialName': self._serialize.url("credential_name", credential_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} if cascade is not None: query_parameters['cascade'] = self._serialize.query("cascade", cascade, 'bool') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} 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 if parameters is not None: body_content = self._serialize.body(parameters, 'DataLakeAnalyticsCatalogCredentialDeleteParameters') else: body_content = None # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send( request, header_parameters, body_content, 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 if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response
delete_credential.metadata = {'url': '/catalog/usql/databases/{databaseName}/credentials/{credentialName}'}
[docs] def list_credentials( self, account_name, database_name, filter=None, top=None, skip=None, select=None, orderby=None, count=None, custom_headers=None, raw=False, **operation_config): """Retrieves the list of credentials from the Data Lake Analytics catalog. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database containing the schema. :type database_name: str :param filter: OData filter. Optional. :type filter: str :param top: The number of items to return. Optional. :type top: int :param skip: The number of items to skip over before returning elements. Optional. :type skip: int :param select: OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. :type select: str :param orderby: OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. :type orderby: str :param count: The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. :type count: bool :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<msrest:optionsforoperations>`. :return: An iterator like instance of USqlCredential :rtype: ~azure.mgmt.datalake.analytics.catalog.models.USqlCredentialPaged[~azure.mgmt.datalake.analytics.catalog.models.USqlCredential] :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL url = self.list_credentials.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') if top is not None: query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) if skip is not None: query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=1) if select is not None: query_parameters['$select'] = self._serialize.query("select", select, 'str') if orderby is not None: query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') if count is not None: query_parameters['$count'] = self._serialize.query("count", count, 'bool') 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['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 and send request request = self._client.get(url, query_parameters) response = self._client.send( request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp return response # Deserialize response deserialized = models.USqlCredentialPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} client_raw_response = models.USqlCredentialPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized
list_credentials.metadata = {'url': '/catalog/usql/databases/{databaseName}/credentials'}
[docs] def get_external_data_source( self, account_name, database_name, external_data_source_name, custom_headers=None, raw=False, **operation_config): """Retrieves the specified external data source from the Data Lake Analytics catalog. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database containing the external data source. :type database_name: str :param external_data_source_name: The name of the external data source. :type external_data_source_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<msrest:optionsforoperations>`. :return: USqlExternalDataSource or ClientRawResponse if raw=true :rtype: ~azure.mgmt.datalake.analytics.catalog.models.USqlExternalDataSource or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = self.get_external_data_source.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str'), 'externalDataSourceName': self._serialize.url("external_data_source_name", external_data_source_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['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 and send request request = self._client.get(url, query_parameters) response = self._client.send(request, header_parameters, 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('USqlExternalDataSource', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized
get_external_data_source.metadata = {'url': '/catalog/usql/databases/{databaseName}/externaldatasources/{externalDataSourceName}'}
[docs] def list_external_data_sources( self, account_name, database_name, filter=None, top=None, skip=None, select=None, orderby=None, count=None, custom_headers=None, raw=False, **operation_config): """Retrieves the list of external data sources from the Data Lake Analytics catalog. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database containing the external data sources. :type database_name: str :param filter: OData filter. Optional. :type filter: str :param top: The number of items to return. Optional. :type top: int :param skip: The number of items to skip over before returning elements. Optional. :type skip: int :param select: OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. :type select: str :param orderby: OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. :type orderby: str :param count: The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. :type count: bool :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<msrest:optionsforoperations>`. :return: An iterator like instance of USqlExternalDataSource :rtype: ~azure.mgmt.datalake.analytics.catalog.models.USqlExternalDataSourcePaged[~azure.mgmt.datalake.analytics.catalog.models.USqlExternalDataSource] :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL url = self.list_external_data_sources.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') if top is not None: query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) if skip is not None: query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=1) if select is not None: query_parameters['$select'] = self._serialize.query("select", select, 'str') if orderby is not None: query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') if count is not None: query_parameters['$count'] = self._serialize.query("count", count, 'bool') 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['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 and send request request = self._client.get(url, query_parameters) response = self._client.send( request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp return response # Deserialize response deserialized = models.USqlExternalDataSourcePaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} client_raw_response = models.USqlExternalDataSourcePaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized
list_external_data_sources.metadata = {'url': '/catalog/usql/databases/{databaseName}/externaldatasources'}
[docs] def get_procedure( self, account_name, database_name, schema_name, procedure_name, custom_headers=None, raw=False, **operation_config): """Retrieves the specified procedure from the Data Lake Analytics catalog. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database containing the procedure. :type database_name: str :param schema_name: The name of the schema containing the procedure. :type schema_name: str :param procedure_name: The name of the procedure. :type procedure_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<msrest:optionsforoperations>`. :return: USqlProcedure or ClientRawResponse if raw=true :rtype: ~azure.mgmt.datalake.analytics.catalog.models.USqlProcedure or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = self.get_procedure.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str'), 'schemaName': self._serialize.url("schema_name", schema_name, 'str'), 'procedureName': self._serialize.url("procedure_name", procedure_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['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 and send request request = self._client.get(url, query_parameters) response = self._client.send(request, header_parameters, 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('USqlProcedure', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized
get_procedure.metadata = {'url': '/catalog/usql/databases/{databaseName}/schemas/{schemaName}/procedures/{procedureName}'}
[docs] def list_procedures( self, account_name, database_name, schema_name, filter=None, top=None, skip=None, select=None, orderby=None, count=None, custom_headers=None, raw=False, **operation_config): """Retrieves the list of procedures from the Data Lake Analytics catalog. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database containing the procedures. :type database_name: str :param schema_name: The name of the schema containing the procedures. :type schema_name: str :param filter: OData filter. Optional. :type filter: str :param top: The number of items to return. Optional. :type top: int :param skip: The number of items to skip over before returning elements. Optional. :type skip: int :param select: OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. :type select: str :param orderby: OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. :type orderby: str :param count: The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. :type count: bool :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<msrest:optionsforoperations>`. :return: An iterator like instance of USqlProcedure :rtype: ~azure.mgmt.datalake.analytics.catalog.models.USqlProcedurePaged[~azure.mgmt.datalake.analytics.catalog.models.USqlProcedure] :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL url = self.list_procedures.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str'), 'schemaName': self._serialize.url("schema_name", schema_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') if top is not None: query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) if skip is not None: query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=1) if select is not None: query_parameters['$select'] = self._serialize.query("select", select, 'str') if orderby is not None: query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') if count is not None: query_parameters['$count'] = self._serialize.query("count", count, 'bool') 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['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 and send request request = self._client.get(url, query_parameters) response = self._client.send( request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp return response # Deserialize response deserialized = models.USqlProcedurePaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} client_raw_response = models.USqlProcedurePaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized
list_procedures.metadata = {'url': '/catalog/usql/databases/{databaseName}/schemas/{schemaName}/procedures'}
[docs] def get_table( self, account_name, database_name, schema_name, table_name, custom_headers=None, raw=False, **operation_config): """Retrieves the specified table from the Data Lake Analytics catalog. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database containing the table. :type database_name: str :param schema_name: The name of the schema containing the table. :type schema_name: str :param table_name: The name of the table. :type table_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<msrest:optionsforoperations>`. :return: USqlTable or ClientRawResponse if raw=true :rtype: ~azure.mgmt.datalake.analytics.catalog.models.USqlTable or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = self.get_table.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str'), 'schemaName': self._serialize.url("schema_name", schema_name, 'str'), 'tableName': self._serialize.url("table_name", table_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['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 and send request request = self._client.get(url, query_parameters) response = self._client.send(request, header_parameters, 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('USqlTable', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized
get_table.metadata = {'url': '/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}'}
[docs] def list_table_fragments( self, account_name, database_name, schema_name, table_name, filter=None, top=None, skip=None, select=None, orderby=None, count=None, custom_headers=None, raw=False, **operation_config): """Retrieves the list of table fragments from the Data Lake Analytics catalog. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database containing the table fragments. :type database_name: str :param schema_name: The name of the schema containing the table fragments. :type schema_name: str :param table_name: The name of the table containing the table fragments. :type table_name: str :param filter: OData filter. Optional. :type filter: str :param top: The number of items to return. Optional. :type top: int :param skip: The number of items to skip over before returning elements. Optional. :type skip: int :param select: OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. :type select: str :param orderby: OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. :type orderby: str :param count: The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. :type count: bool :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<msrest:optionsforoperations>`. :return: An iterator like instance of USqlTableFragment :rtype: ~azure.mgmt.datalake.analytics.catalog.models.USqlTableFragmentPaged[~azure.mgmt.datalake.analytics.catalog.models.USqlTableFragment] :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL url = self.list_table_fragments.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str'), 'schemaName': self._serialize.url("schema_name", schema_name, 'str'), 'tableName': self._serialize.url("table_name", table_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') if top is not None: query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) if skip is not None: query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=1) if select is not None: query_parameters['$select'] = self._serialize.query("select", select, 'str') if orderby is not None: query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') if count is not None: query_parameters['$count'] = self._serialize.query("count", count, 'bool') 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['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 and send request request = self._client.get(url, query_parameters) response = self._client.send( request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp return response # Deserialize response deserialized = models.USqlTableFragmentPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} client_raw_response = models.USqlTableFragmentPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized
list_table_fragments.metadata = {'url': '/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/tablefragments'}
[docs] def list_tables( self, account_name, database_name, schema_name, filter=None, top=None, skip=None, select=None, orderby=None, count=None, basic=False, custom_headers=None, raw=False, **operation_config): """Retrieves the list of tables from the Data Lake Analytics catalog. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database containing the tables. :type database_name: str :param schema_name: The name of the schema containing the tables. :type schema_name: str :param filter: OData filter. Optional. :type filter: str :param top: The number of items to return. Optional. :type top: int :param skip: The number of items to skip over before returning elements. Optional. :type skip: int :param select: OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. :type select: str :param orderby: OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. :type orderby: str :param count: The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. :type count: bool :param basic: The basic switch indicates what level of information to return when listing tables. When basic is true, only database_name, schema_name, table_name and version are returned for each table, otherwise all table metadata is returned. By default, it is false. Optional. :type basic: bool :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<msrest:optionsforoperations>`. :return: An iterator like instance of USqlTable :rtype: ~azure.mgmt.datalake.analytics.catalog.models.USqlTablePaged[~azure.mgmt.datalake.analytics.catalog.models.USqlTable] :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL url = self.list_tables.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str'), 'schemaName': self._serialize.url("schema_name", schema_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') if top is not None: query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) if skip is not None: query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=1) if select is not None: query_parameters['$select'] = self._serialize.query("select", select, 'str') if orderby is not None: query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') if count is not None: query_parameters['$count'] = self._serialize.query("count", count, 'bool') if basic is not None: query_parameters['basic'] = self._serialize.query("basic", basic, 'bool') 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['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 and send request request = self._client.get(url, query_parameters) response = self._client.send( request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp return response # Deserialize response deserialized = models.USqlTablePaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} client_raw_response = models.USqlTablePaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized
list_tables.metadata = {'url': '/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables'}
[docs] def list_table_statistics_by_database_and_schema( self, account_name, database_name, schema_name, filter=None, top=None, skip=None, select=None, orderby=None, count=None, custom_headers=None, raw=False, **operation_config): """Retrieves the list of all table statistics within the specified schema from the Data Lake Analytics catalog. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database containing the statistics. :type database_name: str :param schema_name: The name of the schema containing the statistics. :type schema_name: str :param filter: OData filter. Optional. :type filter: str :param top: The number of items to return. Optional. :type top: int :param skip: The number of items to skip over before returning elements. Optional. :type skip: int :param select: OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. :type select: str :param orderby: OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. :type orderby: str :param count: The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. :type count: bool :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<msrest:optionsforoperations>`. :return: An iterator like instance of USqlTableStatistics :rtype: ~azure.mgmt.datalake.analytics.catalog.models.USqlTableStatisticsPaged[~azure.mgmt.datalake.analytics.catalog.models.USqlTableStatistics] :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL url = self.list_table_statistics_by_database_and_schema.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str'), 'schemaName': self._serialize.url("schema_name", schema_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') if top is not None: query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) if skip is not None: query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=1) if select is not None: query_parameters['$select'] = self._serialize.query("select", select, 'str') if orderby is not None: query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') if count is not None: query_parameters['$count'] = self._serialize.query("count", count, 'bool') 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['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 and send request request = self._client.get(url, query_parameters) response = self._client.send( request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp return response # Deserialize response deserialized = models.USqlTableStatisticsPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} client_raw_response = models.USqlTableStatisticsPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized
list_table_statistics_by_database_and_schema.metadata = {'url': '/catalog/usql/databases/{databaseName}/schemas/{schemaName}/statistics'}
[docs] def get_table_type( self, account_name, database_name, schema_name, table_type_name, custom_headers=None, raw=False, **operation_config): """Retrieves the specified table type from the Data Lake Analytics catalog. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database containing the table type. :type database_name: str :param schema_name: The name of the schema containing the table type. :type schema_name: str :param table_type_name: The name of the table type to retrieve. :type table_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<msrest:optionsforoperations>`. :return: USqlTableType or ClientRawResponse if raw=true :rtype: ~azure.mgmt.datalake.analytics.catalog.models.USqlTableType or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = self.get_table_type.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str'), 'schemaName': self._serialize.url("schema_name", schema_name, 'str'), 'tableTypeName': self._serialize.url("table_type_name", table_type_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['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 and send request request = self._client.get(url, query_parameters) response = self._client.send(request, header_parameters, 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('USqlTableType', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized
get_table_type.metadata = {'url': '/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tabletypes/{tableTypeName}'}
[docs] def list_table_types( self, account_name, database_name, schema_name, filter=None, top=None, skip=None, select=None, orderby=None, count=None, custom_headers=None, raw=False, **operation_config): """Retrieves the list of table types from the Data Lake Analytics catalog. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database containing the table types. :type database_name: str :param schema_name: The name of the schema containing the table types. :type schema_name: str :param filter: OData filter. Optional. :type filter: str :param top: The number of items to return. Optional. :type top: int :param skip: The number of items to skip over before returning elements. Optional. :type skip: int :param select: OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. :type select: str :param orderby: OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. :type orderby: str :param count: The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. :type count: bool :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<msrest:optionsforoperations>`. :return: An iterator like instance of USqlTableType :rtype: ~azure.mgmt.datalake.analytics.catalog.models.USqlTableTypePaged[~azure.mgmt.datalake.analytics.catalog.models.USqlTableType] :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL url = self.list_table_types.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str'), 'schemaName': self._serialize.url("schema_name", schema_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') if top is not None: query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) if skip is not None: query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=1) if select is not None: query_parameters['$select'] = self._serialize.query("select", select, 'str') if orderby is not None: query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') if count is not None: query_parameters['$count'] = self._serialize.query("count", count, 'bool') 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['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 and send request request = self._client.get(url, query_parameters) response = self._client.send( request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp return response # Deserialize response deserialized = models.USqlTableTypePaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} client_raw_response = models.USqlTableTypePaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized
list_table_types.metadata = {'url': '/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tabletypes'}
[docs] def get_package( self, account_name, database_name, schema_name, package_name, custom_headers=None, raw=False, **operation_config): """Retrieves the specified package from the Data Lake Analytics catalog. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database containing the package. :type database_name: str :param schema_name: The name of the schema containing the package. :type schema_name: str :param package_name: The name of the package. :type package_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<msrest:optionsforoperations>`. :return: USqlPackage or ClientRawResponse if raw=true :rtype: ~azure.mgmt.datalake.analytics.catalog.models.USqlPackage or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = self.get_package.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str'), 'schemaName': self._serialize.url("schema_name", schema_name, 'str'), 'packageName': self._serialize.url("package_name", package_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['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 and send request request = self._client.get(url, query_parameters) response = self._client.send(request, header_parameters, 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('USqlPackage', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized
get_package.metadata = {'url': '/catalog/usql/databases/{databaseName}/schemas/{schemaName}/packages/{packageName}'}
[docs] def list_packages( self, account_name, database_name, schema_name, filter=None, top=None, skip=None, select=None, orderby=None, count=None, custom_headers=None, raw=False, **operation_config): """Retrieves the list of packages from the Data Lake Analytics catalog. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database containing the packages. :type database_name: str :param schema_name: The name of the schema containing the packages. :type schema_name: str :param filter: OData filter. Optional. :type filter: str :param top: The number of items to return. Optional. :type top: int :param skip: The number of items to skip over before returning elements. Optional. :type skip: int :param select: OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. :type select: str :param orderby: OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. :type orderby: str :param count: The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. :type count: bool :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<msrest:optionsforoperations>`. :return: An iterator like instance of USqlPackage :rtype: ~azure.mgmt.datalake.analytics.catalog.models.USqlPackagePaged[~azure.mgmt.datalake.analytics.catalog.models.USqlPackage] :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL url = self.list_packages.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str'), 'schemaName': self._serialize.url("schema_name", schema_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') if top is not None: query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) if skip is not None: query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=1) if select is not None: query_parameters['$select'] = self._serialize.query("select", select, 'str') if orderby is not None: query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') if count is not None: query_parameters['$count'] = self._serialize.query("count", count, 'bool') 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['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 and send request request = self._client.get(url, query_parameters) response = self._client.send( request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp return response # Deserialize response deserialized = models.USqlPackagePaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} client_raw_response = models.USqlPackagePaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized
list_packages.metadata = {'url': '/catalog/usql/databases/{databaseName}/schemas/{schemaName}/packages'}
[docs] def get_view( self, account_name, database_name, schema_name, view_name, custom_headers=None, raw=False, **operation_config): """Retrieves the specified view from the Data Lake Analytics catalog. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database containing the view. :type database_name: str :param schema_name: The name of the schema containing the view. :type schema_name: str :param view_name: The name of the view. :type view_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<msrest:optionsforoperations>`. :return: USqlView or ClientRawResponse if raw=true :rtype: ~azure.mgmt.datalake.analytics.catalog.models.USqlView or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = self.get_view.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str'), 'schemaName': self._serialize.url("schema_name", schema_name, 'str'), 'viewName': self._serialize.url("view_name", view_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['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 and send request request = self._client.get(url, query_parameters) response = self._client.send(request, header_parameters, 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('USqlView', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized
get_view.metadata = {'url': '/catalog/usql/databases/{databaseName}/schemas/{schemaName}/views/{viewName}'}
[docs] def list_views( self, account_name, database_name, schema_name, filter=None, top=None, skip=None, select=None, orderby=None, count=None, custom_headers=None, raw=False, **operation_config): """Retrieves the list of views from the Data Lake Analytics catalog. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database containing the views. :type database_name: str :param schema_name: The name of the schema containing the views. :type schema_name: str :param filter: OData filter. Optional. :type filter: str :param top: The number of items to return. Optional. :type top: int :param skip: The number of items to skip over before returning elements. Optional. :type skip: int :param select: OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. :type select: str :param orderby: OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. :type orderby: str :param count: The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. :type count: bool :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<msrest:optionsforoperations>`. :return: An iterator like instance of USqlView :rtype: ~azure.mgmt.datalake.analytics.catalog.models.USqlViewPaged[~azure.mgmt.datalake.analytics.catalog.models.USqlView] :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL url = self.list_views.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str'), 'schemaName': self._serialize.url("schema_name", schema_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') if top is not None: query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) if skip is not None: query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=1) if select is not None: query_parameters['$select'] = self._serialize.query("select", select, 'str') if orderby is not None: query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') if count is not None: query_parameters['$count'] = self._serialize.query("count", count, 'bool') 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['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 and send request request = self._client.get(url, query_parameters) response = self._client.send( request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp return response # Deserialize response deserialized = models.USqlViewPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} client_raw_response = models.USqlViewPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized
list_views.metadata = {'url': '/catalog/usql/databases/{databaseName}/schemas/{schemaName}/views'}
[docs] def get_table_statistic( self, account_name, database_name, schema_name, table_name, statistics_name, custom_headers=None, raw=False, **operation_config): """Retrieves the specified table statistics from the Data Lake Analytics catalog. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database containing the statistics. :type database_name: str :param schema_name: The name of the schema containing the statistics. :type schema_name: str :param table_name: The name of the table containing the statistics. :type table_name: str :param statistics_name: The name of the table statistics. :type statistics_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<msrest:optionsforoperations>`. :return: USqlTableStatistics or ClientRawResponse if raw=true :rtype: ~azure.mgmt.datalake.analytics.catalog.models.USqlTableStatistics or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = self.get_table_statistic.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str'), 'schemaName': self._serialize.url("schema_name", schema_name, 'str'), 'tableName': self._serialize.url("table_name", table_name, 'str'), 'statisticsName': self._serialize.url("statistics_name", statistics_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['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 and send request request = self._client.get(url, query_parameters) response = self._client.send(request, header_parameters, 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('USqlTableStatistics', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized
get_table_statistic.metadata = {'url': '/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/statistics/{statisticsName}'}
[docs] def list_table_statistics( self, account_name, database_name, schema_name, table_name, filter=None, top=None, skip=None, select=None, orderby=None, count=None, custom_headers=None, raw=False, **operation_config): """Retrieves the list of table statistics from the Data Lake Analytics catalog. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database containing the statistics. :type database_name: str :param schema_name: The name of the schema containing the statistics. :type schema_name: str :param table_name: The name of the table containing the statistics. :type table_name: str :param filter: OData filter. Optional. :type filter: str :param top: The number of items to return. Optional. :type top: int :param skip: The number of items to skip over before returning elements. Optional. :type skip: int :param select: OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. :type select: str :param orderby: OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. :type orderby: str :param count: The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. :type count: bool :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<msrest:optionsforoperations>`. :return: An iterator like instance of USqlTableStatistics :rtype: ~azure.mgmt.datalake.analytics.catalog.models.USqlTableStatisticsPaged[~azure.mgmt.datalake.analytics.catalog.models.USqlTableStatistics] :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL url = self.list_table_statistics.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str'), 'schemaName': self._serialize.url("schema_name", schema_name, 'str'), 'tableName': self._serialize.url("table_name", table_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') if top is not None: query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) if skip is not None: query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=1) if select is not None: query_parameters['$select'] = self._serialize.query("select", select, 'str') if orderby is not None: query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') if count is not None: query_parameters['$count'] = self._serialize.query("count", count, 'bool') 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['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 and send request request = self._client.get(url, query_parameters) response = self._client.send( request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp return response # Deserialize response deserialized = models.USqlTableStatisticsPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} client_raw_response = models.USqlTableStatisticsPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized
list_table_statistics.metadata = {'url': '/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/statistics'}
[docs] def preview_table_partition( self, account_name, database_name, schema_name, table_name, partition_name, max_rows=None, max_columns=None, custom_headers=None, raw=False, **operation_config): """Retrieves a preview set of rows in given partition. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database containing the partition. :type database_name: str :param schema_name: The name of the schema containing the partition. :type schema_name: str :param table_name: The name of the table containing the partition. :type table_name: str :param partition_name: The name of the table partition. :type partition_name: str :param max_rows: The maximum number of preview rows to be retrieved.Rows returned may be less than or equal to this number depending on row sizes and number of rows in the partition. :type max_rows: long :param max_columns: The maximum number of columns to be retrieved. :type max_columns: long :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<msrest:optionsforoperations>`. :return: USqlTablePreview or ClientRawResponse if raw=true :rtype: ~azure.mgmt.datalake.analytics.catalog.models.USqlTablePreview or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = self.preview_table_partition.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str'), 'schemaName': self._serialize.url("schema_name", schema_name, 'str'), 'tableName': self._serialize.url("table_name", table_name, 'str'), 'partitionName': self._serialize.url("partition_name", partition_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} if max_rows is not None: query_parameters['maxRows'] = self._serialize.query("max_rows", max_rows, 'long') if max_columns is not None: query_parameters['maxColumns'] = self._serialize.query("max_columns", max_columns, 'long') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} 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 and send request request = self._client.get(url, query_parameters) response = self._client.send(request, header_parameters, 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('USqlTablePreview', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized
preview_table_partition.metadata = {'url': '/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/partitions/{partitionName}/previewrows'}
[docs] def get_table_partition( self, account_name, database_name, schema_name, table_name, partition_name, custom_headers=None, raw=False, **operation_config): """Retrieves the specified table partition from the Data Lake Analytics catalog. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database containing the partition. :type database_name: str :param schema_name: The name of the schema containing the partition. :type schema_name: str :param table_name: The name of the table containing the partition. :type table_name: str :param partition_name: The name of the table partition. :type partition_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<msrest:optionsforoperations>`. :return: USqlTablePartition or ClientRawResponse if raw=true :rtype: ~azure.mgmt.datalake.analytics.catalog.models.USqlTablePartition or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = self.get_table_partition.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str'), 'schemaName': self._serialize.url("schema_name", schema_name, 'str'), 'tableName': self._serialize.url("table_name", table_name, 'str'), 'partitionName': self._serialize.url("partition_name", partition_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['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 and send request request = self._client.get(url, query_parameters) response = self._client.send(request, header_parameters, 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('USqlTablePartition', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized
get_table_partition.metadata = {'url': '/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/partitions/{partitionName}'}
[docs] def preview_table( self, account_name, database_name, schema_name, table_name, max_rows=None, max_columns=None, custom_headers=None, raw=False, **operation_config): """Retrieves a preview set of rows in given table. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database containing the table. :type database_name: str :param schema_name: The name of the schema containing the table. :type schema_name: str :param table_name: The name of the table. :type table_name: str :param max_rows: The maximum number of preview rows to be retrieved. Rows returned may be less than or equal to this number depending on row sizes and number of rows in the table. :type max_rows: long :param max_columns: The maximum number of columns to be retrieved. :type max_columns: long :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<msrest:optionsforoperations>`. :return: USqlTablePreview or ClientRawResponse if raw=true :rtype: ~azure.mgmt.datalake.analytics.catalog.models.USqlTablePreview or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = self.preview_table.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str'), 'schemaName': self._serialize.url("schema_name", schema_name, 'str'), 'tableName': self._serialize.url("table_name", table_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} if max_rows is not None: query_parameters['maxRows'] = self._serialize.query("max_rows", max_rows, 'long') if max_columns is not None: query_parameters['maxColumns'] = self._serialize.query("max_columns", max_columns, 'long') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} 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 and send request request = self._client.get(url, query_parameters) response = self._client.send(request, header_parameters, 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('USqlTablePreview', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized
preview_table.metadata = {'url': '/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/previewrows'}
[docs] def list_table_partitions( self, account_name, database_name, schema_name, table_name, filter=None, top=None, skip=None, select=None, orderby=None, count=None, custom_headers=None, raw=False, **operation_config): """Retrieves the list of table partitions from the Data Lake Analytics catalog. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database containing the partitions. :type database_name: str :param schema_name: The name of the schema containing the partitions. :type schema_name: str :param table_name: The name of the table containing the partitions. :type table_name: str :param filter: OData filter. Optional. :type filter: str :param top: The number of items to return. Optional. :type top: int :param skip: The number of items to skip over before returning elements. Optional. :type skip: int :param select: OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. :type select: str :param orderby: OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. :type orderby: str :param count: The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. :type count: bool :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<msrest:optionsforoperations>`. :return: An iterator like instance of USqlTablePartition :rtype: ~azure.mgmt.datalake.analytics.catalog.models.USqlTablePartitionPaged[~azure.mgmt.datalake.analytics.catalog.models.USqlTablePartition] :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL url = self.list_table_partitions.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str'), 'schemaName': self._serialize.url("schema_name", schema_name, 'str'), 'tableName': self._serialize.url("table_name", table_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') if top is not None: query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) if skip is not None: query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=1) if select is not None: query_parameters['$select'] = self._serialize.query("select", select, 'str') if orderby is not None: query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') if count is not None: query_parameters['$count'] = self._serialize.query("count", count, 'bool') 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['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 and send request request = self._client.get(url, query_parameters) response = self._client.send( request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp return response # Deserialize response deserialized = models.USqlTablePartitionPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} client_raw_response = models.USqlTablePartitionPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized
list_table_partitions.metadata = {'url': '/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/partitions'}
[docs] def list_types( self, account_name, database_name, schema_name, filter=None, top=None, skip=None, select=None, orderby=None, count=None, custom_headers=None, raw=False, **operation_config): """Retrieves the list of types within the specified database and schema from the Data Lake Analytics catalog. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database containing the types. :type database_name: str :param schema_name: The name of the schema containing the types. :type schema_name: str :param filter: OData filter. Optional. :type filter: str :param top: The number of items to return. Optional. :type top: int :param skip: The number of items to skip over before returning elements. Optional. :type skip: int :param select: OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. :type select: str :param orderby: OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. :type orderby: str :param count: The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. :type count: bool :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<msrest:optionsforoperations>`. :return: An iterator like instance of USqlType :rtype: ~azure.mgmt.datalake.analytics.catalog.models.USqlTypePaged[~azure.mgmt.datalake.analytics.catalog.models.USqlType] :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL url = self.list_types.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str'), 'schemaName': self._serialize.url("schema_name", schema_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') if top is not None: query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) if skip is not None: query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=1) if select is not None: query_parameters['$select'] = self._serialize.query("select", select, 'str') if orderby is not None: query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') if count is not None: query_parameters['$count'] = self._serialize.query("count", count, 'bool') 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['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 and send request request = self._client.get(url, query_parameters) response = self._client.send( request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp return response # Deserialize response deserialized = models.USqlTypePaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} client_raw_response = models.USqlTypePaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized
list_types.metadata = {'url': '/catalog/usql/databases/{databaseName}/schemas/{schemaName}/types'}
[docs] def get_table_valued_function( self, account_name, database_name, schema_name, table_valued_function_name, custom_headers=None, raw=False, **operation_config): """Retrieves the specified table valued function from the Data Lake Analytics catalog. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database containing the table valued function. :type database_name: str :param schema_name: The name of the schema containing the table valued function. :type schema_name: str :param table_valued_function_name: The name of the tableValuedFunction. :type table_valued_function_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<msrest:optionsforoperations>`. :return: USqlTableValuedFunction or ClientRawResponse if raw=true :rtype: ~azure.mgmt.datalake.analytics.catalog.models.USqlTableValuedFunction or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = self.get_table_valued_function.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str'), 'schemaName': self._serialize.url("schema_name", schema_name, 'str'), 'tableValuedFunctionName': self._serialize.url("table_valued_function_name", table_valued_function_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['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 and send request request = self._client.get(url, query_parameters) response = self._client.send(request, header_parameters, 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('USqlTableValuedFunction', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized
get_table_valued_function.metadata = {'url': '/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tablevaluedfunctions/{tableValuedFunctionName}'}
[docs] def list_table_valued_functions( self, account_name, database_name, schema_name, filter=None, top=None, skip=None, select=None, orderby=None, count=None, custom_headers=None, raw=False, **operation_config): """Retrieves the list of table valued functions from the Data Lake Analytics catalog. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database containing the table valued functions. :type database_name: str :param schema_name: The name of the schema containing the table valued functions. :type schema_name: str :param filter: OData filter. Optional. :type filter: str :param top: The number of items to return. Optional. :type top: int :param skip: The number of items to skip over before returning elements. Optional. :type skip: int :param select: OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. :type select: str :param orderby: OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. :type orderby: str :param count: The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. :type count: bool :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<msrest:optionsforoperations>`. :return: An iterator like instance of USqlTableValuedFunction :rtype: ~azure.mgmt.datalake.analytics.catalog.models.USqlTableValuedFunctionPaged[~azure.mgmt.datalake.analytics.catalog.models.USqlTableValuedFunction] :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL url = self.list_table_valued_functions.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str'), 'schemaName': self._serialize.url("schema_name", schema_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') if top is not None: query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) if skip is not None: query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=1) if select is not None: query_parameters['$select'] = self._serialize.query("select", select, 'str') if orderby is not None: query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') if count is not None: query_parameters['$count'] = self._serialize.query("count", count, 'bool') 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['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 and send request request = self._client.get(url, query_parameters) response = self._client.send( request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp return response # Deserialize response deserialized = models.USqlTableValuedFunctionPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} client_raw_response = models.USqlTableValuedFunctionPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized
list_table_valued_functions.metadata = {'url': '/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tablevaluedfunctions'}
[docs] def get_assembly( self, account_name, database_name, assembly_name, custom_headers=None, raw=False, **operation_config): """Retrieves the specified assembly from the Data Lake Analytics catalog. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database containing the assembly. :type database_name: str :param assembly_name: The name of the assembly. :type assembly_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<msrest:optionsforoperations>`. :return: USqlAssembly or ClientRawResponse if raw=true :rtype: ~azure.mgmt.datalake.analytics.catalog.models.USqlAssembly or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = self.get_assembly.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str'), 'assemblyName': self._serialize.url("assembly_name", assembly_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['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 and send request request = self._client.get(url, query_parameters) response = self._client.send(request, header_parameters, 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('USqlAssembly', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized
get_assembly.metadata = {'url': '/catalog/usql/databases/{databaseName}/assemblies/{assemblyName}'}
[docs] def list_assemblies( self, account_name, database_name, filter=None, top=None, skip=None, select=None, orderby=None, count=None, custom_headers=None, raw=False, **operation_config): """Retrieves the list of assemblies from the Data Lake Analytics catalog. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database containing the assembly. :type database_name: str :param filter: OData filter. Optional. :type filter: str :param top: The number of items to return. Optional. :type top: int :param skip: The number of items to skip over before returning elements. Optional. :type skip: int :param select: OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. :type select: str :param orderby: OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. :type orderby: str :param count: The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. :type count: bool :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<msrest:optionsforoperations>`. :return: An iterator like instance of USqlAssemblyClr :rtype: ~azure.mgmt.datalake.analytics.catalog.models.USqlAssemblyClrPaged[~azure.mgmt.datalake.analytics.catalog.models.USqlAssemblyClr] :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL url = self.list_assemblies.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') if top is not None: query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) if skip is not None: query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=1) if select is not None: query_parameters['$select'] = self._serialize.query("select", select, 'str') if orderby is not None: query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') if count is not None: query_parameters['$count'] = self._serialize.query("count", count, 'bool') 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['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 and send request request = self._client.get(url, query_parameters) response = self._client.send( request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp return response # Deserialize response deserialized = models.USqlAssemblyClrPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} client_raw_response = models.USqlAssemblyClrPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized
list_assemblies.metadata = {'url': '/catalog/usql/databases/{databaseName}/assemblies'}
[docs] def get_schema( self, account_name, database_name, schema_name, custom_headers=None, raw=False, **operation_config): """Retrieves the specified schema from the Data Lake Analytics catalog. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database containing the schema. :type database_name: str :param schema_name: The name of the schema. :type schema_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<msrest:optionsforoperations>`. :return: USqlSchema or ClientRawResponse if raw=true :rtype: ~azure.mgmt.datalake.analytics.catalog.models.USqlSchema or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = self.get_schema.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str'), 'schemaName': self._serialize.url("schema_name", schema_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['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 and send request request = self._client.get(url, query_parameters) response = self._client.send(request, header_parameters, 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('USqlSchema', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized
get_schema.metadata = {'url': '/catalog/usql/databases/{databaseName}/schemas/{schemaName}'}
[docs] def list_schemas( self, account_name, database_name, filter=None, top=None, skip=None, select=None, orderby=None, count=None, custom_headers=None, raw=False, **operation_config): """Retrieves the list of schemas from the Data Lake Analytics catalog. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database containing the schema. :type database_name: str :param filter: OData filter. Optional. :type filter: str :param top: The number of items to return. Optional. :type top: int :param skip: The number of items to skip over before returning elements. Optional. :type skip: int :param select: OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. :type select: str :param orderby: OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. :type orderby: str :param count: The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. :type count: bool :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<msrest:optionsforoperations>`. :return: An iterator like instance of USqlSchema :rtype: ~azure.mgmt.datalake.analytics.catalog.models.USqlSchemaPaged[~azure.mgmt.datalake.analytics.catalog.models.USqlSchema] :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL url = self.list_schemas.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') if top is not None: query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) if skip is not None: query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=1) if select is not None: query_parameters['$select'] = self._serialize.query("select", select, 'str') if orderby is not None: query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') if count is not None: query_parameters['$count'] = self._serialize.query("count", count, 'bool') 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['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 and send request request = self._client.get(url, query_parameters) response = self._client.send( request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp return response # Deserialize response deserialized = models.USqlSchemaPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} client_raw_response = models.USqlSchemaPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized
list_schemas.metadata = {'url': '/catalog/usql/databases/{databaseName}/schemas'}
[docs] def list_table_statistics_by_database( self, account_name, database_name, filter=None, top=None, skip=None, select=None, orderby=None, count=None, custom_headers=None, raw=False, **operation_config): """Retrieves the list of all statistics in a database from the Data Lake Analytics catalog. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database containing the table statistics. :type database_name: str :param filter: OData filter. Optional. :type filter: str :param top: The number of items to return. Optional. :type top: int :param skip: The number of items to skip over before returning elements. Optional. :type skip: int :param select: OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. :type select: str :param orderby: OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. :type orderby: str :param count: The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. :type count: bool :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<msrest:optionsforoperations>`. :return: An iterator like instance of USqlTableStatistics :rtype: ~azure.mgmt.datalake.analytics.catalog.models.USqlTableStatisticsPaged[~azure.mgmt.datalake.analytics.catalog.models.USqlTableStatistics] :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL url = self.list_table_statistics_by_database.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') if top is not None: query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) if skip is not None: query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=1) if select is not None: query_parameters['$select'] = self._serialize.query("select", select, 'str') if orderby is not None: query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') if count is not None: query_parameters['$count'] = self._serialize.query("count", count, 'bool') 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['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 and send request request = self._client.get(url, query_parameters) response = self._client.send( request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp return response # Deserialize response deserialized = models.USqlTableStatisticsPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} client_raw_response = models.USqlTableStatisticsPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized
list_table_statistics_by_database.metadata = {'url': '/catalog/usql/databases/{databaseName}/statistics'}
[docs] def list_tables_by_database( self, account_name, database_name, filter=None, top=None, skip=None, select=None, orderby=None, count=None, basic=False, custom_headers=None, raw=False, **operation_config): """Retrieves the list of all tables in a database from the Data Lake Analytics catalog. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database containing the tables. :type database_name: str :param filter: OData filter. Optional. :type filter: str :param top: The number of items to return. Optional. :type top: int :param skip: The number of items to skip over before returning elements. Optional. :type skip: int :param select: OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. :type select: str :param orderby: OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. :type orderby: str :param count: The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. :type count: bool :param basic: The basic switch indicates what level of information to return when listing tables. When basic is true, only database_name, schema_name, table_name and version are returned for each table, otherwise all table metadata is returned. By default, it is false :type basic: bool :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<msrest:optionsforoperations>`. :return: An iterator like instance of USqlTable :rtype: ~azure.mgmt.datalake.analytics.catalog.models.USqlTablePaged[~azure.mgmt.datalake.analytics.catalog.models.USqlTable] :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL url = self.list_tables_by_database.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') if top is not None: query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) if skip is not None: query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=1) if select is not None: query_parameters['$select'] = self._serialize.query("select", select, 'str') if orderby is not None: query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') if count is not None: query_parameters['$count'] = self._serialize.query("count", count, 'bool') if basic is not None: query_parameters['basic'] = self._serialize.query("basic", basic, 'bool') 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['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 and send request request = self._client.get(url, query_parameters) response = self._client.send( request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp return response # Deserialize response deserialized = models.USqlTablePaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} client_raw_response = models.USqlTablePaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized
list_tables_by_database.metadata = {'url': '/catalog/usql/databases/{databaseName}/tables'}
[docs] def list_table_valued_functions_by_database( self, account_name, database_name, filter=None, top=None, skip=None, select=None, orderby=None, count=None, custom_headers=None, raw=False, **operation_config): """Retrieves the list of all table valued functions in a database from the Data Lake Analytics catalog. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database containing the table valued functions. :type database_name: str :param filter: OData filter. Optional. :type filter: str :param top: The number of items to return. Optional. :type top: int :param skip: The number of items to skip over before returning elements. Optional. :type skip: int :param select: OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. :type select: str :param orderby: OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. :type orderby: str :param count: The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. :type count: bool :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<msrest:optionsforoperations>`. :return: An iterator like instance of USqlTableValuedFunction :rtype: ~azure.mgmt.datalake.analytics.catalog.models.USqlTableValuedFunctionPaged[~azure.mgmt.datalake.analytics.catalog.models.USqlTableValuedFunction] :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL url = self.list_table_valued_functions_by_database.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') if top is not None: query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) if skip is not None: query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=1) if select is not None: query_parameters['$select'] = self._serialize.query("select", select, 'str') if orderby is not None: query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') if count is not None: query_parameters['$count'] = self._serialize.query("count", count, 'bool') 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['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 and send request request = self._client.get(url, query_parameters) response = self._client.send( request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp return response # Deserialize response deserialized = models.USqlTableValuedFunctionPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} client_raw_response = models.USqlTableValuedFunctionPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized
list_table_valued_functions_by_database.metadata = {'url': '/catalog/usql/databases/{databaseName}/tablevaluedfunctions'}
[docs] def list_views_by_database( self, account_name, database_name, filter=None, top=None, skip=None, select=None, orderby=None, count=None, custom_headers=None, raw=False, **operation_config): """Retrieves the list of all views in a database from the Data Lake Analytics catalog. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database containing the views. :type database_name: str :param filter: OData filter. Optional. :type filter: str :param top: The number of items to return. Optional. :type top: int :param skip: The number of items to skip over before returning elements. Optional. :type skip: int :param select: OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. :type select: str :param orderby: OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. :type orderby: str :param count: The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. :type count: bool :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<msrest:optionsforoperations>`. :return: An iterator like instance of USqlView :rtype: ~azure.mgmt.datalake.analytics.catalog.models.USqlViewPaged[~azure.mgmt.datalake.analytics.catalog.models.USqlView] :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL url = self.list_views_by_database.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') if top is not None: query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) if skip is not None: query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=1) if select is not None: query_parameters['$select'] = self._serialize.query("select", select, 'str') if orderby is not None: query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') if count is not None: query_parameters['$count'] = self._serialize.query("count", count, 'bool') 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['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 and send request request = self._client.get(url, query_parameters) response = self._client.send( request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp return response # Deserialize response deserialized = models.USqlViewPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} client_raw_response = models.USqlViewPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized
list_views_by_database.metadata = {'url': '/catalog/usql/databases/{databaseName}/views'}
[docs] def list_acls_by_database( self, account_name, database_name, filter=None, top=None, skip=None, select=None, orderby=None, count=None, custom_headers=None, raw=False, **operation_config): """Retrieves the list of access control list (ACL) entries for the database from the Data Lake Analytics catalog. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database. :type database_name: str :param filter: OData filter. Optional. :type filter: str :param top: The number of items to return. Optional. :type top: int :param skip: The number of items to skip over before returning elements. Optional. :type skip: int :param select: OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. :type select: str :param orderby: OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. :type orderby: str :param count: The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. :type count: bool :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<msrest:optionsforoperations>`. :return: An iterator like instance of Acl :rtype: ~azure.mgmt.datalake.analytics.catalog.models.AclPaged[~azure.mgmt.datalake.analytics.catalog.models.Acl] :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL url = self.list_acls_by_database.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') if top is not None: query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) if skip is not None: query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=1) if select is not None: query_parameters['$select'] = self._serialize.query("select", select, 'str') if orderby is not None: query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') if count is not None: query_parameters['$count'] = self._serialize.query("count", count, 'bool') 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['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 and send request request = self._client.get(url, query_parameters) response = self._client.send( request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp return response # Deserialize response deserialized = models.AclPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} client_raw_response = models.AclPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized
list_acls_by_database.metadata = {'url': '/catalog/usql/databases/{databaseName}/acl'}
[docs] def list_acls( self, account_name, filter=None, top=None, skip=None, select=None, orderby=None, count=None, custom_headers=None, raw=False, **operation_config): """Retrieves the list of access control list (ACL) entries for the Data Lake Analytics catalog. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param filter: OData filter. Optional. :type filter: str :param top: The number of items to return. Optional. :type top: int :param skip: The number of items to skip over before returning elements. Optional. :type skip: int :param select: OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. :type select: str :param orderby: OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. :type orderby: str :param count: The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. :type count: bool :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<msrest:optionsforoperations>`. :return: An iterator like instance of Acl :rtype: ~azure.mgmt.datalake.analytics.catalog.models.AclPaged[~azure.mgmt.datalake.analytics.catalog.models.Acl] :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL url = self.list_acls.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True) } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') if top is not None: query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) if skip is not None: query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=1) if select is not None: query_parameters['$select'] = self._serialize.query("select", select, 'str') if orderby is not None: query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') if count is not None: query_parameters['$count'] = self._serialize.query("count", count, 'bool') 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['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 and send request request = self._client.get(url, query_parameters) response = self._client.send( request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp return response # Deserialize response deserialized = models.AclPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} client_raw_response = models.AclPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized
list_acls.metadata = {'url': '/catalog/usql/acl'}
[docs] def get_database( self, account_name, database_name, custom_headers=None, raw=False, **operation_config): """Retrieves the specified database from the Data Lake Analytics catalog. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database. :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<msrest:optionsforoperations>`. :return: USqlDatabase or ClientRawResponse if raw=true :rtype: ~azure.mgmt.datalake.analytics.catalog.models.USqlDatabase or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = self.get_database.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), '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') # Construct headers header_parameters = {} 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 and send request request = self._client.get(url, query_parameters) response = self._client.send(request, header_parameters, 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('USqlDatabase', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized
get_database.metadata = {'url': '/catalog/usql/databases/{databaseName}'}
[docs] def list_databases( self, account_name, filter=None, top=None, skip=None, select=None, orderby=None, count=None, custom_headers=None, raw=False, **operation_config): """Retrieves the list of databases from the Data Lake Analytics catalog. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param filter: OData filter. Optional. :type filter: str :param top: The number of items to return. Optional. :type top: int :param skip: The number of items to skip over before returning elements. Optional. :type skip: int :param select: OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. :type select: str :param orderby: OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. :type orderby: str :param count: The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. :type count: bool :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<msrest:optionsforoperations>`. :return: An iterator like instance of USqlDatabase :rtype: ~azure.mgmt.datalake.analytics.catalog.models.USqlDatabasePaged[~azure.mgmt.datalake.analytics.catalog.models.USqlDatabase] :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL url = self.list_databases.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True) } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') if top is not None: query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) if skip is not None: query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=1) if select is not None: query_parameters['$select'] = self._serialize.query("select", select, 'str') if orderby is not None: query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') if count is not None: query_parameters['$count'] = self._serialize.query("count", count, 'bool') 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['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 and send request request = self._client.get(url, query_parameters) response = self._client.send( request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp return response # Deserialize response deserialized = models.USqlDatabasePaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} client_raw_response = models.USqlDatabasePaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized
list_databases.metadata = {'url': '/catalog/usql/databases'}
[docs] def grant_acl( self, account_name, parameters, custom_headers=None, raw=False, **operation_config): """Grants an access control list (ACL) entry to the Data Lake Analytics catalog. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param parameters: Parameters supplied to create or update an access control list (ACL) entry for a Data Lake Analytics catalog. :type parameters: ~azure.mgmt.datalake.analytics.catalog.models.AclCreateOrUpdateParameters :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<msrest:optionsforoperations>`. :return: None or ClientRawResponse if raw=true :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ op = "GRANTACE" # Construct URL url = self.grant_acl.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True) } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['op'] = self._serialize.query("op", op, 'str') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} 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, 'AclCreateOrUpdateParameters') # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send( request, header_parameters, body_content, 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 if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response
grant_acl.metadata = {'url': '/catalog/usql/acl'}
[docs] def grant_acl_to_database( self, account_name, database_name, parameters, custom_headers=None, raw=False, **operation_config): """Grants an access control list (ACL) entry to the database from the Data Lake Analytics catalog. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database. :type database_name: str :param parameters: Parameters supplied to create or update an access control list (ACL) entry for a database. :type parameters: ~azure.mgmt.datalake.analytics.catalog.models.AclCreateOrUpdateParameters :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<msrest:optionsforoperations>`. :return: None or ClientRawResponse if raw=true :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ op = "GRANTACE" # Construct URL url = self.grant_acl_to_database.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['op'] = self._serialize.query("op", op, 'str') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} 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, 'AclCreateOrUpdateParameters') # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send( request, header_parameters, body_content, 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 if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response
grant_acl_to_database.metadata = {'url': '/catalog/usql/databases/{databaseName}/acl'}
[docs] def revoke_acl( self, account_name, ace_type, principal_id, custom_headers=None, raw=False, **operation_config): """Revokes an access control list (ACL) entry from the Data Lake Analytics catalog. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param ace_type: the access control list (ACL) entry type. UserObj and GroupObj denote the owning user and group, respectively. Possible values include: 'UserObj', 'GroupObj', 'Other', 'User', 'Group' :type ace_type: str or ~azure.mgmt.datalake.analytics.catalog.models.AclType :param principal_id: the Azure AD object ID of the user or group being specified in the access control list (ACL) entry. :type principal_id: 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<msrest:optionsforoperations>`. :return: None or ClientRawResponse if raw=true :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ parameters = models.AclDeleteParameters(ace_type=ace_type, principal_id=principal_id) op = "REVOKEACE" # Construct URL url = self.revoke_acl.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True) } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['op'] = self._serialize.query("op", op, 'str') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} 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, 'AclDeleteParameters') # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send( request, header_parameters, body_content, 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 if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response
revoke_acl.metadata = {'url': '/catalog/usql/acl'}
[docs] def revoke_acl_from_database( self, account_name, database_name, ace_type, principal_id, custom_headers=None, raw=False, **operation_config): """Revokes an access control list (ACL) entry for the database from the Data Lake Analytics catalog. :param account_name: The Azure Data Lake Analytics account upon which to execute catalog operations. :type account_name: str :param database_name: The name of the database. :type database_name: str :param ace_type: the access control list (ACL) entry type. UserObj and GroupObj denote the owning user and group, respectively. Possible values include: 'UserObj', 'GroupObj', 'Other', 'User', 'Group' :type ace_type: str or ~azure.mgmt.datalake.analytics.catalog.models.AclType :param principal_id: the Azure AD object ID of the user or group being specified in the access control list (ACL) entry. :type principal_id: 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<msrest:optionsforoperations>`. :return: None or ClientRawResponse if raw=true :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ parameters = models.AclDeleteParameters(ace_type=ace_type, principal_id=principal_id) op = "REVOKEACE" # Construct URL url = self.revoke_acl_from_database.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', skip_quote=True), 'adlaCatalogDnsSuffix': self._serialize.url("self.config.adla_catalog_dns_suffix", self.config.adla_catalog_dns_suffix, 'str', skip_quote=True), 'databaseName': self._serialize.url("database_name", database_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['op'] = self._serialize.query("op", op, 'str') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} 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, 'AclDeleteParameters') # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send( request, header_parameters, body_content, 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 if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response
revoke_acl_from_database.metadata = {'url': '/catalog/usql/databases/{databaseName}/acl'}