Skip to content

Commit e52f0b2

Browse files
author
Henry Dai
committed
Merge remote-tracking branch 'other-repo/henrydai/ImplementCRUDforChangeState' into henrydai/implementChangeStateCRUD0901
2 parents 871d9b4 + bf2565b commit e52f0b2

File tree

11 files changed

+44
-32
lines changed

11 files changed

+44
-32
lines changed

src/azure-changesafety/README.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Azure CLI Change Safety Extension
2-
Azure CLI extension for managing Change Safety `ChangeState` resources used to coordinate operational changes across Azure targets.
2+
Azure CLI extension for managing Change Safety `ChangeRecord` resources. A ChangeRecord describes a planned change to one or more Azure resources, enabling coordination, tracking, and safe deployment across your environment.
33

44
## Installation
55
```bash
@@ -10,23 +10,35 @@ az extension add --name azure-changesafety
1010

1111
## Commands
1212
```bash
13-
az changesafety changerecord create # Create a ChangeState definition for one or more targets.
13+
az changesafety changerecord create # Create a ChangeRecord for one or more targets.
1414
az changesafety changerecord update # Update metadata, rollout configuration, or target definitions.
15-
az changesafety changerecord delete # Delete a ChangeState resource.
16-
az changesafety changerecord show # Display details for a ChangeState resource.
15+
az changesafety changerecord delete # Delete a ChangeRecord resource.
16+
az changesafety changerecord show # Display details for a ChangeRecord resource.
1717
```
1818

1919
Run `az changesafety changerecord -h` to see full parameter details and examples.
2020

2121
## Examples
22-
Create a ChangeState describing a web app rollout:
22+
Create a ChangeRecord for a manual touch operation (e.g., VM maintenance):
23+
```bash
24+
az changesafety changerecord create \
25+
-g MyResourceGroup \
26+
-n changerecord-vm-maintenance \
27+
--change-type ManualTouch \
28+
--rollout-type Normal \
29+
--targets "resourceId=/subscriptions/<subId>/resourceGroups/MyResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm,operation=PATCH" \
30+
--stagemap-name myStageMap
31+
```
32+
33+
Create a ChangeRecord for an app deployment with a StageMap reference:
2334
```bash
2435
az changesafety changerecord create \
2536
-g MyResourceGroup \
2637
-n changerecord-webapp-rollout \
2738
--change-type AppDeployment \
2839
--rollout-type Normal \
29-
--targets "resourceId=/subscriptions/<subId>/resourceGroups/MyResourceGroup/providers/Microsoft.Web/sites/myApp,operation=create" \
40+
--targets "resourceId=/subscriptions/<subId>/resourceGroups/MyResourceGroup/providers/Microsoft.Web/sites/myApp,operation=PUT" \
41+
--stage-map "{resource-id:/subscriptions/<subId>/resourceGroups/MyResourceGroup/providers/Microsoft.ChangeSafety/stageMaps/rolloutStageMap}" \
3042
--links name=Runbook uri=https://contoso.com/runbook
3143
```
3244

@@ -39,7 +51,7 @@ az changesafety changerecord update \
3951
--comments "Escalated due to customer impact"
4052
```
4153

42-
Delete a ChangeState:
54+
Delete a ChangeRecord:
4355
```bash
4456
az changesafety changerecord delete -g MyResourceGroup -n changerecord-webapp-rollout --yes
4557
```

src/azure-changesafety/azext_changesafety/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from azext_changesafety._help import helps # pylint: disable=unused-import
1010

1111

12-
class ChangeStateCommandsLoader(AzCommandsLoader):
12+
class ChangeRecordCommandsLoader(AzCommandsLoader):
1313

1414
def __init__(self, cli_ctx=None):
1515
from azure.cli.core.commands import CliCommandType
@@ -39,4 +39,4 @@ def load_arguments(self, command):
3939
load_arguments(self, command)
4040

4141

42-
COMMAND_LOADER_CLS = ChangeStateCommandsLoader
42+
COMMAND_LOADER_CLS = ChangeRecordCommandsLoader

src/azure-changesafety/azext_changesafety/_help.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717

1818
helps['changesafety changerecord'] = """
1919
type: group
20-
short-summary: Manage ChangeState resources that describe planned changes across targets.
20+
short-summary: Manage ChangeRecord resources that describe planned changes across targets.
2121
"""
2222

2323
helps['changesafety changerecord create'] = """
2424
type: command
25-
short-summary: Create a ChangeState resource.
25+
short-summary: Create a ChangeRecord resource.
2626
long-summary: >
27-
Provide at least one target definition to describe which resources or operations the ChangeState
27+
Provide at least one target definition to describe which resources or operations the ChangeRecord
2828
will affect. Targets are expressed as comma or semicolon separated key=value pairs such as
2929
resourceId=RESOURCE_ID,operation=DELETE. The command is also available through the alias
3030
`az changesafety changerecord`. If you omit scheduling flags, the anticipated start time defaults
@@ -66,10 +66,10 @@
6666

6767
helps['changesafety changerecord update'] = """
6868
type: command
69-
short-summary: Update an existing ChangeState resource.
69+
short-summary: Update an existing ChangeRecord resource.
7070
long-summary: >
7171
Use this command to modify descriptive metadata, rollout settings, or replace targets for an
72-
existing ChangeState. When you pass --targets, the supplied definitions overwrite the previous set.
72+
existing ChangeRecord. When you pass --targets, the supplied definitions overwrite the previous set.
7373
This command is also available through the alias `az change-safety change-record`.
7474
parameters:
7575
- name: --targets
@@ -100,18 +100,18 @@
100100

