-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[FluidRelay] Generate fluid-relay with CodeGen v2 #5155
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
091a214
[FluidRelay]Generate fluid-relay with codegen v2
ZengTaoxu 2cb35b3
update
ZengTaoxu 9e4f728
update
ZengTaoxu 17a3bfa
Merge branch 'Azure:main' into fluidrelay
ZengTaoxu 85599a2
Update service_name.json
ZengTaoxu 5e17f08
Merge branch 'fluidrelay' of https://github.com/ZengTaoxu/azure-cli-e…
ZengTaoxu e91e8f4
Update CODEOWNERS
ZengTaoxu 29adaa5
update
ZengTaoxu adb7976
Update azext_metadata.json
ZengTaoxu ae1e043
update
ZengTaoxu 4212def
Update azext_metadata.json
ZengTaoxu 0012f2c
update
ZengTaoxu d9cb79a
update
ZengTaoxu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| .. :changelog: | ||
|
|
||
| Release History | ||
| =============== | ||
|
|
||
| 0.1.0 | ||
| ++++++ | ||
| * Initial release. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| # Azure CLI FluidRelay Extension # | ||
| This is an extension to Azure CLI to manage FluidRelay resources. | ||
|
|
||
| ### How to use ### | ||
| ``` | ||
| az extension add --name fluid-relay | ||
| ``` | ||
|
|
||
| ### Included Features | ||
| #### Server: | ||
| Manage a fluid relay server: [more info](https://docs.microsoft.com/en-us/azure/azure-fluid-relay/overview/overview) | ||
| *Examples:* | ||
| ``` | ||
| az fluid-relay server create \ | ||
| -n TestFluidRelay \ | ||
| -l westus2 \ | ||
| -g MyResourceGroup \ | ||
| --sku standard \ | ||
| --tags category=sales \ | ||
| --identity type="SystemAssigned | ||
|
|
||
| az fluid-relay server create \ | ||
| -n TestFluidRelay \ | ||
| -l westus2 \ | ||
| -g MyResourceGroup \ | ||
| --sku standard \ | ||
| --tags category=sales \ | ||
| --identity type="SystemAssigned, UserAssigned" \ | ||
| user-assigned-identities= \ | ||
| {"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup/providers/ \ | ||
| Microsoft.ManagedIdentity/userAssignedIdentities/id1","/subscriptions/00000000-0000-0000-0000-000000000000/ \ | ||
| resourceGroups/MyResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2"} | ||
|
|
||
| az fluid-relay server update \ | ||
| -n MyFluidRelay \ | ||
| -l westus2 \ | ||
| -g MyResourceGroup \ | ||
| --tags category=sale | ||
|
|
||
| az fluid-relay server list-key \ | ||
| -g MyResourceGroup \ | ||
| --server-name MyServerName | ||
|
|
||
| az fluid-relay server regenerate-key \ | ||
| -g MyResourceGroup \ | ||
| --server-name MyServerName \ | ||
| --key-name key1 | ||
|
|
||
| az fluid-relay server list \ | ||
| --subscription 00000000-0000-0000-0000-000000000000 | ||
|
|
||
| az fluid-relay server list \ | ||
| -g MyResourceGroup | ||
|
|
||
| az fluid-relay server show \ | ||
| -g MyResourceGroup \ | ||
| -n MyFluidRelay | ||
| ``` | ||
|
|
||
| #### Container: | ||
| Manage a fluid relay container: [more info](https://docs.microsoft.com/en-us/azure/azure-fluid-relay/overview/overview) | ||
| ``` | ||
| az fluid-relay container list \ | ||
| -g MyResourceGroup \ | ||
| --server-name MyServerName | ||
|
|
||
| az fluid-relay container show \ | ||
| -g MyResourceGroup \ | ||
| --server-name MyServerName \ | ||
| -n MyContainerName | ||
|
|
||
| az fluid-relay container delete \ | ||
| -g MyResourceGroup \ | ||
| --server-name MyServerName \ | ||
| -n MyContainerName | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # 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 aaz-dev-tools | ||
| # -------------------------------------------------------------------------------------------- | ||
|
|
||
| from azure.cli.core import AzCommandsLoader | ||
| from azext_fluid_relay._help import helps # pylint: disable=unused-import | ||
|
|
||
|
|
||
| class FluidRelayCommandsLoader(AzCommandsLoader): | ||
|
|
||
| def __init__(self, cli_ctx=None): | ||
| from azure.cli.core.commands import CliCommandType | ||
| custom_command_type = CliCommandType( | ||
| operations_tmpl='azext_fluid_relay.custom#{}') | ||
| super().__init__(cli_ctx=cli_ctx, | ||
| custom_command_type=custom_command_type) | ||
|
|
||
| def load_command_table(self, args): | ||
| from azext_fluid_relay.commands import load_command_table | ||
| from azure.cli.core.aaz import load_aaz_command_table | ||
| try: | ||
| from . import aaz | ||
| except ImportError: | ||
| aaz = None | ||
| if aaz: | ||
| load_aaz_command_table( | ||
| loader=self, | ||
| aaz_pkg_name=aaz.__name__, | ||
| args=args | ||
| ) | ||
| load_command_table(self, args) | ||
| return self.command_table | ||
|
|
||
| def load_arguments(self, command): | ||
| from azext_fluid_relay._params import load_arguments | ||
| load_arguments(self, command) | ||
|
|
||
|
|
||
| COMMAND_LOADER_CLS = FluidRelayCommandsLoader |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # 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 aaz-dev-tools | ||
| # -------------------------------------------------------------------------------------------- | ||
|
|
||
| # pylint: disable=line-too-long | ||
| # pylint: disable=too-many-lines | ||
|
|
||
| from knack.help_files import helps # pylint: disable=unused-import |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # 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 aaz-dev-tools | ||
| # -------------------------------------------------------------------------------------------- | ||
|
|
||
| # pylint: disable=too-many-lines | ||
| # pylint: disable=too-many-statements | ||
|
|
||
|
|
||
| def load_arguments(self, _): # pylint: disable=unused-argument | ||
| pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # 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 aaz-dev-tools | ||
| # -------------------------------------------------------------------------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # 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 aaz-dev-tools | ||
| # -------------------------------------------------------------------------------------------- |
23 changes: 23 additions & 0 deletions
23
src/fluid-relay/azext_fluid_relay/aaz/latest/fluid_relay/__cmd_group.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # 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 aaz-dev-tools | ||
| # -------------------------------------------------------------------------------------------- | ||
|
|
||
| # pylint: skip-file | ||
| # flake8: noqa | ||
|
|
||
| from azure.cli.core.aaz import * | ||
|
|
||
|
|
||
| @register_command_group( | ||
| "fluid-relay", | ||
| ) | ||
| class __CMDGroup(AAZCommandGroup): | ||
| """Manage Fluid Relay | ||
| """ | ||
| pass | ||
|
|
||
|
|
||
| __all__ = ["__CMDGroup"] |
11 changes: 11 additions & 0 deletions
11
src/fluid-relay/azext_fluid_relay/aaz/latest/fluid_relay/__init__.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # 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 aaz-dev-tools | ||
| # -------------------------------------------------------------------------------------------- | ||
|
|
||
| # pylint: skip-file | ||
| # flake8: noqa | ||
|
|
||
| from .__cmd_group import * |
23 changes: 23 additions & 0 deletions
23
src/fluid-relay/azext_fluid_relay/aaz/latest/fluid_relay/container/__cmd_group.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # 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 aaz-dev-tools | ||
| # -------------------------------------------------------------------------------------------- | ||
|
|
||
| # pylint: skip-file | ||
| # flake8: noqa | ||
|
|
||
| from azure.cli.core.aaz import * | ||
|
|
||
|
|
||
| @register_command_group( | ||
| "fluid-relay container", | ||
| ) | ||
| class __CMDGroup(AAZCommandGroup): | ||
| """Manage Fluid Relay Container. | ||
| """ | ||
| pass | ||
|
|
||
|
|
||
| __all__ = ["__CMDGroup"] |
14 changes: 14 additions & 0 deletions
14
src/fluid-relay/azext_fluid_relay/aaz/latest/fluid_relay/container/__init__.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # 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 aaz-dev-tools | ||
| # -------------------------------------------------------------------------------------------- | ||
|
|
||
| # pylint: skip-file | ||
| # flake8: noqa | ||
|
|
||
| from .__cmd_group import * | ||
| from ._delete import * | ||
| from ._list import * | ||
| from ._show import * |
135 changes: 135 additions & 0 deletions
135
src/fluid-relay/azext_fluid_relay/aaz/latest/fluid_relay/container/_delete.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,135 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # 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 aaz-dev-tools | ||
| # -------------------------------------------------------------------------------------------- | ||
|
|
||
| # pylint: skip-file | ||
| # flake8: noqa | ||
|
|
||
| from azure.cli.core.aaz import * | ||
|
|
||
|
|
||
| @register_command( | ||
| "fluid-relay container delete", | ||
| confirmation="Are you sure you want to perform this operation?", | ||
| ) | ||
| class Delete(AAZCommand): | ||
| """Delete a Fluid Relay container. | ||
|
|
||
| :example: FluidRelayContainer_Delete | ||
| az fluid-relay container delete -g MyResourceGroup --server-name MyServerName -n MyContainerName | ||
| """ | ||
|
|
||
| _aaz_info = { | ||
| "version": "2022-06-01", | ||
| "resources": [ | ||
| ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.fluidrelay/fluidrelayservers/{}/fluidrelaycontainers/{}", "2022-06-01"], | ||
| ] | ||
| } | ||
|
|
||
| def _handler(self, command_args): | ||
| super()._handler(command_args) | ||
| self._execute_operations() | ||
| return None | ||
|
|
||
| _args_schema = None | ||
|
|
||
| @classmethod | ||
| def _build_arguments_schema(cls, *args, **kwargs): | ||
| if cls._args_schema is not None: | ||
| return cls._args_schema | ||
| cls._args_schema = super()._build_arguments_schema(*args, **kwargs) | ||
|
|
||
| # define Arg Group "" | ||
|
|
||
| _args_schema = cls._args_schema | ||
| _args_schema.container_name = AAZStrArg( | ||
| options=["-n", "--name", "--container-name"], | ||
| help="The Fluid Relay container resource name.", | ||
| required=True, | ||
| id_part="child_name_1", | ||
| ) | ||
| _args_schema.server_name = AAZStrArg( | ||
| options=["--server-name"], | ||
| help="The Fluid Relay server resource name.", | ||
| required=True, | ||
| id_part="name", | ||
| ) | ||
| _args_schema.resource_group = AAZResourceGroupNameArg( | ||
| required=True, | ||
| ) | ||
| return cls._args_schema | ||
|
|
||
| def _execute_operations(self): | ||
| self.FluidRelayContainersDelete(ctx=self.ctx)() | ||
|
|
||
| class FluidRelayContainersDelete(AAZHttpOperation): | ||
| CLIENT_TYPE = "MgmtClient" | ||
|
|
||
| def __call__(self, *args, **kwargs): | ||
| request = self.make_request() | ||
| session = self.client.send_request(request=request, stream=False, **kwargs) | ||
| if session.http_response.status_code in [200]: | ||
| return self.on_200(session) | ||
| if session.http_response.status_code in [204]: | ||
| return self.on_204(session) | ||
|
|
||
| return self.on_error(session.http_response) | ||
|
|
||
| @property | ||
| def url(self): | ||
| return self.client.format_url( | ||
| "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.FluidRelay/fluidRelayServers/{fluidRelayServerName}/fluidRelayContainers/{fluidRelayContainerName}", | ||
| **self.url_parameters | ||
| ) | ||
|
|
||
| @property | ||
| def method(self): | ||
| return "DELETE" | ||
|
|
||
| @property | ||
| def error_format(self): | ||
| return "MgmtErrorFormat" | ||
|
|
||
| @property | ||
| def url_parameters(self): | ||
| parameters = { | ||
| **self.serialize_url_param( | ||
| "fluidRelayContainerName", self.ctx.args.container_name, | ||
| required=True, | ||
| ), | ||
| **self.serialize_url_param( | ||
| "fluidRelayServerName", self.ctx.args.server_name, | ||
| required=True, | ||
| ), | ||
| **self.serialize_url_param( | ||
| "resourceGroup", self.ctx.args.resource_group, | ||
| required=True, | ||
| ), | ||
| **self.serialize_url_param( | ||
| "subscriptionId", self.ctx.subscription_id, | ||
| required=True, | ||
| ), | ||
| } | ||
| return parameters | ||
|
|
||
| @property | ||
| def query_parameters(self): | ||
| parameters = { | ||
| **self.serialize_query_param( | ||
| "api-version", "2022-06-01", | ||
| required=True, | ||
| ), | ||
| } | ||
| return parameters | ||
|
|
||
| def on_200(self, session): | ||
| pass | ||
|
|
||
| def on_204(self, session): | ||
| pass | ||
|
|
||
|
|
||
| __all__ = ["Delete"] | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to complete the examples part, same as other commands.