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

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ class Create(AAZCommand):
"""

_aaz_info = {
"version": "2022-10-01",
"version": "2025-02-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.operationalinsights/clusters/{}", "2022-10-01"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.operationalinsights/clusters/{}", "2025-02-01"],
]
}

Expand Down Expand Up @@ -63,7 +63,7 @@ def _build_arguments_schema(cls, *args, **kwargs):

_args_schema = cls._args_schema
_args_schema.identity_type = AAZStrArg(
options=["--identity-type"],
options=["--type", "--identity-type"],
arg_group="Identity",
help="Type of managed service identity.",
default="SystemAssigned",
Expand Down Expand Up @@ -135,6 +135,20 @@ def _build_arguments_schema(cls, *args, **kwargs):
enum={"Cluster": "Cluster", "Workspaces": "Workspaces"},
)

# define Arg Group "Replication"

_args_schema = cls._args_schema
_args_schema.replication_enabled = AAZBoolArg(
options=["--replication-enabled"],
arg_group="Replication",
help="Specifies whether the replication is enabled or not. When true the cluster is replicate to the specified location.",
)
_args_schema.replication_location = AAZStrArg(
options=["--replication-location"],
arg_group="Replication",
help="The secondary location of the replication. If replication is being enabled, enabled must be provided.",
)

# define Arg Group "Sku"

_args_schema = cls._args_schema
Expand Down Expand Up @@ -180,16 +194,16 @@ def __call__(self, *args, **kwargs):
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_200_201,
self.on_200,
self.on_error,
lro_options={"final-state-via": "azure-async-operation"},
path_format_arguments=self.url_parameters,
)
if session.http_response.status_code in [200, 201]:
if session.http_response.status_code in [200]:
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_200_201,
self.on_200,
self.on_error,
lro_options={"final-state-via": "azure-async-operation"},
path_format_arguments=self.url_parameters,
Expand Down Expand Up @@ -234,7 +248,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2022-10-01",
"api-version", "2025-02-01",
required=True,
),
}
Expand All @@ -259,7 +273,7 @@ def content(self):
typ=AAZObjectType,
typ_kwargs={"flags": {"required": True, "client_flatten": True}}
)
_builder.set_prop("identity", AAZObjectType)
_builder.set_prop("identity", AAZIdentityObjectType)
_builder.set_prop("location", AAZStrType, ".location", typ_kwargs={"flags": {"required": True}})
_builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}})
_builder.set_prop("sku", AAZObjectType)
Expand All @@ -278,6 +292,7 @@ def content(self):
if properties is not None:
properties.set_prop("billingType", AAZStrType, ".billing_type")
properties.set_prop("keyVaultProperties", AAZObjectType)
properties.set_prop("replication", AAZObjectType)

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

replication = _builder.get(".properties.replication")
if replication is not None:
replication.set_prop("enabled", AAZBoolType, ".replication_enabled")
replication.set_prop("location", AAZStrType, ".replication_location")

sku = _builder.get(".sku")
if sku is not None:
sku.set_prop("capacity", AAZIntType, ".sku_capacity")
Expand All @@ -297,44 +317,44 @@ def content(self):

return self.serialize_content(_content_value)

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

_schema_on_200_201 = None
_schema_on_200 = None

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

cls._schema_on_200_201 = AAZObjectType()
cls._schema_on_200 = AAZObjectType()

_schema_on_200_201 = cls._schema_on_200_201
_schema_on_200_201.id = AAZStrType(
_schema_on_200 = cls._schema_on_200
_schema_on_200.id = AAZStrType(
flags={"read_only": True},
)
_schema_on_200_201.identity = AAZObjectType()
_schema_on_200_201.location = AAZStrType(
_schema_on_200.identity = AAZIdentityObjectType()
_schema_on_200.location = AAZStrType(
flags={"required": True},
)
_schema_on_200_201.name = AAZStrType(
_schema_on_200.name = AAZStrType(
flags={"read_only": True},
)
_schema_on_200_201.properties = AAZObjectType(
_schema_on_200.properties = AAZObjectType(
flags={"client_flatten": True},
)
_schema_on_200_201.sku = AAZObjectType()
_schema_on_200_201.tags = AAZDictType()
_schema_on_200_201.type = AAZStrType(
_schema_on_200.sku = AAZObjectType()
_schema_on_200.tags = AAZDictType()
_schema_on_200.type = AAZStrType(
flags={"read_only": True},
)

identity = cls._schema_on_200_201.identity
identity = cls._schema_on_200.identity
identity.principal_id = AAZStrType(
serialized_name="principalId",
flags={"read_only": True},
Expand All @@ -350,12 +370,12 @@ def _build_schema_on_200_201(cls):
serialized_name="userAssignedIdentities",
)

user_assigned_identities = cls._schema_on_200_201.identity.user_assigned_identities
user_assigned_identities = cls._schema_on_200.identity.user_assigned_identities
user_assigned_identities.Element = AAZObjectType(
nullable=True,
)

_element = cls._schema_on_200_201.identity.user_assigned_identities.Element
_element = cls._schema_on_200.identity.user_assigned_identities.Element
_element.client_id = AAZStrType(
serialized_name="clientId",
flags={"read_only": True},
Expand All @@ -365,7 +385,7 @@ def _build_schema_on_200_201(cls):
flags={"read_only": True},
)

properties = cls._schema_on_200_201.properties
properties = cls._schema_on_200.properties
properties.associated_workspaces = AAZListType(
serialized_name="associatedWorkspaces",
flags={"read_only": True},
Expand Down Expand Up @@ -401,11 +421,12 @@ def _build_schema_on_200_201(cls):
serialized_name="provisioningState",
flags={"read_only": True},
)
properties.replication = AAZObjectType()

associated_workspaces = cls._schema_on_200_201.properties.associated_workspaces
associated_workspaces = cls._schema_on_200.properties.associated_workspaces
associated_workspaces.Element = AAZObjectType()

_element = cls._schema_on_200_201.properties.associated_workspaces.Element
_element = cls._schema_on_200.properties.associated_workspaces.Element
_element.associate_date = AAZStrType(
serialized_name="associateDate",
flags={"read_only": True},
Expand All @@ -423,7 +444,7 @@ def _build_schema_on_200_201(cls):
flags={"read_only": True},
)

capacity_reservation_properties = cls._schema_on_200_201.properties.capacity_reservation_properties
capacity_reservation_properties = cls._schema_on_200.properties.capacity_reservation_properties
capacity_reservation_properties.last_sku_update = AAZStrType(
serialized_name="lastSkuUpdate",
flags={"read_only": True},
Expand All @@ -433,7 +454,7 @@ def _build_schema_on_200_201(cls):
flags={"read_only": True},
)

key_vault_properties = cls._schema_on_200_201.properties.key_vault_properties
key_vault_properties = cls._schema_on_200.properties.key_vault_properties
key_vault_properties.key_name = AAZStrType(
serialized_name="keyName",
)
Expand All @@ -447,14 +468,33 @@ def _build_schema_on_200_201(cls):
serialized_name="keyVersion",
)

sku = cls._schema_on_200_201.sku
replication = cls._schema_on_200.properties.replication
replication.created_date = AAZStrType(
serialized_name="createdDate",
flags={"read_only": True},
)
replication.enabled = AAZBoolType()
replication.is_availability_zones_enabled = AAZBoolType(
serialized_name="isAvailabilityZonesEnabled",
)
replication.last_modified_date = AAZStrType(
serialized_name="lastModifiedDate",
flags={"read_only": True},
)
replication.location = AAZStrType()
replication.provisioning_state = AAZStrType(
serialized_name="provisioningState",
flags={"read_only": True},
)

sku = cls._schema_on_200.sku
sku.capacity = AAZIntType()
sku.name = AAZStrType()

tags = cls._schema_on_200_201.tags
tags = cls._schema_on_200.tags
tags.Element = AAZStrType()

return cls._schema_on_200_201
return cls._schema_on_200


class _CreateHelper:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ class Delete(AAZCommand):
"""

_aaz_info = {
"version": "2022-10-01",
"version": "2025-02-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.operationalinsights/clusters/{}", "2022-10-01"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.operationalinsights/clusters/{}", "2025-02-01"],
]
}

Expand Down Expand Up @@ -143,7 +143,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2022-10-01",
"api-version", "2025-02-01",
required=True,
),
}
Expand Down
Loading