-
Notifications
You must be signed in to change notification settings - Fork 1.5k
CLI Refresh for Elastic (2025-06-01) #9309
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
+1,696
−898
Merged
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
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
188 changes: 188 additions & 0 deletions
188
...ext_elastic/aaz/latest/elastic/_get_elastic_organization_to_azure_subscription_mapping.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,188 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # 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( | ||
| "elastic get-elastic-organization-to-azure-subscription-mapping", | ||
| ) | ||
| class GetElasticOrganizationToAzureSubscriptionMapping(AAZCommand): | ||
| """Retrieve mapping details between the Elastic Organization and Azure Subscription for the logged-in user. | ||
|
|
||
| :example: Organizations_GetElasticToAzureSubscriptionMapping | ||
| az elastic get-elastic-organization-to-azure-subscription-mapping | ||
| """ | ||
|
|
||
| _aaz_info = { | ||
| "version": "2025-06-01", | ||
| "resources": [ | ||
| ["mgmt-plane", "/subscriptions/{}/providers/microsoft.elastic/getelasticorganizationtoazuresubscriptionmapping", "2025-06-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 "" | ||
| return cls._args_schema | ||
|
|
||
| def _execute_operations(self): | ||
| self.pre_operations() | ||
| self.OrganizationsGetElasticToAzureSubscriptionMapping(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 OrganizationsGetElasticToAzureSubscriptionMapping(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( | ||
| "/subscriptions/{subscriptionId}/providers/Microsoft.Elastic/getElasticOrganizationToAzureSubscriptionMapping", | ||
| **self.url_parameters | ||
| ) | ||
|
|
||
| @property | ||
| def method(self): | ||
| return "POST" | ||
|
|
||
| @property | ||
| def error_format(self): | ||
| return "ODataV4Format" | ||
|
|
||
| @property | ||
| def url_parameters(self): | ||
| parameters = { | ||
| **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", "2025-06-01", | ||
| required=True, | ||
| ), | ||
| } | ||
| return parameters | ||
|
|
||
| @property | ||
| def header_parameters(self): | ||
| parameters = { | ||
| **self.serialize_header_param( | ||
| "Accept", "application/json", | ||
| ), | ||
| } | ||
| return parameters | ||
|
|
||
| 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.properties = AAZObjectType() | ||
|
|
||
| properties = cls._schema_on_200.properties | ||
| properties.billed_azure_subscription_id = AAZStrType( | ||
| serialized_name="billedAzureSubscriptionId", | ||
| ) | ||
| properties.elastic_organization_id = AAZStrType( | ||
| serialized_name="elasticOrganizationId", | ||
| ) | ||
| properties.elastic_organization_name = AAZStrType( | ||
| serialized_name="elasticOrganizationName", | ||
| ) | ||
| properties.marketplace_saas_info = AAZObjectType( | ||
| serialized_name="marketplaceSaasInfo", | ||
| flags={"read_only": True}, | ||
| ) | ||
|
|
||
| marketplace_saas_info = cls._schema_on_200.properties.marketplace_saas_info | ||
| marketplace_saas_info.billed_azure_subscription_id = AAZStrType( | ||
| serialized_name="billedAzureSubscriptionId", | ||
| ) | ||
| marketplace_saas_info.marketplace_name = AAZStrType( | ||
| serialized_name="marketplaceName", | ||
| ) | ||
| marketplace_saas_info.marketplace_resource_id = AAZStrType( | ||
| serialized_name="marketplaceResourceId", | ||
| ) | ||
| marketplace_saas_info.marketplace_status = AAZStrType( | ||
| serialized_name="marketplaceStatus", | ||
| ) | ||
| marketplace_saas_info.marketplace_subscription = AAZObjectType( | ||
| serialized_name="marketplaceSubscription", | ||
| ) | ||
| marketplace_saas_info.subscribed = AAZBoolType() | ||
|
|
||
| marketplace_subscription = cls._schema_on_200.properties.marketplace_saas_info.marketplace_subscription | ||
| marketplace_subscription.id = AAZStrType() | ||
| marketplace_subscription.offer_id = AAZStrType( | ||
| serialized_name="offerId", | ||
| ) | ||
| marketplace_subscription.publisher_id = AAZStrType( | ||
| serialized_name="publisherId", | ||
| ) | ||
|
|
||
| return cls._schema_on_200 | ||
|
|
||
|
|
||
| class _GetElasticOrganizationToAzureSubscriptionMappingHelper: | ||
| """Helper class for GetElasticOrganizationToAzureSubscriptionMapping""" | ||
|
|
||
|
|
||
| __all__ = ["GetElasticOrganizationToAzureSubscriptionMapping"] |
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.