-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release New-Relic CLI for stable version 2024-01-01 (#7402)
* NewRelic CLI refresh * fix issues found in manual testing * Fix tag rules commands * Update command for monitored-subscription * Update history and version number * use short abbreviation for monitored_subscription_list * Delete recordings and fix flake8 issues * Remove default value from configuration-name * fix tests * Fix tests and remove unused reference * Fix issues * Fix all integration tests * Add monitored subscription test cases * remove commented test cases * Remove trailling whitespace * Undo breaking changes * Revert get-metric-status to get-metric-statu * Add more test cases and fix breaking changes * Fix GetMetric Status breaking change * Fix ingestionkey secret in recordings * Update changelog to trigger build again * Use Production region to run tests as partner staging is not working * Fix build * Attempt to fix build * Fix versioning
- Loading branch information
1 parent
d286bdc
commit 7429e7a
Showing
38 changed files
with
3,571 additions
and
377 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
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
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
200 changes: 200 additions & 0 deletions
200
src/new-relic/azext_new_relic/aaz/latest/new_relic/monitor/_get_billing_info.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,200 @@ | ||
# -------------------------------------------------------------------------------------------- | ||
# 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( | ||
"new-relic monitor get-billing-info", | ||
) | ||
class GetBillingInfo(AAZCommand): | ||
"""Get marketplace info mapped to the given monitor. | ||
:example: Get marketplace info mapped to the given monitor. | ||
az new-relic monitor get-billing-info --monitor-name MyNewRelicMonitor --resource-group MyResourceGroup | ||
""" | ||
|
||
_aaz_info = { | ||
"version": "2024-01-01", | ||
"resources": [ | ||
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/newrelic.observability/monitors/{}/getbillinginfo", "2024-01-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.monitor_name = AAZStrArg( | ||
options=["--monitor-name"], | ||
help="Name of the Monitoring resource", | ||
required=True, | ||
id_part="name", | ||
fmt=AAZStrArgFormat( | ||
pattern="^.*$", | ||
), | ||
) | ||
_args_schema.resource_group = AAZResourceGroupNameArg( | ||
options=["--resource-group","--g"], | ||
help="Name of resource group. You can configure the default group using az configure --defaults group=<name>.", | ||
required=True, | ||
) | ||
return cls._args_schema | ||
|
||
def _execute_operations(self): | ||
self.pre_operations() | ||
self.BillingInfoGet(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 BillingInfoGet(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}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/getBillingInfo", | ||
**self.url_parameters | ||
) | ||
|
||
@property | ||
def method(self): | ||
return "POST" | ||
|
||
@property | ||
def error_format(self): | ||
return "MgmtErrorFormat" | ||
|
||
@property | ||
def url_parameters(self): | ||
parameters = { | ||
**self.serialize_url_param( | ||
"monitorName", self.ctx.args.monitor_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", "2024-01-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.marketplace_saas_info = AAZObjectType( | ||
serialized_name="marketplaceSaasInfo", | ||
) | ||
_schema_on_200.partner_billing_entity = AAZObjectType( | ||
serialized_name="partnerBillingEntity", | ||
) | ||
|
||
marketplace_saas_info = cls._schema_on_200.marketplace_saas_info | ||
marketplace_saas_info.billed_azure_subscription_id = AAZStrType( | ||
serialized_name="billedAzureSubscriptionId", | ||
) | ||
marketplace_saas_info.marketplace_resource_id = AAZStrType( | ||
serialized_name="marketplaceResourceId", | ||
) | ||
marketplace_saas_info.marketplace_status = AAZStrType( | ||
serialized_name="marketplaceStatus", | ||
) | ||
marketplace_saas_info.marketplace_subscription_id = AAZStrType( | ||
serialized_name="marketplaceSubscriptionId", | ||
) | ||
marketplace_saas_info.marketplace_subscription_name = AAZStrType( | ||
serialized_name="marketplaceSubscriptionName", | ||
) | ||
|
||
partner_billing_entity = cls._schema_on_200.partner_billing_entity | ||
partner_billing_entity.organization_id = AAZStrType( | ||
serialized_name="organizationId", | ||
) | ||
partner_billing_entity.organization_name = AAZStrType( | ||
serialized_name="organizationName", | ||
) | ||
|
||
return cls._schema_on_200 | ||
|
||
|
||
class _GetBillingInfoHelper: | ||
"""Helper class for GetBillingInfo""" | ||
|
||
|
||
__all__ = ["GetBillingInfo"] |
Oops, something went wrong.