forked from Azure/azure-cli-extensions
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FluidRelay] Generate fluid-relay with CodeGen v2 (Azure#5155)
* [FluidRelay] Generate fluid-relay with codegen v2 * Update service_name.json * Update CODEOWNERS * Update azext_metadata.json
- Loading branch information
Showing
34 changed files
with
4,505 additions
and
0 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains 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 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 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 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 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 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 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 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 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 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 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 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 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.