Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR] cost-management/resource-manager #2924

Merged
merged 16 commits into from
May 4, 2019
Merged
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-mgmt-costmanagement/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.. :changelog:

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

0.1.0 (2019-05-04)
++++++++++++++++++

* Initial Release
5 changes: 5 additions & 0 deletions azure-mgmt-costmanagement/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
recursive-include tests *.py *.yaml
include *.rst
include azure/__init__.py
include azure/mgmt/__init__.py

33 changes: 33 additions & 0 deletions azure-mgmt-costmanagement/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Microsoft Azure SDK for Python
==============================

This is the Microsoft Azure Cost 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.


Usage
=====

For code examples, see `Cost 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.


.. image:: https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-costmanagement%2FREADME.png
1 change: 1 addition & 0 deletions azure-mgmt-costmanagement/azure/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
1 change: 1 addition & 0 deletions azure-mgmt-costmanagement/azure/mgmt/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
18 changes: 18 additions & 0 deletions azure-mgmt-costmanagement/azure/mgmt/costmanagement/__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 .cost_management_client import CostManagementClient
from .version import VERSION

__all__ = ['CostManagementClient']

__version__ = VERSION

Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# 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.dimensions_operations import DimensionsOperations
from .operations.query_operations import QueryOperations
from .operations.exports_operations import ExportsOperations
from .operations.operations import Operations
from . import models


class CostManagementClientConfiguration(AzureConfiguration):
"""Configuration for CostManagementClient
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 subscription_id: Azure Subscription ID.
:type subscription_id: str
:param str base_url: Service URL
"""

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

if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
if not base_url:
base_url = 'https://management.azure.com'

super(CostManagementClientConfiguration, self).__init__(base_url)

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

self.credentials = credentials
self.subscription_id = subscription_id


class CostManagementClient(SDKClient):
"""CostManagementClient

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

:ivar dimensions: Dimensions operations
:vartype dimensions: azure.mgmt.costmanagement.operations.DimensionsOperations
:ivar query: Query operations
:vartype query: azure.mgmt.costmanagement.operations.QueryOperations
:ivar exports: Exports operations
:vartype exports: azure.mgmt.costmanagement.operations.ExportsOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.costmanagement.operations.Operations

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

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

self.config = CostManagementClientConfiguration(credentials, subscription_id, base_url)
super(CostManagementClient, 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 = '2019-01-01'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

self.dimensions = DimensionsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.query = QueryOperations(
self._client, self.config, self._serialize, self._deserialize)
self.exports = ExportsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.operations = Operations(
self._client, self.config, self._serialize, self._deserialize)
120 changes: 120 additions & 0 deletions azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# 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 .error_details_py3 import ErrorDetails
from .error_response_py3 import ErrorResponse, ErrorResponseException
from .resource_py3 import Resource
from .dimension_py3 import Dimension
from .query_column_py3 import QueryColumn
from .query_py3 import Query
from .operation_display_py3 import OperationDisplay
from .operation_py3 import Operation
from .query_time_period_py3 import QueryTimePeriod
from .query_dataset_configuration_py3 import QueryDatasetConfiguration
from .query_aggregation_py3 import QueryAggregation
from .query_grouping_py3 import QueryGrouping
from .query_sorting_configuration_py3 import QuerySortingConfiguration
from .query_comparison_expression_py3 import QueryComparisonExpression
from .query_filter_py3 import QueryFilter
from .query_dataset_py3 import QueryDataset
from .query_definition_py3 import QueryDefinition
from .export_recurrence_period_py3 import ExportRecurrencePeriod
from .export_schedule_py3 import ExportSchedule
from .export_py3 import Export
from .export_list_result_py3 import ExportListResult
from .export_delivery_destination_py3 import ExportDeliveryDestination
from .export_delivery_info_py3 import ExportDeliveryInfo
from .common_export_properties_py3 import CommonExportProperties
from .export_execution_py3 import ExportExecution
from .export_execution_list_result_py3 import ExportExecutionListResult
except (SyntaxError, ImportError):
from .error_details import ErrorDetails
from .error_response import ErrorResponse, ErrorResponseException
from .resource import Resource
from .dimension import Dimension
from .query_column import QueryColumn
from .query import Query
from .operation_display import OperationDisplay
from .operation import Operation
from .query_time_period import QueryTimePeriod
from .query_dataset_configuration import QueryDatasetConfiguration
from .query_aggregation import QueryAggregation
from .query_grouping import QueryGrouping
from .query_sorting_configuration import QuerySortingConfiguration
from .query_comparison_expression import QueryComparisonExpression
from .query_filter import QueryFilter
from .query_dataset import QueryDataset
from .query_definition import QueryDefinition
from .export_recurrence_period import ExportRecurrencePeriod
from .export_schedule import ExportSchedule
from .export import Export
from .export_list_result import ExportListResult
from .export_delivery_destination import ExportDeliveryDestination
from .export_delivery_info import ExportDeliveryInfo
from .common_export_properties import CommonExportProperties
from .export_execution import ExportExecution
from .export_execution_list_result import ExportExecutionListResult
from .dimension_paged import DimensionPaged
from .query_paged import QueryPaged
from .operation_paged import OperationPaged
from .cost_management_client_enums import (
TimeframeType,
GranularityType,
QueryColumnType,
SortDirection,
StatusType,
RecurrenceType,
FormatType,
ExecutionType,
ExecutionStatus,
)

__all__ = [
'ErrorDetails',
'ErrorResponse', 'ErrorResponseException',
'Resource',
'Dimension',
'QueryColumn',
'Query',
'OperationDisplay',
'Operation',
'QueryTimePeriod',
'QueryDatasetConfiguration',
'QueryAggregation',
'QueryGrouping',
'QuerySortingConfiguration',
'QueryComparisonExpression',
'QueryFilter',
'QueryDataset',
'QueryDefinition',
'ExportRecurrencePeriod',
'ExportSchedule',
'Export',
'ExportListResult',
'ExportDeliveryDestination',
'ExportDeliveryInfo',
'CommonExportProperties',
'ExportExecution',
'ExportExecutionListResult',
'DimensionPaged',
'QueryPaged',
'OperationPaged',
'TimeframeType',
'GranularityType',
'QueryColumnType',
'SortDirection',
'StatusType',
'RecurrenceType',
'FormatType',
'ExecutionType',
'ExecutionStatus',
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# 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 CommonExportProperties(Model):
"""The common properties of the export.

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

:param format: The format of the export being delivered. Possible values
include: 'Csv'
:type format: str or ~azure.mgmt.costmanagement.models.FormatType
:param delivery_info: Required. Has delivery information for the export.
:type delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo
:param definition: Required. Has definition for the export.
:type definition: ~azure.mgmt.costmanagement.models.QueryDefinition
"""

_validation = {
'delivery_info': {'required': True},
'definition': {'required': True},
}

_attribute_map = {
'format': {'key': 'format', 'type': 'str'},
'delivery_info': {'key': 'deliveryInfo', 'type': 'ExportDeliveryInfo'},
'definition': {'key': 'definition', 'type': 'QueryDefinition'},
}

def __init__(self, **kwargs):
super(CommonExportProperties, self).__init__(**kwargs)
self.format = kwargs.get('format', None)
self.delivery_info = kwargs.get('delivery_info', None)
self.definition = kwargs.get('definition', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# 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 CommonExportProperties(Model):
"""The common properties of the export.

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

:param format: The format of the export being delivered. Possible values
include: 'Csv'
:type format: str or ~azure.mgmt.costmanagement.models.FormatType
:param delivery_info: Required. Has delivery information for the export.
:type delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo
:param definition: Required. Has definition for the export.
:type definition: ~azure.mgmt.costmanagement.models.QueryDefinition
"""

_validation = {
'delivery_info': {'required': True},
'definition': {'required': True},
}

_attribute_map = {
'format': {'key': 'format', 'type': 'str'},
'delivery_info': {'key': 'deliveryInfo', 'type': 'ExportDeliveryInfo'},
'definition': {'key': 'definition', 'type': 'QueryDefinition'},
}

def __init__(self, *, delivery_info, definition, format=None, **kwargs) -> None:
super(CommonExportProperties, self).__init__(**kwargs)
self.format = format
self.delivery_info = delivery_info
self.definition = definition
Loading