Skip to content

Commit

Permalink
docs: update help message per feedback (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
blackchoey authored May 28, 2024
1 parent a5d7113 commit 061bea3
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/apic-extension/azext_apic_extension/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

helps['apic api register'] = """
type: command
short-summary: Registers a new API with version, definition, and associated deployments using the specification file as the source of truth.
short-summary: Registers a new API with version, definition, and associated deployments using the specification file as the source of truth. For now we only support OpenAPI JSON/YAML format.
parameters:
- name: --api-location -l
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ class List(AAZCommand):
:example: List APIs
az apic api list -g contoso-resources -s contoso
:example: List APIs with filter
az apic api list -g contoso-resources -s contoso --filter "kind eq 'rest'"
"""

_aaz_info = {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
interactions:
- request:
body: null
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
CommandName:
- apic api list
Connection:
- keep-alive
ParameterSetName:
- -g -s --filter
User-Agent:
- AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.11.9 (Windows-10-10.0.19045-SP0)
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis?$filter=kind%20eq%20%27rest%27&api-version=2024-03-01
response:
body:
string: '{"value":[{"type":"Microsoft.ApiCenter/services/workspaces/apis","properties":{"title":"Echo
API","kind":"rest","externalDocumentation":[],"contacts":[],"customProperties":{}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000003","name":"clitest000003","systemData":{"createdAt":"2024-05-27T03:36:06.086997Z","lastModifiedAt":"2024-05-27T03:36:06.0869958Z"}},{"type":"Microsoft.ApiCenter/services/workspaces/apis","properties":{"title":"Echo
API","kind":"rest","externalDocumentation":[],"contacts":[],"customProperties":{}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000004","name":"clitest000004","systemData":{"createdAt":"2024-05-27T03:36:08.8849381Z","lastModifiedAt":"2024-05-27T03:36:08.8849374Z"}}]}'
headers:
api-supported-versions:
- 2023-07-01-preview, 2024-03-01, 2024-03-15-preview
cache-control:
- no-cache
content-length:
- '956'
content-type:
- application/json; charset=utf-8
date:
- Mon, 27 May 2024 03:36:11 GMT
expires:
- '-1'
pragma:
- no-cache
strict-transport-security:
- max-age=31536000; includeSubDomains
vary:
- Accept-Encoding
x-cache:
- CONFIG_NOCACHE
x-content-type-options:
- nosniff
x-ms-ratelimit-remaining-subscription-global-reads:
- '3749'
x-msedge-ref:
- 'Ref A: 8DF30CDEB07A4750A8C3AFFA1E37F951 Ref B: MAA201060513029 Ref C: 2024-05-27T03:36:10Z'
x-powered-by:
- ASP.NET
status:
code: 200
message: OK
version: 1
Original file line number Diff line number Diff line change
Expand Up @@ -193,4 +193,15 @@ def test_examples_update_custom_properties(self, metadata_name):
})
self.cmd('az apic api update -g {rg} -s {s} --api-id {api} --custom-properties \'{customProperties}\'', checks=[
self.check('customProperties.{}'.format(metadata_name), True),
])

@ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32)
@ApicServicePreparer()
@ApicApiPreparer(parameter_name='api_id1')
@ApicApiPreparer(parameter_name='api_id2')
def test_examples_list_apis_with_filter(self, api_id1, api_id2):
self.cmd('az apic api list -g {rg} -s {s} --filter "kind eq \'rest\'"', checks=[
self.check('length(@)', 2),
self.check('@[0].name', api_id1),
self.check('@[1].name', api_id2)
])

0 comments on commit 061bea3

Please sign in to comment.