Skip to content

Commit 8bcf24e

Browse files
authored
[Monitor] az monitor log-analytics: Update api-version to 2025-02-01 for cluster and workspace and add new commands failover/failback (#31385)
1 parent 881d4c2 commit 8bcf24e

62 files changed

Lines changed: 24745 additions & 14690 deletions

File tree

Some content is hidden

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

src/azure-cli/azure/cli/command_modules/acr/tests/latest/recordings/test_acr_create_with_audits.yaml

Lines changed: 153 additions & 47 deletions
Large diffs are not rendered by default.

src/azure-cli/azure/cli/command_modules/containerapp/tests/latest/recordings/test_containerapp_get_customdomainverificationid_e2e.yaml

Lines changed: 688 additions & 2194 deletions
Large diffs are not rendered by default.

src/azure-cli/azure/cli/command_modules/monitor/aaz/latest/monitor/log_analytics/cluster/_create.py

Lines changed: 75 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ class Create(AAZCommand):
2222
"""
2323

2424
_aaz_info = {
25-
"version": "2022-10-01",
25+
"version": "2025-02-01",
2626
"resources": [
27-
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.operationalinsights/clusters/{}", "2022-10-01"],
27+
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.operationalinsights/clusters/{}", "2025-02-01"],
2828
]
2929
}
3030

@@ -63,7 +63,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
6363

6464
_args_schema = cls._args_schema
6565
_args_schema.identity_type = AAZStrArg(
66-
options=["--identity-type"],
66+
options=["--type", "--identity-type"],
6767
arg_group="Identity",
6868
help="Type of managed service identity.",
6969
default="SystemAssigned",
@@ -135,6 +135,20 @@ def _build_arguments_schema(cls, *args, **kwargs):
135135
enum={"Cluster": "Cluster", "Workspaces": "Workspaces"},
136136
)
137137

138+
# define Arg Group "Replication"
139+
140+
_args_schema = cls._args_schema
141+
_args_schema.replication_enabled = AAZBoolArg(
142+
options=["--replication-enabled"],
143+
arg_group="Replication",
144+
help="Specifies whether the replication is enabled or not. When true the cluster is replicate to the specified location.",
145+
)
146+
_args_schema.replication_location = AAZStrArg(
147+
options=["--replication-location"],
148+
arg_group="Replication",
149+
help="The secondary location of the replication. If replication is being enabled, enabled must be provided.",
150+
)
151+
138152
# define Arg Group "Sku"
139153

140154
_args_schema = cls._args_schema
@@ -180,16 +194,16 @@ def __call__(self, *args, **kwargs):
180194
return self.client.build_lro_polling(
181195
self.ctx.args.no_wait,
182196
session,
183-
self.on_200_201,
197+
self.on_200,
184198
self.on_error,
185199
lro_options={"final-state-via": "azure-async-operation"},
186200
path_format_arguments=self.url_parameters,
187201
)
188-
if session.http_response.status_code in [200, 201]:
202+
if session.http_response.status_code in [200]:
189203
return self.client.build_lro_polling(
190204
self.ctx.args.no_wait,
191205
session,
192-
self.on_200_201,
206+
self.on_200,
193207
self.on_error,
194208
lro_options={"final-state-via": "azure-async-operation"},
195209
path_format_arguments=self.url_parameters,
@@ -234,7 +248,7 @@ def url_parameters(self):
234248
def query_parameters(self):
235249
parameters = {
236250
**self.serialize_query_param(
237-
"api-version", "2022-10-01",
251+
"api-version", "2025-02-01",
238252
required=True,
239253
),
240254
}
@@ -259,7 +273,7 @@ def content(self):
259273
typ=AAZObjectType,
260274
typ_kwargs={"flags": {"required": True, "client_flatten": True}}
261275
)
262-
_builder.set_prop("identity", AAZObjectType)
276+
_builder.set_prop("identity", AAZIdentityObjectType)
263277
_builder.set_prop("location", AAZStrType, ".location", typ_kwargs={"flags": {"required": True}})
264278
_builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}})
265279
_builder.set_prop("sku", AAZObjectType)
@@ -278,6 +292,7 @@ def content(self):
278292
if properties is not None:
279293
properties.set_prop("billingType", AAZStrType, ".billing_type")
280294
properties.set_prop("keyVaultProperties", AAZObjectType)
295+
properties.set_prop("replication", AAZObjectType)
281296

282297
key_vault_properties = _builder.get(".properties.keyVaultProperties")
283298
if key_vault_properties is not None:
@@ -286,6 +301,11 @@ def content(self):
286301
key_vault_properties.set_prop("keyVaultUri", AAZStrType, ".key_vault_uri")
287302
key_vault_properties.set_prop("keyVersion", AAZStrType, ".key_version")
288303

304+
replication = _builder.get(".properties.replication")
305+
if replication is not None:
306+
replication.set_prop("enabled", AAZBoolType, ".replication_enabled")
307+
replication.set_prop("location", AAZStrType, ".replication_location")
308+
289309
sku = _builder.get(".sku")
290310
if sku is not None:
291311
sku.set_prop("capacity", AAZIntType, ".sku_capacity")
@@ -297,44 +317,44 @@ def content(self):
297317

298318
return self.serialize_content(_content_value)
299319

300-
def on_200_201(self, session):
320+
def on_200(self, session):
301321
data = self.deserialize_http_content(session)
302322
self.ctx.set_var(
303323
"instance",
304324
data,
305-
schema_builder=self._build_schema_on_200_201
325+
schema_builder=self._build_schema_on_200
306326
)
307327

308-
_schema_on_200_201 = None
328+
_schema_on_200 = None
309329

310330
@classmethod
311-
def _build_schema_on_200_201(cls):
312-
if cls._schema_on_200_201 is not None:
313-
return cls._schema_on_200_201
331+
def _build_schema_on_200(cls):
332+
if cls._schema_on_200 is not None:
333+
return cls._schema_on_200
314334

315-
cls._schema_on_200_201 = AAZObjectType()
335+
cls._schema_on_200 = AAZObjectType()
316336

317-
_schema_on_200_201 = cls._schema_on_200_201
318-
_schema_on_200_201.id = AAZStrType(
337+
_schema_on_200 = cls._schema_on_200
338+
_schema_on_200.id = AAZStrType(
319339
flags={"read_only": True},
320340
)
321-
_schema_on_200_201.identity = AAZObjectType()
322-
_schema_on_200_201.location = AAZStrType(
341+
_schema_on_200.identity = AAZIdentityObjectType()
342+
_schema_on_200.location = AAZStrType(
323343
flags={"required": True},
324344
)
325-
_schema_on_200_201.name = AAZStrType(
345+
_schema_on_200.name = AAZStrType(
326346
flags={"read_only": True},
327347
)
328-
_schema_on_200_201.properties = AAZObjectType(
348+
_schema_on_200.properties = AAZObjectType(
329349
flags={"client_flatten": True},
330350
)
331-
_schema_on_200_201.sku = AAZObjectType()
332-
_schema_on_200_201.tags = AAZDictType()
333-
_schema_on_200_201.type = AAZStrType(
351+
_schema_on_200.sku = AAZObjectType()
352+
_schema_on_200.tags = AAZDictType()
353+
_schema_on_200.type = AAZStrType(
334354
flags={"read_only": True},
335355
)
336356

337-
identity = cls._schema_on_200_201.identity
357+
identity = cls._schema_on_200.identity
338358
identity.principal_id = AAZStrType(
339359
serialized_name="principalId",
340360
flags={"read_only": True},
@@ -350,12 +370,12 @@ def _build_schema_on_200_201(cls):
350370
serialized_name="userAssignedIdentities",
351371
)
352372

353-
user_assigned_identities = cls._schema_on_200_201.identity.user_assigned_identities
373+
user_assigned_identities = cls._schema_on_200.identity.user_assigned_identities
354374
user_assigned_identities.Element = AAZObjectType(
355375
nullable=True,
356376
)
357377

358-
_element = cls._schema_on_200_201.identity.user_assigned_identities.Element
378+
_element = cls._schema_on_200.identity.user_assigned_identities.Element
359379
_element.client_id = AAZStrType(
360380
serialized_name="clientId",
361381
flags={"read_only": True},
@@ -365,7 +385,7 @@ def _build_schema_on_200_201(cls):
365385
flags={"read_only": True},
366386
)
367387

368-
properties = cls._schema_on_200_201.properties
388+
properties = cls._schema_on_200.properties
369389
properties.associated_workspaces = AAZListType(
370390
serialized_name="associatedWorkspaces",
371391
flags={"read_only": True},
@@ -401,11 +421,12 @@ def _build_schema_on_200_201(cls):
401421
serialized_name="provisioningState",
402422
flags={"read_only": True},
403423
)
424+
properties.replication = AAZObjectType()
404425

405-
associated_workspaces = cls._schema_on_200_201.properties.associated_workspaces
426+
associated_workspaces = cls._schema_on_200.properties.associated_workspaces
406427
associated_workspaces.Element = AAZObjectType()
407428

408-
_element = cls._schema_on_200_201.properties.associated_workspaces.Element
429+
_element = cls._schema_on_200.properties.associated_workspaces.Element
409430
_element.associate_date = AAZStrType(
410431
serialized_name="associateDate",
411432
flags={"read_only": True},
@@ -423,7 +444,7 @@ def _build_schema_on_200_201(cls):
423444
flags={"read_only": True},
424445
)
425446

426-
capacity_reservation_properties = cls._schema_on_200_201.properties.capacity_reservation_properties
447+
capacity_reservation_properties = cls._schema_on_200.properties.capacity_reservation_properties
427448
capacity_reservation_properties.last_sku_update = AAZStrType(
428449
serialized_name="lastSkuUpdate",
429450
flags={"read_only": True},
@@ -433,7 +454,7 @@ def _build_schema_on_200_201(cls):
433454
flags={"read_only": True},
434455
)
435456

436-
key_vault_properties = cls._schema_on_200_201.properties.key_vault_properties
457+
key_vault_properties = cls._schema_on_200.properties.key_vault_properties
437458
key_vault_properties.key_name = AAZStrType(
438459
serialized_name="keyName",
439460
)
@@ -447,14 +468,33 @@ def _build_schema_on_200_201(cls):
447468
serialized_name="keyVersion",
448469
)
449470

450-
sku = cls._schema_on_200_201.sku
471+
replication = cls._schema_on_200.properties.replication
472+
replication.created_date = AAZStrType(
473+
serialized_name="createdDate",
474+
flags={"read_only": True},
475+
)
476+
replication.enabled = AAZBoolType()
477+
replication.is_availability_zones_enabled = AAZBoolType(
478+
serialized_name="isAvailabilityZonesEnabled",
479+
)
480+
replication.last_modified_date = AAZStrType(
481+
serialized_name="lastModifiedDate",
482+
flags={"read_only": True},
483+
)
484+
replication.location = AAZStrType()
485+
replication.provisioning_state = AAZStrType(
486+
serialized_name="provisioningState",
487+
flags={"read_only": True},
488+
)
489+
490+
sku = cls._schema_on_200.sku
451491
sku.capacity = AAZIntType()
452492
sku.name = AAZStrType()
453493

454-
tags = cls._schema_on_200_201.tags
494+
tags = cls._schema_on_200.tags
455495
tags.Element = AAZStrType()
456496

457-
return cls._schema_on_200_201
497+
return cls._schema_on_200
458498

459499

460500
class _CreateHelper:

src/azure-cli/azure/cli/command_modules/monitor/aaz/latest/monitor/log_analytics/cluster/_delete.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ class Delete(AAZCommand):
2323
"""
2424

2525
_aaz_info = {
26-
"version": "2022-10-01",
26+
"version": "2025-02-01",
2727
"resources": [
28-
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.operationalinsights/clusters/{}", "2022-10-01"],
28+
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.operationalinsights/clusters/{}", "2025-02-01"],
2929
]
3030
}
3131

@@ -143,7 +143,7 @@ def url_parameters(self):
143143
def query_parameters(self):
144144
parameters = {
145145
**self.serialize_query_param(
146-
"api-version", "2022-10-01",
146+
"api-version", "2025-02-01",
147147
required=True,
148148
),
149149
}

0 commit comments

Comments
 (0)