101101
helps['changesafety changerecord delete'] = """
102102
type: command
103-
short-summary: Delete a ChangeState resource.
103+
short-summary: Delete a ChangeRecord resource.
104104
examples:
105-
- name: Delete a change state without confirmation
105+
- name: Delete a ChangeRecord without confirmation
106106
text: |-
107107
az changesafety changerecord delete -g MyResourceGroup -n changerecord001 --yes
108108
"""
109109

110110
helps['changesafety changerecord show'] = """
111111
type: command
112-
short-summary: Show details for a ChangeState resource.
112+
short-summary: Show details for a ChangeRecord resource.
113113
examples:
114-
- name: Show a change state
114+
- name: Show a ChangeRecord
115115
text: |-
116116
az changesafety changerecord show -g MyResourceGroup -n changerecord001
117117
"""

src/azure-changesafety/azext_changesafety/aaz/latest/change_safety/change_state/_create.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"changesafety changestate create",
1616
)
1717
class Create(AAZCommand):
18-
"""Create a ChangeState
18+
"""Create a ChangeRecord
1919
"""
2020

2121
_aaz_info = {
@@ -44,7 +44,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
4444
_args_schema = cls._args_schema
4545
_args_schema.change_state_name = AAZStrArg(
4646
options=["-n", "--name", "--change-record-name"],
47-
help="The name of the ChangeState resource.",
47+
help="The name of the ChangeRecord resource.",
4848
required=True,
4949
fmt=AAZStrArgFormat(
5050
pattern="^[a-zA-Z0-9-]{3,100}$",
@@ -88,7 +88,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
8888
_args_schema.comments = AAZStrArg(
8989
options=["--comments"],
9090
arg_group="Properties",
91-
help="Comments about the last update to the changeState resource.",
91+
help="Comments about the last update to the ChangeRecord resource.",
9292
fmt=AAZStrArgFormat(
9393
max_length=2000,
9494
),

src/azure-changesafety/azext_changesafety/aaz/latest/change_safety/change_state/_delete.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
confirmation="Are you sure you want to perform this operation?",
1717
)
1818
class Delete(AAZCommand):
19-
"""Delete a ChangeState
19+
"""Delete a ChangeRecord
2020
"""
2121

2222
_aaz_info = {
@@ -44,7 +44,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
4444
_args_schema = cls._args_schema
4545
_args_schema.change_state_name = AAZStrArg(
4646
options=["-n", "--name", "--change-record-name"],
47-
help="The name of the ChangeState resource.",
47+
help="The name of the ChangeRecord resource.",
4848
required=True,
4949
id_part="name",
5050
fmt=AAZStrArgFormat(

src/azure-changesafety/azext_changesafety/aaz/latest/change_safety/change_state/_show.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"changesafety changestate show",
1616
)
1717
class Show(AAZCommand):
18-
"""Get a ChangeState
18+
"""Get a ChangeRecord
1919
"""
2020

2121
_aaz_info = {
@@ -44,7 +44,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
4444
_args_schema = cls._args_schema
4545
_args_schema.change_state_name = AAZStrArg(
4646
options=["-n", "--name", "--change-record-name"],
47-
help="The name of the ChangeState resource.",
47+
help="The name of the ChangeRecord resource.",
4848
required=True,
4949
id_part="name",
5050
fmt=AAZStrArgFormat(

src/azure-changesafety/azext_changesafety/aaz/latest/change_safety/change_state/_update.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"changesafety changestate update",
1616
)
1717
class Update(AAZCommand):
18-
"""Update a ChangeState
18+
"""Update a ChangeRecord
1919
"""
2020

2121
_aaz_info = {
@@ -46,7 +46,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
4646
_args_schema = cls._args_schema
4747
_args_schema.change_state_name = AAZStrArg(
4848
options=["-n", "--name", "--change-record-name"],
49-
help="The name of the ChangeState resource.",
49+
help="The name of the ChangeRecord resource.",
5050
required=True,
5151
id_part="name",
5252
fmt=AAZStrArgFormat(
@@ -92,7 +92,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
9292
_args_schema.comments = AAZStrArg(
9393
options=["--comments"],
9494
arg_group="Properties",
95-
help="Comments about the last update to the changeState resource.",
95+
help="Comments about the last update to the ChangeRecord resource.",
9696
nullable=True,
9797
fmt=AAZStrArgFormat(
9898
max_length=2000,

src/azure-changesafety/azext_changesafety/aaz/latest/change_safety/stage_progression/_create.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
4444
_args_schema = cls._args_schema
4545
_args_schema.change_state_name = AAZStrArg(
4646
options=["--change-record-name"],
47-
help="The name of the ChangeState resource.",
47+
help="The name of the ChangeRecord resource.",
4848
required=True,
4949
fmt=AAZStrArgFormat(
5050
pattern="^[a-zA-Z0-9-]{3,100}$",

src/azure-changesafety/azext_changesafety/aaz/latest/change_safety/stage_progression/_delete.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
4545
_args_schema = cls._args_schema
4646
_args_schema.change_state_name = AAZStrArg(
4747
options=["--change-record-name"],
48-
help="The name of the ChangeState resource.",
48+
help="The name of the ChangeRecord resource.",
4949
required=True,
5050
id_part="name",
5151
fmt=AAZStrArgFormat(

src/azure-changesafety/azext_changesafety/aaz/latest/change_safety/stage_progression/_show.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
4444
_args_schema = cls._args_schema
4545
_args_schema.change_state_name = AAZStrArg(
4646
options=["--change-record-name"],
47-
help="The name of the ChangeState resource.",
47+
help="The name of the ChangeRecord resource.",
4848
required=True,
4949
id_part="name",
5050
fmt=AAZStrArgFormat(

0 commit comments

Comments
 (0)