Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
3 changes: 2 additions & 1 deletion src/aks-preview/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ To release a new version, please select a new version number (usually plus 1 to

Pending
+++++++
* `az aks create/update`: Add `--enable-azure-monitor-logs` support to container network logs validation.
* `az aks safeguards`: Update Deployment Safeguards commands to API version 2025-07-01 and add idempotency check for create operation.

19.0.0b22
+++++++
* `az aks create/update`: Add `--enable-azure-monitor-logs` support to container network logs validation.
* `az aks create/update`: Automatically enable `--enable-high-log-scale-mode` when `--enable-container-network-logs` is specified. Raises an error if user explicitly disables HLSM while enabling CNL.

19.0.0b21
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"aks safeguards",
)
class __CMDGroup(AAZCommandGroup):
"""Manage Deployment Safeguards
"""Manage Safeguards
"""
pass

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,26 @@
class Create(AAZCommand):
"""Enable Deployment Safeguards for a Managed Cluster

:example: Creates a DeploymentSafeguards resource at Warn level with a managed cluster resource id
az aks safeguards create --resource /subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1 --level Warn
:example: Create a DeploymentSafeguards resource at Warn level with a managed cluster resource id
az aks safeguards create --managed-cluster subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1 --level Warn

:example: Creates a DeploymentSafeguards resource at Warn level using subscription, resourcegroup, and name tags
:example: Create a DeploymentSafeguards resource at Warn level using subscription, resourcegroup, and name tags
az aks safeguards create --subscription subid1 -g rg1 -n cluster1 --level Warn

:example: Create a DeploymentSafeguards resource at Warn level with ignored namespaces
az aks safeguards create -g rg1 -n mc1 --excluded-ns ns1 ns2 --level Warn

:example: Creates a DeploymentSafeguards resource at Warn level with pod security standards level set to Baseline
az aks safeguards create --managed-cluster subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1 --level Warn --pss-level Baseline
:example: Create a DeploymentSafeguards resource at Warn level with Pod Security Standards level set to Baseline
az aks safeguards create --managed-cluster /subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1 --level Warn --pss-level Baseline

:example: Create a DeploymentSafeguards resource with PSS level set to Restricted using -g/-n pattern
az aks safeguards create -g rg1 -n cluster1 --level Enforce --pss-level Restricted
"""

_aaz_info = {
"version": "2025-05-02-preview",
"version": "2025-07-01",
"resources": [
["mgmt-plane", "/{resourceuri}/providers/microsoft.containerservice/deploymentsafeguards/default", "2025-05-02-preview"],
["mgmt-plane", "/{resourceuri}/providers/microsoft.containerservice/deploymentsafeguards/default", "2025-07-01"],
]
}

Expand Down Expand Up @@ -78,7 +81,6 @@ def _build_arguments_schema(cls, *args, **kwargs):
options=["--pss-level"],
arg_group="Properties",
help="The pod security standards level",
is_preview=True,
enum={"Baseline": "Baseline", "Privileged": "Privileged", "Restricted": "Restricted"},
)

Expand All @@ -100,7 +102,7 @@ def post_operations(self):
pass

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

class DeploymentSafeguardsCreate(AAZHttpOperation):
Expand Down Expand Up @@ -150,7 +152,6 @@ def url_parameters(self):
parameters = {
**self.serialize_url_param(
"resourceUri", self.ctx.args.managed_cluster,
skip_quote=True,
required=True,
),
}
Expand All @@ -160,7 +161,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2025-05-02-preview",
"api-version", "2025-07-01",
required=True,
),
}
Expand All @@ -185,7 +186,7 @@ def content(self):
typ=AAZObjectType,
typ_kwargs={"flags": {"required": True, "client_flatten": True}}
)
_builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}})
_builder.set_prop("properties", AAZObjectType)

properties = _builder.get(".properties")
if properties is not None:
Expand Down Expand Up @@ -227,9 +228,7 @@ def _build_schema_on_200_201(cls):
_schema_on_200_201.name = AAZStrType(
flags={"read_only": True},
)
_schema_on_200_201.properties = AAZObjectType(
flags={"client_flatten": True},
)
_schema_on_200_201.properties = AAZObjectType()
_schema_on_200_201.system_data = AAZObjectType(
serialized_name="systemData",
flags={"read_only": True},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@
confirmation="Are you sure you want to perform this operation?",
)
class Delete(AAZCommand):
"""Disable Deployment Safeguards for a Managed Cluster
"""Delete DeploymentSafeguards

:example: Deletes a DeploymentSafeguard resource by managed cluster id
:example: Delete a DeploymentSafeguard resource by managed cluster id
az aks safeguards delete -c subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1

:example: Deletes a DeploymentSafeguard resource with resourceGroup and clusterName arguments
:example: Delete a DeploymentSafeguard resource with resourceGroup and clusterName arguments
az aks safeguards delete -g rg1 -n cluster1
"""

