Skip to content

Commit d0214e3

Browse files
committed
update loganalytics
1 parent 930ec5d commit d0214e3

File tree

27 files changed

+4455
-273
lines changed

27 files changed

+4455
-273
lines changed

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

Lines changed: 81 additions & 36 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",
@@ -134,6 +134,25 @@ def _build_arguments_schema(cls, *args, **kwargs):
134134
help="The cluster's billing type.",
135135
enum={"Cluster": "Cluster", "Workspaces": "Workspaces"},
136136
)
137+
_args_schema.replication = AAZObjectArg(
138+
options=["--replication"],
139+
arg_group="Properties",
140+
help="Cluster's replication properties.",
141+
)
142+
143+
replication = cls._args_schema.replication
144+
replication.enabled = AAZBoolArg(
145+
options=["enabled"],
146+
help="Specifies whether the replication is enabled or not. When true the cluster is replicate to the specified location.",
147+
)
148+
replication.is_availability_zones_enabled = AAZBoolArg(
149+
options=["is-availability-zones-enabled"],
150+
help="Should enable AvailabilityZones for the given replicated cluster",
151+
)
152+
replication.location = AAZStrArg(
153+
options=["location"],
154+
help="The secondary location of the replication. If replication is being enabled, enabled must be provided.",
155+
)
137156

138157
# define Arg Group "Sku"
139158

@@ -180,16 +199,16 @@ def __call__(self, *args, **kwargs):
180199
return self.client.build_lro_polling(
181200
self.ctx.args.no_wait,
182201
session,
183-
self.on_200_201,
202+
self.on_200,
184203
self.on_error,
185204
lro_options={"final-state-via": "azure-async-operation"},
186205
path_format_arguments=self.url_parameters,
187206
)
188-
if session.http_response.status_code in [200, 201]:
207+
if session.http_response.status_code in [200]:
189208
return self.client.build_lro_polling(
190209
self.ctx.args.no_wait,
191210
session,
192-
self.on_200_201,
211+
self.on_200,
193212
self.on_error,
194213
lro_options={"final-state-via": "azure-async-operation"},
195214
path_format_arguments=self.url_parameters,
@@ -234,7 +253,7 @@ def url_parameters(self):
234253
def query_parameters(self):
235254
parameters = {
236255
**self.serialize_query_param(
237-
"api-version", "2022-10-01",
256+
"api-version", "2025-02-01",
238257
required=True,
239258
),
240259
}
@@ -259,7 +278,7 @@ def content(self):
259278
typ=AAZObjectType,
260279
typ_kwargs={"flags": {"required": True, "client_flatten": True}}
261280
)
262-
_builder.set_prop("identity", AAZObjectType)
281+
_builder.set_prop("identity", AAZIdentityObjectType)
263282
_builder.set_prop("location", AAZStrType, ".location", typ_kwargs={"flags": {"required": True}})
264283
_builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}})
265284
_builder.set_prop("sku", AAZObjectType)
@@ -278,6 +297,7 @@ def content(self):
278297
if properties is not None:
279298
properties.set_prop("billingType", AAZStrType, ".billing_type")
280299
properties.set_prop("keyVaultProperties", AAZObjectType)
300+
properties.set_prop("replication", AAZObjectType, ".replication")
281301

282302
key_vault_properties = _builder.get(".properties.keyVaultProperties")
283303
if key_vault_properties is not None:
@@ -286,6 +306,12 @@ def content(self):
286306
key_vault_properties.set_prop("keyVaultUri", AAZStrType, ".key_vault_uri")
287307
key_vault_properties.set_prop("keyVersion", AAZStrType, ".key_version")
288308

309+
replication = _builder.get(".properties.replication")
310+
if replication is not None:
311+
replication.set_prop("enabled", AAZBoolType, ".enabled")
312+
replication.set_prop("isAvailabilityZonesEnabled", AAZBoolType, ".is_availability_zones_enabled")
313+
replication.set_prop("location", AAZStrType, ".location")
314+
289315
sku = _builder.get(".sku")
290316
if sku is not None:
291317
sku.set_prop("capacity", AAZIntType, ".sku_capacity")
@@ -297,44 +323,44 @@ def content(self):
297323

298324
return self.serialize_content(_content_value)
299325

300-
def on_200_201(self, session):
326+
def on_200(self, session):
301327
data = self.deserialize_http_content(session)
302328
self.ctx.set_var(
303329
"instance",
304330
data,
305-
schema_builder=self._build_schema_on_200_201
331+
schema_builder=self._build_schema_on_200
306332
)
307333

308-
_schema_on_200_201 = None
334+
_schema_on_200 = None
309335

310336
@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
337+
def _build_schema_on_200(cls):
338+
if cls._schema_on_200 is not None:
339+
return cls._schema_on_200
314340

315-
cls._schema_on_200_201 = AAZObjectType()
341+
cls._schema_on_200 = AAZObjectType()
316342

