-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Logic]
az logic workflow
: Add new command group identity
to supp…
…ort managing identity (#7029)
- Loading branch information
Showing
109 changed files
with
7,604 additions
and
37,022 deletions.
There are no files selected for viewing
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
11 changes: 5 additions & 6 deletions
11
src/logic/azext_logic/manual/_help.py → src/logic/azext_logic/_help.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 |
---|---|---|
@@ -1,12 +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=too-many-lines | ||
|
||
from knack.help_files import helps | ||
# pylint: disable=line-too-long | ||
# pylint: disable=too-many-lines | ||
|
||
helps['logic'] = """ | ||
type: group | ||
short-summary: Manage Logic | ||
""" | ||
from knack.help_files import helps # pylint: disable=unused-import |
13 changes: 7 additions & 6 deletions
13
src/logic/azext_logic/action.py → src/logic/azext_logic/_params.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 |
---|---|---|
@@ -1,12 +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=wildcard-import | ||
# pylint: disable=unused-wildcard-import | ||
|
||
from .generated.action import * # noqa: F403 | ||
try: | ||
from .manual.action import * # noqa: F403 | ||
except ImportError: | ||
# 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
268 changes: 268 additions & 0 deletions
268
src/logic/azext_logic/aaz/latest/logic/integration_account/_create.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,268 @@ | ||
# -------------------------------------------------------------------------------------------- | ||
# 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( | ||
"logic integration-account create", | ||
) | ||
class Create(AAZCommand): | ||
"""Create an integration account. | ||
:example: Create integration account | ||
az logic integration-account create --sku Standard --name integration-account-name --resource-group rg | ||
""" | ||
|
||
_aaz_info = { | ||
"version": "2019-05-01", | ||
"resources": [ | ||
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.logic/integrationaccounts/{}", "2019-05-01"], | ||
] | ||
} | ||
|
||
def _handler(self, command_args): | ||
super()._handler(command_args) | ||
self._execute_operations() | ||
return self._output() | ||
|
||
_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.name = AAZStrArg( | ||
options=["-n", "--name"], | ||
help="The integration account name.", | ||
required=True, | ||
) | ||
_args_schema.resource_group = AAZResourceGroupNameArg( | ||
required=True, | ||
) | ||
_args_schema.location = AAZResourceLocationArg( | ||
help="The resource location.", | ||
fmt=AAZResourceLocationArgFormat( | ||
resource_group_arg="resource_group", | ||
), | ||
) | ||
_args_schema.integration_service_environment = AAZObjectArg( | ||
options=["--integration-service-environment"], | ||
help="The integration service environment.", | ||
) | ||
_args_schema.state = AAZStrArg( | ||
options=["--state"], | ||
help="The workflow state.", | ||
enum={"Completed": "Completed", "Deleted": "Deleted", "Disabled": "Disabled", "Enabled": "Enabled", "NotSpecified": "NotSpecified", "Suspended": "Suspended"}, | ||
) | ||
_args_schema.sku = AAZStrArg( | ||
options=["--sku"], | ||
help="The sku name.", | ||
enum={"Basic": "Basic", "Free": "Free", "NotSpecified": "NotSpecified", "Standard": "Standard"}, | ||
) | ||
_args_schema.tags = AAZDictArg( | ||
options=["--tags"], | ||
help="The resource tags.", | ||
) | ||
|
||
integration_service_environment = cls._args_schema.integration_service_environment | ||
integration_service_environment.id = AAZStrArg( | ||
options=["id"], | ||
help="The resource id.", | ||
) | ||
|
||
tags = cls._args_schema.tags | ||
tags.Element = AAZStrArg() | ||
return cls._args_schema | ||
|
||
def _execute_operations(self): | ||
self.pre_operations() | ||
self.IntegrationAccountsCreateOrUpdate(ctx=self.ctx)() | ||
self.post_operations() | ||
|
||
@register_callback | ||
def pre_operations(self): | ||
pass | ||
|
||
@register_callback | ||
def post_operations(self): | ||
pass | ||
|
||
def _output(self, *args, **kwargs): | ||
result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) | ||
return result | ||
|
||
class IntegrationAccountsCreateOrUpdate(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, 201]: | ||
return self.on_200_201(session) | ||
|
||
return self.on_error(session.http_response) | ||
|
||
@property | ||
def url(self): | ||
return self.client.format_url( | ||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}", | ||
**self.url_parameters | ||
) | ||
|
||
@property | ||
def method(self): | ||
return "PUT" | ||
|
||
@property | ||
def error_format(self): | ||
return "ODataV4Format" | ||
|
||
@property | ||
def url_parameters(self): | ||
parameters = { | ||
**self.serialize_url_param( | ||
"integrationAccountName", self.ctx.args.name, | ||
required=True, | ||
), | ||
**self.serialize_url_param( | ||
"resourceGroupName", 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", "2019-05-01", | ||
required=True, | ||
), | ||
} | ||
return parameters | ||
|
||
@property | ||
def header_parameters(self): | ||
parameters = { | ||
**self.serialize_header_param( | ||
"Content-Type", "application/json", | ||
), | ||
**self.serialize_header_param( | ||
"Accept", "application/json", | ||
), | ||
} | ||
return parameters | ||
|
||
@property | ||
def content(self): | ||
_content_value, _builder = self.new_content_builder( | ||
self.ctx.args, | ||
typ=AAZObjectType, | ||
typ_kwargs={"flags": {"required": True, "client_flatten": True}} | ||
) | ||
_builder.set_prop("location", AAZStrType, ".location") | ||
_builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) | ||
_builder.set_prop("sku", AAZObjectType) | ||
_builder.set_prop("tags", AAZDictType, ".tags") | ||
|
||
properties = _builder.get(".properties") | ||
if properties is not None: | ||
properties.set_prop("integrationServiceEnvironment", AAZObjectType, ".integration_service_environment") | ||
properties.set_prop("state", AAZStrType, ".state") | ||
|
||
integration_service_environment = _builder.get(".properties.integrationServiceEnvironment") | ||
if integration_service_environment is not None: | ||
integration_service_environment.set_prop("id", AAZStrType, ".id") | ||
|
||
sku = _builder.get(".sku") | ||
if sku is not None: | ||
sku.set_prop("name", AAZStrType, ".sku", typ_kwargs={"flags": {"required": True}}) | ||
|
||
tags = _builder.get(".tags") | ||
if tags is not None: | ||
tags.set_elements(AAZStrType, ".") | ||
|
||
return self.serialize_content(_content_value) | ||
|
||
def on_200_201(self, session): | ||
data = self.deserialize_http_content(session) | ||
self.ctx.set_var( | ||
"instance", | ||
data, | ||
schema_builder=self._build_schema_on_200_201 | ||
) | ||
|
||
_schema_on_200_201 = None | ||
|
||
@classmethod | ||
def _build_schema_on_200_201(cls): | ||
if cls._schema_on_200_201 is not None: | ||
return cls._schema_on_200_201 | ||
|
||
cls._schema_on_200_201 = AAZObjectType() | ||
|
||
_schema_on_200_201 = cls._schema_on_200_201 | ||
_schema_on_200_201.id = AAZStrType( | ||
flags={"read_only": True}, | ||
) | ||
_schema_on_200_201.location = AAZStrType() | ||
_schema_on_200_201.name = AAZStrType( | ||
flags={"read_only": True}, | ||
) | ||
_schema_on_200_201.properties = AAZObjectType( | ||
flags={"client_flatten": True}, | ||
) | ||
_schema_on_200_201.sku = AAZObjectType() | ||
_schema_on_200_201.tags = AAZDictType() | ||
_schema_on_200_201.type = AAZStrType( | ||
flags={"read_only": True}, | ||
) | ||
|
||
properties = cls._schema_on_200_201.properties | ||
properties.integration_service_environment = AAZObjectType( | ||
serialized_name="integrationServiceEnvironment", | ||
) | ||
properties.state = AAZStrType() | ||
|
||
integration_service_environment = cls._schema_on_200_201.properties.integration_service_environment | ||
integration_service_environment.id = AAZStrType() | ||
integration_service_environment.name = AAZStrType( | ||
flags={"read_only": True}, | ||
) | ||
integration_service_environment.type = AAZStrType( | ||
flags={"read_only": True}, | ||
) | ||
|
||
sku = cls._schema_on_200_201.sku | ||
sku.name = AAZStrType( | ||
flags={"required": True}, | ||
) | ||
|
||
tags = cls._schema_on_200_201.tags | ||
tags.Element = AAZStrType() | ||
|
||
return cls._schema_on_200_201 | ||
|
||
|
||
class _CreateHelper: | ||
"""Helper class for Create""" | ||
|
||
|
||
__all__ = ["Create"] |
Oops, something went wrong.