Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions azure-monitor/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.. :changelog:

Release History
===============

0.1.0 (1970-01-01)
++++++++++++++++++

* Initial Release
2 changes: 2 additions & 0 deletions azure-monitor/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include *.rst
include azure_bdist_wheel.py
49 changes: 49 additions & 0 deletions azure-monitor/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
Microsoft Azure SDK for Python
==============================

This is the Microsoft Azure MyService Management Client Library.

Azure Resource Manager (ARM) is the next generation of management APIs that
replace the old Azure Service Management (ASM).

This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7.

For the older Azure Service Management (ASM) libraries, see
`azure-servicemanagement-legacy <https://pypi.python.org/pypi/azure-servicemanagement-legacy>`__ library.

For a more complete set of Azure libraries, see the `azure <https://pypi.python.org/pypi/azure>`__ bundle package.


Compatibility
=============

**IMPORTANT**: If you have an earlier version of the azure package
(version < 1.0), you should uninstall it before installing this package.

You can check the version using pip:

.. code:: shell

pip freeze

If you see azure==0.11.0 (or any version below 1.0), uninstall it first:

.. code:: shell

pip uninstall azure


Usage
=====

For code examples, see `MyService Management
<https://docs.microsoft.com/python/api/overview/azure/>`__
on docs.microsoft.com.


Provide Feedback
================

If you encounter any bugs or have suggestions, please file an issue in the
`Issues <https://github.com/Azure/azure-sdk-for-python/issues>`__
section of the project.
1 change: 1 addition & 0 deletions azure-monitor/azure/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
18 changes: 18 additions & 0 deletions azure-monitor/azure/monitor/__init__.py
Original file line number Diff line number Diff line change
@@ -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 .azure_metrics_client import AzureMetricsClient
from .version import VERSION

__all__ = ['AzureMetricsClient']

__version__ = VERSION

74 changes: 74 additions & 0 deletions azure-monitor/azure/monitor/azure_metrics_client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# 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 Serializer, Deserializer
from msrestazure import AzureConfiguration
from .version import VERSION
from .operations.metrics_operations import MetricsOperations
from . import models


class AzureMetricsClientConfiguration(AzureConfiguration):
"""Configuration for AzureMetricsClient
Note that all parameters used to create this instance are saved as instance
attributes.

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
: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://monitoring.azure.com'

super(AzureMetricsClientConfiguration, self).__init__(base_url)

self.add_user_agent('azure-monitor/{}'.format(VERSION))
self.add_user_agent('Azure-SDK-For-Python')

self.credentials = credentials


class AzureMetricsClient(SDKClient):
"""Monitor Management Client

:ivar config: Configuration for client.
:vartype config: AzureMetricsClientConfiguration

:ivar metrics: Metrics operations
:vartype metrics: azure.monitor.operations.MetricsOperations

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param str base_url: Service URL
"""

def __init__(
self, credentials, base_url=None):

self.config = AzureMetricsClientConfiguration(credentials, base_url)
super(AzureMetricsClient, 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 = '2018-09-01-preview'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

self.metrics = MetricsOperations(
self._client, self.config, self._serialize, self._deserialize)
37 changes: 37 additions & 0 deletions azure-monitor/azure/monitor/models/__init__.py
Original file line number Diff line number Diff line change
@@ -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 .azure_time_series_data_py3 import AzureTimeSeriesData
from .azure_metrics_base_data_py3 import AzureMetricsBaseData
from .azure_metrics_data_py3 import AzureMetricsData
from .azure_metrics_document_py3 import AzureMetricsDocument
from .api_error_py3 import ApiError
from .api_failure_response_py3 import ApiFailureResponse
from .azure_metrics_result_py3 import AzureMetricsResult, AzureMetricsResultException
except (SyntaxError, ImportError):
from .azure_time_series_data import AzureTimeSeriesData
from .azure_metrics_base_data import AzureMetricsBaseData
from .azure_metrics_data import AzureMetricsData
from .azure_metrics_document import AzureMetricsDocument
from .api_error import ApiError
from .api_failure_response import ApiFailureResponse
from .azure_metrics_result import AzureMetricsResult, AzureMetricsResultException

__all__ = [
'AzureTimeSeriesData',
'AzureMetricsBaseData',
'AzureMetricsData',
'AzureMetricsDocument',
'ApiError',
'ApiFailureResponse',
'AzureMetricsResult', 'AzureMetricsResultException',
]
32 changes: 32 additions & 0 deletions azure-monitor/azure/monitor/models/api_error.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 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 ApiError(Model):
"""ApiError.

