Creates a new report using the description that you provide.
Parameters:
-
report_definition
(ReportDefinition)
–
Represents the output of the PutReportDefinition operation. The content consists of the detailed metadata and data file information.
-
tags
(Optional[TagList], default:
None
)
–
The tags to be assigned to the report definition resource.
Raises:
Examples:
To create a report named ExampleReport.
The following example creates a AWS Cost and Usage report named ExampleReport.
>>> await client.put_report_definition(report_definition={'ReportName': 'ExampleReport', 'TimeUnit': 'DAILY', 'Format': 'textORcsv', 'Compression': 'ZIP', 'AdditionalSchemaElements': ['RESOURCES'], 'S3Bucket': 'example-s3-bucket', 'S3Prefix': 'exampleprefix', 'S3Region': 'us-east-1', 'AdditionalArtifacts': ['REDSHIFT', 'QUICKSIGHT']})
Source code in docs_src/capo_cost_and_usage_report_service/_services/async_costand_usage_report_service.py
| async def put_report_definition(
self,
report_definition: "capo_cost_and_usage_report_service.types.report_definition.ReportDefinition",
*,
config_overrides: Optional[AsyncCostandUsageReportServiceClientConfig] = None,
tags: Optional[
"capo_cost_and_usage_report_service.types.tag_list.TagList"
] = None,
) -> "capo_cost_and_usage_report_service.types.put_report_definition_response.PutReportDefinitionResponse":
"""<p>Creates a new report using the description that you provide.</p>
Args:
report_definition: <p>Represents the output of the PutReportDefinition operation. The content consists of the detailed metadata and data file information. </p>
tags: <p>The tags to be assigned to the report definition resource.</p>
Raises:
capo_cost_and_usage_report_service.errors.duplicate_report_name_exception.DuplicateReportNameException: <p>A report with the specified name already exists in the account. Specify a different report name.</p>
capo_cost_and_usage_report_service.errors.internal_error_exception.InternalErrorException: <p>An error on the server occurred during the processing of your request. Try again later.</p>
capo_cost_and_usage_report_service.errors.report_limit_reached_exception.ReportLimitReachedException: <p>This account already has five reports defined. To define a new report, you must delete an existing report.</p>
capo_cost_and_usage_report_service.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified report (<code>ReportName</code>) in the request doesn't exist.</p>
capo_cost_and_usage_report_service.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
capo_cost_and_usage_report_service.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
To create a report named ExampleReport.
The following example creates a AWS Cost and Usage report named ExampleReport.
>>> await client.put_report_definition(report_definition={'ReportName': 'ExampleReport', 'TimeUnit': 'DAILY', 'Format': 'textORcsv', 'Compression': 'ZIP', 'AdditionalSchemaElements': ['RESOURCES'], 'S3Bucket': 'example-s3-bucket', 'S3Prefix': 'exampleprefix', 'S3Region': 'us-east-1', 'AdditionalArtifacts': ['REDSHIFT', 'QUICKSIGHT']})
"""
async def _handler(
req: "AsyncOperationRequest[capo_cost_and_usage_report_service.types.put_report_definition_request.PutReportDefinitionRequest]",
) -> AsyncOperationResponse[
"capo_cost_and_usage_report_service.types.put_report_definition_response.PutReportDefinitionResponse"
]:
import capo_cost_and_usage_report_service._operations.aws_origami_service_gateway_service.put_report_definition
(
output,
http_response,
) = await capo_cost_and_usage_report_service._operations.aws_origami_service_gateway_service.put_report_definition.async_put_report_definition(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("PutReportDefinition")
)
input_: capo_cost_and_usage_report_service.types.put_report_definition_request.PutReportDefinitionRequest = {
"report_definition": report_definition
}
if tags is not None:
input_["tags"] = tags
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|