AWS Cost and Usage Report Service

2017/01/16 - AWS Cost and Usage Report Service - 3 new api methods

Changes  The AWS Cost and Usage Report Service API allows you to enable and disable the Cost & Usage report, as well as modify the report name, the data granularity, and the delivery preferences.

PutReportDefinition (new) Link ¶

Create a new report definition

See also: AWS API Documentation

Request Syntax

client.put_report_definition(
    ReportDefinition={
        'ReportName': 'string',
        'TimeUnit': 'HOURLY'|'DAILY',
        'Format': 'textORcsv',
        'Compression': 'ZIP'|'GZIP',
        'AdditionalSchemaElements': [
            'RESOURCES',
        ],
        'S3Bucket': 'string',
        'S3Prefix': 'string',
        'S3Region': 'us-east-1'|'us-west-1'|'us-west-2'|'eu-central-1'|'eu-west-1'|'ap-southeast-1'|'ap-southeast-2'|'ap-northeast-1',
        'AdditionalArtifacts': [
            'REDSHIFT'|'QUICKSIGHT',
        ]
    }
)
type ReportDefinition

dict

param ReportDefinition

[REQUIRED] The definition of AWS Cost and Usage Report. Customer can specify the report name, time unit, report format, compression format, S3 bucket and additional artifacts and schema elements in the definition.

  • ReportName (string) -- [REQUIRED] Preferred name for a report, it has to be unique. Must starts with a number/letter, case sensitive. Limited to 256 characters.

  • TimeUnit (string) -- [REQUIRED] The frequency on which report data are measured and displayed.

  • Format (string) -- [REQUIRED] Preferred format for report.

  • Compression (string) -- [REQUIRED] Preferred compression format for report.

  • AdditionalSchemaElements (list) -- [REQUIRED] A list of schema elements.

    • (string) -- Preference of including Resource IDs. You can include additional details about individual resource IDs in your report.

  • S3Bucket (string) -- [REQUIRED] Name of customer S3 bucket.

  • S3Prefix (string) -- [REQUIRED] Preferred report path prefix. Limited to 256 characters.

  • S3Region (string) -- [REQUIRED] Region of customer S3 bucket.

  • AdditionalArtifacts (list) -- A list of additional artifacts.

    • (string) -- Enable support for Redshift and/or QuickSight.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) -- Response of PutReportDefinition

DescribeReportDefinitions (new) Link ¶

Describe a list of report definitions owned by the account

See also: AWS API Documentation

Request Syntax

client.describe_report_definitions(
    MaxResults=123,
    NextToken='string'
)
type MaxResults

integer

param MaxResults

The max number of results returned by the operation.

type NextToken

string

param NextToken

A generic string.

rtype

dict

returns

Response Syntax

{
    'ReportDefinitions': [
        {
            'ReportName': 'string',
            'TimeUnit': 'HOURLY'|'DAILY',
            'Format': 'textORcsv',
            'Compression': 'ZIP'|'GZIP',
            'AdditionalSchemaElements': [
                'RESOURCES',
            ],
            'S3Bucket': 'string',
            'S3Prefix': 'string',
            'S3Region': 'us-east-1'|'us-west-1'|'us-west-2'|'eu-central-1'|'eu-west-1'|'ap-southeast-1'|'ap-southeast-2'|'ap-northeast-1',
            'AdditionalArtifacts': [
                'REDSHIFT'|'QUICKSIGHT',
            ]
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) -- Response of DescribeReportDefinitions

    • ReportDefinitions (list) -- A list of report definitions.

      • (dict) -- The definition of AWS Cost and Usage Report. Customer can specify the report name, time unit, report format, compression format, S3 bucket and additional artifacts and schema elements in the definition.

        • ReportName (string) -- Preferred name for a report, it has to be unique. Must starts with a number/letter, case sensitive. Limited to 256 characters.

        • TimeUnit (string) -- The frequency on which report data are measured and displayed.

        • Format (string) -- Preferred format for report.

        • Compression (string) -- Preferred compression format for report.

        • AdditionalSchemaElements (list) -- A list of schema elements.

          • (string) -- Preference of including Resource IDs. You can include additional details about individual resource IDs in your report.

        • S3Bucket (string) -- Name of customer S3 bucket.

        • S3Prefix (string) -- Preferred report path prefix. Limited to 256 characters.

        • S3Region (string) -- Region of customer S3 bucket.

        • AdditionalArtifacts (list) -- A list of additional artifacts.

          • (string) -- Enable support for Redshift and/or QuickSight.

    • NextToken (string) -- A generic string.

DeleteReportDefinition (new) Link ¶

Delete a specified report definition

See also: AWS API Documentation

Request Syntax

client.delete_report_definition(
    ReportName='string'
)
type ReportName

string

param ReportName

Preferred name for a report, it has to be unique. Must starts with a number/letter, case sensitive. Limited to 256 characters.

rtype

dict

returns

Response Syntax

{
    'ResponseMessage': 'string'
}

Response Structure

  • (dict) -- Response of DeleteReportDefinition

    • ResponseMessage (string) -- A message indicates if the deletion is successful.