-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generated from c39c7d121543da651a1ffd746e93fb300a240c17
add dataWarehouseUserActivityName add dataWarehouseUserActivityName
- Loading branch information
1 parent
ff441dd
commit bd84c2a
Showing
5 changed files
with
165 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
azure-mgmt-sql/azure/mgmt/sql/models/data_warehouse_user_activities.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for | ||
# license information. | ||
# | ||
# Code generated by Microsoft (R) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is | ||
# regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
from .proxy_resource import ProxyResource | ||
|
||
|
||
class DataWarehouseUserActivities(ProxyResource): | ||
"""User activities of a data warehouse. | ||
Variables are only populated by the server, and will be ignored when | ||
sending a request. | ||
:ivar id: Resource ID. | ||
:vartype id: str | ||
:ivar name: Resource name. | ||
:vartype name: str | ||
:ivar type: Resource type. | ||
:vartype type: str | ||
:ivar active_queries_count: Count of running and suspended queries. | ||
:vartype active_queries_count: int | ||
""" | ||
|
||
_validation = { | ||
'id': {'readonly': True}, | ||
'name': {'readonly': True}, | ||
'type': {'readonly': True}, | ||
'active_queries_count': {'readonly': True}, | ||
} | ||
|
||
_attribute_map = { | ||
'id': {'key': 'id', 'type': 'str'}, | ||
'name': {'key': 'name', 'type': 'str'}, | ||
'type': {'key': 'type', 'type': 'str'}, | ||
'active_queries_count': {'key': 'properties.activeQueriesCount', 'type': 'int'}, | ||
} | ||
|
||
def __init__(self): | ||
super(DataWarehouseUserActivities, self).__init__() | ||
self.active_queries_count = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 109 additions & 0 deletions
109
azure-mgmt-sql/azure/mgmt/sql/operations/data_warehouse_user_activities_operations.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
# 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 | ||
|
||
|
||
class DataWarehouseUserActivitiesOperations(object): | ||
"""DataWarehouseUserActivitiesOperations 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 data_warehouse_user_activity_name: The activity name of the data warehouse. . Constant value: "current". | ||
:ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". | ||
""" | ||
|
||
models = models | ||
|
||
def __init__(self, client, config, serializer, deserializer): | ||
|
||
self._client = client | ||
self._serialize = serializer | ||
self._deserialize = deserializer | ||
self.data_warehouse_user_activity_name = "current" | ||
self.api_version = "2017-03-01-preview" | ||
|
||
self.config = config | ||
|
||
def get( | ||
self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): | ||
"""Gets the user activities of a data warehouse which includes running and | ||
suspended queries. | ||
:param resource_group_name: The name of the resource group that | ||
contains the resource. You can obtain this value from the Azure | ||
Resource Manager API or the portal. | ||
:type resource_group_name: str | ||
:param server_name: The name of the server. | ||
:type server_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: DataWarehouseUserActivities or ClientRawResponse if raw=true | ||
:rtype: ~azure.mgmt.sql.models.DataWarehouseUserActivities or | ||
~msrest.pipeline.ClientRawResponse | ||
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` | ||
""" | ||
# Construct URL | ||
url = self.get.metadata['url'] | ||
path_format_arguments = { | ||
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), | ||
'serverName': self._serialize.url("server_name", server_name, 'str'), | ||
'databaseName': self._serialize.url("database_name", database_name, 'str'), | ||
'dataWarehouseUserActivityName': self._serialize.url("self.data_warehouse_user_activity_name", self.data_warehouse_user_activity_name, 'str'), | ||
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') | ||
} | ||
url = self._client.format_url(url, **path_format_arguments) | ||
|
||
# Construct parameters | ||
query_parameters = {} | ||
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') | ||
|
||
# Construct headers | ||
header_parameters = {} | ||
header_parameters['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('DataWarehouseUserActivities', response) | ||
|
||
if raw: | ||
client_raw_response = ClientRawResponse(deserialized, response) | ||
return client_raw_response | ||
|
||
return deserialized | ||
get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataWarehouseUserActivities/{dataWarehouseUserActivityName}'} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters