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

Fix help text #37

Merged
merged 1 commit into from
Mar 22, 2022
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
29 changes: 15 additions & 14 deletions src/containerapp/azext_containerapp/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

helps['containerapp'] = """
type: group
short-summary: Commands to manage Azure Container Apps.
short-summary: Manage Azure Container Apps.
"""

helps['containerapp create'] = """
Expand All @@ -21,17 +21,18 @@
az containerapp create -n MyContainerapp -g MyResourceGroup \\
--image myregistry.azurecr.io/my-app:v1.0 --environment MyContainerappEnv \\
--ingress external --target-port 80 \\
--registry-server myregistry.azurecr.io --registry-username myregistry --registry-password $REGISTRY_PASSWORD \\
--query properties.configuration.ingress.fqdn
- name: Create a container app with resource requirements and replica count limits.
text: |
az containerapp create -n MyContainerapp -g MyResourceGroup \\
--image myregistry.azurecr.io/my-app:v1.0 --environment MyContainerappEnv \\
--image nginx --environment MyContainerappEnv \\
--cpu 0.5 --memory 1.0Gi \\
--min-replicas 4 --max-replicas 8
- name: Create a container app with secrets and environment variables.
text: |
az containerapp create -n MyContainerapp -g MyResourceGroup \\
--image myregistry.azurecr.io/my-app:v1.0 --environment MyContainerappEnv \\
--image my-app:v1.0 --environment MyContainerappEnv \\
--secrets mysecret=secretvalue1 anothersecret="secret value 2" \\
--env-vars GREETING="Hello, world" SECRETENV=secretref:anothersecret
- name: Create a container app using a YAML configuration. Example YAML configuration - https://docs.microsoft.com/azure/container-apps/azure-resource-manager-api-spec#examples
Expand Down Expand Up @@ -224,43 +225,43 @@

helps['containerapp env dapr-component'] = """
type: group
short-summary: Commmands to manage dapr components on the Container App environment.
short-summary: Commands to manage Dapr components for the Container Apps environment.
"""

helps['containerapp env dapr-component list'] = """
type: command
short-summary: List dapr components for a Containerapp environment.
short-summary: List Dapr components for an environment.
examples:
- name: List dapr components for a Containerapp environment.
- name: List Dapr components for an environment.
text: |
az containerapp env dapr-component list -g MyResourceGroup --name MyEnvironment
"""

helps['containerapp env dapr-component show'] = """
type: command
short-summary: Show the details of a dapr component.
short-summary: Show the details of a Dapr component.
examples:
- name: Show the details of a dapr component.
- name: Show the details of a Dapr component.
text: |
az containerapp env dapr-component show -g MyResourceGroup --dapr-component-name MyDaprComponentName --name MyEnvironment
"""

helps['containerapp env dapr-component set'] = """
type: command
short-summary: Create or update a dapr component.
short-summary: Create or update a Dapr component.
examples:
- name: Create a dapr component.
- name: Create a Dapr component.
text: |
az containerapp env dapr-component set -g MyResourceGroup --name MyEnv --yaml MyYAMLPath --dapr-component-name MyDaprComponentName
"""

helps['containerapp env dapr-component remove'] = """
type: command
short-summary: Remove a dapr componenet from a Containerapp environment.
short-summary: Remove a Dapr component from an environment.
examples:
- name: Remove a dapr componenet from a Containerapp environment.
- name: Remove a Dapr component from a Container Apps environment.
text: |
az containerapp env dapr-component remove -g MyResourceGroup --dapr-component-name MyDaprComponenetName --name MyEnvironment
az containerapp env dapr-component remove -g MyResourceGroup --dapr-component-name MyDaprComponentName --name MyEnvironment
"""

# Identity Commands
Expand Down Expand Up @@ -511,7 +512,7 @@
# Dapr Commands
helps['containerapp dapr'] = """
type: group
short-summary: Commands to manage Dapr.
short-summary: Commands to manage Dapr. To manage Dapr components, see `az containerapp env dapr-component`.
"""

helps['containerapp dapr enable'] = """
Expand Down
11 changes: 5 additions & 6 deletions src/containerapp/azext_containerapp/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def load_arguments(self, _):
c.argument('yaml', type=file_type, help='Path to a .yaml file with the configuration of a container app. All other parameters will be ignored. For an example, see https://docs.microsoft.com/azure/container-apps/azure-resource-manager-api-spec#examples')

