Skip to content

Commit

Permalink
[AutoPR] advisor/resource-manager (#7889)
Browse files Browse the repository at this point in the history
* [AutoPR advisor/resource-manager] [Advisor] Add OperationalExcellence category to enum list. (#7885)

* Generated from 470b9dc33f877037875aca6fcedbbd845b88ba78

Update advisor.json

* Packaging update of azure-mgmt-advisor

* history and version

* general breaking changes
  • Loading branch information
AutorestCI authored and fengzhou-msft committed Nov 5, 2019
1 parent 602441a commit a881a8c
Show file tree
Hide file tree
Showing 40 changed files with 1,182 additions and 1,032 deletions.
16 changes: 16 additions & 0 deletions sdk/advisor/azure-mgmt-advisor/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@
Release History
===============

3.0.0 (2019-10-24)
++++++++++++++++++

**Features**

- Added operation group RecommendationMetadataOperations

**General Breaking Changes**

This version uses a next-generation code generator that might introduce breaking changes if from some import. In summary, some modules were incorrectly visible/importable and have been renamed. This fixed several issues caused by usage of classes that were not supposed to be used in the first place.
AdvisorManagementClient cannot be imported from azure.mgmt.advisor.advisor_management_client anymore (import from azure.mgmt.advisor works like before)
AdvisorManagementClientConfiguration import has been moved from azure.mgmt.advisor.advisor_management_client to azure.mgmt.advisor
A model MyClass from a "models" sub-module cannot be imported anymore using azure.mgmt.advisor.models.my_class (import from azure.mgmt.advisor.models works like before)
An operation class MyClassOperations from an operations sub-module cannot be imported anymore using azure.mgmt.advisor.operations.my_class_operations (import from azure.mgmt.advisor.operations works like before)
Last but not least, HTTP connection pooling is now enabled by default. You should always use a client as a context manager, or call close(), or use no more than one client per process.

2.0.1 (2018-10-16)
++++++++++++++++++

Expand Down
2 changes: 1 addition & 1 deletion sdk/advisor/azure-mgmt-advisor/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This is the Microsoft Azure Advisor 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.
This package has been tested with Python 2.7, 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.
Expand Down
7 changes: 4 additions & 3 deletions sdk/advisor/azure-mgmt-advisor/azure/mgmt/advisor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
# regenerated.
# --------------------------------------------------------------------------

from .advisor_management_client import AdvisorManagementClient
from .version import VERSION
from ._configuration import AdvisorManagementClientConfiguration
from ._advisor_management_client import AdvisorManagementClient
__all__ = ['AdvisorManagementClient', 'AdvisorManagementClientConfiguration']

__all__ = ['AdvisorManagementClient']
from .version import VERSION

__version__ = VERSION

Original file line number Diff line number Diff line change
Expand Up @@ -11,45 +11,14 @@

from msrest.service_client import SDKClient
from msrest import Serializer, Deserializer
from msrestazure import AzureConfiguration
from .version import VERSION
from .operations.configurations_operations import ConfigurationsOperations
from .operations.recommendations_operations import RecommendationsOperations
from .operations.operations import Operations
from .operations.suppressions_operations import SuppressionsOperations
from . import models


class AdvisorManagementClientConfiguration(AzureConfiguration):
"""Configuration for AdvisorManagementClient
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: The 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(AdvisorManagementClientConfiguration, self).__init__(base_url)

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

self.credentials = credentials
self.subscription_id = subscription_id
from ._configuration import AdvisorManagementClientConfiguration
from .operations import RecommendationMetadataOperations
from .operations import ConfigurationsOperations
from .operations import RecommendationsOperations
from .operations import Operations
from .operations import SuppressionsOperations
from . import models


class AdvisorManagementClient(SDKClient):
Expand All @@ -58,6 +27,8 @@ class AdvisorManagementClient(SDKClient):
:ivar config: Configuration for client.
:vartype config: AdvisorManagementClientConfiguration
:ivar recommendation_metadata: RecommendationMetadata operations
:vartype recommendation_metadata: azure.mgmt.advisor.operations.RecommendationMetadataOperations
:ivar configurations: Configurations operations
:vartype configurations: azure.mgmt.advisor.operations.ConfigurationsOperations
:ivar recommendations: Recommendations operations
Expand Down Expand Up @@ -86,6 +57,8 @@ def __init__(
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

self.recommendation_metadata = RecommendationMetadataOperations(
self._client, self.config, self._serialize, self._deserialize)
self.configurations = ConfigurationsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.recommendations = RecommendationsOperations(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# 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 msrestazure import AzureConfiguration

from .version import VERSION


class AdvisorManagementClientConfiguration(AzureConfiguration):
"""Configuration for AdvisorManagementClient
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: The 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(AdvisorManagementClientConfiguration, self).__init__(base_url)

# Starting Autorest.Python 4.0.64, make connection pool activated by default
self.keep_alive = True

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

self.credentials = credentials
self.subscription_id = subscription_id
Original file line number Diff line number Diff line change
Expand Up @@ -10,49 +10,59 @@
# --------------------------------------------------------------------------

try:
from .config_data_properties_py3 import ConfigDataProperties
from .config_data_py3 import ConfigData
from .arm_error_response_body_py3 import ARMErrorResponseBody
from .short_description_py3 import ShortDescription
from .resource_recommendation_base_py3 import ResourceRecommendationBase
from .resource_py3 import Resource
from .operation_display_info_py3 import OperationDisplayInfo
from .operation_entity_py3 import OperationEntity
from .suppression_contract_py3 import SuppressionContract
from ._models_py3 import ARMErrorResponseBody
from ._models_py3 import ConfigData
from ._models_py3 import ConfigDataProperties
from ._models_py3 import MetadataEntity
from ._models_py3 import MetadataSupportedValueDetail
from ._models_py3 import OperationDisplayInfo
from ._models_py3 import OperationEntity
from ._models_py3 import Resource
from ._models_py3 import ResourceRecommendationBase
from ._models_py3 import ShortDescription
from ._models_py3 import SuppressionContract
except (SyntaxError, ImportError):
from .config_data_properties import ConfigDataProperties
from .config_data import ConfigData
from .arm_error_response_body import ARMErrorResponseBody
from .short_description import ShortDescription
from .resource_recommendation_base import ResourceRecommendationBase
from .resource import Resource
from .operation_display_info import OperationDisplayInfo
from .operation_entity import OperationEntity
from .suppression_contract import SuppressionContract
from .config_data_paged import ConfigDataPaged
from .resource_recommendation_base_paged import ResourceRecommendationBasePaged
from .operation_entity_paged import OperationEntityPaged
from .suppression_contract_paged import SuppressionContractPaged
from .advisor_management_client_enums import (
from ._models import ARMErrorResponseBody
from ._models import ConfigData
from ._models import ConfigDataProperties
from ._models import MetadataEntity
from ._models import MetadataSupportedValueDetail
from ._models import OperationDisplayInfo
from ._models import OperationEntity
from ._models import Resource
from ._models import ResourceRecommendationBase
from ._models import ShortDescription
from ._models import SuppressionContract
from ._paged_models import ConfigDataPaged
from ._paged_models import MetadataEntityPaged
from ._paged_models import OperationEntityPaged
from ._paged_models import ResourceRecommendationBasePaged
from ._paged_models import SuppressionContractPaged
from ._advisor_management_client_enums import (
Scenario,
Category,
Impact,
Risk,
)

__all__ = [
'ConfigDataProperties',
'ConfigData',
'ARMErrorResponseBody',
'ShortDescription',
'ResourceRecommendationBase',
'Resource',
'ConfigData',
'ConfigDataProperties',
'MetadataEntity',
'MetadataSupportedValueDetail',
'OperationDisplayInfo',
'OperationEntity',
'Resource',
'ResourceRecommendationBase',
'ShortDescription',
'SuppressionContract',
'MetadataEntityPaged',
'ConfigDataPaged',
'ResourceRecommendationBasePaged',
'OperationEntityPaged',
'SuppressionContractPaged',
'Scenario',
'Category',
'Impact',
'Risk',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@
from enum import Enum


class Scenario(str, Enum):

alerts = "Alerts"


class Category(str, Enum):

high_availability = "HighAvailability"
security = "Security"
performance = "Performance"
cost = "Cost"
operational_excellence = "OperationalExcellence"


class Impact(str, Enum):
Expand Down
Loading

0 comments on commit a881a8c

Please sign in to comment.