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: integration examples and bad example for apic update #91

Merged
merged 2 commits into from
Jan 13, 2025
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 @@ -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
Loading