diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index d13744434ac..01fc0712b50 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -34,4 +34,6 @@ /src/express-route-cross-connection/ @tjprescott +/src/log-analytics/ @alexeldeib + /src/mesh/ @linggengmsft diff --git a/src/index.json b/src/index.json index fac0c13a847..d497dd84567 100644 --- a/src/index.json +++ b/src/index.json @@ -951,6 +951,39 @@ "version": "0.9.1" } } + ], + "log-analytics": [ + { + "filename": "log_analytics-0.1.2-py2.py3-none-any.whl", + "sha256Digest": "b958800232b5340871999f1e90aa3b198e1be645d5d7553e2f023759912f87a8", + "downloadUrl": "https://files.pythonhosted.org/packages/0c/06/78ddfe634d2af7b35a4931b7a17aea9f026c202316b18f861f462857a2fc/log_analytics-0.1.2-py2.py3-none-any.whl", + "metadata": { + "azext.isPreview": true, + "extensions": { + "python.details": { + "contacts": [ + { + "email": "aleldeib@microsoft.com", + "name": "Ace Eldeib", + "role": "author" + } + ], + "document_names": { + "description": "DESCRIPTION.rst" + }, + "project_urls": { + "Home": "https://github.com/Azure/azure-cli-extensions/tree/master/src/log-analytics" + } + } + }, + "generator": "bdist_wheel (0.30.0)", + "license": "MIT", + "metadata_version": "2.0", + "name": "log-analytics", + "summary": "Support for Azure Log Analytics query capabilities.", + "version": "0.1.2" + } + } ] } } diff --git a/src/log-analytics/HISTORY.rst b/src/log-analytics/HISTORY.rst new file mode 100644 index 00000000000..7e7352aee99 --- /dev/null +++ b/src/log-analytics/HISTORY.rst @@ -0,0 +1,14 @@ +0.1.2 +++++++++++++++++++ + +* Change --kql to --analytics-query + +0.1.1 +++++++++++++++++++ + +* Fix homepage + +0.1.0 +++++++++++++++++++ + +* Initial release. \ No newline at end of file diff --git a/src/log-analytics/README.rst b/src/log-analytics/README.rst new file mode 100644 index 00000000000..49a13a938f6 --- /dev/null +++ b/src/log-analytics/README.rst @@ -0,0 +1,2 @@ +Commands for working with Azure Log Analytics +============================================== diff --git a/src/log-analytics/azext_loganalytics/__init__.py b/src/log-analytics/azext_loganalytics/__init__.py new file mode 100644 index 00000000000..8678dabb6d9 --- /dev/null +++ b/src/log-analytics/azext_loganalytics/__init__.py @@ -0,0 +1,36 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from azure.cli.core import AzCommandsLoader + +from azext_loganalytics._help import helps # pylint: disable=unused-import + + +class LogAnalyticsCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + from azext_loganalytics._client_factory import loganalytics_data_plane_client + loganalytics_custom = CliCommandType( + operations_tmpl='azext_loganalytics.custom#{}', + client_factory=loganalytics_data_plane_client + ) + + super(LogAnalyticsCommandsLoader, self).__init__( + cli_ctx=cli_ctx, + custom_command_type=loganalytics_custom + ) + + def load_command_table(self, args): + from azext_loganalytics.commands import load_command_table + load_command_table(self, args) + return self.command_table + + def load_arguments(self, command): + from azext_loganalytics._params import load_arguments + load_arguments(self, command) + + +COMMAND_LOADER_CLS = LogAnalyticsCommandsLoader diff --git a/src/log-analytics/azext_loganalytics/_client_factory.py b/src/log-analytics/azext_loganalytics/_client_factory.py new file mode 100644 index 00000000000..f4fe1e8d0a7 --- /dev/null +++ b/src/log-analytics/azext_loganalytics/_client_factory.py @@ -0,0 +1,14 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +def loganalytics_data_plane_client(cli_ctx, _): + """Initialize Log Analytics data client for use with CLI.""" + from .vendored_sdks.loganalytics import LogAnalyticsDataClient + from azure.cli.core._profile import Profile + profile = Profile(cli_ctx=cli_ctx) + cred, _, _ = profile.get_login_credentials( + resource="https://api.loganalytics.io") + return LogAnalyticsDataClient(cred) diff --git a/src/log-analytics/azext_loganalytics/_help.py b/src/log-analytics/azext_loganalytics/_help.py new file mode 100644 index 00000000000..059a19d5b9b --- /dev/null +++ b/src/log-analytics/azext_loganalytics/_help.py @@ -0,0 +1,28 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from knack.help_files import helps + +# pylint: disable=line-too-long + +helps['monitor log-analytics query'] = """ + type: command + short-summary: Query a Log Analytics workspace. + parameters: + - workspace: --workspace -w + type: string + short-summary: GUID of the Log Analytics workspace. + - analytics-query: --analytics-query + type: string + short-summary: Query to execute over the Log Analytics data. + - timespan: --timespan -t + type: string + short-summary: Timespan over which to query data. Defaults to all data. + - workspaces: --workspaces + type: array + short-summary: Additional workspaces to union data for querying. Specify additional workspace IDs separated by commas. + examples: + - name: +""" diff --git a/src/log-analytics/azext_loganalytics/_params.py b/src/log-analytics/azext_loganalytics/_params.py new file mode 100644 index 00000000000..9cdce306487 --- /dev/null +++ b/src/log-analytics/azext_loganalytics/_params.py @@ -0,0 +1,14 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# pylint: disable=line-too-long + + +def load_arguments(self, _): + with self.argument_context('monitor log-analytics query') as c: + c.argument('workspace', options_list=['--workspace', '-w'], help='GUID of the Log Analytics Workspace') + c.argument('analytics-query', help='Query to execute over Log Analytics data.') + c.argument('timespan', options_list=['--timespan', '-t'], help='Timespan over which to query. Defaults to querying all available data.') + c.argument('workspaces', nargs='+', help='Optional additional workspaces over which to join data for the query.') diff --git a/src/log-analytics/azext_loganalytics/azext_metadata.json b/src/log-analytics/azext_loganalytics/azext_metadata.json new file mode 100644 index 00000000000..a2f37531f6a --- /dev/null +++ b/src/log-analytics/azext_loganalytics/azext_metadata.json @@ -0,0 +1,3 @@ +{ + "azext.isPreview": true +} \ No newline at end of file diff --git a/src/log-analytics/azext_loganalytics/commands.py b/src/log-analytics/azext_loganalytics/commands.py new file mode 100644 index 00000000000..db0eed247ab --- /dev/null +++ b/src/log-analytics/azext_loganalytics/commands.py @@ -0,0 +1,12 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# pylint: disable=line-too-long + + +def load_command_table(self, _): + + with self.command_group('monitor log-analytics') as g: + g.custom_command('query', 'execute_query') diff --git a/src/log-analytics/azext_loganalytics/custom.py b/src/log-analytics/azext_loganalytics/custom.py new file mode 100644 index 00000000000..74cf8884198 --- /dev/null +++ b/src/log-analytics/azext_loganalytics/custom.py @@ -0,0 +1,14 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from knack.log import get_logger + +logger = get_logger(__name__) + + +def execute_query(client, workspace, analytics_query, timespan=None, workspaces=None): + """Executes a query against the provided Log Analytics workspace.""" + from .vendored_sdks.loganalytics.models import QueryBody + return client.query(workspace, QueryBody(query=analytics_query, timespan=timespan, workspaces=workspaces)) diff --git a/src/log-analytics/azext_loganalytics/tests/__init__.py b/src/log-analytics/azext_loganalytics/tests/__init__.py new file mode 100644 index 00000000000..34913fb394d --- /dev/null +++ b/src/log-analytics/azext_loganalytics/tests/__init__.py @@ -0,0 +1,4 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- diff --git a/src/log-analytics/azext_loganalytics/tests/latest/__init__.py b/src/log-analytics/azext_loganalytics/tests/latest/__init__.py new file mode 100644 index 00000000000..34913fb394d --- /dev/null +++ b/src/log-analytics/azext_loganalytics/tests/latest/__init__.py @@ -0,0 +1,4 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- diff --git a/src/log-analytics/azext_loganalytics/tests/latest/recordings/test_query.yaml b/src/log-analytics/azext_loganalytics/tests/latest/recordings/test_query.yaml new file mode 100644 index 00000000000..e0654423dba --- /dev/null +++ b/src/log-analytics/azext_loganalytics/tests/latest/recordings/test_query.yaml @@ -0,0 +1,63 @@ +interactions: +- request: + body: '{"query": "Heartbeat | getschema"}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['34'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.6 (Windows-10-10.0.17134-SP0) requests/2.19.1 msrest/0.5.4 + azure-loganalytics/0.1.0] + method: POST + uri: https://api.loganalytics.io/v1/workspaces/cab864ad-d0c1-496b-bc5e-4418315621bf/query + response: + body: {string: '{"tables":[{"name":"getschema","columns":[{"name":"ColumnName","type":"string"},{"name":"ColumnOrdinal","type":"int"},{"name":"DataType","type":"string"},{"name":"ColumnType","type":"string"}],"rows":[["TenantId",0,"System.String","string"],["SourceSystem",1,"System.String","string"],["TimeGenerated",2,"System.DateTime","datetime"],["MG",3,"System.String","string"],["ManagementGroupName",4,"System.String","string"],["SourceComputerId",5,"System.String","string"],["ComputerIP",6,"System.String","string"],["Computer",7,"System.String","string"],["Category",8,"System.String","string"],["OSType",9,"System.String","string"],["OSName",10,"System.String","string"],["OSMajorVersion",11,"System.String","string"],["OSMinorVersion",12,"System.String","string"],["Version",13,"System.String","string"],["SCAgentChannel",14,"System.String","string"],["IsGatewayInstalled",15,"System.SByte","bool"],["RemoteIPLongitude",16,"System.Double","real"],["RemoteIPLatitude",17,"System.Double","real"],["RemoteIPCountry",18,"System.String","string"],["SubscriptionId",19,"System.String","string"],["ResourceGroup",20,"System.String","string"],["ResourceProvider",21,"System.String","string"],["Resource",22,"System.String","string"],["ResourceId",23,"System.String","string"],["ResourceType",24,"System.String","string"],["ComputerEnvironment",25,"System.String","string"],["Solutions",26,"System.String","string"],["VMUUID",27,"System.String","string"],["Type",28,"System.String","string"]]}]}'} + headers: + access-control-allow-origin: ['*'] + access-control-expose-headers: ['Retry-After,Age,WWW-Authenticate,x-resource-identities,x-ms-status-location'] + connection: [keep-alive] + content-length: ['1482'] + content-location: ['https://eastus.api.loganalytics.io/v1/workspaces/cab864ad-d0c1-496b-bc5e-4418315621bf/query'] + content-type: [application/json; charset=utf-8] + date: ['Fri, 27 Jul 2018 23:07:57 GMT'] + server: [nginx] + strict-transport-security: [max-age=31536000000; includeSubDomains, max-age=31536000; + includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + via: [1.1 draft-oms-blue.aa4dbcee-9107-11e8-9ab8-70b3d5800008] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: '{"query": "Heartbeat | getschema"}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['34'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.6 (Windows-10-10.0.17134-SP0) requests/2.19.1 msrest/0.5.4 + azure-loganalytics/0.1.0] + method: POST + uri: https://api.loganalytics.io/v1/workspaces/cab864ad-d0c1-496b-bc5e-4418315621bf/query + response: + body: {string: '{"tables":[{"name":"getschema","columns":[{"name":"ColumnName","type":"string"},{"name":"ColumnOrdinal","type":"int"},{"name":"DataType","type":"string"},{"name":"ColumnType","type":"string"}],"rows":[["TenantId",0,"System.String","string"],["SourceSystem",1,"System.String","string"],["TimeGenerated",2,"System.DateTime","datetime"],["MG",3,"System.String","string"],["ManagementGroupName",4,"System.String","string"],["SourceComputerId",5,"System.String","string"],["ComputerIP",6,"System.String","string"],["Computer",7,"System.String","string"],["Category",8,"System.String","string"],["OSType",9,"System.String","string"],["OSName",10,"System.String","string"],["OSMajorVersion",11,"System.String","string"],["OSMinorVersion",12,"System.String","string"],["Version",13,"System.String","string"],["SCAgentChannel",14,"System.String","string"],["IsGatewayInstalled",15,"System.SByte","bool"],["RemoteIPLongitude",16,"System.Double","real"],["RemoteIPLatitude",17,"System.Double","real"],["RemoteIPCountry",18,"System.String","string"],["SubscriptionId",19,"System.String","string"],["ResourceGroup",20,"System.String","string"],["ResourceProvider",21,"System.String","string"],["Resource",22,"System.String","string"],["ResourceId",23,"System.String","string"],["ResourceType",24,"System.String","string"],["ComputerEnvironment",25,"System.String","string"],["Solutions",26,"System.String","string"],["VMUUID",27,"System.String","string"],["Type",28,"System.String","string"]]}]}'} + headers: + access-control-allow-origin: ['*'] + access-control-expose-headers: ['Retry-After,Age,WWW-Authenticate,x-resource-identities,x-ms-status-location'] + age: ['0'] + connection: [keep-alive] + content-length: ['1482'] + content-location: ['https://eastus.api.loganalytics.io/v1/workspaces/cab864ad-d0c1-496b-bc5e-4418315621bf/query'] + content-type: [application/json; charset=utf-8] + date: ['Fri, 27 Jul 2018 23:07:58 GMT'] + server: [nginx] + strict-transport-security: [max-age=31536000000; includeSubDomains, max-age=31536000; + includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + via: [1.1 draft-oms-blue.cbd591df-9107-11e8-9ab8-70b3d5800008] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +version: 1 diff --git a/src/log-analytics/azext_loganalytics/tests/latest/test_loganalytics_commands.py b/src/log-analytics/azext_loganalytics/tests/latest/test_loganalytics_commands.py new file mode 100644 index 00000000000..b35aeb96fd8 --- /dev/null +++ b/src/log-analytics/azext_loganalytics/tests/latest/test_loganalytics_commands.py @@ -0,0 +1,19 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# pylint: disable=line-too-long +from azure.cli.testsdk import ScenarioTest + + +class LogAnalyticsDataClientTests(ScenarioTest): + """Test class for Log Analytics data client.""" + def test_query(self): + """Tests data plane query capabilities for Log Analytics.""" + self.cmd('az monitor log-analytics query --workspace cab864ad-d0c1-496b-bc5e-4418315621bf --analytics-query "Heartbeat | getschema"', checks=[ + self.check('tables[0].rows[0][0]', 'TenantId') + ]) + query_result = self.cmd('az monitor log-analytics query -w cab864ad-d0c1-496b-bc5e-4418315621bf --analytics-query "Heartbeat | getschema"').get_output_in_json() + assert len(query_result['tables'][0]['rows']) == 29 + assert isinstance(query_result['tables'][0]['rows'][0][1], (int, float, complex)) diff --git a/src/log-analytics/azext_loganalytics/vendored_sdks/__init__.py b/src/log-analytics/azext_loganalytics/vendored_sdks/__init__.py new file mode 100644 index 00000000000..a5b81f3bde4 --- /dev/null +++ b/src/log-analytics/azext_loganalytics/vendored_sdks/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +__import__('pkg_resources').declare_namespace(__name__) diff --git a/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/__init__.py b/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/__init__.py new file mode 100644 index 00000000000..b26c9dd6478 --- /dev/null +++ b/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/__init__.py @@ -0,0 +1,18 @@ +# 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 .log_analytics_data_client import LogAnalyticsDataClient +from .version import VERSION + +__all__ = ['LogAnalyticsDataClient'] + +__version__ = VERSION + diff --git a/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/log_analytics_data_client.py b/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/log_analytics_data_client.py new file mode 100644 index 00000000000..75521bb6886 --- /dev/null +++ b/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/log_analytics_data_client.py @@ -0,0 +1,132 @@ +# 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 msrest.service_client import SDKClient +from msrest import Configuration, Serializer, Deserializer +from .version import VERSION +from msrest.pipeline import ClientRawResponse +from . import models + + +class LogAnalyticsDataClientConfiguration(Configuration): + """Configuration for LogAnalyticsDataClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Subscription credentials which uniquely identify + client subscription. + :type credentials: None + :param str base_url: Service URL + """ + + def __init__( + self, credentials, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if not base_url: + base_url = 'https://api.loganalytics.io/v1' + + super(LogAnalyticsDataClientConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-loganalytics/{}'.format(VERSION)) + + self.credentials = credentials + + +class LogAnalyticsDataClient(SDKClient): + """Log Analytics Data Plane Client + + :ivar config: Configuration for client. + :vartype config: LogAnalyticsDataClientConfiguration + + :param credentials: Subscription credentials which uniquely identify + client subscription. + :type credentials: None + :param str base_url: Service URL + """ + + def __init__( + self, credentials, base_url=None): + + self.config = LogAnalyticsDataClientConfiguration(credentials, base_url) + super(LogAnalyticsDataClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = 'v1' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + + def query( + self, workspace_id, body, custom_headers=None, raw=False, **operation_config): + """Execute an Analytics query. + + Executes an Analytics query for data. + [Here](https://dev.loganalytics.io/documentation/Using-the-API) is an + example for using POST with an Analytics query. + + :param workspace_id: ID of the workspace. This is Workspace ID from + the Properties blade in the Azure portal. + :type workspace_id: str + :param body: The Analytics query. Learn more about the [Analytics + query + syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/) + :type body: ~azure.loganalytics.models.QueryBody + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: QueryResults or ClientRawResponse if raw=true + :rtype: ~azure.loganalytics.models.QueryResults or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.query.metadata['url'] + path_format_arguments = { + 'workspaceId': self._serialize.url("workspace_id", workspace_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(body, 'QueryBody') + + # 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]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('QueryResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + query.metadata = {'url': '/workspaces/{workspaceId}/query'} diff --git a/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/__init__.py b/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/__init__.py new file mode 100644 index 00000000000..14fa816d7ba --- /dev/null +++ b/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/__init__.py @@ -0,0 +1,37 @@ +# 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. +# -------------------------------------------------------------------------- + +try: + from .query_body_py3 import QueryBody + from .column_py3 import Column + from .table_py3 import Table + from .query_results_py3 import QueryResults + from .error_detail_py3 import ErrorDetail + from .error_info_py3 import ErrorInfo + from .error_response_py3 import ErrorResponse, ErrorResponseException +except (SyntaxError, ImportError): + from .query_body import QueryBody + from .column import Column + from .table import Table + from .query_results import QueryResults + from .error_detail import ErrorDetail + from .error_info import ErrorInfo + from .error_response import ErrorResponse, ErrorResponseException + +__all__ = [ + 'QueryBody', + 'Column', + 'Table', + 'QueryResults', + 'ErrorDetail', + 'ErrorInfo', + 'ErrorResponse', 'ErrorResponseException', +] diff --git a/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/column.py b/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/column.py new file mode 100644 index 00000000000..fde9b294d35 --- /dev/null +++ b/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/column.py @@ -0,0 +1,34 @@ +# 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 msrest.serialization import Model + + +class Column(Model): + """A table column. + + A column in a table. + + :param name: The name of this column. + :type name: str + :param type: The data type of this column. + :type type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Column, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) diff --git a/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/column_py3.py b/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/column_py3.py new file mode 100644 index 00000000000..4df2ac58398 --- /dev/null +++ b/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/column_py3.py @@ -0,0 +1,34 @@ +# 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 msrest.serialization import Model + + +class Column(Model): + """A table column. + + A column in a table. + + :param name: The name of this column. + :type name: str + :param type: The data type of this column. + :type type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, type: str=None, **kwargs) -> None: + super(Column, self).__init__(**kwargs) + self.name = name + self.type = type diff --git a/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/error_detail.py b/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/error_detail.py new file mode 100644 index 00000000000..3fd620dffa4 --- /dev/null +++ b/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/error_detail.py @@ -0,0 +1,58 @@ +# 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 msrest.serialization import Model + + +class ErrorDetail(Model): + """Error details. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. The error's code. + :type code: str + :param message: Required. A human readable error message. + :type message: str + :param target: Indicates which property in the request is responsible for + the error. + :type target: str + :param value: Indicates which value in 'target' is responsible for the + error. + :type value: str + :param resources: Indicates resources which were responsible for the + error. + :type resources: list[str] + :param additional_properties: + :type additional_properties: object + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'resources': {'key': 'resources', 'type': '[str]'}, + 'additional_properties': {'key': 'additionalProperties', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(ErrorDetail, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.value = kwargs.get('value', None) + self.resources = kwargs.get('resources', None) + self.additional_properties = kwargs.get('additional_properties', None) diff --git a/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/error_detail_py3.py b/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/error_detail_py3.py new file mode 100644 index 00000000000..8c714de89d1 --- /dev/null +++ b/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/error_detail_py3.py @@ -0,0 +1,58 @@ +# 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 msrest.serialization import Model + + +class ErrorDetail(Model): + """Error details. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. The error's code. + :type code: str + :param message: Required. A human readable error message. + :type message: str + :param target: Indicates which property in the request is responsible for + the error. + :type target: str + :param value: Indicates which value in 'target' is responsible for the + error. + :type value: str + :param resources: Indicates resources which were responsible for the + error. + :type resources: list[str] + :param additional_properties: + :type additional_properties: object + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'resources': {'key': 'resources', 'type': '[str]'}, + 'additional_properties': {'key': 'additionalProperties', 'type': 'object'}, + } + + def __init__(self, *, code: str, message: str, target: str=None, value: str=None, resources=None, additional_properties=None, **kwargs) -> None: + super(ErrorDetail, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.value = value + self.resources = resources + self.additional_properties = additional_properties diff --git a/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/error_info.py b/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/error_info.py new file mode 100644 index 00000000000..60b1bff092d --- /dev/null +++ b/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/error_info.py @@ -0,0 +1,51 @@ +# 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 msrest.serialization import Model + + +class ErrorInfo(Model): + """The code and message for an error. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. A machine readable error code. + :type code: str + :param message: Required. A human readable error message. + :type message: str + :param details: error details. + :type details: list[~azure.loganalytics.models.ErrorDetail] + :param innererror: Inner error details if they exist. + :type innererror: ~azure.loganalytics.models.ErrorInfo + :param additional_properties: + :type additional_properties: object + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'innererror': {'key': 'innererror', 'type': 'ErrorInfo'}, + 'additional_properties': {'key': 'additionalProperties', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(ErrorInfo, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.details = kwargs.get('details', None) + self.innererror = kwargs.get('innererror', None) + self.additional_properties = kwargs.get('additional_properties', None) diff --git a/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/error_info_py3.py b/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/error_info_py3.py new file mode 100644 index 00000000000..1692b9d1696 --- /dev/null +++ b/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/error_info_py3.py @@ -0,0 +1,51 @@ +# 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 msrest.serialization import Model + + +class ErrorInfo(Model): + """The code and message for an error. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. A machine readable error code. + :type code: str + :param message: Required. A human readable error message. + :type message: str + :param details: error details. + :type details: list[~azure.loganalytics.models.ErrorDetail] + :param innererror: Inner error details if they exist. + :type innererror: ~azure.loganalytics.models.ErrorInfo + :param additional_properties: + :type additional_properties: object + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'innererror': {'key': 'innererror', 'type': 'ErrorInfo'}, + 'additional_properties': {'key': 'additionalProperties', 'type': 'object'}, + } + + def __init__(self, *, code: str, message: str, details=None, innererror=None, additional_properties=None, **kwargs) -> None: + super(ErrorInfo, self).__init__(**kwargs) + self.code = code + self.message = message + self.details = details + self.innererror = innererror + self.additional_properties = additional_properties diff --git a/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/error_response.py b/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/error_response.py new file mode 100644 index 00000000000..8ecb3f3ed70 --- /dev/null +++ b/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/error_response.py @@ -0,0 +1,49 @@ +# 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 msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Model): + """Error details. + + Contains details when the response code indicates an error. + + All required parameters must be populated in order to send to Azure. + + :param error: Required. The error details. + :type error: ~azure.loganalytics.models.ErrorInfo + """ + + _validation = { + 'error': {'required': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorInfo'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/error_response_py3.py b/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/error_response_py3.py new file mode 100644 index 00000000000..d12bb2b0a34 --- /dev/null +++ b/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/error_response_py3.py @@ -0,0 +1,49 @@ +# 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 msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Model): + """Error details. + + Contains details when the response code indicates an error. + + All required parameters must be populated in order to send to Azure. + + :param error: Required. The error details. + :type error: ~azure.loganalytics.models.ErrorInfo + """ + + _validation = { + 'error': {'required': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorInfo'}, + } + + def __init__(self, *, error, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/query_body.py b/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/query_body.py new file mode 100644 index 00000000000..255d440bed4 --- /dev/null +++ b/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/query_body.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class QueryBody(Model): + """The Analytics query. Learn more about the [Analytics query + syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/). + + All required parameters must be populated in order to send to Azure. + + :param query: Required. The query to execute. + :type query: str + :param timespan: Optional. The timespan over which to query data. This is + an ISO8601 time period value. This timespan is applied in addition to any + that are specified in the query expression. + :type timespan: str + :param workspaces: A list of workspaces that are included in the query. + :type workspaces: list[str] + """ + + _validation = { + 'query': {'required': True}, + } + + _attribute_map = { + 'query': {'key': 'query', 'type': 'str'}, + 'timespan': {'key': 'timespan', 'type': 'str'}, + 'workspaces': {'key': 'workspaces', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(QueryBody, self).__init__(**kwargs) + self.query = kwargs.get('query', None) + self.timespan = kwargs.get('timespan', None) + self.workspaces = kwargs.get('workspaces', None) diff --git a/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/query_body_py3.py b/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/query_body_py3.py new file mode 100644 index 00000000000..65d455bd010 --- /dev/null +++ b/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/query_body_py3.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class QueryBody(Model): + """The Analytics query. Learn more about the [Analytics query + syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/). + + All required parameters must be populated in order to send to Azure. + + :param query: Required. The query to execute. + :type query: str + :param timespan: Optional. The timespan over which to query data. This is + an ISO8601 time period value. This timespan is applied in addition to any + that are specified in the query expression. + :type timespan: str + :param workspaces: A list of workspaces that are included in the query. + :type workspaces: list[str] + """ + + _validation = { + 'query': {'required': True}, + } + + _attribute_map = { + 'query': {'key': 'query', 'type': 'str'}, + 'timespan': {'key': 'timespan', 'type': 'str'}, + 'workspaces': {'key': 'workspaces', 'type': '[str]'}, + } + + def __init__(self, *, query: str, timespan: str=None, workspaces=None, **kwargs) -> None: + super(QueryBody, self).__init__(**kwargs) + self.query = query + self.timespan = timespan + self.workspaces = workspaces diff --git a/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/query_results.py b/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/query_results.py new file mode 100644 index 00000000000..a13f3c811b7 --- /dev/null +++ b/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/query_results.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class QueryResults(Model): + """A query response. + + Contains the tables, columns & rows resulting from a query. + + All required parameters must be populated in order to send to Azure. + + :param tables: Required. The list of tables, columns and rows. + :type tables: list[~azure.loganalytics.models.Table] + """ + + _validation = { + 'tables': {'required': True}, + } + + _attribute_map = { + 'tables': {'key': 'tables', 'type': '[Table]'}, + } + + def __init__(self, **kwargs): + super(QueryResults, self).__init__(**kwargs) + self.tables = kwargs.get('tables', None) diff --git a/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/query_results_py3.py b/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/query_results_py3.py new file mode 100644 index 00000000000..a9265f7bcbf --- /dev/null +++ b/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/query_results_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class QueryResults(Model): + """A query response. + + Contains the tables, columns & rows resulting from a query. + + All required parameters must be populated in order to send to Azure. + + :param tables: Required. The list of tables, columns and rows. + :type tables: list[~azure.loganalytics.models.Table] + """ + + _validation = { + 'tables': {'required': True}, + } + + _attribute_map = { + 'tables': {'key': 'tables', 'type': '[Table]'}, + } + + def __init__(self, *, tables, **kwargs) -> None: + super(QueryResults, self).__init__(**kwargs) + self.tables = tables diff --git a/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/table.py b/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/table.py new file mode 100644 index 00000000000..69989740957 --- /dev/null +++ b/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/table.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class Table(Model): + """A query response table. + + Contains the columns and rows for one table in a query response. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the table. + :type name: str + :param columns: Required. The list of columns in this table. + :type columns: list[~azure.loganalytics.models.Column] + :param rows: Required. The resulting rows from this query. + :type rows: list[list[object]] + """ + + _validation = { + 'name': {'required': True}, + 'columns': {'required': True}, + 'rows': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'columns': {'key': 'columns', 'type': '[Column]'}, + 'rows': {'key': 'rows', 'type': '[[object]]'}, + } + + def __init__(self, **kwargs): + super(Table, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.columns = kwargs.get('columns', None) + self.rows = kwargs.get('rows', None) diff --git a/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/table_py3.py b/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/table_py3.py new file mode 100644 index 00000000000..dc7dbe3e09b --- /dev/null +++ b/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/models/table_py3.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class Table(Model): + """A query response table. + + Contains the columns and rows for one table in a query response. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the table. + :type name: str + :param columns: Required. The list of columns in this table. + :type columns: list[~azure.loganalytics.models.Column] + :param rows: Required. The resulting rows from this query. + :type rows: list[list[object]] + """ + + _validation = { + 'name': {'required': True}, + 'columns': {'required': True}, + 'rows': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'columns': {'key': 'columns', 'type': '[Column]'}, + 'rows': {'key': 'rows', 'type': '[[object]]'}, + } + + def __init__(self, *, name: str, columns, rows, **kwargs) -> None: + super(Table, self).__init__(**kwargs) + self.name = name + self.columns = columns + self.rows = rows diff --git a/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/version.py b/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/version.py new file mode 100644 index 00000000000..e0ec669828c --- /dev/null +++ b/src/log-analytics/azext_loganalytics/vendored_sdks/loganalytics/version.py @@ -0,0 +1,13 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "0.1.0" + diff --git a/src/log-analytics/setup.cfg b/src/log-analytics/setup.cfg new file mode 100644 index 00000000000..3c6e79cf31d --- /dev/null +++ b/src/log-analytics/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/src/log-analytics/setup.py b/src/log-analytics/setup.py new file mode 100644 index 00000000000..5890af72e27 --- /dev/null +++ b/src/log-analytics/setup.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python + +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from codecs import open +from setuptools import setup, find_packages + +VERSION = "0.1.2" + +CLASSIFIERS = [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'License :: OSI Approved :: MIT License', +] + +DEPENDENCIES = [] + +with open('README.rst', 'r', encoding='utf-8') as f: + README = f.read() +with open('HISTORY.rst', 'r', encoding='utf-8') as f: + HISTORY = f.read() + +setup( + name='log-analytics', + version=VERSION, + description='Support for Azure Log Analytics query capabilities.', + long_description=README + '\n\n' + HISTORY, + license='MIT', + author='Ace Eldeib', + author_email='aleldeib@microsoft.com', + url='https://github.com/Azure/azure-cli-extensions/tree/master/src/log-analytics', + classifiers=CLASSIFIERS, + packages=find_packages(exclude=["tests"]), + package_data={'azext_loganalytics': ['azext_metadata.json']}, + install_requires=DEPENDENCIES +)