AWS Cost and Usage Report Service 2017-01-06
- Client: Aws\CostandUsageReportService\CostandUsageReportServiceClient
- Service ID: cur
- Version: 2017-01-06
This page describes the parameters and results for the operations of the AWS Cost and Usage Report Service (2017-01-06), and shows how to use the Aws\CostandUsageReportService\CostandUsageReportServiceClient object to call the described operations. This documentation is specific to the 2017-01-06 API version of the service.
Operation Summary
Each of the following operations can be created from a client using
$client->getCommand('CommandName')
, where "CommandName" is the
name of one of the following operations. Note: a command is a value that
encapsulates an operation and the parameters used to create an HTTP request.
You can also create and send a command immediately using the magic methods
available on a client object: $client->commandName(/* parameters */)
.
You can send the command asynchronously (returning a promise) by appending the
word "Async" to the operation name: $client->commandNameAsync(/* parameters */)
.
- DeleteReportDefinition ( array $params = [] )
Deletes the specified report.
- DescribeReportDefinitions ( array $params = [] )
Lists the AWS Cost and Usage reports available to this account.
- ModifyReportDefinition ( array $params = [] )
Allows you to programatically update your report preferences.
- PutReportDefinition ( array $params = [] )
Creates a new report using the description that you provide.
Paginators
Paginators handle automatically iterating over paginated API results. Paginators are associated with specific API operations, and they accept the parameters that the corresponding API operation accepts. You can get a paginator from a client class using getPaginator($paginatorName, $operationParameters). This client supports the following paginators:
Operations
DeleteReportDefinition
$result = $client->deleteReportDefinition
([/* ... */]); $promise = $client->deleteReportDefinitionAsync
([/* ... */]);
Deletes the specified report.
Parameter Syntax
$result = $client->deleteReportDefinition([ 'ReportName' => '<string>', ]);
Parameter Details
Members
- ReportName
-
- Type: string
The name of the report that you want to delete. The name must be unique, is case sensitive, and can't include spaces.
Result Syntax
[ 'ResponseMessage' => '<string>', ]
Result Details
Members
- ResponseMessage
-
- Type: string
Whether the deletion was successful or not.
Errors
-
An error on the server occurred during the processing of your request. Try again later.
-
The input fails to satisfy the constraints specified by an AWS service.
Examples
Example 1: To delete the AWS Cost and Usage report named ExampleReport.
The following example deletes the AWS Cost and Usage report named ExampleReport.
$result = $client->deleteReportDefinition([ 'ReportName' => 'ExampleReport', ]);
DescribeReportDefinitions
$result = $client->describeReportDefinitions
([/* ... */]); $promise = $client->describeReportDefinitionsAsync
([/* ... */]);
Lists the AWS Cost and Usage reports available to this account.
Parameter Syntax
$result = $client->describeReportDefinitions([ 'MaxResults' => <integer>, 'NextToken' => '<string>', ]);
Parameter Details
Members
- MaxResults
-
- Type: int
The maximum number of results that AWS returns for the operation.
- NextToken
-
- Type: string
A generic string.
Result Syntax
[ 'NextToken' => '<string>', 'ReportDefinitions' => [ [ 'AdditionalArtifacts' => ['<string>', ...], 'AdditionalSchemaElements' => ['<string>', ...], 'BillingViewArn' => '<string>', 'Compression' => 'ZIP|GZIP|Parquet', 'Format' => 'textORcsv|Parquet', 'RefreshClosedReports' => true || false, 'ReportName' => '<string>', 'ReportVersioning' => 'CREATE_NEW_REPORT|OVERWRITE_REPORT', 'S3Bucket' => '<string>', 'S3Prefix' => '<string>', 'S3Region' => 'af-south-1|ap-east-1|ap-south-1|ap-south-2|ap-southeast-1|ap-southeast-2|ap-southeast-3|ap-northeast-1|ap-northeast-2|ap-northeast-3|ca-central-1|eu-central-1|eu-central-2|eu-west-1|eu-west-2|eu-west-3|eu-north-1|eu-south-1|eu-south-2|me-central-1|me-south-1|sa-east-1|us-east-1|us-east-2|us-west-1|us-west-2|cn-north-1|cn-northwest-1', 'TimeUnit' => 'HOURLY|DAILY|MONTHLY', ], // ... ], ]
Result Details
Members
- NextToken
-
- Type: string
A generic string.
- ReportDefinitions
-
- Type: Array of ReportDefinition structures
A list of AWS Cost and Usage reports owned by the account.
Errors
-
An error on the server occurred during the processing of your request. Try again later.
Examples
Example 1: To list the AWS Cost and Usage reports for the account.
The following example lists the AWS Cost and Usage reports for the account.
$result = $client->describeReportDefinitions([ 'MaxResults' => 5, ]);
Result syntax:
[ 'ReportDefinitions' => [ [ 'AdditionalArtifacts' => [ 'QUICKSIGHT', ], 'AdditionalSchemaElements' => [ 'RESOURCES', ], 'Compression' => 'GZIP', 'Format' => 'textORcsv', 'ReportName' => 'ExampleReport', 'S3Bucket' => 'example-s3-bucket', 'S3Prefix' => 'exampleprefix', 'S3Region' => 'us-east-1', 'TimeUnit' => 'HOURLY', ], [ 'AdditionalArtifacts' => [ 'QUICKSIGHT', ], 'AdditionalSchemaElements' => [ 'RESOURCES', ], 'Compression' => 'GZIP', 'Format' => 'textORcsv', 'ReportName' => 'ExampleReport2', 'S3Bucket' => 'example-s3-bucket', 'S3Prefix' => 'exampleprefix', 'S3Region' => 'us-east-1', 'TimeUnit' => 'HOURLY', ], ], ]
ModifyReportDefinition
$result = $client->modifyReportDefinition
([/* ... */]); $promise = $client->modifyReportDefinitionAsync
([/* ... */]);
Allows you to programatically update your report preferences.
Parameter Syntax
$result = $client->modifyReportDefinition([ 'ReportDefinition' => [ // REQUIRED 'AdditionalArtifacts' => ['<string>', ...], 'AdditionalSchemaElements' => ['<string>', ...], // REQUIRED 'BillingViewArn' => '<string>', 'Compression' => 'ZIP|GZIP|Parquet', // REQUIRED 'Format' => 'textORcsv|Parquet', // REQUIRED 'RefreshClosedReports' => true || false, 'ReportName' => '<string>', // REQUIRED 'ReportVersioning' => 'CREATE_NEW_REPORT|OVERWRITE_REPORT', 'S3Bucket' => '<string>', // REQUIRED 'S3Prefix' => '<string>', // REQUIRED 'S3Region' => 'af-south-1|ap-east-1|ap-south-1|ap-south-2|ap-southeast-1|ap-southeast-2|ap-southeast-3|ap-northeast-1|ap-northeast-2|ap-northeast-3|ca-central-1|eu-central-1|eu-central-2|eu-west-1|eu-west-2|eu-west-3|eu-north-1|eu-south-1|eu-south-2|me-central-1|me-south-1|sa-east-1|us-east-1|us-east-2|us-west-1|us-west-2|cn-north-1|cn-northwest-1', // REQUIRED 'TimeUnit' => 'HOURLY|DAILY|MONTHLY', // REQUIRED ], 'ReportName' => '<string>', // REQUIRED ]);
Parameter Details
Members
- ReportDefinition
-
- Required: Yes
- Type: ReportDefinition structure
The definition of AWS Cost and Usage Report. You can specify the report name, time unit, report format, compression format, S3 bucket, additional artifacts, and schema elements in the definition.
- ReportName
-
- Required: Yes
- Type: string
The name of the report that you want to create. The name must be unique, is case sensitive, and can't include spaces.
Result Syntax
[]
Result Details
Errors
-
An error on the server occurred during the processing of your request. Try again later.
-
The input fails to satisfy the constraints specified by an AWS service.
PutReportDefinition
$result = $client->putReportDefinition
([/* ... */]); $promise = $client->putReportDefinitionAsync
([/* ... */]);
Creates a new report using the description that you provide.
Parameter Syntax
$result = $client->putReportDefinition([ 'ReportDefinition' => [ // REQUIRED 'AdditionalArtifacts' => ['<string>', ...], 'AdditionalSchemaElements' => ['<string>', ...], // REQUIRED 'BillingViewArn' => '<string>', 'Compression' => 'ZIP|GZIP|Parquet', // REQUIRED 'Format' => 'textORcsv|Parquet', // REQUIRED 'RefreshClosedReports' => true || false, 'ReportName' => '<string>', // REQUIRED 'ReportVersioning' => 'CREATE_NEW_REPORT|OVERWRITE_REPORT', 'S3Bucket' => '<string>', // REQUIRED 'S3Prefix' => '<string>', // REQUIRED 'S3Region' => 'af-south-1|ap-east-1|ap-south-1|ap-south-2|ap-southeast-1|ap-southeast-2|ap-southeast-3|ap-northeast-1|ap-northeast-2|ap-northeast-3|ca-central-1|eu-central-1|eu-central-2|eu-west-1|eu-west-2|eu-west-3|eu-north-1|eu-south-1|eu-south-2|me-central-1|me-south-1|sa-east-1|us-east-1|us-east-2|us-west-1|us-west-2|cn-north-1|cn-northwest-1', // REQUIRED 'TimeUnit' => 'HOURLY|DAILY|MONTHLY', // REQUIRED ], ]);
Parameter Details
Members
- ReportDefinition
-
- Required: Yes
- Type: ReportDefinition structure
Represents the output of the PutReportDefinition operation. The content consists of the detailed metadata and data file information.
Result Syntax
[]
Result Details
Errors
-
A report with the specified name already exists in the account. Specify a different report name.
-
This account already has five reports defined. To define a new report, you must delete an existing report.
-
An error on the server occurred during the processing of your request. Try again later.
-
The input fails to satisfy the constraints specified by an AWS service.
Examples
Example 1: To create a report named ExampleReport.
The following example creates a AWS Cost and Usage report named ExampleReport.
$result = $client->putReportDefinition([ 'ReportDefinition' => [ 'AdditionalArtifacts' => [ 'REDSHIFT', 'QUICKSIGHT', ], 'AdditionalSchemaElements' => [ 'RESOURCES', ], 'Compression' => 'ZIP', 'Format' => 'textORcsv', 'ReportName' => 'ExampleReport', 'S3Bucket' => 'example-s3-bucket', 'S3Prefix' => 'exampleprefix', 'S3Region' => 'us-east-1', 'TimeUnit' => 'DAILY', ], ]);
Shapes
DuplicateReportNameException
Description
A report with the specified name already exists in the account. Specify a different report name.
Members
- Message
-
- Type: string
A message to show the detail of the exception.
InternalErrorException
Description
An error on the server occurred during the processing of your request. Try again later.
Members
- Message
-
- Type: string
A message to show the detail of the exception.
ReportDefinition
Description
The definition of AWS Cost and Usage Report. You can specify the report name, time unit, report format, compression format, S3 bucket, additional artifacts, and schema elements in the definition.
Members
- AdditionalArtifacts
-
- Type: Array of strings
A list of manifests that you want Amazon Web Services to create for this report.
- AdditionalSchemaElements
-
- Required: Yes
- Type: Array of strings
A list of strings that indicate additional content that Amazon Web Services includes in the report, such as individual resource IDs.
- BillingViewArn
-
- Type: string
The Amazon resource name of the billing view. You can get this value by using the billing view service public APIs.
- Compression
-
- Required: Yes
- Type: string
The compression format that AWS uses for the report.
- Format
-
- Required: Yes
- Type: string
The format that AWS saves the report in.
- RefreshClosedReports
-
- Type: boolean
Whether you want Amazon Web Services to update your reports after they have been finalized if Amazon Web Services detects charges related to previous months. These charges can include refunds, credits, or support fees.
- ReportName
-
- Required: Yes
- Type: string
The name of the report that you want to create. The name must be unique, is case sensitive, and can't include spaces.
- ReportVersioning
-
- Type: string
Whether you want Amazon Web Services to overwrite the previous version of each report or to deliver the report in addition to the previous versions.
- S3Bucket
-
- Required: Yes
- Type: string
The S3 bucket where AWS delivers the report.
- S3Prefix
-
- Required: Yes
- Type: string
The prefix that AWS adds to the report name when AWS delivers the report. Your prefix can't include spaces.
- S3Region
-
- Required: Yes
- Type: string
The region of the S3 bucket that AWS delivers the report into.
- TimeUnit
-
- Required: Yes
- Type: string
The length of time covered by the report.
ReportLimitReachedException
Description
This account already has five reports defined. To define a new report, you must delete an existing report.
Members
- Message
-
- Type: string
A message to show the detail of the exception.
ValidationException
Description
The input fails to satisfy the constraints specified by an AWS service.
Members
- Message
-
- Type: string
A message to show the detail of the exception.