forked from Azure/azure-cli-extensions
-
Notifications
You must be signed in to change notification settings - Fork 4
Generate AAZ hybridconnectivity SDK and remove vendored sdk #31
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
Open
vthiebaut10
wants to merge
1
commit into
main
Choose a base branch
from
feature-hybridconnectivity
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
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
20 changes: 20 additions & 0 deletions
20
src/ssh/azext_ssh/aaz/latest/hybrid_connectivity/__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,20 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # 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 * | ||
|
|
||
|
|
||
| class __CMDGroup(AAZCommandGroup): | ||
| """Command group for operations on the Hybrid Connectivity RP. | ||
| """ | ||
| pass | ||
|
|
||
|
|
||
| __all__ = ["__CMDGroup"] |
11 changes: 11 additions & 0 deletions
11
src/ssh/azext_ssh/aaz/latest/hybrid_connectivity/__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 * |
20 changes: 20 additions & 0 deletions
20
src/ssh/azext_ssh/aaz/latest/hybrid_connectivity/endpoint/__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,20 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # 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 * | ||
|
|
||
|
|
||
| class __CMDGroup(AAZCommandGroup): | ||
| """Endpoint Operations on Hybrid Connectivity RP | ||
| """ | ||
| pass | ||
|
|
||
|
|
||
| __all__ = ["__CMDGroup"] |
13 changes: 13 additions & 0 deletions
13
src/ssh/azext_ssh/aaz/latest/hybrid_connectivity/endpoint/__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,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: skip-file | ||
| # flake8: noqa | ||
|
|
||
| from .__cmd_group import * | ||
| from ._create import * | ||
| from ._list_credential import * |
239 changes: 239 additions & 0 deletions
239
src/ssh/azext_ssh/aaz/latest/hybrid_connectivity/endpoint/_create.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,239 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # 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 * | ||
|
|
||
|
|
||
| class Create(AAZCommand): | ||
| """Create the endpoint to the target resource. | ||
| """ | ||
|
|
||
| _aaz_info = { | ||
| "version": "2022-05-01-preview", | ||
| "resources": [ | ||
| ["mgmt-plane", "/{resourceuri}/providers/microsoft.hybridconnectivity/endpoints/{}", "2022-05-01-preview"], | ||
| ] | ||
| } | ||
|
|
||
| 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.endpoint_name = AAZStrArg( | ||
| options=["--endpoint-name"], | ||
| help="The endpoint name.", | ||
| required=True, | ||
| ) | ||
| _args_schema.resource_uri = AAZStrArg( | ||
| options=["--resource-uri"], | ||
| help="The fully qualified Azure Resource manager identifier of the resource to be connected.", | ||
| required=True, | ||
| ) | ||
|
|
||
| # define Arg Group "Properties" | ||
|
|
||
| _args_schema = cls._args_schema | ||
| _args_schema.resource_id = AAZStrArg( | ||
| options=["--resource-id"], | ||
| arg_group="Properties", | ||
| help="The resource Id of the connectivity endpoint (optional).", | ||
| ) | ||
| _args_schema.type = AAZStrArg( | ||
| options=["--type"], | ||
| arg_group="Properties", | ||
| help="The type of endpoint.", | ||
| enum={"custom": "custom", "default": "default"}, | ||
| ) | ||
| return cls._args_schema | ||
|
|
||
| def _execute_operations(self): | ||
| self.pre_operations() | ||
| self.EndpointsCreateOrUpdate(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=False) | ||
| return result | ||
|
|
||
| class EndpointsCreateOrUpdate(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) | ||
|
|
||
| return self.on_error(session.http_response) | ||
|
|
||
| @property | ||
| def url(self): | ||
| return self.client.format_url( | ||
| "/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}", | ||
| **self.url_parameters | ||
| ) | ||
|
|
||
| @property | ||
| def method(self): | ||
| return "PUT" | ||
|
|
||
| @property | ||
| def error_format(self): | ||
| return "MgmtErrorFormat" | ||
|
|
||
| @property | ||
| def url_parameters(self): | ||
| parameters = { | ||
| **self.serialize_url_param( | ||
| "endpointName", self.ctx.args.endpoint_name, | ||
| skip_quote=True, | ||
| required=True, | ||
| ), | ||
| **self.serialize_url_param( | ||
| "resourceUri", self.ctx.args.resource_uri, | ||
| skip_quote=True, | ||
| required=True, | ||
| ), | ||
| } | ||
| return parameters | ||
|
|
||
| @property | ||
| def query_parameters(self): | ||
| parameters = { | ||
| **self.serialize_query_param( | ||
| "api-version", "2022-05-01-preview", | ||
| 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("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) | ||
|
|
||
| properties = _builder.get(".properties") | ||
| if properties is not None: | ||
| properties.set_prop("resourceId", AAZStrType, ".resource_id") | ||
| properties.set_prop("type", AAZStrType, ".type", typ_kwargs={"flags": {"required": True}}) | ||
|
|
||
| return self.serialize_content(_content_value) | ||
|
|
||
| def on_200(self, session): | ||
| data = self.deserialize_http_content(session) | ||
| self.ctx.set_var( | ||
| "instance", | ||
| data, | ||
| schema_builder=self._build_schema_on_200 | ||
| ) | ||
|
|
||
| _schema_on_200 = None | ||
|
|
||
| @classmethod | ||
| def _build_schema_on_200(cls): | ||
| if cls._schema_on_200 is not None: | ||
| return cls._schema_on_200 | ||
|
|
||
| cls._schema_on_200 = AAZObjectType() | ||
|
|
||
| _schema_on_200 = cls._schema_on_200 | ||
| _schema_on_200.id = AAZStrType( | ||
| flags={"read_only": True}, | ||
| ) | ||
| _schema_on_200.name = AAZStrType( | ||
| flags={"read_only": True}, | ||
| ) | ||
| _schema_on_200.properties = AAZObjectType( | ||
| flags={"client_flatten": True}, | ||
| ) | ||
| _schema_on_200.system_data = AAZObjectType( | ||
| serialized_name="systemData", | ||
| flags={"client_flatten": True, "read_only": True}, | ||
| ) | ||
| _schema_on_200.type = AAZStrType( | ||
| flags={"read_only": True}, | ||
| ) | ||
|
|
||
| properties = cls._schema_on_200.properties | ||
| properties.provisioning_state = AAZStrType( | ||
| serialized_name="provisioningState", | ||
| flags={"read_only": True}, | ||
| ) | ||
| properties.resource_id = AAZStrType( | ||
| serialized_name="resourceId", | ||
| ) | ||
| properties.type = AAZStrType( | ||
| flags={"required": True}, | ||
| ) | ||
|
|
||
| system_data = cls._schema_on_200.system_data | ||
| system_data.created_at = AAZStrType( | ||
| serialized_name="createdAt", | ||
| ) | ||
| system_data.created_by = AAZStrType( | ||
| serialized_name="createdBy", | ||
| ) | ||
| system_data.created_by_type = AAZStrType( | ||
| serialized_name="createdByType", | ||
| ) | ||
| system_data.last_modified_at = AAZStrType( | ||
| serialized_name="lastModifiedAt", | ||
| ) | ||
| system_data.last_modified_by = AAZStrType( | ||
| serialized_name="lastModifiedBy", | ||
| ) | ||
| system_data.last_modified_by_type = AAZStrType( | ||
| serialized_name="lastModifiedByType", | ||
| ) | ||
|
|
||
| return cls._schema_on_200 | ||
|
|
||
|
|
||
| class _CreateHelper: | ||
| """Helper class for Create""" | ||
|
|
||
|
|
||
| __all__ = ["Create"] | ||
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.
I manually set client_flatten to false, because apparently the flattening is failing because there is some naming conflict with the argument named "type" and some other internal feature.