_aaz_info = {
"version": "2025-05-02-preview",
"version": "2025-07-01",
"resources": [
["mgmt-plane", "/{resourceuri}/providers/microsoft.containerservice/deploymentsafeguards/default", "2025-05-02-preview"],
["mgmt-plane", "/{resourceuri}/providers/microsoft.containerservice/deploymentsafeguards/default", "2025-07-01"],
]
}

Expand Down Expand Up @@ -125,7 +125,6 @@ def url_parameters(self):
parameters = {
**self.serialize_url_param(
"resourceUri", self.ctx.args.managed_cluster,
skip_quote=True,
required=True,
),
}
Expand All @@ -135,7 +134,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2025-05-02-preview",
"api-version", "2025-07-01",
required=True,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@
class List(AAZCommand):
"""List DeploymentSafeguards by parent resource

:example: List DeploymentSafeguards by parent resource
:example: List DeploymentSafeguard resources by managed cluster id
az aks safeguards list --managed-cluster subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1

:example: List DeploymentSafeguards by parent resource
:example: List DeploymentSafeguard resources with resourceGroup and clusterName arguments
az aks safeguards list -g rg1 -n cluster1
"""

_aaz_info = {
"version": "2025-05-02-preview",
"version": "2025-07-01",
"resources": [
["mgmt-plane", "/{resourceuri}/providers/microsoft.containerservice/deploymentsafeguards", "2025-05-02-preview"],
["mgmt-plane", "/{resourceuri}/providers/microsoft.containerservice/deploymentsafeguards", "2025-07-01"],
]
}

Expand Down Expand Up @@ -69,7 +69,7 @@ def post_operations(self):
pass

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

Expand Down Expand Up @@ -104,7 +104,6 @@ def url_parameters(self):
parameters = {
**self.serialize_url_param(
"resourceUri", self.ctx.args.managed_cluster,
skip_quote=True,
required=True,
),
}
Expand All @@ -114,7 +113,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2025-05-02-preview",
"api-version", "2025-07-01",
required=True,
),
}
Expand Down Expand Up @@ -168,9 +167,7 @@ def _build_schema_on_200(cls):
_element.name = AAZStrType(
flags={"read_only": True},
)
_element.properties = AAZObjectType(
flags={"client_flatten": True},
)
_element.properties = AAZObjectType()
_element.system_data = AAZObjectType(
serialized_name="systemData",
flags={"read_only": True},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@
"aks safeguards show",
)
class Show(AAZCommand):
"""Show Deployment Safeguards Configuration for a Managed Cluster
"""Get a deployment safeguard by name

:example: Gets a DeploymentSafeguard resource by managed cluster id
:example: Get a DeploymentSafeguard resource by managed cluster id
az aks safeguards show --managed-cluster subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1

:example: Gets a DeploymentSafeguard resource with resourceGroup and clusterName arguments
:example: Get a DeploymentSafeguard resource with resourceGroup and clusterName arguments
az aks safeguards show -g rg1 -n cluster1
"""

_aaz_info = {
"version": "2025-05-02-preview",
"version": "2025-07-01",
"resources": [
["mgmt-plane", "/{resourceuri}/providers/microsoft.containerservice/deploymentsafeguards/default", "2025-05-02-preview"],
["mgmt-plane", "/{resourceuri}/providers/microsoft.containerservice/deploymentsafeguards/default", "2025-07-01"],
]
}

Expand Down Expand Up @@ -68,7 +68,7 @@ def post_operations(self):
pass

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

class DeploymentSafeguardsGet(AAZHttpOperation):
Expand Down Expand Up @@ -102,7 +102,6 @@ def url_parameters(self):
parameters = {
**self.serialize_url_param(
"resourceUri", self.ctx.args.managed_cluster,
skip_quote=True,
required=True,
),
}
Expand All @@ -112,7 +111,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2025-05-02-preview",
"api-version", "2025-07-01",
required=True,
),
}
Expand Down Expand Up @@ -155,9 +154,7 @@ def _build_schema_on_200(cls):
_schema_on_200.name = AAZStrType(
flags={"read_only": True},
)
_schema_on_200.properties = AAZObjectType(
flags={"client_flatten": True},
)
_schema_on_200.properties = AAZObjectType()
_schema_on_200.system_data = AAZObjectType(
serialized_name="systemData",
flags={"read_only": True},
Expand Down
Loading
Loading