Skip to content

Commit 3790712

Browse files
committed
CLI Refresh for Elastic
1 parent dbe4e9b commit 3790712

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1691
-897
lines changed

src/elastic/azext_elastic/aaz/latest/elastic/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@
99
# flake8: noqa
1010

1111
from .__cmd_group import *
12+
from ._get_elastic_organization_to_azure_subscription_mapping import *
1213
from ._get_organization_api_key import *
Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
# --------------------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
#
5+
# Code generated by aaz-dev-tools
6+
# --------------------------------------------------------------------------------------------
7+
8+
# pylint: skip-file
9+
# flake8: noqa
10+
11+
from azure.cli.core.aaz import *
12+
13+
14+
@register_command(
15+
"elastic get-elastic-organization-to-azure-subscription-mapping",
16+
)
17+
class GetElasticOrganizationToAzureSubscriptionMapping(AAZCommand):
18+
"""Retrieve mapping details between the Elastic Organization and Azure Subscription for the logged-in user.
19+
20+
:example: Organizations_GetElasticToAzureSubscriptionMapping
21+
az elastic get-elastic-organization-to-azure-subscription-mapping
22+
"""
23+
24+
_aaz_info = {
25+
"version": "2025-06-01",
26+
"resources": [
27+
["mgmt-plane", "/subscriptions/{}/providers/microsoft.elastic/getelasticorganizationtoazuresubscriptionmapping", "2025-06-01"],
28+
]
29+
}
30+
31+
def _handler(self, command_args):
32+
super()._handler(command_args)
33+
self._execute_operations()
34+
return self._output()
35+
36+
_args_schema = None
37+
38+
@classmethod
39+
def _build_arguments_schema(cls, *args, **kwargs):
40+
if cls._args_schema is not None:
41+
return cls._args_schema
42+
cls._args_schema = super()._build_arguments_schema(*args, **kwargs)
43+
44+
# define Arg Group ""
45+
return cls._args_schema
46+
47+
def _execute_operations(self):
48+
self.pre_operations()
49+
self.OrganizationsGetElasticToAzureSubscriptionMapping(ctx=self.ctx)()
50+
self.post_operations()
51+
52+
@register_callback
53+
def pre_operations(self):
54+
pass
55+
56+
@register_callback
57+
def post_operations(self):
58+
pass
59+
60+
def _output(self, *args, **kwargs):
61+
result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False)
62+
return result
63+
64+
class OrganizationsGetElasticToAzureSubscriptionMapping(AAZHttpOperation):
65+
CLIENT_TYPE = "MgmtClient"
66+
67+
def __call__(self, *args, **kwargs):
68+
request = self.make_request()
69+
session = self.client.send_request(request=request, stream=False, **kwargs)
70+
if session.http_response.status_code in [200]:
71+
return self.on_200(session)
72+
73+
return self.on_error(session.http_response)
74+
75+
@property
76+
def url(self):
77+
return self.client.format_url(
78+
"/subscriptions/{subscriptionId}/providers/Microsoft.Elastic/getElasticOrganizationToAzureSubscriptionMapping",
79+
**self.url_parameters
80+
)
81+
82+
@property
83+
def method(self):
84+
return "POST"
85+
86+
@property
87+
def error_format(self):
88+
return "ODataV4Format"
89+
90+
@property
91+
def url_parameters(self):
92+
parameters = {
93+
**self.serialize_url_param(
94+
"subscriptionId", self.ctx.subscription_id,
95+
required=True,
96+
),
97+
}
98+
return parameters
99+
100+
@property
101+
def query_parameters(self):
102+
parameters = {
103+
**self.serialize_query_param(
104+
"api-version", "2025-06-01",
105+
required=True,
106+
),
107+
}
108+
return parameters
109+
110+
@property
111+
def header_parameters(self):
112+
parameters = {
113+
**self.serialize_header_param(
114+
"Accept", "application/json",
115+
),
116+
}
117+
return parameters
118+
119+
def on_200(self, session):
120+
data = self.deserialize_http_content(session)
121+
self.ctx.set_var(
122+
"instance",
123+
data,
124+
schema_builder=self._build_schema_on_200
125+
)
126+
127+
_schema_on_200 = None
128+
129+
@classmethod
130+
def _build_schema_on_200(cls):
131+
if cls._schema_on_200 is not None:
132+
return cls._schema_on_200
133+
134+
cls._schema_on_200 = AAZObjectType()
135+
136+
_schema_on_200 = cls._schema_on_200
137+
_schema_on_200.properties = AAZObjectType()
138+
139+
properties = cls._schema_on_200.properties
140+
properties.billed_azure_subscription_id = AAZStrType(
141+
serialized_name="billedAzureSubscriptionId",
142+
)
143+
properties.elastic_organization_id = AAZStrType(
144+
serialized_name="elasticOrganizationId",
145+
)
146+
properties.elastic_organization_name = AAZStrType(
147+
serialized_name="elasticOrganizationName",
148+
)
149+
properties.marketplace_saas_info = AAZObjectType(
150+
serialized_name="marketplaceSaasInfo",
151+
flags={"read_only": True},
152+
)
153+
154+
marketplace_saas_info = cls._schema_on_200.properties.marketplace_saas_info
155+
marketplace_saas_info.billed_azure_subscription_id = AAZStrType(
156+
serialized_name="billedAzureSubscriptionId",
157+
)
158+
marketplace_saas_info.marketplace_name = AAZStrType(
159+
serialized_name="marketplaceName",
160+
)
161+
marketplace_saas_info.marketplace_resource_id = AAZStrType(
162+
serialized_name="marketplaceResourceId",
163+
)
164+
marketplace_saas_info.marketplace_status = AAZStrType(
165+
serialized_name="marketplaceStatus",
166+
)
167+
marketplace_saas_info.marketplace_subscription = AAZObjectType(
168+
serialized_name="marketplaceSubscription",
169+
)
170+
marketplace_saas_info.subscribed = AAZBoolType()
171+
172+
marketplace_subscription = cls._schema_on_200.properties.marketplace_saas_info.marketplace_subscription
173+
marketplace_subscription.id = AAZStrType()
174+
marketplace_subscription.offer_id = AAZStrType(
175+
serialized_name="offerId",
176+
)
177+
marketplace_subscription.publisher_id = AAZStrType(
178+
serialized_name="publisherId",
179+
)
180+
181+
return cls._schema_on_200
182+
183+
184+
class _GetElasticOrganizationToAzureSubscriptionMappingHelper:
185+
"""Helper class for GetElasticOrganizationToAzureSubscriptionMapping"""
186+
187+
188+
__all__ = ["GetElasticOrganizationToAzureSubscriptionMapping"]

