Skip to content

Commit

Permalink
refactor: integration examples and bad example for apic update (#91)
Browse files Browse the repository at this point in the history
* refactor: integration examples

* fix: apic update example
  • Loading branch information
frankqianms authored Jan 13, 2025
1 parent 4febe76 commit d2cf45b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Update(AAZCommand):
az apic update -g contoso-resources -n contoso
:example: Update Service With System Assigned Identity Example
az apic create -g contoso-resources -n contoso --identity '{type:systemassigned}'
az apic update -g contoso-resources -n contoso --identity '{type:systemassigned}'
"""

_aaz_info = {
Expand Down
12 changes: 6 additions & 6 deletions src/apic-extension/azext_apic_extension/command_patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,10 +328,10 @@ class CreateApimIntegration(DefaultWorkspaceParameter, CreateIntegration):
"""Add Azure APIM as an API source
:example: Add Azure APIM in the same resource group as the Azure API Center instance as an API source
az apic integration create apim -g contoso-resources -n contoso --integration-name sync-from-my-apim --azure-apim myapim
az apic integration create apim -g contoso-resources -n contoso -i sync-from-my-apim --azure-apim myapim
:example: Add Azure APIM in another resource group as an API source
az apic integration create apim -g contoso-resources -n contoso --integration-name sync-from-my-apim --azure-apim /subscriptions/12345678-1234-1234-1234-123456789abc/resourceGroups/samplegroup/providers/Microsoft.ApiManagement/service/sampleapim
az apic integration create apim -g contoso-resources -n contoso -i sync-from-my-apim --azure-apim /subscriptions/12345678-1234-1234-1234-123456789abc/resourceGroups/samplegroup/providers/Microsoft.ApiManagement/service/sampleapim
"""
# pylint: enable=C0301
Expand Down Expand Up @@ -396,7 +396,7 @@ class CreateAmazonApiGatewayIntegration(DefaultWorkspaceParameter, CreateIntegra
"""Add Amazon API Gateway as an API source
:example: Add Amazon API Gateway as an API source
az apic integration create aws -g contoso-resources -n contoso --integration-name sync-from-my-amazon-api-gateway --aws-access-key-reference https://mykey.vault.azure.net/secrets/AccessKey --aws-secret-access-key-reference https://mykey.vault.azure.net/secrets/SecretAccessKey --aws-region-name us-east-2
az apic integration create aws -g contoso-resources -n contoso -i sync-from-my-amazon-api-gateway -a https://{keyvaultName}.vault.azure.net/secrets/{secretName1} -s https://{keyvaultName}.vault.azure.net/secrets/{secretName2} -r us-east-2
"""

@classmethod
Expand Down Expand Up @@ -425,7 +425,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
required=True,
)
args_schema.region_name = AAZStrArg(
options=["--aws-region-name"],
options=["--aws-region-name", "-r"],
arg_group="AmazonApiGatewaySource",
help="Amazon API Gateway Region (ex. us-east-2).",
required=True,
Expand Down Expand Up @@ -463,7 +463,7 @@ class ImportAmazonApiGatewaySource(DefaultWorkspaceParameter, Import):
"""Import an Amazon API Gateway API source
:example: Import an Amazon API Gateway API source
az apic import aws -g contoso-resources -n contoso --aws-access-key-reference https://mykey.vault.azure.net/secrets/AccessKey --aws-secret-access-key-reference https://mykey.vault.azure.net/secrets/SecretAccessKey --aws-region-name us-east-2
az apic import aws -g contoso-resources -n contoso -a https://{keyvaultName}.vault.azure.net/secrets/{secretName1} -s https://{keyvaultName}.vault.azure.net/secrets/{secretName2} -r us-east-2
"""

@classmethod
Expand Down Expand Up @@ -493,7 +493,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
required=True,
)
args_schema.region_name = AAZStrArg(
options=["--aws-region-name"],
options=["--aws-region-name", "-r"],
arg_group="AmazonApiGatewaySource",
help="Amazon API Gateway Region (ex. us-east-2).",
required=True,
Expand Down

0 comments on commit d2cf45b

Please sign in to comment.