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
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ class Create(AAZCommand):
"""Create a new origin group within the specified profile.

:example: Creates a new origin group within the specified profile.
az afd origin-group create -g group --origin-group-name og1 --profile-name profile --probe-request-type GET --probe-protocol Http --probe-interval-in-seconds 120 --probe-path /test1/azure.txt --sample-size 4 --successful-samples-required 3 --additional-latency-in-milliseconds 50 --enable-health-probe true
az afd origin-group create --resource-group RG --profile-name profile1 --origin-group-name origingroup1 --sample-size 3 --successful-samples-required 3 --additional-latency-in-milliseconds 1000 --health-probe-settings "{probe-path:/path2,probe-request-type:NotSet,probe-protocol:NotSet,probe-interval-in-seconds:10}" --traffic-restoration-time-to-healed-or-new-endpoints-in-minutes 5
"""

_aaz_info = {
"version": "2024-09-01",
"version": "2025-04-15",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cdn/profiles/{}/origingroups/{}", "2024-09-01"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cdn/profiles/{}/origingroups/{}", "2025-04-15"],
]
}

Expand Down Expand Up @@ -52,43 +52,18 @@ def _build_arguments_schema(cls, *args, **kwargs):
)
_args_schema.profile_name = AAZStrArg(
options=["--profile-name"],
help="Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group.",
help="Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group.",
required=True,
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$",
max_length=260,
min_length=1,
),
)
_args_schema.resource_group = AAZResourceGroupNameArg(
required=True,
)

# define Arg Group "HealthProbeSettings"

_args_schema = cls._args_schema
_args_schema.probe_interval_in_seconds = AAZIntArg(
options=["--probe-interval-in-seconds"],
arg_group="HealthProbeSettings",
help="The number of seconds between health probes.Default is 240sec.",
fmt=AAZIntArgFormat(
maximum=255,
minimum=1,
),
)
_args_schema.probe_path = AAZStrArg(
options=["--probe-path"],
arg_group="HealthProbeSettings",
help="The path relative to the origin that is used to determine the health of the origin.",
)
_args_schema.probe_protocol = AAZStrArg(
options=["--probe-protocol"],
arg_group="HealthProbeSettings",
help="Protocol to use for health probe.",
enum={"Http": "Http", "Https": "Https", "NotSet": "NotSet"},
)
_args_schema.probe_request_type = AAZStrArg(
options=["--probe-request-type"],
arg_group="HealthProbeSettings",
help="The type of health probe request that is made.",
enum={"GET": "GET", "HEAD": "HEAD", "NotSet": "NotSet"},
)

# define Arg Group "LoadBalancingSettings"

_args_schema = cls._args_schema
Expand All @@ -111,6 +86,11 @@ def _build_arguments_schema(cls, *args, **kwargs):
# define Arg Group "Properties"

_args_schema = cls._args_schema
_args_schema.health_probe_settings = AAZObjectArg(
options=["--health-probe-settings"],
arg_group="Properties",
help="Health probe settings to the origin that is used to determine the health of the origin.",
)
_args_schema.session_affinity_state = AAZStrArg(
options=["--session-affinity-state"],
arg_group="Properties",
Expand All @@ -126,6 +106,30 @@ def _build_arguments_schema(cls, *args, **kwargs):
minimum=0,
),
)

health_probe_settings = cls._args_schema.health_probe_settings
health_probe_settings.probe_interval_in_seconds = AAZIntArg(
options=["probe-interval-in-seconds"],
help="The number of seconds between health probes.Default is 240sec.",
fmt=AAZIntArgFormat(
maximum=255,
minimum=1,
),
)
health_probe_settings.probe_path = AAZStrArg(
options=["probe-path"],
help="The path relative to the origin that is used to determine the health of the origin.",
)
health_probe_settings.probe_protocol = AAZStrArg(
options=["probe-protocol"],
help="Protocol to use for health probe.",
enum={"Http": "Http", "Https": "Https", "NotSet": "NotSet"},
)
health_probe_settings.probe_request_type = AAZStrArg(
options=["probe-request-type"],
help="The type of health probe request that is made.",
enum={"GET": "GET", "HEAD": "HEAD", "NotSet": "NotSet"},
)
return cls._args_schema