src/elastic/azext_elastic/aaz/latest/elastic/_get_organization_api_key.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
class GetOrganizationApiKey(AAZCommand):
1818
"""Fetch the User API Key from the internal database, if it was generated and stored during the creation of the Elasticsearch Organization.
1919
20-
:example: Get organization api key
21-
az elastic get-organization-api-key --email-id id
20+
:example: Organizations_GetApiKey
21+
az elastic get-organization-api-key
2222
"""
2323

2424
_aaz_info = {
25-
"version": "2024-06-15-preview",
25+
"version": "2025-06-01",
2626
"resources": [
27-
["mgmt-plane", "/subscriptions/{}/providers/microsoft.elastic/getorganizationapikey", "2024-06-15-preview"],
27+
["mgmt-plane", "/subscriptions/{}/providers/microsoft.elastic/getorganizationapikey", "2025-06-01"],
2828
]
2929
}
3030

@@ -110,7 +110,7 @@ def url_parameters(self):
110110
def query_parameters(self):
111111
parameters = {
112112
**self.serialize_query_param(
113-
"api-version", "2024-06-15-preview",
113+
"api-version", "2025-06-01",
114114
required=True,
115115
),
116116
}

src/elastic/azext_elastic/aaz/latest/elastic/elastic_version/__cmd_group.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"elastic elastic-version",
1616
)
1717
class __CMDGroup(AAZCommandGroup):
18-
"""Retrieve a list of all available Elastic versions for a specified region, helping you choose the best version for your deployment.
18+
"""Manage the version of Elastic, including upgrades and compatibility checks.
1919
"""
2020
pass
2121

src/elastic/azext_elastic/aaz/latest/elastic/elastic_version/_list.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@
1515
"elastic elastic-version list",
1616
)
1717
class List(AAZCommand):
18-
"""List a list of available versions for a region.
18+
"""List a list of all available Elastic versions for a specified region, helping you choose the best version for your deployment.
1919
2020
:example: ElasticVersions_List
2121
az elastic elastic-version list --region myregion
2222
"""
2323

