Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: add @filename.json examples #78

Merged
merged 6 commits into from
Nov 12, 2024
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 @@ -22,6 +22,9 @@ class Create(AAZCommand):

:example: Create API with custom properties
az apic api create -g contoso-resources -n contoso --api-id echo-api --title "Echo API" --type REST --custom-properties '{\"public-facing\":true}'

:example: Create API with custom properties using json file
az apic api create -g contoso-resources -n contoso --api-id echo-api --title "Echo API" --type REST --custom-properties '@customProperties.json'
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@blackchoey Would you like to put the new example here or to create another new example title?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's create a new example to show the use of @filename syntax, so users can clearly know it's about reading the json content from a file. Maybe the title can be: Create API with custom properties from a file (feel free to adjust the tile as you wish).

"""

_aaz_info = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ class Update(AAZCommand):
:example: Update custom properties
az apic api update -g contoso-resources -n contoso --api-id echo-api --custom-properties '{\"public-facing\":true}'

:example: Update custom properties using json file
az apic api update -g contoso-resources -n contoso --api-id echo-api --custom-properties '@customProperities.json'

:example: Update single custom metadata
az apic api update -g contoso-resources -n contoso --api-id echo-api --set customProperties.internal=false
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ class Create(AAZCommand):

:example: Create deployment
az apic api deployment create -g api-center-test -n contoso --deployment-id production --title "Production deployment" --description "Public cloud production deployment." --api-id echo-api --environment-id "/workspaces/default/environments/production" --definition-id "/workspaces/default/apis/echo-api/versions/2023-01-01/definitions/openapi" --server '{\"runtimeUri\":[\"https://example.com\"]}'

:example: Create deployment using server json file
az apic api deployment create -g api-center-test -n contoso --deployment-id production --title "Production deployment" --description "Public cloud production deployment." --api-id echo-api --environment-id "/workspaces/default/environments/production" --definition-id "/workspaces/default/apis/echo-api/versions/2023-01-01/definitions/openapi" --server '@server.json'
"""

_aaz_info = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ class Create(AAZCommand):

:example: Create metadata example 2
az apic metadata create --resource-group api-center-test --service-name contoso --metadata-name testregion --schema '{\"type\":\"string\",\"title\":\"testregion\",\"oneOf\":[{\"const\":\"Region1\",\"description\":\"\"},{\"const\":\"Region2\",\"description\":\"\"},{\"const\":\"Region3\",\"description\":\"\"}]}' --assignments '[{entity:api,required:true,deprecated:false},{entity:environment,required:true,deprecated:false}]'

:example: Create metadata using json file schema and assignments example
az apic metadata create --resource-group api-center-test --service-name contoso --metadata-name "test" --schema '@schema.json' --assignments '@assignments.json'
"""

_aaz_info = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ class Update(AAZCommand):

:example: Update schema
az apic metadata update --resource-group api-center-test --service-name contoso --metadata-name "test1" --schema '{\"type\":\"string\", \"title\":\"Last name\", \"pattern\": \"^[a-zA-Z0-9]+$\"}'

:example: Update schema using schema json file
az apic metadata update --resource-group api-center-test --service-name contoso --metadata-name "test1" --schema '@schema.json'
"""

_aaz_info = {
Expand Down
Loading