def _execute_operations(self):
Expand Down Expand Up @@ -213,7 +217,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-09-01",
"api-version", "2025-04-15",
required=True,
),
}
Expand Down Expand Up @@ -242,7 +246,7 @@ def content(self):

properties = _builder.get(".properties")
if properties is not None:
properties.set_prop("healthProbeSettings", AAZObjectType)
properties.set_prop("healthProbeSettings", AAZObjectType, ".health_probe_settings")
properties.set_prop("loadBalancingSettings", AAZObjectType)
properties.set_prop("sessionAffinityState", AAZStrType, ".session_affinity_state")
properties.set_prop("trafficRestorationTimeToHealedOrNewEndpointsInMinutes", AAZIntType, ".traffic_restoration_time_to_healed_or_new_endpoints_in_minutes")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ class Delete(AAZCommand):
"""

_aaz_info = {
"version": "2024-09-01",
"version": "2025-04-15",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cdn/profiles/{}/origingroups/{}", "2024-09-01"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cdn/profiles/{}/origingroups/{}", "2025-04-15"],
]
}

Expand Down Expand Up @@ -54,9 +54,14 @@ def _build_arguments_schema(cls, *args, **kwargs):
)
_args_schema.profile_name = AAZStrArg(
options=["--profile-name"],
help="Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group.",
help="Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group.",
required=True,
id_part="name",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$",
max_length=260,
min_length=1,
),
)
_args_schema.resource_group = AAZResourceGroupNameArg(
required=True,
Expand Down Expand Up @@ -153,7 +158,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-09-01",
"api-version", "2025-04-15",
required=True,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ class List(AAZCommand):
"""

_aaz_info = {
"version": "2024-09-01",
"version": "2025-04-15",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cdn/profiles/{}/origingroups", "2024-09-01"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cdn/profiles/{}/origingroups", "2025-04-15"],
]
}

Expand All @@ -46,6 +46,11 @@ def _build_arguments_schema(cls, *args, **kwargs):
options=["--profile-name"],
help="Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group.",
required=True,
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$",
max_length=260,
min_length=1,
),
)
_args_schema.resource_group = AAZResourceGroupNameArg(
required=True,
Expand Down Expand Up @@ -118,7 +123,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-09-01",
"api-version", "2025-04-15",
required=True,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@
)
class Show(AAZCommand):
"""Get an existing origin group within a profile.

:example: Get an existing origin group within a profile.
az afd origin-group show --resource-group RG --profile-name profile1 --origin-group-name origingroup1
"""

_aaz_info = {
"version": "2024-09-01",
"version": "2025-04-15",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cdn/profiles/{}/origingroups/{}", "2024-09-01"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cdn/profiles/{}/origingroups/{}", "2025-04-15"],
]
}

Expand Down Expand Up @@ -49,9 +52,14 @@ def _build_arguments_schema(cls, *args, **kwargs):
)
_args_schema.profile_name = AAZStrArg(
options=["--profile-name"],
help="Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group.",
help="Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group.",
required=True,
id_part="name",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$",
max_length=260,
min_length=1,
),
)
_args_schema.resource_group = AAZResourceGroupNameArg(
required=True,
Expand Down Expand Up @@ -127,7 +135,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-09-01",
"api-version", "2025-04-15",
required=True,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
class Update(AAZCommand):
"""Update a new origin group within the specified profile.

:example: Update the probe setting of the specified origin group.
:example: Update a new origin group within the specified profile.
az afd origin-group update -g group --origin-group-name og1 --profile-name profile --probe-request-type HEAD --probe-protocol Https --probe-interval-in-seconds 120 --probe-path /test1/azure.txt
"""

_aaz_info = {
"version": "2024-09-01",
"version": "2025-04-15",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cdn/profiles/{}/origingroups/{}", "2024-09-01"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cdn/profiles/{}/origingroups/{}", "2025-04-15"],
]
}