# Container
with self.argument_context('containerapp', arg_group='Container (Creates new revision)') as c:
with self.argument_context('containerapp', arg_group='Container') as c:
c.argument('image', type=str, options_list=['--image', '-i'], help="Container image, e.g. publisher/image-name:tag.")
c.argument('container_name', type=str, help="Name of the container.")
c.argument('cpu', type=float, validator=validate_cpu, help="Required CPU in cores, e.g. 0.5")
Expand All @@ -42,14 +42,14 @@ def load_arguments(self, _):
c.argument('revision_suffix', type=str, help='User friendly suffix that is appended to the revision name')

# Env vars
with self.argument_context('containerapp', arg_group='Environment variables (Creates new revision)') as c:
with self.argument_context('containerapp', arg_group='Environment variables') as c:
c.argument('set_env_vars', nargs='*', help="A list of environment variable(s) to add to the container. Space-separated values in 'key=value' format. If stored as a secret, value must start with \'secretref:\' followed by the secret name.")
c.argument('remove_env_vars', nargs='*', help="A list of environment variable(s) to remove from container. Space-separated env var name values.")
c.argument('replace_env_vars', nargs='*', help="A list of environment variable(s) to replace from the container. Space-separated values in 'key=value' format. If stored as a secret, value must start with \'secretref:\' followed by the secret name.")
c.argument('remove_all_env_vars', help="Option to remove all environment variable(s) from the container.")

# Scale
with self.argument_context('containerapp', arg_group='Scale (Creates new revision)') as c:
with self.argument_context('containerapp', arg_group='Scale') as c:
c.argument('min_replicas', type=int, help="The minimum number of replicas.")
c.argument('max_replicas', type=int, help="The maximum number of replicas.")

Expand All @@ -59,7 +59,6 @@ def load_arguments(self, _):
c.argument('dapr_app_port', type=int, help="The port Dapr uses to talk to the application.")
c.argument('dapr_app_id', type=str, help="The Dapr application identifier.")
c.argument('dapr_app_protocol', type=str, arg_type=get_enum_type(['http', 'grpc']), help="The protocol Dapr uses to talk to the application.")
c.argument('dapr_components', help="The name of a yaml file containing a list of dapr components.")

# Configuration
with self.argument_context('containerapp', arg_group='Configuration') as c:
Expand Down Expand Up @@ -162,10 +161,10 @@ def load_arguments(self, _):
c.argument('secret_names', nargs='+', help="A list of secret(s) for the container app. Space-separated secret values names.")

with self.argument_context('containerapp env dapr-component') as c:
c.argument('dapr_app_id', help="The dapr app id.")
c.argument('dapr_app_id', help="The Dapr app ID.")
c.argument('dapr_app_port', help="The port of your app.")
c.argument('dapr_app_protocol', help="Tells Dapr which protocol your application is using. Allowed values: grpc, http.")
c.argument('dapr_component_name', help="The dapr component name.")
c.argument('dapr_component_name', help="The Dapr component name.")
c.argument('environment_name', options_list=['--name', '-n'], help="The environment name.")

with self.argument_context('containerapp revision set-mode') as c:
Expand Down
1 change: 0 additions & 1 deletion src/containerapp/azext_containerapp/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,6 @@ def create_containerapp(cmd,
dapr_app_port=None,
dapr_app_id=None,
dapr_app_protocol=None,
# dapr_components=None,
revision_suffix=None,
startup_command=None,
args=None,
Expand Down