Skip to content

Commit 51dd403

Browse files
authored
feat!: rename parameter names to align with other Azure CLI command experience (#52)
1 parent 0473617 commit 51dd403

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+327
-356
lines changed

src/apic-extension/HISTORY.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ Release History
66
1.0.0
77
++++++++++++++++++
88
* Update: Redesigned `az apic service import-from-apim` command to provide easier way to specify APIM instance
9+
* Update: Renamed `az apic service *` commands to `az apic *` commands
10+
* Update: Renamed `--name/--service/--service-name/-s` parameters in `az apic *` commands to `--name/-n`
11+
* Update: Renamed `--service/--service-name/-s` parameters in each sub commands to `--service-name/-n`
12+
* Update: Renamed `--metadata-schema/--metadata-schema-name/--name` parameters in `az apic metadata *` commands to `--metadata-name`
13+
* Update: Renamed `--environment-name` parameter in `az apic api register` command to `--environment-id`
914
* Fix: API title created by register command is not same with provided spec
1015
* Fix: Error not thrown when import spec with >3MB file
1116
* Fix: Error when register API with long description in spec

src/apic-extension/azext_apic_extension/_help.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@
2020
- name: --resource-group -g
2121
type: string
2222
short-summary: Resource group name.
23-
- name: --service -s
23+
- name: --service-name -n
2424
type: string
2525
short-summary: APICenter Catalog or Service name.
26-
- name: --environment-name -e
26+
- name: --environment-id
2727
type: string
28-
short-summary: Name of environment created before.
28+
short-summary: Id of environment created before.
2929
examples:
3030
- name: Register api by providing spec file.
3131
text: |
32-
az apic api register -g api-center-test -s contosoeuap --api-location "examples/cli-examples/spec-examples/openai.json" --environment-name public
33-
az apic api register -g api-center-test -s contosoeuap --api-location "examples/cli-examples/spec-examples/openai.yml" --environment-name public
32+
az apic api register -g api-center-test -n contosoeuap --api-location "examples/cli-examples/spec-examples/openai.json" --environment-id public
33+
az apic api register -g api-center-test -n contosoeuap --api-location "examples/cli-examples/spec-examples/openai.yml" --environment-id public
3434
"""

src/apic-extension/azext_apic_extension/_params.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ def load_arguments(self, _): # pylint: disable=unused-argument
2626
)
2727
c.argument(
2828
"service_name",
29-
options_list=['--service', '-s'],
29+
options_list=['--service-name', '-n'],
3030
help="Service name",
3131
required=True,
3232
)
3333
c.argument(
34-
"environment_name",
35-
options_list=['--environment-name', '-e'],
36-
help="Environemnt name",
34+
"environment_id",
35+
options_list=['--environment-id'],
36+
help="Environemnt id",
3737
required=False
3838
)

src/apic-extension/azext_apic_extension/aaz/latest/apic/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,9 @@
99
# flake8: noqa
1010

1111
from .__cmd_group import *
12+
from ._create import *
13+
from ._delete import *
14+
from ._import_from_apim import *
15+
from ._list import *
16+
from ._show import *
17+
from ._update import *

src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_create.py renamed to src/apic-extension/azext_apic_extension/aaz/latest/apic/_create.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@
1212

1313

1414
@register_command(
15-
"apic service create",
15+
"apic create",
1616
)
1717
class Create(AAZCommand):
1818
"""Creates an instance or update an existing instance of an Azure API Center service.
1919
2020
:example: Create service Example 1
21-
az apic service create -g contoso-resources -s contoso -l eastus
21+
az apic create -g contoso-resources -n contoso -l eastus
2222
2323
:example: Create Service Example 2
24-
az apic service create --resource-group contoso-resources --name contoso --location eastus
24+
az apic create --resource-group contoso-resources --name contoso --location eastus
2525
"""
2626

2727
_aaz_info = {
@@ -50,8 +50,8 @@ def _build_arguments_schema(cls, *args, **kwargs):
5050
_args_schema.resource_group = AAZResourceGroupNameArg(
5151
required=True,
5252
)
53-
_args_schema.service_name = AAZStrArg(
54-
options=["-s", "--name", "--service", "--service-name"],
53+
_args_schema.name = AAZStrArg(
54+
options=["-n", "--name"],
5555
help="The name of the API Center service.",
5656
required=True,
5757
fmt=AAZStrArgFormat(
@@ -149,7 +149,7 @@ def url_parameters(self):
149149
required=True,
150150
),
151151
**self.serialize_url_param(
152-
"serviceName", self.ctx.args.service_name,
152+
"serviceName", self.ctx.args.name,
153153
required=True,
154154
),
155155
**self.serialize_url_param(

src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_delete.py renamed to src/apic-extension/azext_apic_extension/aaz/latest/apic/_delete.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212

1313

1414
@register_command(
15-
"apic service delete",
15+
"apic delete",
1616
confirmation="Are you sure you want to perform this operation?",
1717
)
1818
class Delete(AAZCommand):
1919
"""Deletes an instance of an Azure API Center service.
2020
2121
:example: Delete service
22-
az apic service delete -s contoso -g contoso-resources
22+
az apic delete -n contoso -g contoso-resources
2323
"""
2424

2525
_aaz_info = {
@@ -48,8 +48,8 @@ def _build_arguments_schema(cls, *args, **kwargs):
4848
_args_schema.resource_group = AAZResourceGroupNameArg(
4949
required=True,
5050
)
51-
_args_schema.service_name = AAZStrArg(
52-
options=["-s", "--name", "--service", "--service-name"],
51+
_args_schema.name = AAZStrArg(
52+
options=["-n", "--name"],
5353
help="The name of the API Center service.",
5454
required=True,
5555
id_part="name",
@@ -110,7 +110,7 @@ def url_parameters(self):
110110
required=True,
111111
),
112112
**self.serialize_url_param(
113-
"serviceName", self.ctx.args.service_name,
113+
"serviceName", self.ctx.args.name,
114114
required=True,
115115
),
116116
**self.serialize_url_param(

src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_import_from_apim.py renamed to src/apic-extension/azext_apic_extension/aaz/latest/apic/_import_from_apim.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@
1212

1313

1414
@register_command(
15-
"apic service import-from-apim",
15+
"apic import-from-apim",
1616
)
1717
class ImportFromApim(AAZCommand):
1818
"""Imports APIs from an Azure API Management service instance.
1919
2020
:example: Import all APIs from APIM in same resource group
21-
az apic service import-from-apim -g api-center-test --service-name contoso-apic --apim-name contoso-apim --apim-apis *
21+
az apic import-from-apim -g api-center-test --service-name contoso-apic --apim-name contoso-apim --apim-apis *
2222
2323
:example: Import selected APIs from APIM in same resource group
24-
az apic service import-from-apim -g api-center-test --service-name contoso-apic --apim-name contoso-apim --apim-apis [echo,foo]
24+
az apic import-from-apim -g api-center-test --service-name contoso-apic --apim-name contoso-apim --apim-apis [echo,foo]
2525
2626
:example: Import all APIs from APIM in another subscription and resource group
27-
az apic service import-from-apim -g api-center-test --service-name contoso-apic --apim-subscription 00000000-0000-0000-0000-000000000000 --apim-resource-group apim-rg --apim-name contoso-apim --apim-apis *
27+
az apic import-from-apim -g api-center-test --service-name contoso-apic --apim-subscription 00000000-0000-0000-0000-000000000000 --apim-resource-group apim-rg --apim-name contoso-apim --apim-apis *
2828
"""
2929

3030
_aaz_info = {
@@ -55,7 +55,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
5555
required=True,
5656
)
5757
_args_schema.service_name = AAZStrArg(
58-
options=["-s", "--service", "--service-name"],
58+
options=["-n", "--service-name"],
5959
help="The name of Azure API Center service.",
6060
required=True,
6161
id_part="name",

src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_list.py renamed to src/apic-extension/azext_apic_extension/aaz/latest/apic/_list.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212

1313

1414
@register_command(
15-
"apic service list",
15+
"apic list",
1616
)
1717
class List(AAZCommand):
1818
"""Lists Azure API Center services within an Azure subscription.
1919
2020
:example: List services in resource group
21-
az apic service list -g contoso-resources
21+
az apic list -g contoso-resources
2222
"""
2323

2424
_aaz_info = {

src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_show.py renamed to src/apic-extension/azext_apic_extension/aaz/latest/apic/_show.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212

1313

1414
@register_command(
15-
"apic service show",
15+
"apic show",
1616
)
1717
class Show(AAZCommand):
1818
"""Show details of an Azure API Center service instance.
1919
2020
:example: Show service details
21-
az apic service show -g contoso-resources -s contoso
21+
az apic show -g contoso-resources -n contoso
2222
"""
2323

2424
_aaz_info = {
@@ -47,8 +47,8 @@ def _build_arguments_schema(cls, *args, **kwargs):
4747
_args_schema.resource_group = AAZResourceGroupNameArg(
4848
required=True,
4949
)
50-
_args_schema.service_name = AAZStrArg(
51-
options=["-s", "--name", "--service", "--service-name"],
50+
_args_schema.name = AAZStrArg(
51+
options=["-n", "--name"],
5252
help="The name of the API Center service.",
5353
required=True,
5454
id_part="name",
@@ -111,7 +111,7 @@ def url_parameters(self):
111111
required=True,
112112
),
113113
**self.serialize_url_param(
114-
"serviceName", self.ctx.args.service_name,
114+
"serviceName", self.ctx.args.name,
115115
required=True,
116116
),
117117
**self.serialize_url_param(

src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_update.py renamed to src/apic-extension/azext_apic_extension/aaz/latest/apic/_update.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212

1313

1414
@register_command(
15-
"apic service update",
15+
"apic update",
1616
)
1717
class Update(AAZCommand):
1818
"""Update an instance of an Azure API Center service.
1919
2020
:example: Update service details
21-
az apic service update -g contoso-resources -s contoso
21+
az apic update -g contoso-resources -n contoso
2222
"""
2323

2424
_aaz_info = {
@@ -47,9 +47,9 @@ def _build_arguments_schema(cls, *args, **kwargs):
4747
_args_schema.resource_group = AAZResourceGroupNameArg(
4848
required=True,
4949
)
50-
_args_schema.service_name = AAZStrArg(
51-
options=["-s", "--name", "--service", "--service-name"],
52-
help="The name of Azure API Center service.",
50+
_args_schema.name = AAZStrArg(
51+
options=["-n", "--name"],
52+
help="The name of the API Center service.",
5353
required=True,
5454
id_part="name",
5555
fmt=AAZStrArgFormat(
@@ -140,7 +140,7 @@ def url_parameters(self):
140140
required=True,
141141
),
142142
**self.serialize_url_param(
143-
"serviceName", self.ctx.args.service_name,
143+
"serviceName", self.ctx.args.name,
144144
required=True,
145145
),
146146
**self.serialize_url_param(

0 commit comments

Comments
 (0)