317-
_schema_on_200_201 = cls._schema_on_200_201
318-
_schema_on_200_201.id = AAZStrType(
343+
_schema_on_200 = cls._schema_on_200
344+
_schema_on_200.id = AAZStrType(
319345
flags={"read_only": True},
320346
)
321-
_schema_on_200_201.identity = AAZObjectType()
322-
_schema_on_200_201.location = AAZStrType(
347+
_schema_on_200.identity = AAZIdentityObjectType()
348+
_schema_on_200.location = AAZStrType(
323349
flags={"required": True},
324350
)
325-
_schema_on_200_201.name = AAZStrType(
351+
_schema_on_200.name = AAZStrType(
326352
flags={"read_only": True},
327353
)
328-
_schema_on_200_201.properties = AAZObjectType(
354+
_schema_on_200.properties = AAZObjectType(
329355
flags={"client_flatten": True},
330356
)
331-
_schema_on_200_201.sku = AAZObjectType()
332-
_schema_on_200_201.tags = AAZDictType()
333-
_schema_on_200_201.type = AAZStrType(
357+
_schema_on_200.sku = AAZObjectType()
358+
_schema_on_200.tags = AAZDictType()
359+
_schema_on_200.type = AAZStrType(
334360
flags={"read_only": True},
335361
)
336362

337-
identity = cls._schema_on_200_201.identity
363+
identity = cls._schema_on_200.identity
338364
identity.principal_id = AAZStrType(
339365
serialized_name="principalId",
340366
flags={"read_only": True},
@@ -350,12 +376,12 @@ def _build_schema_on_200_201(cls):
350376
serialized_name="userAssignedIdentities",
351377
)
352378

353-
user_assigned_identities = cls._schema_on_200_201.identity.user_assigned_identities
379+
user_assigned_identities = cls._schema_on_200.identity.user_assigned_identities
354380
user_assigned_identities.Element = AAZObjectType(
355381
nullable=True,
356382
)
357383

358-
_element = cls._schema_on_200_201.identity.user_assigned_identities.Element
384+
_element = cls._schema_on_200.identity.user_assigned_identities.Element
359385
_element.client_id = AAZStrType(
360386
serialized_name="clientId",
361387
flags={"read_only": True},
@@ -365,10 +391,9 @@ def _build_schema_on_200_201(cls):
365391
flags={"read_only": True},
366392
)
367393

368-
properties = cls._schema_on_200_201.properties
394+
properties = cls._schema_on_200.properties
369395
properties.associated_workspaces = AAZListType(
370396
serialized_name="associatedWorkspaces",
371-
flags={"read_only": True},
372397
)
373398
properties.billing_type = AAZStrType(
374399
serialized_name="billingType",
@@ -401,11 +426,12 @@ def _build_schema_on_200_201(cls):
401426
serialized_name="provisioningState",
402427
flags={"read_only": True},
403428
)
429+
properties.replication = AAZObjectType()
404430

405-
associated_workspaces = cls._schema_on_200_201.properties.associated_workspaces
431+
associated_workspaces = cls._schema_on_200.properties.associated_workspaces
406432
associated_workspaces.Element = AAZObjectType()
407433

408-
_element = cls._schema_on_200_201.properties.associated_workspaces.Element
434+
_element = cls._schema_on_200.properties.associated_workspaces.Element
409435
_element.associate_date = AAZStrType(
410436
serialized_name="associateDate",
411437
flags={"read_only": True},
@@ -423,7 +449,7 @@ def _build_schema_on_200_201(cls):
423449
flags={"read_only": True},
424450
)
425451

426-
capacity_reservation_properties = cls._schema_on_200_201.properties.capacity_reservation_properties
452+
capacity_reservation_properties = cls._schema_on_200.properties.capacity_reservation_properties
427453
capacity_reservation_properties.last_sku_update = AAZStrType(
428454
serialized_name="lastSkuUpdate",
429455
flags={"read_only": True},
@@ -433,7 +459,7 @@ def _build_schema_on_200_201(cls):
433459
flags={"read_only": True},
434460
)
435461

436-
key_vault_properties = cls._schema_on_200_201.properties.key_vault_properties
462+
key_vault_properties = cls._schema_on_200.properties.key_vault_properties
437463
key_vault_properties.key_name = AAZStrType(
438464
serialized_name="keyName",
439465
)
@@ -447,14 +473,33 @@ def _build_schema_on_200_201(cls):
447473
serialized_name="keyVersion",
448474
)
449475

450-
sku = cls._schema_on_200_201.sku
476+
replication = cls._schema_on_200.properties.replication
477+
replication.created_date = AAZStrType(
478+
serialized_name="createdDate",
479+
flags={"read_only": True},
480+
)
481+
replication.enabled = AAZBoolType()
482+
replication.is_availability_zones_enabled = AAZBoolType(
483+
serialized_name="isAvailabilityZonesEnabled",
484+
)
485+
replication.last_modified_date = AAZStrType(
486+
serialized_name="lastModifiedDate",
487+
flags={"read_only": True},
488+
)
489+
replication.location = AAZStrType()
490+
replication.provisioning_state = AAZStrType(
491+
serialized_name="provisioningState",
492+
flags={"read_only": True},
493+
)
494+
495+
sku = cls._schema_on_200.sku
451496
sku.capacity = AAZIntType()
452497
sku.name = AAZStrType()
453498

454-
tags = cls._schema_on_200_201.tags
499+
tags = cls._schema_on_200.tags
455500
tags.Element = AAZStrType()
456501

457-
return cls._schema_on_200_201
502+
return cls._schema_on_200
458503

459504

460505
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)