Skip to content
Open
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
6 changes: 6 additions & 0 deletions src/servicegroup/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
Release History
===============

1.0.0b2
+++++++
* Update service group commands to use stable API version 2026-08-01.
* Add support for service group criticality attributes.
* Remove the preview-only ``service-group list-ancestors`` command.

1.0.0b1
+++++++
* Initial release.
12 changes: 7 additions & 5 deletions src/servicegroup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ az service-group create --name ChildGroup --display-name "Child Group" \
--parent resource-id="/providers/Microsoft.Management/serviceGroups/ParentGroup"
```

#### Create a service group with a criticality attribute
```
az service-group create --name CriticalGroup --display-name "Critical Group" \
--attributes criticality=1 \
--parent resource-id="/providers/Microsoft.Management/serviceGroups/<tenantId>"
```

#### Show a service group
```
az service-group show --name MyServiceGroup
Expand All @@ -35,11 +42,6 @@ az service-group show --name MyServiceGroup
az service-group update --name MyServiceGroup --display-name "Updated Name"
```

#### List ancestors of a service group
```
az service-group list-ancestors --name MyServiceGroup
```

#### Delete a service group
```
az service-group delete --name MyServiceGroup --yes
Expand Down
15 changes: 5 additions & 10 deletions src/servicegroup/azext_servicegroup/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
text: >
az service-group create --name ChildGroup --display-name "Child Group"
--parent resource-id="/providers/Microsoft.Management/serviceGroups/ParentGroup"
- name: Create a service group with a criticality attribute
text: >
az service-group create --name CriticalGroup --display-name "Critical Group"
--attributes criticality=1
--parent resource-id="/providers/Microsoft.Management/serviceGroups/<tenantId>"
"""

helps['service-group show'] = """
Expand Down Expand Up @@ -64,16 +69,6 @@
az service-group delete --name MyServiceGroup --yes
"""

helps['service-group list-ancestors'] = """
type: command
short-summary: List the ancestors of a service group.
long-summary: Get the details of the service group's ancestors in the hierarchy.
examples:
- name: List ancestors of a service group
text: >
az service-group list-ancestors --name MyServiceGroup
"""

helps['service-group wait'] = """
type: command
short-summary: Place the CLI in a waiting state until a condition of the service group is met.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@
from ._create import *
from ._update import *
from ._delete import *
from ._list_ancestors import *
from ._wait import *
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ class Create(AAZCommand):
az service-group create --name MyServiceGroup --display-name "My Service Group" --parent resource-id="/providers/Microsoft.Management/serviceGroups/<tenantId>"
:example: Create a child service group under an existing parent
az service-group create --name ChildGroup --display-name "Child" --parent resource-id="/providers/Microsoft.Management/serviceGroups/ParentGroup"
:example: Create a service group with a criticality attribute
az service-group create --name CriticalGroup --display-name "Critical Group" --attributes criticality=1 --parent resource-id="/providers/Microsoft.Management/serviceGroups/<tenantId>"
"""

_aaz_info = {
"version": "2024-02-01-preview",
"version": "2026-08-01",
"resources": [
["mgmt-plane", "/providers/microsoft.management/servicegroups/{}", "2024-02-01-preview"],
["mgmt-plane", "/providers/microsoft.management/servicegroups/{}", "2026-08-01"],
]
}

Expand Down Expand Up @@ -74,6 +76,11 @@ def _build_arguments_schema(cls, *args, **kwargs):
# define Arg Group "Properties"

_args_schema = cls._args_schema
_args_schema.attributes = AAZObjectArg(
options=["--attributes"],
arg_group="Properties",
help="The attributes of the service group.",
)
_args_schema.display_name = AAZStrArg(
options=["--display-name"],
arg_group="Properties",
Expand All @@ -85,6 +92,16 @@ def _build_arguments_schema(cls, *args, **kwargs):
help="The details of the parent service group.",
)

attributes = cls._args_schema.attributes
attributes.criticality = AAZIntArg(
options=["criticality"],
help="The criticality designation of the service group. Valid values range from 0 through 4.",
fmt=AAZIntArgFormat(
maximum=4,
minimum=0,
),
)

parent = cls._args_schema.parent
parent.resource_id = AAZStrArg(
options=["resource-id"],
Expand Down Expand Up @@ -123,7 +140,7 @@ def __call__(self, *args, **kwargs):
session,
self.on_200_201,
self.on_error,
lro_options={"final-state-via": "azure-async-operation"},
lro_options={"final-state-via": "original-uri"},
path_format_arguments=self.url_parameters,
)
if session.http_response.status_code in [200, 201]:
Expand All @@ -132,7 +149,7 @@ def __call__(self, *args, **kwargs):
session,
self.on_200_201,
self.on_error,
lro_options={"final-state-via": "azure-async-operation"},
lro_options={"final-state-via": "original-uri"},
path_format_arguments=self.url_parameters,
)

Expand Down Expand Up @@ -167,7 +184,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-02-01-preview",
"api-version", "2026-08-01",
required=True,
),
}
Expand Down Expand Up @@ -198,9 +215,14 @@ def content(self):

properties = _builder.get(".properties")
if properties is not None:
properties.set_prop("attributes", AAZObjectType, ".attributes")
properties.set_prop("displayName", AAZStrType, ".display_name")
properties.set_prop("parent", AAZObjectType, ".parent")

attributes = _builder.get(".properties.attributes")
if attributes is not None:
attributes.set_prop("criticality", AAZIntType, ".criticality")

parent = _builder.get(".properties.parent")
if parent is not None:
parent.set_prop("resourceId", AAZStrType, ".resource_id")
Expand Down Expand Up @@ -249,6 +271,7 @@ def _build_schema_on_200_201(cls):
)

properties = cls._schema_on_200_201.properties
properties.attributes = AAZObjectType()
properties.display_name = AAZStrType(
serialized_name="displayName",
)
Expand All @@ -258,6 +281,9 @@ def _build_schema_on_200_201(cls):
flags={"read_only": True},
)

attributes = cls._schema_on_200_201.properties.attributes
attributes.criticality = AAZFloatType()

parent = cls._schema_on_200_201.properties.parent
parent.resource_id = AAZStrType(
serialized_name="resourceId",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ class Delete(AAZCommand):
"""

_aaz_info = {
"version": "2024-02-01-preview",
"version": "2026-08-01",
"resources": [
["mgmt-plane", "/providers/microsoft.management/servicegroups/{}", "2024-02-01-preview"],
["mgmt-plane", "/providers/microsoft.management/servicegroups/{}", "2026-08-01"],
]
}

Expand Down Expand Up @@ -123,7 +123,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-02-01-preview",
"api-version", "2026-08-01",
required=True,
),
}
Expand Down
Loading
Loading