Retrieves the margin summary report, which includes the Amazon Web Services cost and charged amount (pro forma cost) by Amazon Web Services service for a specific billing group.
Parameters:
-
arn
(BillingGroupArn)
–
The Amazon Resource Number (ARN) that uniquely identifies the billing group.
-
billing_period_range
(Optional[BillingPeriodRange], default:
None
)
–
A time range for which the margin summary is effective. You can specify up to 12 months.
-
group_by
(Optional[GroupByAttributesList], default:
None
)
–
A list of strings that specify the attributes that are used to break down costs in the margin summary reports for the billing group. For example, you can view your costs by the Amazon Web Services service name or the billing period.
-
max_results
(Optional[MaxBillingGroupCostReportResults], default:
None
)
–
The maximum number of margin summary reports to retrieve.
-
next_token
(Optional[Token], default:
None
)
–
The pagination token used on subsequent calls to get reports.
Raises:
Source code in docs_src/capo_billingconductor/_services/async_billingconductor.py
| async def get_billing_group_cost_report(
self,
arn: "capo_billingconductor.types.billing_group_arn.BillingGroupArn",
*,
config_overrides: Optional[AsyncbillingconductorClientConfig] = None,
billing_period_range: Optional[
"capo_billingconductor.types.billing_period_range.BillingPeriodRange"
] = None,
group_by: Optional[
"capo_billingconductor.types.group_by_attributes_list.GroupByAttributesList"
] = None,
max_results: Optional[
"capo_billingconductor.types.max_billing_group_cost_report_results.MaxBillingGroupCostReportResults"
] = None,
next_token: Optional["capo_billingconductor.types.token.Token"] = None,
) -> "capo_billingconductor.types.get_billing_group_cost_report_output.GetBillingGroupCostReportOutput":
"""<p>Retrieves the margin summary report, which includes the Amazon Web Services cost and charged amount (pro forma cost) by Amazon Web Services service for a specific billing group.</p>
Args:
arn: <p>The Amazon Resource Number (ARN) that uniquely identifies the billing group.</p>
billing_period_range: <p>A time range for which the margin summary is effective. You can specify up to 12 months.</p>
group_by: <p>A list of strings that specify the attributes that are used to break down costs in the margin summary reports for the billing group. For example, you can view your costs by the Amazon Web Services service name or the billing period.</p>
max_results: <p>The maximum number of margin summary reports to retrieve.</p>
next_token: <p>The pagination token used on subsequent calls to get reports.</p>
Raises:
capo_billingconductor.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action. </p>
capo_billingconductor.errors.internal_server_exception.InternalServerException: <p>An unexpected error occurred while processing a request. </p>
capo_billingconductor.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request references a resource that doesn't exist. </p>
capo_billingconductor.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. </p>
capo_billingconductor.errors.validation_exception.ValidationException: <p>The input doesn't match with the constraints specified by Amazon Web Services services.</p>
capo_billingconductor.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_billingconductor.types.get_billing_group_cost_report_input.GetBillingGroupCostReportInput]",
) -> AsyncOperationResponse[
"capo_billingconductor.types.get_billing_group_cost_report_output.GetBillingGroupCostReportOutput"
]:
import capo_billingconductor._operations.aws_billing_conductor.get_billing_group_cost_report
(
output,
http_response,
) = await capo_billingconductor._operations.aws_billing_conductor.get_billing_group_cost_report.async_get_billing_group_cost_report(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetBillingGroupCostReport")
)
input_: capo_billingconductor.types.get_billing_group_cost_report_input.GetBillingGroupCostReportInput = {
"arn": arn
}
if billing_period_range is not None:
input_["billing_period_range"] = billing_period_range
if group_by is not None:
input_["group_by"] = group_by
if max_results is not None:
input_["max_results"] = max_results
if next_token is not None:
input_["next_token"] = next_token
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|