Expand Down Expand Up @@ -55,48 +55,19 @@ def _build_arguments_schema(cls, *args, **kwargs):
)
_args_schema.profile_name = AAZStrArg(
options=["--profile-name"],
help="Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group.",
help="Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group.",
required=True,
id_part="name",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$",
max_length=260,
min_length=1,
),
)
_args_schema.resource_group = AAZResourceGroupNameArg(
required=True,
)

# define Arg Group "HealthProbeSettings"

_args_schema = cls._args_schema
_args_schema.probe_interval_in_seconds = AAZIntArg(
options=["--probe-interval-in-seconds"],
arg_group="HealthProbeSettings",
help="The number of seconds between health probes.Default is 240sec.",
nullable=True,
fmt=AAZIntArgFormat(
maximum=255,
minimum=1,
),
)
_args_schema.probe_path = AAZStrArg(
options=["--probe-path"],
arg_group="HealthProbeSettings",
help="The path relative to the origin that is used to determine the health of the origin.",
nullable=True,
)
_args_schema.probe_protocol = AAZStrArg(
options=["--probe-protocol"],
arg_group="HealthProbeSettings",
help="Protocol to use for health probe.",
nullable=True,
enum={"Http": "Http", "Https": "Https", "NotSet": "NotSet"},
)
_args_schema.probe_request_type = AAZStrArg(
options=["--probe-request-type"],
arg_group="HealthProbeSettings",
help="The type of health probe request that is made.",
nullable=True,
enum={"GET": "GET", "HEAD": "HEAD", "NotSet": "NotSet"},
)

# define Arg Group "LoadBalancingSettings"

_args_schema = cls._args_schema
Expand All @@ -122,6 +93,12 @@ def _build_arguments_schema(cls, *args, **kwargs):
# define Arg Group "Properties"

_args_schema = cls._args_schema
_args_schema.health_probe_settings = AAZObjectArg(
options=["--health-probe-settings"],
arg_group="Properties",
help="Health probe settings to the origin that is used to determine the health of the origin.",
nullable=True,
)
_args_schema.session_affinity_state = AAZStrArg(
options=["--session-affinity-state"],
arg_group="Properties",
Expand All @@ -139,6 +116,34 @@ def _build_arguments_schema(cls, *args, **kwargs):
minimum=0,
),
)

health_probe_settings = cls._args_schema.health_probe_settings
health_probe_settings.probe_interval_in_seconds = AAZIntArg(
options=["probe-interval-in-seconds"],
help="The number of seconds between health probes.Default is 240sec.",
nullable=True,
fmt=AAZIntArgFormat(
maximum=255,
minimum=1,
),
)
health_probe_settings.probe_path = AAZStrArg(
options=["probe-path"],
help="The path relative to the origin that is used to determine the health of the origin.",
nullable=True,
)
health_probe_settings.probe_protocol = AAZStrArg(
options=["probe-protocol"],
help="Protocol to use for health probe.",
nullable=True,
enum={"Http": "Http", "Https": "Https", "NotSet": "NotSet"},
)
health_probe_settings.probe_request_type = AAZStrArg(
options=["probe-request-type"],
help="The type of health probe request that is made.",
nullable=True,
enum={"GET": "GET", "HEAD": "HEAD", "NotSet": "NotSet"},
)
return cls._args_schema

def _execute_operations(self):
Expand Down Expand Up @@ -223,7 +228,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-09-01",
"api-version", "2025-04-15",
required=True,
),
}
Expand Down Expand Up @@ -326,7 +331,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-09-01",
"api-version", "2025-04-15",
required=True,
),
}
Expand Down Expand Up @@ -388,7 +393,7 @@ def _update_instance(self, instance):

properties = _builder.get(".properties")
if properties is not None:
properties.set_prop("healthProbeSettings", AAZObjectType)
properties.set_prop("healthProbeSettings", AAZObjectType, ".health_probe_settings")
properties.set_prop("loadBalancingSettings", AAZObjectType)
properties.set_prop("sessionAffinityState", AAZStrType, ".session_affinity_state")
properties.set_prop("trafficRestorationTimeToHealedOrNewEndpointsInMinutes", AAZIntType, ".traffic_restoration_time_to_healed_or_new_endpoints_in_minutes")
Expand Down
Loading