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
6 changes: 3 additions & 3 deletions sdk/elastic/azure-mgmt-elastic/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"commit": "1f449b5a17448f05ce1cd914f8ed75a0b568d130",
"commit": "2866efa971d1f558e25264a100041abcbdfb4d92",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.2",
"use": [
"@autorest/python@6.4.8",
"@autorest/python@6.6.0",
"@autorest/modelerfour@4.24.3"
],
"autorest_command": "autorest specification/elastic/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.4.8 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
"autorest_command": "autorest specification/elastic/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.6.0 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
"readme": "specification/elastic/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,16 @@ class MicrosoftElasticConfiguration(Configuration): # pylint: disable=too-many-

:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g.
00000000-0000-0000-0000-000000000000). Required.
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2023-02-01-preview". Note that overriding
:keyword api_version: Api Version. Default value is "2023-07-01-preview". Note that overriding
this default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(MicrosoftElasticConfiguration, self).__init__(**kwargs)
api_version: str = kwargs.pop("api_version", "2023-02-01-preview")
api_version: str = kwargs.pop("api_version", "2023-07-01-preview")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
from .operations import (
AllTrafficFiltersOperations,
AssociateTrafficFilterOperations,
BillingInfoOperations,
ConnectedPartnerResourcesOperations,
CreateAndAssociateIPFilterOperations,
CreateAndAssociatePLFilterOperations,
DeploymentInfoOperations,
Expand Down Expand Up @@ -59,6 +61,11 @@ class MicrosoftElastic: # pylint: disable=client-accepts-api-version-keyword,to
:vartype deployment_info: azure.mgmt.elastic.operations.DeploymentInfoOperations
:ivar external_user: ExternalUserOperations operations
:vartype external_user: azure.mgmt.elastic.operations.ExternalUserOperations
:ivar billing_info: BillingInfoOperations operations
:vartype billing_info: azure.mgmt.elastic.operations.BillingInfoOperations
:ivar connected_partner_resources: ConnectedPartnerResourcesOperations operations
:vartype connected_partner_resources:
azure.mgmt.elastic.operations.ConnectedPartnerResourcesOperations
:ivar tag_rules: TagRulesOperations operations
:vartype tag_rules: azure.mgmt.elastic.operations.TagRulesOperations
:ivar vm_host: VMHostOperations operations
Expand Down Expand Up @@ -96,12 +103,11 @@ class MicrosoftElastic: # pylint: disable=client-accepts-api-version-keyword,to
:vartype organizations: azure.mgmt.elastic.operations.OrganizationsOperations
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g.
00000000-0000-0000-0000-000000000000). Required.
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: Api Version. Default value is "2023-02-01-preview". Note that overriding
:keyword api_version: Api Version. Default value is "2023-07-01-preview". Note that overriding
this default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Expand Down Expand Up @@ -132,6 +138,10 @@ def __init__(
)
self.deployment_info = DeploymentInfoOperations(self._client, self._config, self._serialize, self._deserialize)
self.external_user = ExternalUserOperations(self._client, self._config, self._serialize, self._deserialize)
self.billing_info = BillingInfoOperations(self._client, self._config, self._serialize, self._deserialize)
self.connected_partner_resources = ConnectedPartnerResourcesOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.tag_rules = TagRulesOperations(self._client, self._config, self._serialize, self._deserialize)
self.vm_host = VMHostOperations(self._client, self._config, self._serialize, self._deserialize)
self.vm_ingestion = VMIngestionOperations(self._client, self._config, self._serialize, self._deserialize)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "1.1.0b3"
VERSION = "1.0.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,16 @@ class MicrosoftElasticConfiguration(Configuration): # pylint: disable=too-many-

:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g.
00000000-0000-0000-0000-000000000000). Required.
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2023-02-01-preview". Note that overriding
:keyword api_version: Api Version. Default value is "2023-07-01-preview". Note that overriding
this default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(MicrosoftElasticConfiguration, self).__init__(**kwargs)
api_version: str = kwargs.pop("api_version", "2023-02-01-preview")
api_version: str = kwargs.pop("api_version", "2023-07-01-preview")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
from .operations import (
AllTrafficFiltersOperations,
AssociateTrafficFilterOperations,
BillingInfoOperations,
ConnectedPartnerResourcesOperations,
CreateAndAssociateIPFilterOperations,
CreateAndAssociatePLFilterOperations,
DeploymentInfoOperations,
Expand Down Expand Up @@ -59,6 +61,11 @@ class MicrosoftElastic: # pylint: disable=client-accepts-api-version-keyword,to
:vartype deployment_info: azure.mgmt.elastic.aio.operations.DeploymentInfoOperations
:ivar external_user: ExternalUserOperations operations
:vartype external_user: azure.mgmt.elastic.aio.operations.ExternalUserOperations
:ivar billing_info: BillingInfoOperations operations
:vartype billing_info: azure.mgmt.elastic.aio.operations.BillingInfoOperations
:ivar connected_partner_resources: ConnectedPartnerResourcesOperations operations
:vartype connected_partner_resources:
azure.mgmt.elastic.aio.operations.ConnectedPartnerResourcesOperations
:ivar tag_rules: TagRulesOperations operations
:vartype tag_rules: azure.mgmt.elastic.aio.operations.TagRulesOperations
:ivar vm_host: VMHostOperations operations
Expand Down Expand Up @@ -96,12 +103,11 @@ class MicrosoftElastic: # pylint: disable=client-accepts-api-version-keyword,to
:vartype organizations: azure.mgmt.elastic.aio.operations.OrganizationsOperations
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g.
00000000-0000-0000-0000-000000000000). Required.
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: Api Version. Default value is "2023-02-01-preview". Note that overriding
:keyword api_version: Api Version. Default value is "2023-07-01-preview". Note that overriding
this default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Expand Down Expand Up @@ -132,6 +138,10 @@ def __init__(
)
self.deployment_info = DeploymentInfoOperations(self._client, self._config, self._serialize, self._deserialize)
self.external_user = ExternalUserOperations(self._client, self._config, self._serialize, self._deserialize)
self.billing_info = BillingInfoOperations(self._client, self._config, self._serialize, self._deserialize)
self.connected_partner_resources = ConnectedPartnerResourcesOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.tag_rules = TagRulesOperations(self._client, self._config, self._serialize, self._deserialize)
self.vm_host = VMHostOperations(self._client, self._config, self._serialize, self._deserialize)
self.vm_ingestion = VMIngestionOperations(self._client, self._config, self._serialize, self._deserialize)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
from ._monitored_resources_operations import MonitoredResourcesOperations
from ._deployment_info_operations import DeploymentInfoOperations
from ._external_user_operations import ExternalUserOperations
from ._billing_info_operations import BillingInfoOperations
from ._connected_partner_resources_operations import ConnectedPartnerResourcesOperations
from ._tag_rules_operations import TagRulesOperations
from ._vm_host_operations import VMHostOperations
from ._vm_ingestion_operations import VMIngestionOperations
Expand Down Expand Up @@ -39,6 +41,8 @@
"MonitoredResourcesOperations",
"DeploymentInfoOperations",
"ExternalUserOperations",
"BillingInfoOperations",
"ConnectedPartnerResourcesOperations",
"TagRulesOperations",
"VMHostOperations",
"VMIngestionOperations",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ async def list(

Get the list of all traffic filters for the account.

:param resource_group_name: The name of the resource group to which the Elastic resource
belongs. Required.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param monitor_name: Monitor resource name. Required.
:type monitor_name: str
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ async def begin_associate(

Associate traffic filter for the given deployment.

:param resource_group_name: The name of the resource group to which the Elastic resource
belongs. Required.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param monitor_name: Monitor resource name. Required.
:type monitor_name: str
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# pylint: disable=too-many-lines
# 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 typing import Any, Callable, Dict, Optional, TypeVar

from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import AsyncHttpResponse
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat

from ... import models as _models
from ..._vendor import _convert_request
from ...operations._billing_info_operations import build_get_request

T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]


class BillingInfoOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.

Instead, you should access the following operations through
:class:`~azure.mgmt.elastic.aio.MicrosoftElastic`'s
:attr:`billing_info` attribute.
"""

models = _models

def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")

@distributed_trace_async
async def get(self, resource_group_name: str, monitor_name: str, **kwargs: Any) -> _models.BillingInfoResponse:
"""Get marketplace and organization info mapped to the given monitor.

Get marketplace and organization info mapped to the given monitor.

:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param monitor_name: Monitor resource name. Required.
:type monitor_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: BillingInfoResponse or the result of cls(response)
:rtype: ~azure.mgmt.elastic.models.BillingInfoResponse
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})

_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.BillingInfoResponse] = kwargs.pop("cls", None)

request = build_get_request(
resource_group_name=resource_group_name,
monitor_name=monitor_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.get.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)

_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **kwargs
)

response = pipeline_response.http_response

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(
_models.ResourceProviderDefaultErrorResponse, pipeline_response
)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize("BillingInfoResponse", pipeline_response)

if cls:
return cls(pipeline_response, deserialized, {})

return deserialized

get.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/getBillingInfo"
}
Loading