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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/elastic/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
Release History
===============

1.0.0b5
++++++
* Bump up `elastic` API version to `2025-06-01`

1.0.0b4
++++++
* Update the CLI command documentation
Expand Down
1 change: 1 addition & 0 deletions src/elastic/azext_elastic/aaz/latest/elastic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
# flake8: noqa

from .__cmd_group import *
from ._get_elastic_organization_to_azure_subscription_mapping import *
from ._get_organization_api_key import *
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
# --------------------------------------------------------------------------------------------
# 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 aaz-dev-tools
# --------------------------------------------------------------------------------------------

# pylint: skip-file
# flake8: noqa

from azure.cli.core.aaz import *


@register_command(
"elastic get-elastic-organization-to-azure-subscription-mapping",
)
class GetElasticOrganizationToAzureSubscriptionMapping(AAZCommand):
"""Retrieve mapping details between the Elastic Organization and Azure Subscription for the logged-in user.

:example: Organizations_GetElasticToAzureSubscriptionMapping
az elastic get-elastic-organization-to-azure-subscription-mapping
"""

_aaz_info = {
"version": "2025-06-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/providers/microsoft.elastic/getelasticorganizationtoazuresubscriptionmapping", "2025-06-01"],
]
}

def _handler(self, command_args):
super()._handler(command_args)
self._execute_operations()
return self._output()

_args_schema = None

@classmethod
def _build_arguments_schema(cls, *args, **kwargs):
if cls._args_schema is not None:
return cls._args_schema
cls._args_schema = super()._build_arguments_schema(*args, **kwargs)

# define Arg Group ""
return cls._args_schema

def _execute_operations(self):
self.pre_operations()
self.OrganizationsGetElasticToAzureSubscriptionMapping(ctx=self.ctx)()
self.post_operations()

@register_callback
def pre_operations(self):
pass

@register_callback
def post_operations(self):
pass

def _output(self, *args, **kwargs):
result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False)
return result

class OrganizationsGetElasticToAzureSubscriptionMapping(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"

def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(request=request, stream=False, **kwargs)
if session.http_response.status_code in [200]:
return self.on_200(session)

return self.on_error(session.http_response)

@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/providers/Microsoft.Elastic/getElasticOrganizationToAzureSubscriptionMapping",
**self.url_parameters
)

@property
def method(self):
return "POST"

@property
def error_format(self):
return "ODataV4Format"

@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters

@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2025-06-01",
required=True,
),
}
return parameters

@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters

def on_200(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200
)

_schema_on_200 = None

@classmethod
def _build_schema_on_200(cls):
if cls._schema_on_200 is not None:
return cls._schema_on_200

cls._schema_on_200 = AAZObjectType()

_schema_on_200 = cls._schema_on_200
_schema_on_200.properties = AAZObjectType()

properties = cls._schema_on_200.properties
properties.billed_azure_subscription_id = AAZStrType(
serialized_name="billedAzureSubscriptionId",
)
properties.elastic_organization_id = AAZStrType(
serialized_name="elasticOrganizationId",
)
properties.elastic_organization_name = AAZStrType(
serialized_name="elasticOrganizationName",
)
properties.marketplace_saas_info = AAZObjectType(
serialized_name="marketplaceSaasInfo",
flags={"read_only": True},
)

marketplace_saas_info = cls._schema_on_200.properties.marketplace_saas_info
marketplace_saas_info.billed_azure_subscription_id = AAZStrType(
serialized_name="billedAzureSubscriptionId",
)
marketplace_saas_info.marketplace_name = AAZStrType(
serialized_name="marketplaceName",
)
marketplace_saas_info.marketplace_resource_id = AAZStrType(
serialized_name="marketplaceResourceId",
)
marketplace_saas_info.marketplace_status = AAZStrType(
serialized_name="marketplaceStatus",
)
marketplace_saas_info.marketplace_subscription = AAZObjectType(
serialized_name="marketplaceSubscription",
)
marketplace_saas_info.subscribed = AAZBoolType()

