Skip to content

Commit

Permalink
Generated from c39c7d121543da651a1ffd746e93fb300a240c17
Browse files Browse the repository at this point in the history
add dataWarehouseUserActivityName

add dataWarehouseUserActivityName
  • Loading branch information
AutorestCI committed Mar 9, 2018
1 parent ff441dd commit bd84c2a
Show file tree
Hide file tree
Showing 5 changed files with 165 additions and 0 deletions.
2 changes: 2 additions & 0 deletions azure-mgmt-sql/azure/mgmt/sql/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
from .subscription_usage import SubscriptionUsage
from .virtual_network_rule import VirtualNetworkRule
from .database_operation import DatabaseOperation
from .data_warehouse_user_activities import DataWarehouseUserActivities
from .resource_move_definition import ResourceMoveDefinition
from .automatic_tuning_server_options import AutomaticTuningServerOptions
from .server_automatic_tuning import ServerAutomaticTuning
Expand Down Expand Up @@ -283,6 +284,7 @@
'SubscriptionUsage',
'VirtualNetworkRule',
'DatabaseOperation',
'DataWarehouseUserActivities',
'ResourceMoveDefinition',
'AutomaticTuningServerOptions',
'ServerAutomaticTuning',
Expand Down
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
2 changes: 2 additions & 0 deletions azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
from .subscription_usages_operations import SubscriptionUsagesOperations
from .virtual_network_rules_operations import VirtualNetworkRulesOperations
from .database_operations import DatabaseOperations
from .data_warehouse_user_activities_operations import DataWarehouseUserActivitiesOperations
from .server_automatic_tuning_operations import ServerAutomaticTuningOperations
from .server_dns_aliases_operations import ServerDnsAliasesOperations
from .restore_points_operations import RestorePointsOperations
Expand Down Expand Up @@ -90,6 +91,7 @@
'SubscriptionUsagesOperations',
'VirtualNetworkRulesOperations',
'DatabaseOperations',
'DataWarehouseUserActivitiesOperations',
'ServerAutomaticTuningOperations',
'ServerDnsAliasesOperations',
'RestorePointsOperations',
Expand Down
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}'}
5 changes: 5 additions & 0 deletions azure-mgmt-sql/azure/mgmt/sql/sql_management_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
from .operations.subscription_usages_operations import SubscriptionUsagesOperations
from .operations.virtual_network_rules_operations import VirtualNetworkRulesOperations
from .operations.database_operations import DatabaseOperations
from .operations.data_warehouse_user_activities_operations import DataWarehouseUserActivitiesOperations
from .operations.server_automatic_tuning_operations import ServerAutomaticTuningOperations
from .operations.server_dns_aliases_operations import ServerDnsAliasesOperations
from .operations.restore_points_operations import RestorePointsOperations
Expand Down Expand Up @@ -172,6 +173,8 @@ class SqlManagementClient(object):
:vartype virtual_network_rules: azure.mgmt.sql.operations.VirtualNetworkRulesOperations
:ivar database_operations: DatabaseOperations operations
:vartype database_operations: azure.mgmt.sql.operations.DatabaseOperations
:ivar data_warehouse_user_activities: DataWarehouseUserActivities operations
:vartype data_warehouse_user_activities: azure.mgmt.sql.operations.DataWarehouseUserActivitiesOperations
:ivar server_automatic_tuning: ServerAutomaticTuning operations
:vartype server_automatic_tuning: azure.mgmt.sql.operations.ServerAutomaticTuningOperations
:ivar server_dns_aliases: ServerDnsAliases operations
Expand Down Expand Up @@ -274,6 +277,8 @@ def __init__(
self._client, self.config, self._serialize, self._deserialize)
self.database_operations = DatabaseOperations(
self._client, self.config, self._serialize, self._deserialize)
self.data_warehouse_user_activities = DataWarehouseUserActivitiesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.server_automatic_tuning = ServerAutomaticTuningOperations(
self._client, self.config, self._serialize, self._deserialize)
self.server_dns_aliases = ServerDnsAliasesOperations(
Expand Down

0 comments on commit bd84c2a

Please sign in to comment.