-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[Breadth Coverage] logic apps #1423
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
Changes from 35 commits
57d3896
eef64c8
1824ffe
96ec237
ec74b58
d8b93e9
8c9eb5e
a65912c
dc7c9b5
7539b43
ea4fa96
784634a
6d4bc1e
83aeabc
7dfe858
325ffc3
8185c5a
a9259fe
414165d
b5121f6
0dd4e11
68fd993
6abf027
3ff3a91
8e1b9b6
4603792
746c558
292ee02
aa55b10
fb0ed48
98adc7f
00be4f2
2c3bafe
8a2c089
5633d6f
7547ee2
0b684fe
a4e8b5d
dd767e6
bf6df85
343044d
2d97a78
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -94,6 +94,8 @@ | |
|
|
||
| /src/blueprint/ @fengzhou-msft | ||
|
|
||
| /src/logic/ @bquantump | ||
|
|
||
| /src/databox/ @jsntcy | ||
|
|
||
| /src/hpc-cache/ @qianwens | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| .. :changelog: | ||
|
|
||
| Release History | ||
| =============== | ||
|
|
||
| 0.1.0 | ||
| ++++++ | ||
| * Initial release. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| Microsoft Azure CLI 'logic' Extension | ||
| ========================================== | ||
|
|
||
| This package is for the 'logic' extension. | ||
| i.e. 'az logic' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. See License.txt in the project root for license information. | ||
| # -------------------------------------------------------------------------------------------- | ||
|
|
||
| from azure.cli.core import AzCommandsLoader | ||
| from azext_logic.generated._help import helps # pylint: disable=unused-import | ||
|
|
||
|
|
||
| class LogicManagementClientCommandsLoader(AzCommandsLoader): | ||
|
|
||
| def __init__(self, cli_ctx=None): | ||
| from azure.cli.core.commands import CliCommandType | ||
| from azext_logic.generated._client_factory import cf_logic | ||
| logic_custom = CliCommandType( | ||
| operations_tmpl='azext_logic.custom#{}', | ||
| client_factory=cf_logic) | ||
| super(LogicManagementClientCommandsLoader, self).__init__(cli_ctx=cli_ctx, | ||
| custom_command_type=logic_custom) | ||
|
|
||
| def load_command_table(self, args): | ||
| from azext_logic.generated.commands import load_command_table | ||
| load_command_table(self, args) | ||
| try: | ||
| from azext_logic.manual.commands import load_command_table as load_command_table_manual | ||
| load_command_table_manual(self, args) | ||
| except ImportError: | ||
| pass | ||
| return self.command_table | ||
|
|
||
| def load_arguments(self, command): | ||
| from azext_logic.generated._params import load_arguments | ||
| load_arguments(self, command) | ||
| try: | ||
| from azext_logic.manual._params import load_arguments as load_arguments_manual | ||
| load_arguments_manual(self, command) | ||
| except ImportError: | ||
| pass | ||
|
|
||
|
|
||
| COMMAND_LOADER_CLS = LogicManagementClientCommandsLoader |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. See License.txt in the project root for license information. | ||
| # -------------------------------------------------------------------------------------------- | ||
| # pylint: disable=wildcard-import | ||
| # pylint: disable=unused-wildcard-import | ||
|
|
||
| from .generated.action import * # noqa: F403 | ||
| try: | ||
| from .manual.action import * # noqa: F403 | ||
| except ImportError: | ||
| pass |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "azext.isPreview": true, | ||
| "azext.minCliCoreVersion": "2.0.67" | ||
|
bquantump marked this conversation as resolved.
Outdated
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. See License.txt in the project root for license information. | ||
| # -------------------------------------------------------------------------------------------- | ||
| # pylint: disable=wildcard-import | ||
| # pylint: disable=unused-wildcard-import | ||
|
|
||
| from .generated.commands import * # noqa: F403 | ||
| try: | ||
| from .manual.commands import * # noqa: F403 | ||
| except ImportError: | ||
| pass |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. See License.txt in the project root for license information. | ||
| # -------------------------------------------------------------------------------------------- | ||
| # pylint: disable=wildcard-import | ||
| # pylint: disable=unused-wildcard-import | ||
|
|
||
| from .generated.custom import * # noqa: F403 | ||
| try: | ||
| from .manual.custom import * # noqa: F403 | ||
| except ImportError: | ||
| pass |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # coding=utf-8 | ||
| # -------------------------------------------------------------------------- | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. See License.txt in the project root for | ||
| # license information. | ||
| # | ||
| # Code generated by Microsoft (R) AutoRest Code Generator. | ||
| # Changes may cause incorrect behavior and will be lost if the code is | ||
| # regenerated. | ||
| # -------------------------------------------------------------------------- | ||
|
|
||
| __path__ = __import__('pkgutil').extend_path(__path__, __name__) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. See License.txt in the project root for license information. | ||
| # -------------------------------------------------------------------------------------------- | ||
|
|
||
|
|
||
| def cf_logic(cli_ctx, *_): | ||
| from azure.cli.core.commands.client_factory import get_mgmt_service_client | ||
| from ..vendored_sdks.logic import LogicManagementClient | ||
| return get_mgmt_service_client(cli_ctx, LogicManagementClient) | ||
|
|
||
|
|
||
| def cf_workflow(cli_ctx, *_): | ||
| return cf_logic(cli_ctx).workflow | ||
|
|
||
|
|
||
| def cf_integration_account(cli_ctx, *_): | ||
| return cf_logic(cli_ctx).integration_account |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,119 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. See License.txt in the project root for license information. | ||
| # -------------------------------------------------------------------------------------------- | ||
| # pylint: disable=line-too-long | ||
| # pylint: disable=too-many-lines | ||
|
|
||
| from knack.help_files import helps | ||
|
|
||
|
|
||
| helps['logic workflow'] = """ | ||
| type: group | ||
| short-summary: logic workflow | ||
| """ | ||
|
|
||
| helps['logic workflow list'] = """ | ||
| type: command | ||
| short-summary: Gets a list of workflows by subscription. | ||
| examples: | ||
| - name: List all workflows in a resource group | ||
| text: |- | ||
| az logic workflow list --resource-group "test_resource_group" | ||
|
bquantump marked this conversation as resolved.
|
||
| """ | ||
|
|
||
| helps['logic workflow show'] = """ | ||
| type: command | ||
| short-summary: Gets a workflow. | ||
| examples: | ||
| - name: Get a workflow | ||
| text: |- | ||
| az logic workflow show --resource-group "test_resource_group" --name "test_workflow" | ||
| """ | ||
|
|
||
| helps['logic workflow create'] = """ | ||
| type: command | ||
| short-summary: Creates or updates a workflow using a JSON file for the defintion. | ||
| examples: | ||
| - name: Create or update a workflow | ||
| text: |- | ||
| az logic workflow create --resource-group "test_resource_group" --location "centralus" --name "test_workflow" --definition "workflow.json" | ||
|
bquantump marked this conversation as resolved.
|
||
| """ | ||
|
|
||
| helps['logic workflow update'] = """ | ||
| type: command | ||
| short-summary: Updates a workflow. | ||
| examples: | ||
| - name: Patch a workflow | ||
| text: |- | ||
| az logic workflow update --resource-group "test_resource_group" --definition workflow.json --name "test_workflow" | ||
| """ | ||
|
|
||
| helps['logic workflow delete'] = """ | ||
| type: command | ||
| short-summary: Deletes a workflow. | ||
| examples: | ||
| - name: Delete a workflow | ||
| text: |- | ||
| az logic workflow delete --resource-group "test_resource_group" --name "test_workflow" | ||
| """ | ||
|
|
||
| helps['logic integration-account'] = """ | ||
| type: group | ||
| short-summary: logic integration-account | ||
| """ | ||
|
|
||
| helps['logic integration-account list'] = """ | ||
| type: command | ||
| short-summary: Gets a list of integration accounts by subscription. | ||
| examples: | ||
| - name: List integration accounts by resource group name | ||
| text: |- | ||
| az logic integration-account list --resource-group "test_resource_group" | ||
| """ | ||
|
|
||
| helps['logic integration-account show'] = """ | ||
| type: command | ||
| short-summary: Gets an integration account. | ||
| examples: | ||
| - name: Get integration account by name | ||
| text: |- | ||
| az logic integration-account show --name "test_integration_account" --resource-group "test_resource_group" | ||
| """ | ||
|
|
||
| helps['logic integration-account create'] = """ | ||
| type: command | ||
| short-summary: Creates or updates an integration account. | ||
| examples: | ||
| - name: Create or update an integration account | ||
| text: |- | ||
| az logic integration-account create --location "centralus" --sku name=Standard --name "test_integration_account" --resource-group "test_resource_group" | ||
|
bquantump marked this conversation as resolved.
|
||
| """ | ||
|
|
||
| helps['logic integration-account update'] = """ | ||
| type: command | ||
| short-summary: Updates an integration account. | ||
| examples: | ||
| - name: Patch an integration account | ||
| text: |- | ||
| az logic integration-account update --sku name=Basic --tag atag=123 --name "test_integration_account" --resource-group "test_resource_group" | ||
| """ | ||
|
|
||
|
|
||
| helps['logic integration-account import'] = """ | ||
| type: command | ||
| short-summary: Import an integration account from a JSON file. | ||
| examples: | ||
| - name: Import an integration account. | ||
| text: |- | ||
| az logic integration-account import --name "test_integration_account" --resource-group "test_resource_group" --input-path "integration.json" | ||
|
bquantump marked this conversation as resolved.
|
||
| """ | ||
|
|
||
| helps['logic integration-account delete'] = """ | ||
| type: command | ||
| short-summary: Deletes an integration account. | ||
| examples: | ||
| - name: Delete an integration account | ||
| text: |- | ||
| az logic integration-account delete --name "test_integration_account" --resource-group "test_resource_group" | ||
| """ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,132 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. See License.txt in the project root for license information. | ||
| # -------------------------------------------------------------------------------------------- | ||
| # pylint: disable=too-many-lines | ||
| # pylint: disable=too-many-statements | ||
|
|
||
| from argcomplete.completers import FilesCompleter | ||
| from knack.arguments import CLIArgumentType | ||
| from azure.cli.core.commands.parameters import ( | ||
| file_type, | ||
| tags_type, | ||
| get_enum_type, | ||
| resource_group_name_type, | ||
| get_location_type | ||
| ) | ||
| from azext_logic.action import ( | ||
| AddIntegrationAccount, | ||
| AddSku, | ||
| AddKeyVault | ||
| ) | ||
|
|
||
|
|
||
| def load_arguments(self, _): | ||
|
|
||
| with self.argument_context('logic workflow list') as c: | ||
| c.argument('resource_group_name', resource_group_name_type, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the argument name is defined as
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you suggesting to just remove the resource_group_name argument? That seems odd, because other developers can’t just glean from the code what arguments are part of a command. Maybe this is not the suggestion, though? |
||
| help='The resource group name.') | ||
| c.argument( | ||
| 'top', help='The number of items to be included in the result.') | ||
| c.argument('filter', help='The filter to apply on the operation. Options for filters include: State, Trigger, a' | ||
|
bquantump marked this conversation as resolved.
|
||
| 'nd ReferencedResourceId.') | ||
|
|
||
| with self.argument_context('logic workflow show') as c: | ||
| c.argument('resource_group_name', resource_group_name_type, | ||
| help='The resource group name.') | ||
| c.argument('name', options_list=[ | ||
| '--name', '-n'], help='The workflow name.') | ||
|
|
||
| with self.argument_context('logic workflow create') as c: | ||
| c.argument('resource_group_name', resource_group_name_type, | ||
| help='The resource group name.') | ||
| c.argument('name', options_list=[ | ||
| '--name', '-n'], help='The workflow name.') | ||
| c.argument('definition', type=file_type, help='Path to a workflow JSON file. ' + | ||
| 'This JSON format should match what the logic app design tool exports', completer=FilesCompleter()) | ||
| c.argument('location', arg_type=get_location_type( | ||
| self.cli_ctx), help='The resource location.') | ||
|
bquantump marked this conversation as resolved.
Outdated
|
||
| c.argument('integration_account', action=AddIntegrationAccount, | ||
| nargs='+', help='The integration account.') | ||
| c.argument('integration_service_environment', action=AddIntegrationAccount, nargs='+', help='The integration se' | ||
| 'rvice environment.') | ||
| c.argument('endpoints_configuration', arg_type=CLIArgumentType(options_list=['--endpoints-configuration'], | ||
| help='The endpoints configuration.')) | ||
| c.argument('access_control', arg_type=CLIArgumentType(options_list=['--access-control'], help='The access contr' | ||
| 'ol configuration.')) | ||
| c.argument('state', arg_type=get_enum_type(['NotSpecified', 'Completed', 'Enabled', 'Disabled', 'Deleted', 'Sus' | ||
| 'pended']), help='The state.') | ||
| c.argument('tags', tags_type, help='The resource tags.') | ||
|
|
||
| with self.argument_context('logic workflow update') as c: | ||
| c.argument('resource_group_name', resource_group_name_type, | ||
| help='The resource group name.') | ||
| c.argument('name', options_list=[ | ||
| '--name', '-n'], help='The workflow name.') | ||
| c.argument('state', arg_type=get_enum_type(['NotSpecified', 'Completed', 'Enabled', 'Disabled', 'Deleted', 'Sus' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are these values defined in an Enum type? If yes (take XXXState for example), we'd better to use
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @RodgeFu Should the codgen handle this?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @arrownj , i am not quite get the issue here. looks like the get_emum_type has already been used. could you provide more details? |
||
| 'pended']), help='The state.') | ||
| c.argument('definition', type=file_type, help='Path to a workflow JSON file. ' + | ||
| 'This JSON format should match what the logic app design tool exports', completer=FilesCompleter()) | ||
| c.argument('tags', tags_type, help='The resource tags.') | ||
|
|
||
| with self.argument_context('logic workflow delete') as c: | ||
| c.argument('resource_group_name', resource_group_name_type, | ||
| help='The resource group name.') | ||
| c.argument('name', options_list=[ | ||
| '--name', '-n'], help='The workflow name.') | ||
|
|
||
| with self.argument_context('logic integration-account list') as c: | ||
| c.argument('resource_group_name', resource_group_name_type, | ||
| help='The resource group name.') | ||
| c.argument( | ||
| 'top', help='The number of items to be included in the result.') | ||
|
|
||
| with self.argument_context('logic integration-account show') as c: | ||
| c.argument('resource_group_name', resource_group_name_type, | ||
| help='The resource group name.') | ||
| c.argument('name', options_list=[ | ||
| '--name', '-n'], help='The integration account name.') | ||
|
|
||
| with self.argument_context('logic integration-account create') as c: | ||
| c.argument('resource_group_name', resource_group_name_type, | ||
| help='The resource group name.') | ||
| c.argument('name', options_list=[ | ||
| '--name', '-n'], help='The integration account name.') | ||
| c.argument('location', arg_type=get_location_type( | ||
|
bquantump marked this conversation as resolved.
|
||
| self.cli_ctx), help='The resource location.') | ||
| c.argument('tags', tags_type, help='The resource tags.') | ||
| c.argument('sku', action=AddSku, nargs='+', help='The sku.') | ||
| c.argument('integration_service_environment', arg_type=CLIArgumentType(options_list=['--integration-service-env' | ||
| 'ironment'], help='The integration service environment.')) | ||
| c.argument('state', arg_type=get_enum_type(['NotSpecified', 'Completed', 'Enabled', 'Disabled', 'Deleted', 'Sus' | ||
| 'pended']), help='The workflow state.') | ||
|
|
||
| with self.argument_context('logic integration-account update') as c: | ||
| c.argument('resource_group_name', resource_group_name_type, | ||
| help='The resource group name.') | ||
| c.argument('name', options_list=[ | ||
| '--name', '-n'], help='The integration account name.') | ||
| c.argument('tags', tags_type, help='The resource tags.') | ||
| c.argument('sku', action=AddSku, nargs='+', help='The sku.') | ||
| c.argument('integration_service_environment', arg_type=CLIArgumentType(options_list=['--integration-service-env' | ||
| 'ironment'], help='The integration service environment.')) | ||
| c.argument('state', arg_type=get_enum_type(['NotSpecified', 'Completed', 'Enabled', 'Disabled', 'Deleted', 'Sus' | ||
| 'pended']), help='The workflow state.') | ||
|
|
||
| with self.argument_context('logic integration-account delete') as c: | ||
| c.argument('resource_group_name', resource_group_name_type, | ||
| help='The resource group name.') | ||
| c.argument('name', options_list=[ | ||
| '--name', '-n'], help='The integration account name.') | ||
|
|
||
| with self.argument_context('logic integration-account import') as c: | ||
| c.argument('resource_group_name', resource_group_name_type, | ||
| help='The resource group name.') | ||
| c.argument('name', options_list=[ | ||
| '--name', '-n'], help='The integration account name.') | ||
| c.argument('input_path', type=file_type, | ||
| help='Path to a intergration-account JSON file', completer=FilesCompleter()) | ||
| c.argument('location', arg_type=get_location_type( | ||
| self.cli_ctx), help='The resource location.') | ||
| c.argument('tags', tags_type, help='The resource tags.') | ||
| c.argument('sku', type=str, help='The integration account sku.') | ||
|
bquantump marked this conversation as resolved.
|
||
Uh oh!
There was an error while loading. Please reload this page.