marketplace_subscription = cls._schema_on_200.properties.marketplace_saas_info.marketplace_subscription
marketplace_subscription.id = AAZStrType()
marketplace_subscription.offer_id = AAZStrType(
serialized_name="offerId",
)
marketplace_subscription.publisher_id = AAZStrType(
serialized_name="publisherId",
)

return cls._schema_on_200


class _GetElasticOrganizationToAzureSubscriptionMappingHelper:
"""Helper class for GetElasticOrganizationToAzureSubscriptionMapping"""


__all__ = ["GetElasticOrganizationToAzureSubscriptionMapping"]
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
class GetOrganizationApiKey(AAZCommand):
"""Fetch the User API Key from the internal database, if it was generated and stored during the creation of the Elasticsearch Organization.

:example: Get organization api key
az elastic get-organization-api-key --email-id id
:example: Organizations_GetApiKey
az elastic get-organization-api-key
"""

_aaz_info = {
"version": "2024-06-15-preview",
"version": "2025-06-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/providers/microsoft.elastic/getorganizationapikey", "2024-06-15-preview"],
["mgmt-plane", "/subscriptions/{}/providers/microsoft.elastic/getorganizationapikey", "2025-06-01"],
]
}

Expand Down Expand Up @@ -110,7 +110,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-06-15-preview",
"api-version", "2025-06-01",
required=True,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"elastic elastic-version",
)
class __CMDGroup(AAZCommandGroup):
"""Retrieve a list of all available Elastic versions for a specified region, helping you choose the best version for your deployment.
"""Manage the version of Elastic, including upgrades and compatibility checks.
"""
pass

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
"elastic elastic-version list",
)
class List(AAZCommand):
"""List a list of available versions for a region.
"""List a list of all available Elastic versions for a specified region, helping you choose the best version for your deployment.

:example: ElasticVersions_List
az elastic elastic-version list --region myregion
"""

_aaz_info = {
"version": "2024-06-15-preview",
"version": "2025-06-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/providers/microsoft.elastic/elasticversions", "2024-06-15-preview"],
["mgmt-plane", "/subscriptions/{}/providers/microsoft.elastic/elasticversions", "2025-06-01"],
]
}

Expand Down Expand Up @@ -114,7 +114,7 @@ def query_parameters(self):
required=True,
),
**self.serialize_query_param(
"api-version", "2024-06-15-preview",
"api-version", "2025-06-01",
required=True,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@
from ._list_associated_traffic_filter import *
from ._list_connected_partner_resource import *
from ._list_deployment_info import *
from ._list_monitored_resource import *
from ._list_resource import *
from ._list_upgradable_version import *
from ._list_vm_host import *
from ._show import *
from ._update import *
from ._update_vm_collection import *
from ._upgrade import *
from ._vm_collection_update import *
from ._vm_ingestion_detail import *
from ._wait import *
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,22 @@
class AssociateTrafficFilter(AAZCommand):
"""Associate a traffic filter with your Elastic monitor resource to control and manage network traffic.

:example: Monitor associate traffic filter
az elastic monitor associate-traffic-filter --monitor-name name -g rg --ruleset-id
:example: AssociateTrafficFilter_Associate
az elastic monitor associate-traffic-filter --resource-group myResourceGroup --monitor-name myMonitor --ruleset-id 31d91b5afb6f4c2eaaf104c97b1991dd
"""

_aaz_info = {
"version": "2024-06-15-preview",
"version": "2025-06-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.elastic/monitors/{}/associatetrafficfilter", "2024-06-15-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.elastic/monitors/{}/associatetrafficfilter", "2025-06-01"],
]
}

AZ_SUPPORT_NO_WAIT = True

def _handler(self, command_args):
super()._handler(command_args)
self._execute_operations()
return None
return self.build_lro_poller(self._execute_operations, None)

_args_schema = None

Expand Down Expand Up @@ -135,7 +134,7 @@ def query_parameters(self):
"rulesetId", self.ctx.args.ruleset_id,
),
**self.serialize_query_param(
"api-version", "2024-06-15-preview",
"api-version", "2025-06-01",
required=True,
),
}
Expand Down
Loading
Loading