diff --git a/sdk/elastic/azure-mgmt-elastic/_meta.json b/sdk/elastic/azure-mgmt-elastic/_meta.json index 99a262400bd8..40f27140bd83 100644 --- a/sdk/elastic/azure-mgmt-elastic/_meta.json +++ b/sdk/elastic/azure-mgmt-elastic/_meta.json @@ -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" } \ No newline at end of file diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/_configuration.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/_configuration.py index 8273c3f2bcde..4f086dd9a095 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/_configuration.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/_configuration.py @@ -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.") diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/_microsoft_elastic.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/_microsoft_elastic.py index e931c84eb210..f5d43c23faa6 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/_microsoft_elastic.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/_microsoft_elastic.py @@ -18,6 +18,8 @@ from .operations import ( AllTrafficFiltersOperations, AssociateTrafficFilterOperations, + BillingInfoOperations, + ConnectedPartnerResourcesOperations, CreateAndAssociateIPFilterOperations, CreateAndAssociatePLFilterOperations, DeploymentInfoOperations, @@ -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 @@ -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 @@ -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) diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/_version.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/_version.py index 73aef742777f..e5754a47ce68 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/_version.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/_version.py @@ -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" diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/_configuration.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/_configuration.py index d692acb9479c..5bd344be1101 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/_configuration.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/_configuration.py @@ -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.") diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/_microsoft_elastic.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/_microsoft_elastic.py index 9af83af61936..6f6fe2b7ef0f 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/_microsoft_elastic.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/_microsoft_elastic.py @@ -18,6 +18,8 @@ from .operations import ( AllTrafficFiltersOperations, AssociateTrafficFilterOperations, + BillingInfoOperations, + ConnectedPartnerResourcesOperations, CreateAndAssociateIPFilterOperations, CreateAndAssociatePLFilterOperations, DeploymentInfoOperations, @@ -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 @@ -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 @@ -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) diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/__init__.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/__init__.py index e04a06140193..319115087417 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/__init__.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/__init__.py @@ -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 @@ -39,6 +41,8 @@ "MonitoredResourcesOperations", "DeploymentInfoOperations", "ExternalUserOperations", + "BillingInfoOperations", + "ConnectedPartnerResourcesOperations", "TagRulesOperations", "VMHostOperations", "VMIngestionOperations", diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_all_traffic_filters_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_all_traffic_filters_operations.py index 1531baef4334..82b1adda51e2 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_all_traffic_filters_operations.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_all_traffic_filters_operations.py @@ -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 diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_associate_traffic_filter_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_associate_traffic_filter_operations.py index f40bfed1a937..690737668a15 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_associate_traffic_filter_operations.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_associate_traffic_filter_operations.py @@ -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 diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_billing_info_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_billing_info_operations.py new file mode 100644 index 000000000000..5d8cca92c15a --- /dev/null +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_billing_info_operations.py @@ -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" + } diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_connected_partner_resources_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_connected_partner_resources_operations.py new file mode 100644 index 000000000000..6981abcc2ee0 --- /dev/null +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_connected_partner_resources_operations.py @@ -0,0 +1,153 @@ +# 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, AsyncIterable, Callable, Dict, Optional, TypeVar +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +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 import distributed_trace +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._connected_partner_resources_operations import build_list_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ConnectedPartnerResourcesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.elastic.aio.MicrosoftElastic`'s + :attr:`connected_partner_resources` 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 + def list( + self, resource_group_name: str, monitor_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ConnectedPartnerResourcesListFormat"]: + """List of all active deployments that are associated with the marketplace subscription linked to + the given monitor. + + List of all active deployments that are associated with the marketplace subscription linked 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: An iterator like instance of either ConnectedPartnerResourcesListFormat or the result + of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.elastic.models.ConnectedPartnerResourcesListFormat] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _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.ConnectedPartnerResourcesListResponse] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + resource_group_name=resource_group_name, + monitor_name=monitor_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ConnectedPartnerResourcesListResponse", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + _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) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/listConnectedPartnerResources" + } diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_create_and_associate_ip_filter_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_create_and_associate_ip_filter_operations.py index 681032d9ed38..f86ec6c471ab 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_create_and_associate_ip_filter_operations.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_create_and_associate_ip_filter_operations.py @@ -122,8 +122,8 @@ async def begin_create( Create and Associate IP 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 diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_create_and_associate_pl_filter_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_create_and_associate_pl_filter_operations.py index 46adcc10b04d..6ee41abd487c 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_create_and_associate_pl_filter_operations.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_create_and_associate_pl_filter_operations.py @@ -125,8 +125,8 @@ async def begin_create( Create and Associate private link 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 diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_deployment_info_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_deployment_info_operations.py index 656aa3b649f3..1b7cbc8d963d 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_deployment_info_operations.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_deployment_info_operations.py @@ -58,8 +58,8 @@ async def list(self, resource_group_name: str, monitor_name: str, **kwargs: Any) Fetch information regarding Elastic cloud deployment corresponding to the Elastic monitor resource. - :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 diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_detach_and_delete_traffic_filter_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_detach_and_delete_traffic_filter_operations.py index d4f699e9601b..eccf6d862086 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_detach_and_delete_traffic_filter_operations.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_detach_and_delete_traffic_filter_operations.py @@ -58,8 +58,8 @@ async def delete( # pylint: disable=inconsistent-return-statements Detach and Delete traffic filter from 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 diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_detach_traffic_filter_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_detach_traffic_filter_operations.py index 86c526788c2a..e0eddd5bb3d9 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_detach_traffic_filter_operations.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_detach_traffic_filter_operations.py @@ -111,8 +111,8 @@ async def begin_update( Detach 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 diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_external_user_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_external_user_operations.py index 2732c78deee9..91483dc62334 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_external_user_operations.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_external_user_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -66,8 +67,8 @@ async def create_or_update( Create User inside elastic deployment which are used by customers to perform operations on the elastic 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 @@ -98,8 +99,8 @@ async def create_or_update( Create User inside elastic deployment which are used by customers to perform operations on the elastic 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 @@ -128,8 +129,8 @@ async def create_or_update( Create User inside elastic deployment which are used by customers to perform operations on the elastic 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 @@ -162,7 +163,7 @@ async def create_or_update( content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_list_associated_traffic_filters_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_list_associated_traffic_filters_operations.py index 6c666aa90711..ca0bb279030f 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_list_associated_traffic_filters_operations.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_list_associated_traffic_filters_operations.py @@ -58,8 +58,8 @@ async def list( Get the list of all associated traffic filters 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 diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_monitor_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_monitor_operations.py index 244aad40ab59..583a7dac90a6 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_monitor_operations.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_monitor_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -77,7 +78,7 @@ async def _upgrade_initial( # pylint: disable=inconsistent-return-statements content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -135,8 +136,8 @@ async def begin_upgrade( Upgradable version for a monitor resource. - :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 @@ -172,8 +173,8 @@ async def begin_upgrade( Upgradable version for a monitor resource. - :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 @@ -207,8 +208,8 @@ async def begin_upgrade( Upgradable version for a monitor resource. - :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 diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_monitored_resources_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_monitored_resources_operations.py index 8a5d4b92d330..02b70ca746b4 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_monitored_resources_operations.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_monitored_resources_operations.py @@ -60,8 +60,8 @@ def list( List the resources currently being monitored by the Elastic monitor resource. - :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 diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_monitors_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_monitors_operations.py index a676a7588601..4ca81777b85a 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_monitors_operations.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_monitors_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -157,8 +158,8 @@ def list_by_resource_group( List all monitors under the specified resource group. - :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 :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ElasticMonitorResource or the result of @@ -250,8 +251,8 @@ async def get(self, resource_group_name: str, monitor_name: str, **kwargs: Any) Get the properties of a specific monitor resource. - :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 @@ -336,7 +337,7 @@ async def _create_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -402,8 +403,8 @@ async def begin_create( Create a monitor resource. - :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 @@ -440,8 +441,8 @@ async def begin_create( Create a monitor resource. - :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 @@ -476,8 +477,8 @@ async def begin_create( Create a monitor resource. - :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 @@ -565,8 +566,8 @@ async def update( Update a monitor resource. - :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 @@ -595,8 +596,8 @@ async def update( Update a monitor resource. - :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 @@ -623,8 +624,8 @@ async def update( Update a monitor resource. - :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 @@ -657,7 +658,7 @@ async def update( content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -761,8 +762,8 @@ async def begin_delete(self, resource_group_name: str, monitor_name: str, **kwar Delete a monitor resource. - :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 diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_organizations_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_organizations_operations.py index c0672c22373c..0a1576298278 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_organizations_operations.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_organizations_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -25,7 +26,10 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._organizations_operations import build_get_api_key_request +from ...operations._organizations_operations import ( + build_get_api_key_request, + build_get_elastic_to_azure_subscription_mapping_request, +) T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -133,7 +137,7 @@ async def get_api_key( content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -176,3 +180,65 @@ async def get_api_key( return deserialized get_api_key.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Elastic/getOrganizationApiKey"} + + @distributed_trace_async + async def get_elastic_to_azure_subscription_mapping( + self, **kwargs: Any + ) -> _models.ElasticOrganizationToAzureSubscriptionMappingResponse: + """Get Elastic Organization To Azure Subscription Mapping details for the logged-in user. + + Get Elastic Organization To Azure Subscription Mapping details for the logged-in user. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ElasticOrganizationToAzureSubscriptionMappingResponse or the result of cls(response) + :rtype: ~azure.mgmt.elastic.models.ElasticOrganizationToAzureSubscriptionMappingResponse + :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.ElasticOrganizationToAzureSubscriptionMappingResponse] = kwargs.pop("cls", None) + + request = build_get_elastic_to_azure_subscription_mapping_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get_elastic_to_azure_subscription_mapping.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("ElasticOrganizationToAzureSubscriptionMappingResponse", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_elastic_to_azure_subscription_mapping.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Elastic/getElasticOrganizationToAzureSubscriptionMapping" + } diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_tag_rules_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_tag_rules_operations.py index e8b5c5f9fd16..da60b1374803 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_tag_rules_operations.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_tag_rules_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -68,8 +69,8 @@ def list( List the tag rules for a given monitor resource. - :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 @@ -171,8 +172,8 @@ async def create_or_update( Create or update a tag rule set for a given monitor resource. - :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 @@ -204,8 +205,8 @@ async def create_or_update( Create or update a tag rule set for a given monitor resource. - :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 @@ -235,8 +236,8 @@ async def create_or_update( Create or update a tag rule set for a given monitor resource. - :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 @@ -271,7 +272,7 @@ async def create_or_update( content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -328,8 +329,8 @@ async def get( Get a tag rule set for a given monitor resource. - :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 @@ -451,8 +452,8 @@ async def begin_delete( Delete a tag rule set for a given monitor resource. - :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 diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_traffic_filters_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_traffic_filters_operations.py index 0af6ea7fbeef..31c0e6e1538d 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_traffic_filters_operations.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_traffic_filters_operations.py @@ -58,8 +58,8 @@ async def delete( # pylint: disable=inconsistent-return-statements Delete traffic filter from 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 diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_upgradable_versions_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_upgradable_versions_operations.py index 98d985766d00..f7dec45994ab 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_upgradable_versions_operations.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_upgradable_versions_operations.py @@ -58,8 +58,8 @@ async def details( List of upgradable versions for a given monitor resource. - :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 diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_vm_collection_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_vm_collection_operations.py index 72b9d859f5ab..722890bbd2cc 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_vm_collection_operations.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_vm_collection_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -64,8 +65,8 @@ async def update( # pylint: disable=inconsistent-return-statements Update the vm details that will be monitored by the Elastic monitor resource. - :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 @@ -94,8 +95,8 @@ async def update( # pylint: disable=inconsistent-return-statements Update the vm details that will be monitored by the Elastic monitor resource. - :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 @@ -122,8 +123,8 @@ async def update( # pylint: disable=inconsistent-return-statements Update the vm details that will be monitored by the Elastic monitor resource. - :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 @@ -156,7 +157,7 @@ async def update( # pylint: disable=inconsistent-return-statements content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_vm_host_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_vm_host_operations.py index d6fdd06c7769..f3e9b7a0d7db 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_vm_host_operations.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_vm_host_operations.py @@ -58,8 +58,8 @@ def list(self, resource_group_name: str, monitor_name: str, **kwargs: Any) -> As List the vm resources currently being monitored by the Elastic monitor resource. - :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 diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_vm_ingestion_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_vm_ingestion_operations.py index 5d3fef056051..2eb59c175db3 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_vm_ingestion_operations.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/aio/operations/_vm_ingestion_operations.py @@ -58,8 +58,8 @@ async def details( List the vm ingestion details that will be monitored by the Elastic monitor resource. - :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 diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/models/__init__.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/models/__init__.py index 21f1938cbe84..cb999c28304a 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/models/__init__.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/models/__init__.py @@ -6,7 +6,11 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from ._models_py3 import BillingInfoResponse from ._models_py3 import CompanyInfo +from ._models_py3 import ConnectedPartnerResourceProperties +from ._models_py3 import ConnectedPartnerResourcesListFormat +from ._models_py3 import ConnectedPartnerResourcesListResponse from ._models_py3 import DeploymentInfoResponse from ._models_py3 import ElasticCloudDeployment from ._models_py3 import ElasticCloudUser @@ -14,6 +18,8 @@ from ._models_py3 import ElasticMonitorResourceListResponse from ._models_py3 import ElasticMonitorResourceUpdateParameters from ._models_py3 import ElasticMonitorUpgrade +from ._models_py3 import ElasticOrganizationToAzureSubscriptionMappingResponse +from ._models_py3 import ElasticOrganizationToAzureSubscriptionMappingResponseProperties from ._models_py3 import ElasticProperties from ._models_py3 import ElasticTrafficFilter from ._models_py3 import ElasticTrafficFilterResponse @@ -38,6 +44,7 @@ from ._models_py3 import OperationDisplay from ._models_py3 import OperationListResult from ._models_py3 import OperationResult +from ._models_py3 import PartnerBillingEntity from ._models_py3 import ResourceProviderDefaultErrorResponse from ._models_py3 import ResourceSku from ._models_py3 import SystemData @@ -66,7 +73,11 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ + "BillingInfoResponse", "CompanyInfo", + "ConnectedPartnerResourceProperties", + "ConnectedPartnerResourcesListFormat", + "ConnectedPartnerResourcesListResponse", "DeploymentInfoResponse", "ElasticCloudDeployment", "ElasticCloudUser", @@ -74,6 +85,8 @@ "ElasticMonitorResourceListResponse", "ElasticMonitorResourceUpdateParameters", "ElasticMonitorUpgrade", + "ElasticOrganizationToAzureSubscriptionMappingResponse", + "ElasticOrganizationToAzureSubscriptionMappingResponseProperties", "ElasticProperties", "ElasticTrafficFilter", "ElasticTrafficFilterResponse", @@ -98,6 +111,7 @@ "OperationDisplay", "OperationListResult", "OperationResult", + "PartnerBillingEntity", "ResourceProviderDefaultErrorResponse", "ResourceSku", "SystemData", diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/models/_models_py3.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/models/_models_py3.py index b012b217a9d5..7baf79ed7d0e 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/models/_models_py3.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/models/_models_py3.py @@ -17,6 +17,38 @@ from .. import models as _models +class BillingInfoResponse(_serialization.Model): + """Marketplace Subscription and Organization details to which resource gets billed into. + + :ivar marketplace_saas_info: Marketplace Subscription details. + :vartype marketplace_saas_info: ~azure.mgmt.elastic.models.MarketplaceSaaSInfo + :ivar partner_billing_entity: Partner Billing Entity details: Organization Info. + :vartype partner_billing_entity: ~azure.mgmt.elastic.models.PartnerBillingEntity + """ + + _attribute_map = { + "marketplace_saas_info": {"key": "marketplaceSaasInfo", "type": "MarketplaceSaaSInfo"}, + "partner_billing_entity": {"key": "partnerBillingEntity", "type": "PartnerBillingEntity"}, + } + + def __init__( + self, + *, + marketplace_saas_info: Optional["_models.MarketplaceSaaSInfo"] = None, + partner_billing_entity: Optional["_models.PartnerBillingEntity"] = None, + **kwargs: Any + ) -> None: + """ + :keyword marketplace_saas_info: Marketplace Subscription details. + :paramtype marketplace_saas_info: ~azure.mgmt.elastic.models.MarketplaceSaaSInfo + :keyword partner_billing_entity: Partner Billing Entity details: Organization Info. + :paramtype partner_billing_entity: ~azure.mgmt.elastic.models.PartnerBillingEntity + """ + super().__init__(**kwargs) + self.marketplace_saas_info = marketplace_saas_info + self.partner_billing_entity = partner_billing_entity + + class CompanyInfo(_serialization.Model): """Company information of the user to be passed to partners. @@ -78,6 +110,107 @@ def __init__( self.country = country +class ConnectedPartnerResourceProperties(_serialization.Model): + """Connected Partner Resource Properties. + + :ivar partner_deployment_name: Elastic deployment name. + :vartype partner_deployment_name: str + :ivar partner_deployment_uri: Deployment URL of the elasticsearch in Elastic cloud deployment. + :vartype partner_deployment_uri: str + :ivar azure_resource_id: The azure resource Id of the deployment. + :vartype azure_resource_id: str + :ivar location: The location of the deployment. + :vartype location: str + """ + + _attribute_map = { + "partner_deployment_name": {"key": "partnerDeploymentName", "type": "str"}, + "partner_deployment_uri": {"key": "partnerDeploymentUri", "type": "str"}, + "azure_resource_id": {"key": "azureResourceId", "type": "str"}, + "location": {"key": "location", "type": "str"}, + } + + def __init__( + self, + *, + partner_deployment_name: Optional[str] = None, + partner_deployment_uri: Optional[str] = None, + azure_resource_id: Optional[str] = None, + location: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword partner_deployment_name: Elastic deployment name. + :paramtype partner_deployment_name: str + :keyword partner_deployment_uri: Deployment URL of the elasticsearch in Elastic cloud + deployment. + :paramtype partner_deployment_uri: str + :keyword azure_resource_id: The azure resource Id of the deployment. + :paramtype azure_resource_id: str + :keyword location: The location of the deployment. + :paramtype location: str + """ + super().__init__(**kwargs) + self.partner_deployment_name = partner_deployment_name + self.partner_deployment_uri = partner_deployment_uri + self.azure_resource_id = azure_resource_id + self.location = location + + +class ConnectedPartnerResourcesListFormat(_serialization.Model): + """Connected Partner Resources List Format. + + :ivar properties: Connected Partner Resource Properties. + :vartype properties: ~azure.mgmt.elastic.models.ConnectedPartnerResourceProperties + """ + + _attribute_map = { + "properties": {"key": "properties", "type": "ConnectedPartnerResourceProperties"}, + } + + def __init__( + self, *, properties: Optional["_models.ConnectedPartnerResourceProperties"] = None, **kwargs: Any + ) -> None: + """ + :keyword properties: Connected Partner Resource Properties. + :paramtype properties: ~azure.mgmt.elastic.models.ConnectedPartnerResourceProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class ConnectedPartnerResourcesListResponse(_serialization.Model): + """List of all active elastic deployments. + + :ivar value: Results of a list operation. + :vartype value: list[~azure.mgmt.elastic.models.ConnectedPartnerResourcesListFormat] + :ivar next_link: Link to the next set of results, if any. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[ConnectedPartnerResourcesListFormat]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.ConnectedPartnerResourcesListFormat"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: Results of a list operation. + :paramtype value: list[~azure.mgmt.elastic.models.ConnectedPartnerResourcesListFormat] + :keyword next_link: Link to the next set of results, if any. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + class DeploymentInfoResponse(_serialization.Model): """The properties of deployment in Elastic cloud corresponding to the Elastic monitor resource. @@ -366,6 +499,89 @@ def __init__(self, *, version: Optional[str] = None, **kwargs: Any) -> None: self.version = version +class ElasticOrganizationToAzureSubscriptionMappingResponse(_serialization.Model): + """The Azure Subscription ID to which the Organization of the logged in user belongs and gets + billed into. + + :ivar properties: The properties of Azure Subscription ID to which the Organization of the + logged in user belongs and gets billed into. + :vartype properties: + ~azure.mgmt.elastic.models.ElasticOrganizationToAzureSubscriptionMappingResponseProperties + """ + + _attribute_map = { + "properties": {"key": "properties", "type": "ElasticOrganizationToAzureSubscriptionMappingResponseProperties"}, + } + + def __init__( + self, + *, + properties: Optional["_models.ElasticOrganizationToAzureSubscriptionMappingResponseProperties"] = None, + **kwargs: Any + ) -> None: + """ + :keyword properties: The properties of Azure Subscription ID to which the Organization of the + logged in user belongs and gets billed into. + :paramtype properties: + ~azure.mgmt.elastic.models.ElasticOrganizationToAzureSubscriptionMappingResponseProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class ElasticOrganizationToAzureSubscriptionMappingResponseProperties(_serialization.Model): + """The properties of Azure Subscription ID to which the Organization of the logged in user belongs + and gets billed into. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar billed_azure_subscription_id: The Azure Subscription ID to which the Organization belongs + and gets billed into. This is empty for a new user OR a user without an Elastic Organization. + :vartype billed_azure_subscription_id: str + :ivar marketplace_saas_info: Marketplace SaaS Info of the resource. + :vartype marketplace_saas_info: ~azure.mgmt.elastic.models.MarketplaceSaaSInfo + :ivar elastic_organization_id: The Elastic Organization Id. + :vartype elastic_organization_id: str + :ivar elastic_organization_name: The Elastic Organization Name. + :vartype elastic_organization_name: str + """ + + _validation = { + "marketplace_saas_info": {"readonly": True}, + } + + _attribute_map = { + "billed_azure_subscription_id": {"key": "billedAzureSubscriptionId", "type": "str"}, + "marketplace_saas_info": {"key": "marketplaceSaasInfo", "type": "MarketplaceSaaSInfo"}, + "elastic_organization_id": {"key": "elasticOrganizationId", "type": "str"}, + "elastic_organization_name": {"key": "elasticOrganizationName", "type": "str"}, + } + + def __init__( + self, + *, + billed_azure_subscription_id: Optional[str] = None, + elastic_organization_id: Optional[str] = None, + elastic_organization_name: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword billed_azure_subscription_id: The Azure Subscription ID to which the Organization + belongs and gets billed into. This is empty for a new user OR a user without an Elastic + Organization. + :paramtype billed_azure_subscription_id: str + :keyword elastic_organization_id: The Elastic Organization Id. + :paramtype elastic_organization_id: str + :keyword elastic_organization_name: The Elastic Organization Name. + :paramtype elastic_organization_name: str + """ + super().__init__(**kwargs) + self.billed_azure_subscription_id = billed_azure_subscription_id + self.marketplace_saas_info = None + self.elastic_organization_id = elastic_organization_id + self.elastic_organization_name = elastic_organization_name + + class ElasticProperties(_serialization.Model): """Elastic Resource Properties. @@ -873,6 +1089,13 @@ class MarketplaceSaaSInfo(_serialization.Model): :vartype marketplace_name: str :ivar marketplace_resource_id: Marketplace Subscription Details: Resource URI. :vartype marketplace_resource_id: str + :ivar marketplace_status: Marketplace Subscription Details: SaaS Subscription Status. + :vartype marketplace_status: str + :ivar billed_azure_subscription_id: The Azure Subscription ID to which the Marketplace + Subscription belongs and gets billed into. + :vartype billed_azure_subscription_id: str + :ivar subscribed: Flag specifying if the Marketplace status is subscribed or not. + :vartype subscribed: bool """ _attribute_map = { @@ -882,6 +1105,9 @@ class MarketplaceSaaSInfo(_serialization.Model): }, "marketplace_name": {"key": "marketplaceName", "type": "str"}, "marketplace_resource_id": {"key": "marketplaceResourceId", "type": "str"}, + "marketplace_status": {"key": "marketplaceStatus", "type": "str"}, + "billed_azure_subscription_id": {"key": "billedAzureSubscriptionId", "type": "str"}, + "subscribed": {"key": "subscribed", "type": "bool"}, } def __init__( @@ -890,6 +1116,9 @@ def __init__( marketplace_subscription: Optional["_models.MarketplaceSaaSInfoMarketplaceSubscription"] = None, marketplace_name: Optional[str] = None, marketplace_resource_id: Optional[str] = None, + marketplace_status: Optional[str] = None, + billed_azure_subscription_id: Optional[str] = None, + subscribed: Optional[bool] = None, **kwargs: Any ) -> None: """ @@ -900,11 +1129,21 @@ def __init__( :paramtype marketplace_name: str :keyword marketplace_resource_id: Marketplace Subscription Details: Resource URI. :paramtype marketplace_resource_id: str + :keyword marketplace_status: Marketplace Subscription Details: SaaS Subscription Status. + :paramtype marketplace_status: str + :keyword billed_azure_subscription_id: The Azure Subscription ID to which the Marketplace + Subscription belongs and gets billed into. + :paramtype billed_azure_subscription_id: str + :keyword subscribed: Flag specifying if the Marketplace status is subscribed or not. + :paramtype subscribed: bool """ super().__init__(**kwargs) self.marketplace_subscription = marketplace_subscription self.marketplace_name = marketplace_name self.marketplace_resource_id = marketplace_resource_id + self.marketplace_status = marketplace_status + self.billed_azure_subscription_id = billed_azure_subscription_id + self.subscribed = subscribed class MarketplaceSaaSInfoMarketplaceSubscription(_serialization.Model): @@ -1316,6 +1555,45 @@ def __init__( self.origin = origin +class PartnerBillingEntity(_serialization.Model): + """Partner Billing details associated with the resource. + + :ivar id: The Elastic Organization Id. + :vartype id: str + :ivar name: The Elastic Organization Name. + :vartype name: str + :ivar partner_entity_uri: Link to the elastic organization page. + :vartype partner_entity_uri: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "partner_entity_uri": {"key": "partnerEntityUri", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + partner_entity_uri: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: The Elastic Organization Id. + :paramtype id: str + :keyword name: The Elastic Organization Name. + :paramtype name: str + :keyword partner_entity_uri: Link to the elastic organization page. + :paramtype partner_entity_uri: str + """ + super().__init__(**kwargs) + self.id = id + self.name = name + self.partner_entity_uri = partner_entity_uri + + class ResourceProviderDefaultErrorResponse(_serialization.Model): """RP default error response. diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/__init__.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/__init__.py index e04a06140193..319115087417 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/__init__.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/__init__.py @@ -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 @@ -39,6 +41,8 @@ "MonitoredResourcesOperations", "DeploymentInfoOperations", "ExternalUserOperations", + "BillingInfoOperations", + "ConnectedPartnerResourcesOperations", "TagRulesOperations", "VMHostOperations", "VMIngestionOperations", diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_all_traffic_filters_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_all_traffic_filters_operations.py index 44f6f3f4ef83..b6ab1573ef21 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_all_traffic_filters_operations.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_all_traffic_filters_operations.py @@ -38,7 +38,7 @@ def build_list_request(resource_group_name: str, monitor_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -48,7 +48,9 @@ def build_list_request(resource_group_name: str, monitor_name: str, subscription ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), "monitorName": _SERIALIZER.url("monitor_name", monitor_name, "str"), } @@ -88,8 +90,8 @@ def list(self, resource_group_name: str, monitor_name: str, **kwargs: Any) -> _m 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 diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_associate_traffic_filter_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_associate_traffic_filter_operations.py index f4d6ca047c10..e058a22e9917 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_associate_traffic_filter_operations.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_associate_traffic_filter_operations.py @@ -47,7 +47,7 @@ def build_associate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -57,7 +57,9 @@ def build_associate_request( ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), "monitorName": _SERIALIZER.url("monitor_name", monitor_name, "str"), } @@ -152,8 +154,8 @@ 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 diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_billing_info_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_billing_info_operations.py new file mode 100644 index 000000000000..2e12b41e28e5 --- /dev/null +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_billing_info_operations.py @@ -0,0 +1,152 @@ +# 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 HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from .._serialization import Serializer +from .._vendor import _convert_request, _format_url_section + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_get_request(resource_group_name: str, monitor_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-07-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/getBillingInfo", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "monitorName": _SERIALIZER.url("monitor_name", monitor_name, "str"), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class BillingInfoOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.elastic.MicrosoftElastic`'s + :attr:`billing_info` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + 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 + 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 = 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" + } diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_connected_partner_resources_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_connected_partner_resources_operations.py new file mode 100644 index 000000000000..d66223ab1bf6 --- /dev/null +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_connected_partner_resources_operations.py @@ -0,0 +1,187 @@ +# 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, Iterable, Optional, TypeVar +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from .._serialization import Serializer +from .._vendor import _convert_request, _format_url_section + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request(resource_group_name: str, monitor_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-07-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/listConnectedPartnerResources", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "monitorName": _SERIALIZER.url("monitor_name", monitor_name, "str"), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class ConnectedPartnerResourcesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.elastic.MicrosoftElastic`'s + :attr:`connected_partner_resources` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + 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 + def list( + self, resource_group_name: str, monitor_name: str, **kwargs: Any + ) -> Iterable["_models.ConnectedPartnerResourcesListFormat"]: + """List of all active deployments that are associated with the marketplace subscription linked to + the given monitor. + + List of all active deployments that are associated with the marketplace subscription linked 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: An iterator like instance of either ConnectedPartnerResourcesListFormat or the result + of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.elastic.models.ConnectedPartnerResourcesListFormat] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _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.ConnectedPartnerResourcesListResponse] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + resource_group_name=resource_group_name, + monitor_name=monitor_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ConnectedPartnerResourcesListResponse", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = 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) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/listConnectedPartnerResources" + } diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_create_and_associate_ip_filter_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_create_and_associate_ip_filter_operations.py index 2e77e0738887..a43b08d60fb1 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_create_and_associate_ip_filter_operations.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_create_and_associate_ip_filter_operations.py @@ -48,7 +48,7 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -58,7 +58,9 @@ def build_create_request( ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), "monitorName": _SERIALIZER.url("monitor_name", monitor_name, "str"), } @@ -166,8 +168,8 @@ def begin_create( Create and Associate IP 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 diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_create_and_associate_pl_filter_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_create_and_associate_pl_filter_operations.py index 61010dd5b257..81b6f078aca1 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_create_and_associate_pl_filter_operations.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_create_and_associate_pl_filter_operations.py @@ -49,7 +49,7 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -59,7 +59,9 @@ def build_create_request( ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), "monitorName": _SERIALIZER.url("monitor_name", monitor_name, "str"), } @@ -172,8 +174,8 @@ def begin_create( Create and Associate private link 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 diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_deployment_info_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_deployment_info_operations.py index c550079dba14..54550a641e35 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_deployment_info_operations.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_deployment_info_operations.py @@ -38,7 +38,7 @@ def build_list_request(resource_group_name: str, monitor_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -48,7 +48,9 @@ def build_list_request(resource_group_name: str, monitor_name: str, subscription ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), "monitorName": _SERIALIZER.url("monitor_name", monitor_name, "str"), } @@ -90,8 +92,8 @@ def list(self, resource_group_name: str, monitor_name: str, **kwargs: Any) -> _m Fetch information regarding Elastic cloud deployment corresponding to the Elastic monitor resource. - :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 diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_detach_and_delete_traffic_filter_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_detach_and_delete_traffic_filter_operations.py index 141ac6d0a687..a47f832bd5e8 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_detach_and_delete_traffic_filter_operations.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_detach_and_delete_traffic_filter_operations.py @@ -45,7 +45,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -55,7 +55,9 @@ def build_delete_request( ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), "monitorName": _SERIALIZER.url("monitor_name", monitor_name, "str"), } @@ -99,8 +101,8 @@ def delete( # pylint: disable=inconsistent-return-statements Detach and Delete traffic filter from 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 diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_detach_traffic_filter_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_detach_traffic_filter_operations.py index 4bbac697a4cb..0d2162527a30 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_detach_traffic_filter_operations.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_detach_traffic_filter_operations.py @@ -47,7 +47,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -57,7 +57,9 @@ def build_update_request( ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), "monitorName": _SERIALIZER.url("monitor_name", monitor_name, "str"), } @@ -152,8 +154,8 @@ def begin_update( Detach 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 diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_elastic_versions_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_elastic_versions_operations.py index a64062bb7e85..fd01bf54f83b 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_elastic_versions_operations.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_elastic_versions_operations.py @@ -40,7 +40,7 @@ def build_list_request(subscription_id: str, *, region: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_external_user_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_external_user_operations.py index 13aaee3c5836..1f661deeace2 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_external_user_operations.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_external_user_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -40,7 +41,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-07-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -51,7 +52,9 @@ def build_create_or_update_request( ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), "monitorName": _SERIALIZER.url("monitor_name", monitor_name, "str"), } @@ -103,8 +106,8 @@ def create_or_update( Create User inside elastic deployment which are used by customers to perform operations on the elastic 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 @@ -135,8 +138,8 @@ def create_or_update( Create User inside elastic deployment which are used by customers to perform operations on the elastic 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 @@ -165,8 +168,8 @@ def create_or_update( Create User inside elastic deployment which are used by customers to perform operations on the elastic 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 @@ -199,7 +202,7 @@ def create_or_update( content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_list_associated_traffic_filters_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_list_associated_traffic_filters_operations.py index 8455ed2d8eea..210e37fa23ad 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_list_associated_traffic_filters_operations.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_list_associated_traffic_filters_operations.py @@ -38,7 +38,7 @@ def build_list_request(resource_group_name: str, monitor_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -48,7 +48,9 @@ def build_list_request(resource_group_name: str, monitor_name: str, subscription ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), "monitorName": _SERIALIZER.url("monitor_name", monitor_name, "str"), } @@ -88,8 +90,8 @@ def list(self, resource_group_name: str, monitor_name: str, **kwargs: Any) -> _m Get the list of all associated traffic filters 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 diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_monitor_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_monitor_operations.py index c53c7ded4ea8..1c712957b26b 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_monitor_operations.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_monitor_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -42,7 +43,7 @@ def build_upgrade_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-07-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -53,7 +54,9 @@ def build_upgrade_request( ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), "monitorName": _SERIALIZER.url("monitor_name", monitor_name, "str"), } @@ -114,7 +117,7 @@ def _upgrade_initial( # pylint: disable=inconsistent-return-statements content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -172,8 +175,8 @@ def begin_upgrade( Upgradable version for a monitor resource. - :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 @@ -209,8 +212,8 @@ def begin_upgrade( Upgradable version for a monitor resource. - :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 @@ -244,8 +247,8 @@ def begin_upgrade( Upgradable version for a monitor resource. - :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 diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_monitored_resources_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_monitored_resources_operations.py index 81896222cd8c..df5d1daf72a4 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_monitored_resources_operations.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_monitored_resources_operations.py @@ -40,7 +40,7 @@ def build_list_request(resource_group_name: str, monitor_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -50,7 +50,9 @@ def build_list_request(resource_group_name: str, monitor_name: str, subscription ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), "monitorName": _SERIALIZER.url("monitor_name", monitor_name, "str"), } @@ -90,8 +92,8 @@ def list(self, resource_group_name: str, monitor_name: str, **kwargs: Any) -> It List the resources currently being monitored by the Elastic monitor resource. - :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 diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_monitors_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_monitors_operations.py index 58da5f864dae..0d67e535b479 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_monitors_operations.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_monitors_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -42,7 +43,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -66,7 +67,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -76,7 +77,9 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), } _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore @@ -94,7 +97,7 @@ def build_get_request(resource_group_name: str, monitor_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -104,7 +107,9 @@ def build_get_request(resource_group_name: str, monitor_name: str, subscription_ ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), "monitorName": _SERIALIZER.url("monitor_name", monitor_name, "str"), } @@ -125,7 +130,7 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-07-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -136,7 +141,9 @@ def build_create_request( ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), "monitorName": _SERIALIZER.url("monitor_name", monitor_name, "str"), } @@ -159,7 +166,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-07-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -170,7 +177,9 @@ def build_update_request( ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), "monitorName": _SERIALIZER.url("monitor_name", monitor_name, "str"), } @@ -193,7 +202,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -203,7 +212,9 @@ def build_delete_request( ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), "monitorName": _SERIALIZER.url("monitor_name", monitor_name, "str"), } @@ -331,8 +342,8 @@ def list_by_resource_group( List all monitors under the specified resource group. - :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 :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ElasticMonitorResource or the result of @@ -423,8 +434,8 @@ def get(self, resource_group_name: str, monitor_name: str, **kwargs: Any) -> _mo Get the properties of a specific monitor resource. - :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 @@ -509,7 +520,7 @@ def _create_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -575,8 +586,8 @@ def begin_create( Create a monitor resource. - :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 @@ -613,8 +624,8 @@ def begin_create( Create a monitor resource. - :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 @@ -649,8 +660,8 @@ def begin_create( Create a monitor resource. - :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 @@ -737,8 +748,8 @@ def update( Update a monitor resource. - :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 @@ -767,8 +778,8 @@ def update( Update a monitor resource. - :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 @@ -795,8 +806,8 @@ def update( Update a monitor resource. - :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 @@ -829,7 +840,7 @@ def update( content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -933,8 +944,8 @@ def begin_delete(self, resource_group_name: str, monitor_name: str, **kwargs: An Delete a monitor resource. - :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 diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_operations.py index dbb633cae84e..b925b4150f9f 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_operations.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_operations.py @@ -40,7 +40,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_organizations_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_organizations_operations.py index def6b8bfb7c7..40ae81ce6f3c 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_organizations_operations.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_organizations_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -38,7 +39,7 @@ def build_get_api_key_request(subscription_id: str, **kwargs: Any) -> HttpReques _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-07-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -63,6 +64,33 @@ def build_get_api_key_request(subscription_id: str, **kwargs: Any) -> HttpReques return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) +def build_get_elastic_to_azure_subscription_mapping_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-07-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/providers/Microsoft.Elastic/getElasticOrganizationToAzureSubscriptionMapping", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + class OrganizationsOperations: """ .. warning:: @@ -165,7 +193,7 @@ def get_api_key( content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -208,3 +236,65 @@ def get_api_key( return deserialized get_api_key.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Elastic/getOrganizationApiKey"} + + @distributed_trace + def get_elastic_to_azure_subscription_mapping( + self, **kwargs: Any + ) -> _models.ElasticOrganizationToAzureSubscriptionMappingResponse: + """Get Elastic Organization To Azure Subscription Mapping details for the logged-in user. + + Get Elastic Organization To Azure Subscription Mapping details for the logged-in user. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ElasticOrganizationToAzureSubscriptionMappingResponse or the result of cls(response) + :rtype: ~azure.mgmt.elastic.models.ElasticOrganizationToAzureSubscriptionMappingResponse + :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.ElasticOrganizationToAzureSubscriptionMappingResponse] = kwargs.pop("cls", None) + + request = build_get_elastic_to_azure_subscription_mapping_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get_elastic_to_azure_subscription_mapping.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = 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("ElasticOrganizationToAzureSubscriptionMappingResponse", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_elastic_to_azure_subscription_mapping.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Elastic/getElasticOrganizationToAzureSubscriptionMapping" + } diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_tag_rules_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_tag_rules_operations.py index 909cb38d4eef..826f17b5b1e7 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_tag_rules_operations.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_tag_rules_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -42,7 +43,7 @@ def build_list_request(resource_group_name: str, monitor_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -52,7 +53,9 @@ def build_list_request(resource_group_name: str, monitor_name: str, subscription ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), "monitorName": _SERIALIZER.url("monitor_name", monitor_name, "str"), } @@ -73,7 +76,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-07-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -84,7 +87,9 @@ def build_create_or_update_request( ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), "monitorName": _SERIALIZER.url("monitor_name", monitor_name, "str"), "ruleSetName": _SERIALIZER.url("rule_set_name", rule_set_name, "str"), } @@ -108,7 +113,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -118,7 +123,9 @@ def build_get_request( ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), "monitorName": _SERIALIZER.url("monitor_name", monitor_name, "str"), "ruleSetName": _SERIALIZER.url("rule_set_name", rule_set_name, "str"), } @@ -140,7 +147,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -150,7 +157,9 @@ def build_delete_request( ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), "monitorName": _SERIALIZER.url("monitor_name", monitor_name, "str"), "ruleSetName": _SERIALIZER.url("rule_set_name", rule_set_name, "str"), } @@ -193,8 +202,8 @@ def list( List the tag rules for a given monitor resource. - :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 @@ -296,8 +305,8 @@ def create_or_update( Create or update a tag rule set for a given monitor resource. - :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 @@ -329,8 +338,8 @@ def create_or_update( Create or update a tag rule set for a given monitor resource. - :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 @@ -360,8 +369,8 @@ def create_or_update( Create or update a tag rule set for a given monitor resource. - :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 @@ -396,7 +405,7 @@ def create_or_update( content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: @@ -453,8 +462,8 @@ def get( Get a tag rule set for a given monitor resource. - :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 @@ -576,8 +585,8 @@ def begin_delete( Delete a tag rule set for a given monitor resource. - :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 diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_traffic_filters_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_traffic_filters_operations.py index 10906efde353..b9b3b37c64e8 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_traffic_filters_operations.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_traffic_filters_operations.py @@ -45,7 +45,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -55,7 +55,9 @@ def build_delete_request( ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), "monitorName": _SERIALIZER.url("monitor_name", monitor_name, "str"), } @@ -99,8 +101,8 @@ def delete( # pylint: disable=inconsistent-return-statements Delete traffic filter from 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 diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_upgradable_versions_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_upgradable_versions_operations.py index 31b48571ba70..4a7d937912e2 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_upgradable_versions_operations.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_upgradable_versions_operations.py @@ -40,7 +40,7 @@ def build_details_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -50,7 +50,9 @@ def build_details_request( ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), "monitorName": _SERIALIZER.url("monitor_name", monitor_name, "str"), } @@ -90,8 +92,8 @@ def details(self, resource_group_name: str, monitor_name: str, **kwargs: Any) -> List of upgradable versions for a given monitor resource. - :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 diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_vm_collection_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_vm_collection_operations.py index 00c04f8cfaf2..124c04d2435b 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_vm_collection_operations.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_vm_collection_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -40,7 +41,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-07-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -51,7 +52,9 @@ def build_update_request( ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), "monitorName": _SERIALIZER.url("monitor_name", monitor_name, "str"), } @@ -101,8 +104,8 @@ def update( # pylint: disable=inconsistent-return-statements Update the vm details that will be monitored by the Elastic monitor resource. - :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 @@ -131,8 +134,8 @@ def update( # pylint: disable=inconsistent-return-statements Update the vm details that will be monitored by the Elastic monitor resource. - :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 @@ -159,8 +162,8 @@ def update( # pylint: disable=inconsistent-return-statements Update the vm details that will be monitored by the Elastic monitor resource. - :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 @@ -193,7 +196,7 @@ def update( # pylint: disable=inconsistent-return-statements content_type = content_type or "application/json" _json = None _content = None - if isinstance(body, (IO, bytes)): + if isinstance(body, (IOBase, bytes)): _content = body else: if body is not None: diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_vm_host_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_vm_host_operations.py index e30b3b0be992..82e3717a190d 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_vm_host_operations.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_vm_host_operations.py @@ -40,7 +40,7 @@ def build_list_request(resource_group_name: str, monitor_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -50,7 +50,9 @@ def build_list_request(resource_group_name: str, monitor_name: str, subscription ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), "monitorName": _SERIALIZER.url("monitor_name", monitor_name, "str"), } @@ -90,8 +92,8 @@ def list(self, resource_group_name: str, monitor_name: str, **kwargs: Any) -> It List the vm resources currently being monitored by the Elastic monitor resource. - :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 diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_vm_ingestion_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_vm_ingestion_operations.py index 25fe8184cbfb..10877a20fd02 100644 --- a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_vm_ingestion_operations.py +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_vm_ingestion_operations.py @@ -40,7 +40,7 @@ def build_details_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -50,7 +50,9 @@ def build_details_request( ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), "monitorName": _SERIALIZER.url("monitor_name", monitor_name, "str"), } @@ -90,8 +92,8 @@ def details(self, resource_group_name: str, monitor_name: str, **kwargs: Any) -> List the vm ingestion details that will be monitored by the Elastic monitor resource. - :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 diff --git a/sdk/elastic/azure-mgmt-elastic/generated_samples/all_traffic_filters_list.py b/sdk/elastic/azure-mgmt-elastic/generated_samples/all_traffic_filters_list.py index a42374ba3806..2014aad275b6 100644 --- a/sdk/elastic/azure-mgmt-elastic/generated_samples/all_traffic_filters_list.py +++ b/sdk/elastic/azure-mgmt-elastic/generated_samples/all_traffic_filters_list.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-02-01-preview/examples/AllTrafficFilters_list.json +# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-07-01-preview/examples/AllTrafficFilters_list.json if __name__ == "__main__": main() diff --git a/sdk/elastic/azure-mgmt-elastic/generated_samples/associate_traffic_filter_update.py b/sdk/elastic/azure-mgmt-elastic/generated_samples/associate_traffic_filter_update.py index 4ebfacddd958..a641bc13c456 100644 --- a/sdk/elastic/azure-mgmt-elastic/generated_samples/associate_traffic_filter_update.py +++ b/sdk/elastic/azure-mgmt-elastic/generated_samples/associate_traffic_filter_update.py @@ -29,13 +29,12 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.associate_traffic_filter.begin_associate( + client.associate_traffic_filter.begin_associate( resource_group_name="myResourceGroup", monitor_name="myMonitor", ).result() - print(response) -# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-02-01-preview/examples/AssociateTrafficFilter_Update.json +# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-07-01-preview/examples/AssociateTrafficFilter_Update.json if __name__ == "__main__": main() diff --git a/sdk/elastic/azure-mgmt-elastic/generated_samples/associated_filters_for_deployment_list.py b/sdk/elastic/azure-mgmt-elastic/generated_samples/associated_filters_for_deployment_list.py index 7fa71659b4f9..a6e7f07675fa 100644 --- a/sdk/elastic/azure-mgmt-elastic/generated_samples/associated_filters_for_deployment_list.py +++ b/sdk/elastic/azure-mgmt-elastic/generated_samples/associated_filters_for_deployment_list.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-02-01-preview/examples/AssociatedFiltersForDeployment_list.json +# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-07-01-preview/examples/AssociatedFiltersForDeployment_list.json if __name__ == "__main__": main() diff --git a/sdk/elastic/azure-mgmt-elastic/generated_samples/billing_info_get.py b/sdk/elastic/azure-mgmt-elastic/generated_samples/billing_info_get.py new file mode 100644 index 000000000000..1158d8b66e92 --- /dev/null +++ b/sdk/elastic/azure-mgmt-elastic/generated_samples/billing_info_get.py @@ -0,0 +1,41 @@ +# 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.identity import DefaultAzureCredential +from azure.mgmt.elastic import MicrosoftElastic + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-elastic +# USAGE + python billing_info_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = MicrosoftElastic( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.billing_info.get( + resource_group_name="myResourceGroup", + monitor_name="myMonitor", + ) + print(response) + + +# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-07-01-preview/examples/BillingInfo_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/elastic/azure-mgmt-elastic/generated_samples/connected_partner_resources_list.py b/sdk/elastic/azure-mgmt-elastic/generated_samples/connected_partner_resources_list.py new file mode 100644 index 000000000000..d37e9f6608d3 --- /dev/null +++ b/sdk/elastic/azure-mgmt-elastic/generated_samples/connected_partner_resources_list.py @@ -0,0 +1,42 @@ +# 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.identity import DefaultAzureCredential +from azure.mgmt.elastic import MicrosoftElastic + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-elastic +# USAGE + python connected_partner_resources_list.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = MicrosoftElastic( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.connected_partner_resources.list( + resource_group_name="myResourceGroup", + monitor_name="myMonitor", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-07-01-preview/examples/ConnectedPartnerResources_List.json +if __name__ == "__main__": + main() diff --git a/sdk/elastic/azure-mgmt-elastic/generated_samples/deployment_info_list.py b/sdk/elastic/azure-mgmt-elastic/generated_samples/deployment_info_list.py index f9f5471d191c..fbbc0d9da57d 100644 --- a/sdk/elastic/azure-mgmt-elastic/generated_samples/deployment_info_list.py +++ b/sdk/elastic/azure-mgmt-elastic/generated_samples/deployment_info_list.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-02-01-preview/examples/DeploymentInfo_List.json +# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-07-01-preview/examples/DeploymentInfo_List.json if __name__ == "__main__": main() diff --git a/sdk/elastic/azure-mgmt-elastic/generated_samples/detach_and_delete_traffic_filter_delete.py b/sdk/elastic/azure-mgmt-elastic/generated_samples/detach_and_delete_traffic_filter_delete.py index 37c3be96b736..e339c6b082b6 100644 --- a/sdk/elastic/azure-mgmt-elastic/generated_samples/detach_and_delete_traffic_filter_delete.py +++ b/sdk/elastic/azure-mgmt-elastic/generated_samples/detach_and_delete_traffic_filter_delete.py @@ -29,13 +29,12 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.detach_and_delete_traffic_filter.delete( + client.detach_and_delete_traffic_filter.delete( resource_group_name="myResourceGroup", monitor_name="myMonitor", ) - print(response) -# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-02-01-preview/examples/DetachAndDeleteTrafficFilter_Delete.json +# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-07-01-preview/examples/DetachAndDeleteTrafficFilter_Delete.json if __name__ == "__main__": main() diff --git a/sdk/elastic/azure-mgmt-elastic/generated_samples/detach_traffic_filters_update.py b/sdk/elastic/azure-mgmt-elastic/generated_samples/detach_traffic_filters_update.py index d1bc562e0155..f93681e729e4 100644 --- a/sdk/elastic/azure-mgmt-elastic/generated_samples/detach_traffic_filters_update.py +++ b/sdk/elastic/azure-mgmt-elastic/generated_samples/detach_traffic_filters_update.py @@ -29,13 +29,12 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.detach_traffic_filter.begin_update( + client.detach_traffic_filter.begin_update( resource_group_name="myResourceGroup", monitor_name="myMonitor", ).result() - print(response) -# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-02-01-preview/examples/DetachTrafficFilters_Update.json +# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-07-01-preview/examples/DetachTrafficFilters_Update.json if __name__ == "__main__": main() diff --git a/sdk/elastic/azure-mgmt-elastic/generated_samples/elastic_versions_list.py b/sdk/elastic/azure-mgmt-elastic/generated_samples/elastic_versions_list.py index d25c99d64273..5bb9281d74b7 100644 --- a/sdk/elastic/azure-mgmt-elastic/generated_samples/elastic_versions_list.py +++ b/sdk/elastic/azure-mgmt-elastic/generated_samples/elastic_versions_list.py @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-02-01-preview/examples/ElasticVersions_List.json +# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-07-01-preview/examples/ElasticVersions_List.json if __name__ == "__main__": main() diff --git a/sdk/elastic/azure-mgmt-elastic/generated_samples/external_user_info.py b/sdk/elastic/azure-mgmt-elastic/generated_samples/external_user_info.py index cb2d81d0f7a2..f216eb922480 100644 --- a/sdk/elastic/azure-mgmt-elastic/generated_samples/external_user_info.py +++ b/sdk/elastic/azure-mgmt-elastic/generated_samples/external_user_info.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-02-01-preview/examples/ExternalUserInfo.json +# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-07-01-preview/examples/ExternalUserInfo.json if __name__ == "__main__": main() diff --git a/sdk/elastic/azure-mgmt-elastic/generated_samples/ip_traffic_filter_create.py b/sdk/elastic/azure-mgmt-elastic/generated_samples/ip_traffic_filter_create.py index 7c9f06f5823c..8ad486ab9905 100644 --- a/sdk/elastic/azure-mgmt-elastic/generated_samples/ip_traffic_filter_create.py +++ b/sdk/elastic/azure-mgmt-elastic/generated_samples/ip_traffic_filter_create.py @@ -29,13 +29,12 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.create_and_associate_ip_filter.begin_create( + client.create_and_associate_ip_filter.begin_create( resource_group_name="myResourceGroup", monitor_name="myMonitor", ).result() - print(response) -# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-02-01-preview/examples/IPTrafficFilter_Create.json +# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-07-01-preview/examples/IPTrafficFilter_Create.json if __name__ == "__main__": main() diff --git a/sdk/elastic/azure-mgmt-elastic/generated_samples/monitor_upgrade.py b/sdk/elastic/azure-mgmt-elastic/generated_samples/monitor_upgrade.py index 03933d91bf37..d03f963822df 100644 --- a/sdk/elastic/azure-mgmt-elastic/generated_samples/monitor_upgrade.py +++ b/sdk/elastic/azure-mgmt-elastic/generated_samples/monitor_upgrade.py @@ -29,13 +29,12 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.monitor.begin_upgrade( + client.monitor.begin_upgrade( resource_group_name="myResourceGroup", monitor_name="myMonitor", ).result() - print(response) -# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-02-01-preview/examples/Monitor_Upgrade.json +# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-07-01-preview/examples/Monitor_Upgrade.json if __name__ == "__main__": main() diff --git a/sdk/elastic/azure-mgmt-elastic/generated_samples/monitored_resources_list.py b/sdk/elastic/azure-mgmt-elastic/generated_samples/monitored_resources_list.py index 34c42022dd53..44f11d854c0e 100644 --- a/sdk/elastic/azure-mgmt-elastic/generated_samples/monitored_resources_list.py +++ b/sdk/elastic/azure-mgmt-elastic/generated_samples/monitored_resources_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-02-01-preview/examples/MonitoredResources_List.json +# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-07-01-preview/examples/MonitoredResources_List.json if __name__ == "__main__": main() diff --git a/sdk/elastic/azure-mgmt-elastic/generated_samples/monitors_create.py b/sdk/elastic/azure-mgmt-elastic/generated_samples/monitors_create.py index 97bec945a017..5a18dbec9681 100644 --- a/sdk/elastic/azure-mgmt-elastic/generated_samples/monitors_create.py +++ b/sdk/elastic/azure-mgmt-elastic/generated_samples/monitors_create.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-02-01-preview/examples/Monitors_Create.json +# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-07-01-preview/examples/Monitors_Create.json if __name__ == "__main__": main() diff --git a/sdk/elastic/azure-mgmt-elastic/generated_samples/monitors_delete.py b/sdk/elastic/azure-mgmt-elastic/generated_samples/monitors_delete.py index e618dbfeb7b3..43fe06dea882 100644 --- a/sdk/elastic/azure-mgmt-elastic/generated_samples/monitors_delete.py +++ b/sdk/elastic/azure-mgmt-elastic/generated_samples/monitors_delete.py @@ -29,13 +29,12 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.monitors.begin_delete( + client.monitors.begin_delete( resource_group_name="myResourceGroup", monitor_name="myMonitor", ).result() - print(response) -# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-02-01-preview/examples/Monitors_Delete.json +# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-07-01-preview/examples/Monitors_Delete.json if __name__ == "__main__": main() diff --git a/sdk/elastic/azure-mgmt-elastic/generated_samples/monitors_get.py b/sdk/elastic/azure-mgmt-elastic/generated_samples/monitors_get.py index 2374996c0997..5b51c2a17da7 100644 --- a/sdk/elastic/azure-mgmt-elastic/generated_samples/monitors_get.py +++ b/sdk/elastic/azure-mgmt-elastic/generated_samples/monitors_get.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-02-01-preview/examples/Monitors_Get.json +# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-07-01-preview/examples/Monitors_Get.json if __name__ == "__main__": main() diff --git a/sdk/elastic/azure-mgmt-elastic/generated_samples/monitors_list.py b/sdk/elastic/azure-mgmt-elastic/generated_samples/monitors_list.py index 780a08c79273..90b972c89c8b 100644 --- a/sdk/elastic/azure-mgmt-elastic/generated_samples/monitors_list.py +++ b/sdk/elastic/azure-mgmt-elastic/generated_samples/monitors_list.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-02-01-preview/examples/Monitors_List.json +# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-07-01-preview/examples/Monitors_List.json if __name__ == "__main__": main() diff --git a/sdk/elastic/azure-mgmt-elastic/generated_samples/monitors_list_by_resource_group.py b/sdk/elastic/azure-mgmt-elastic/generated_samples/monitors_list_by_resource_group.py index 4263efcf6b3c..a56f7673d3a6 100644 --- a/sdk/elastic/azure-mgmt-elastic/generated_samples/monitors_list_by_resource_group.py +++ b/sdk/elastic/azure-mgmt-elastic/generated_samples/monitors_list_by_resource_group.py @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-02-01-preview/examples/Monitors_ListByResourceGroup.json +# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-07-01-preview/examples/Monitors_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/elastic/azure-mgmt-elastic/generated_samples/monitors_update.py b/sdk/elastic/azure-mgmt-elastic/generated_samples/monitors_update.py index 45f443cf06b8..b8371e67c090 100644 --- a/sdk/elastic/azure-mgmt-elastic/generated_samples/monitors_update.py +++ b/sdk/elastic/azure-mgmt-elastic/generated_samples/monitors_update.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-02-01-preview/examples/Monitors_Update.json +# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-07-01-preview/examples/Monitors_Update.json if __name__ == "__main__": main() diff --git a/sdk/elastic/azure-mgmt-elastic/generated_samples/operations_list.py b/sdk/elastic/azure-mgmt-elastic/generated_samples/operations_list.py index 789d816651c8..fe64868c16c3 100644 --- a/sdk/elastic/azure-mgmt-elastic/generated_samples/operations_list.py +++ b/sdk/elastic/azure-mgmt-elastic/generated_samples/operations_list.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-02-01-preview/examples/Operations_List.json +# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-07-01-preview/examples/Operations_List.json if __name__ == "__main__": main() diff --git a/sdk/elastic/azure-mgmt-elastic/generated_samples/organizations_get_api_key.py b/sdk/elastic/azure-mgmt-elastic/generated_samples/organizations_get_api_key.py index c890fc4eea4f..3dd7817d7941 100644 --- a/sdk/elastic/azure-mgmt-elastic/generated_samples/organizations_get_api_key.py +++ b/sdk/elastic/azure-mgmt-elastic/generated_samples/organizations_get_api_key.py @@ -33,6 +33,6 @@ def main(): print(response) -# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-02-01-preview/examples/Organizations_GetApiKey.json +# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-07-01-preview/examples/Organizations_GetApiKey.json if __name__ == "__main__": main() diff --git a/sdk/elastic/azure-mgmt-elastic/generated_samples/organizations_get_elastic_to_azure_subscription_mapping.py b/sdk/elastic/azure-mgmt-elastic/generated_samples/organizations_get_elastic_to_azure_subscription_mapping.py new file mode 100644 index 000000000000..a1ee794a3723 --- /dev/null +++ b/sdk/elastic/azure-mgmt-elastic/generated_samples/organizations_get_elastic_to_azure_subscription_mapping.py @@ -0,0 +1,38 @@ +# 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.identity import DefaultAzureCredential +from azure.mgmt.elastic import MicrosoftElastic + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-elastic +# USAGE + python organizations_get_elastic_to_azure_subscription_mapping.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = MicrosoftElastic( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.organizations.get_elastic_to_azure_subscription_mapping() + print(response) + + +# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-07-01-preview/examples/Organizations_GetElasticToAzureSubscriptionMapping.json +if __name__ == "__main__": + main() diff --git a/sdk/elastic/azure-mgmt-elastic/generated_samples/private_link_traffic_filters_create.py b/sdk/elastic/azure-mgmt-elastic/generated_samples/private_link_traffic_filters_create.py index 6fc1a55f2f98..76513ca4f2b7 100644 --- a/sdk/elastic/azure-mgmt-elastic/generated_samples/private_link_traffic_filters_create.py +++ b/sdk/elastic/azure-mgmt-elastic/generated_samples/private_link_traffic_filters_create.py @@ -29,13 +29,12 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.create_and_associate_pl_filter.begin_create( + client.create_and_associate_pl_filter.begin_create( resource_group_name="myResourceGroup", monitor_name="myMonitor", ).result() - print(response) -# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-02-01-preview/examples/PrivateLinkTrafficFilters_Create.json +# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-07-01-preview/examples/PrivateLinkTrafficFilters_Create.json if __name__ == "__main__": main() diff --git a/sdk/elastic/azure-mgmt-elastic/generated_samples/tag_rules_create_or_update.py b/sdk/elastic/azure-mgmt-elastic/generated_samples/tag_rules_create_or_update.py index f16175babc31..9980b629efeb 100644 --- a/sdk/elastic/azure-mgmt-elastic/generated_samples/tag_rules_create_or_update.py +++ b/sdk/elastic/azure-mgmt-elastic/generated_samples/tag_rules_create_or_update.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-02-01-preview/examples/TagRules_CreateOrUpdate.json +# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-07-01-preview/examples/TagRules_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/elastic/azure-mgmt-elastic/generated_samples/tag_rules_delete.py b/sdk/elastic/azure-mgmt-elastic/generated_samples/tag_rules_delete.py index 07be4c529575..b98dfa370968 100644 --- a/sdk/elastic/azure-mgmt-elastic/generated_samples/tag_rules_delete.py +++ b/sdk/elastic/azure-mgmt-elastic/generated_samples/tag_rules_delete.py @@ -29,14 +29,13 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.tag_rules.begin_delete( + client.tag_rules.begin_delete( resource_group_name="myResourceGroup", monitor_name="myMonitor", rule_set_name="default", ).result() - print(response) -# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-02-01-preview/examples/TagRules_Delete.json +# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-07-01-preview/examples/TagRules_Delete.json if __name__ == "__main__": main() diff --git a/sdk/elastic/azure-mgmt-elastic/generated_samples/tag_rules_get.py b/sdk/elastic/azure-mgmt-elastic/generated_samples/tag_rules_get.py index ac3e4b327080..7cfb0127c674 100644 --- a/sdk/elastic/azure-mgmt-elastic/generated_samples/tag_rules_get.py +++ b/sdk/elastic/azure-mgmt-elastic/generated_samples/tag_rules_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-02-01-preview/examples/TagRules_Get.json +# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-07-01-preview/examples/TagRules_Get.json if __name__ == "__main__": main() diff --git a/sdk/elastic/azure-mgmt-elastic/generated_samples/tag_rules_list.py b/sdk/elastic/azure-mgmt-elastic/generated_samples/tag_rules_list.py index 4635af09ee15..597e80191f90 100644 --- a/sdk/elastic/azure-mgmt-elastic/generated_samples/tag_rules_list.py +++ b/sdk/elastic/azure-mgmt-elastic/generated_samples/tag_rules_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-02-01-preview/examples/TagRules_List.json +# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-07-01-preview/examples/TagRules_List.json if __name__ == "__main__": main() diff --git a/sdk/elastic/azure-mgmt-elastic/generated_samples/traffic_filters_delete.py b/sdk/elastic/azure-mgmt-elastic/generated_samples/traffic_filters_delete.py index 12d2890ec1b8..ca888f9c09b9 100644 --- a/sdk/elastic/azure-mgmt-elastic/generated_samples/traffic_filters_delete.py +++ b/sdk/elastic/azure-mgmt-elastic/generated_samples/traffic_filters_delete.py @@ -29,13 +29,12 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.traffic_filters.delete( + client.traffic_filters.delete( resource_group_name="myResourceGroup", monitor_name="myMonitor", ) - print(response) -# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-02-01-preview/examples/TrafficFilters_Delete.json +# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-07-01-preview/examples/TrafficFilters_Delete.json if __name__ == "__main__": main() diff --git a/sdk/elastic/azure-mgmt-elastic/generated_samples/upgradable_versions_details.py b/sdk/elastic/azure-mgmt-elastic/generated_samples/upgradable_versions_details.py index 9760ac3fc9ad..c645c0846bad 100644 --- a/sdk/elastic/azure-mgmt-elastic/generated_samples/upgradable_versions_details.py +++ b/sdk/elastic/azure-mgmt-elastic/generated_samples/upgradable_versions_details.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-02-01-preview/examples/UpgradableVersions_Details.json +# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-07-01-preview/examples/UpgradableVersions_Details.json if __name__ == "__main__": main() diff --git a/sdk/elastic/azure-mgmt-elastic/generated_samples/vm_collection_update.py b/sdk/elastic/azure-mgmt-elastic/generated_samples/vm_collection_update.py index 46d2923474a9..57505ee3654c 100644 --- a/sdk/elastic/azure-mgmt-elastic/generated_samples/vm_collection_update.py +++ b/sdk/elastic/azure-mgmt-elastic/generated_samples/vm_collection_update.py @@ -29,13 +29,12 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.vm_collection.update( + client.vm_collection.update( resource_group_name="myResourceGroup", monitor_name="myMonitor", ) - print(response) -# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-02-01-preview/examples/VMCollection_Update.json +# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-07-01-preview/examples/VMCollection_Update.json if __name__ == "__main__": main() diff --git a/sdk/elastic/azure-mgmt-elastic/generated_samples/vm_host_list.py b/sdk/elastic/azure-mgmt-elastic/generated_samples/vm_host_list.py index 377cd922c9c5..84e896752965 100644 --- a/sdk/elastic/azure-mgmt-elastic/generated_samples/vm_host_list.py +++ b/sdk/elastic/azure-mgmt-elastic/generated_samples/vm_host_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-02-01-preview/examples/VMHost_List.json +# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-07-01-preview/examples/VMHost_List.json if __name__ == "__main__": main() diff --git a/sdk/elastic/azure-mgmt-elastic/generated_samples/vm_ingestion_details.py b/sdk/elastic/azure-mgmt-elastic/generated_samples/vm_ingestion_details.py index 88b44f9d902e..95d4c0bf2709 100644 --- a/sdk/elastic/azure-mgmt-elastic/generated_samples/vm_ingestion_details.py +++ b/sdk/elastic/azure-mgmt-elastic/generated_samples/vm_ingestion_details.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-02-01-preview/examples/VMIngestion_Details.json +# x-ms-original-file: specification/elastic/resource-manager/Microsoft.Elastic/preview/2023-07-01-preview/examples/VMIngestion_Details.json if __name__ == "__main__": main()