:param code: Gets or sets the azure metrics error code
:type code: str
:param message: Gets or sets the azure metrics error message
:type message: str
"""

_attribute_map = {
'code': {'key': 'code', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
}

def __init__(self, **kwargs):
super(ApiError, self).__init__(**kwargs)
self.code = kwargs.get('code', None)
self.message = kwargs.get('message', None)
32 changes: 32 additions & 0 deletions azure-monitor/azure/monitor/models/api_error_py3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 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 ApiError(Model):
"""ApiError.

:param code: Gets or sets the azure metrics error code
:type code: str
:param message: Gets or sets the azure metrics error message
:type message: str
"""

_attribute_map = {
'code': {'key': 'code', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
}

def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None:
super(ApiError, self).__init__(**kwargs)
self.code = code
self.message = message
28 changes: 28 additions & 0 deletions azure-monitor/azure/monitor/models/api_failure_response.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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 ApiFailureResponse(Model):
"""ApiFailureResponse.

:param error:
:type error: ~azure.monitor.models.ApiError
"""

_attribute_map = {
'error': {'key': 'error', 'type': 'ApiError'},
}

def __init__(self, **kwargs):
super(ApiFailureResponse, self).__init__(**kwargs)
self.error = kwargs.get('error', None)
28 changes: 28 additions & 0 deletions azure-monitor/azure/monitor/models/api_failure_response_py3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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 ApiFailureResponse(Model):
"""ApiFailureResponse.

:param error:
:type error: ~azure.monitor.models.ApiError
"""

_attribute_map = {
'error': {'key': 'error', 'type': 'ApiError'},
}

def __init__(self, *, error=None, **kwargs) -> None:
super(ApiFailureResponse, self).__init__(**kwargs)
self.error = error
49 changes: 49 additions & 0 deletions azure-monitor/azure/monitor/models/azure_metrics_base_data.py
Original file line number Diff line number Diff line change
@@ -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


class AzureMetricsBaseData(Model):
"""AzureMetricsBaseData.

All required parameters must be populated in order to send to Azure.

:param metric: Required. Gets or sets the Metric name
:type metric: str
:param namespace: Required. Gets or sets the Metric namespace
:type namespace: str
:param dim_names: Gets or sets the list of dimension names (optional)
:type dim_names: list[str]
:param series: Required. Gets or sets the list of time series data for the
metric (one per unique dimension combination)
:type series: list[~azure.monitor.models.AzureTimeSeriesData]
"""

_validation = {
'metric': {'required': True},
'namespace': {'required': True},
'series': {'required': True},
}

_attribute_map = {
'metric': {'key': 'metric', 'type': 'str'},
'namespace': {'key': 'namespace', 'type': 'str'},
'dim_names': {'key': 'dimNames', 'type': '[str]'},
'series': {'key': 'series', 'type': '[AzureTimeSeriesData]'},
}

def __init__(self, **kwargs):
super(AzureMetricsBaseData, self).__init__(**kwargs)
self.metric = kwargs.get('metric', None)
self.namespace = kwargs.get('namespace', None)
self.dim_names = kwargs.get('dim_names', None)
self.series = kwargs.get('series', None)
Loading