2424
_aaz_info = {
25-
"version": "2024-06-15-preview",
25+
"version": "2025-06-01",
2626
"resources": [
27-
["mgmt-plane", "/subscriptions/{}/providers/microsoft.elastic/elasticversions", "2024-06-15-preview"],
27+
["mgmt-plane", "/subscriptions/{}/providers/microsoft.elastic/elasticversions", "2025-06-01"],
2828
]
2929
}
3030

@@ -114,7 +114,7 @@ def query_parameters(self):
114114
required=True,
115115
),
116116
**self.serialize_query_param(
117-
"api-version", "2024-06-15-preview",
117+
"api-version", "2025-06-01",
118118
required=True,
119119
),
120120
}

src/elastic/azext_elastic/aaz/latest/elastic/monitor/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,14 @@
2424
from ._list_associated_traffic_filter import *
2525
from ._list_connected_partner_resource import *
2626
from ._list_deployment_info import *
27+
from ._list_monitored_resource import *
2728
from ._list_resource import *
2829
from ._list_upgradable_version import *
2930
from ._list_vm_host import *
3031
from ._show import *
3132
from ._update import *
3233
from ._update_vm_collection import *
3334
from ._upgrade import *
35+
from ._vm_collection_update import *
3436
from ._vm_ingestion_detail import *
3537
from ._wait import *

src/elastic/azext_elastic/aaz/latest/elastic/monitor/_associate_traffic_filter.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,22 @@
1717
class AssociateTrafficFilter(AAZCommand):
1818
"""Associate a traffic filter with your Elastic monitor resource to control and manage network traffic.
1919
20-
:example: Monitor associate traffic filter
21-
az elastic monitor associate-traffic-filter --monitor-name name -g rg --ruleset-id
20+
:example: AssociateTrafficFilter_Associate
21+
az elastic monitor associate-traffic-filter --resource-group myResourceGroup --monitor-name myMonitor --ruleset-id 31d91b5afb6f4c2eaaf104c97b1991dd
2222
"""
2323

2424
_aaz_info = {
25-
"version": "2024-06-15-preview",
25+
"version": "2025-06-01",
2626
"resources": [
27-
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.elastic/monitors/{}/associatetrafficfilter", "2024-06-15-preview"],
27+
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.elastic/monitors/{}/associatetrafficfilter", "2025-06-01"],
2828
]
2929
}
3030

3131
AZ_SUPPORT_NO_WAIT = True
3232

3333
def _handler(self, command_args):
3434
super()._handler(command_args)
35-
self._execute_operations()
36-
return None
35+
return self.build_lro_poller(self._execute_operations, None)
3736

3837
_args_schema = None
3938

@@ -135,7 +134,7 @@ def query_parameters(self):
135134
"rulesetId", self.ctx.args.ruleset_id,
136135
),
137136
**self.serialize_query_param(
138-
"api-version", "2024-06-15-preview",
137+
"api-version", "2025-06-01",
139138
required=True,
140139
),
141140
}

0 commit comments

Comments
 (0)