Subscribes to bill files by using Object Storage Service (OSS), which stores billing data in a specified OSS bucket.
Operation description
Before calling this operation, note the following information:
-
You can subscribe to one type of bill file at a time.
-
After subscription, the bill file generated on the previous day is pushed daily starting from the next day. On the 4th of each month, the full bill files for the entire billing cycle of the previous month are pushed. The monthly bill PDF is pushed on the 4th of each month for the previous month.
-
Bill files generated on a daily basis may be delayed. Delayed bills are pushed the day after they are generated and may include bills from earlier days that were delayed until the previous day. Pull the full files for the previous month at the beginning of each month.
To use OSS subscription for the first time, grant the AliyunConsumeDump2OSSRole permission to the subscribing user. If the authorization is revoked, the system stops pushing files, and the user must re-authorize.
-
This subscription is the same feature as "Bill Data Storage" in the Expenses and Costs console. Subscriptions are synchronized between the two.
-
When subscribing to a directory under a bucket, follow the directory naming conventions:
Emojis are not allowed. Use valid UTF-8 characters.
Use / to separate paths and quickly create subdirectories. Do not start with / or , and do not use consecutive / characters.
A subdirectory named .. is not allowed.
The total length must be 1 to 254 characters.
-
File names:
-
BillingItemDetailForBillingPeriod (billing item details)
-
Daily push file name format:
UID_BillingItemDetail_YYYYMMDD, for example,169**_BillingItemDetail_20190310. -
Full file name format at the beginning of the next month:
UID_BillingItemDetail_YYYYMM, for example,169**_BillingItemDetail_201903.
-
-
InstanceDetailForBillingPeriod (instance bill details)
-
Daily push file name format:
UID_InstanceDetail_YYYYMMDD, for example,169**_InstanceDetail_20190310. -
Full file name format at the beginning of the next month:
UID_InstanceDetail_YYYYMM, for example,169**_InstanceDetail_201903.
-
-
InstanceDetailMonthly (instance bill summary by billing cycle)
Daily push file name format:
UID_InstanceDetailMonthly_YYYYMM, for example,169**_InstanceDetailMonthly_201903. This file is updated daily with full data from the beginning of the month to the current day, until the 4th of the next month.
-
BillingItemDetailMonthly (billing item summary by billing cycle)
Daily push file name format:
UID_BillingItemDetailMonthly_YYYYMM, for example,169**_BillingItemDetailMonthly_201903. This file is updated daily with full data from the beginning of the month to the current day, until the 4th of the next month.
-
SplitItemDetailDaily (split bill daily summary)
Daily push file name format:
UID_SplitItemDetailDaily_YYYYMM, for example,169**_SplitItemDetailDaily_201903. This file is updated daily with full data from the beginning of the month to the current day, until the 4th of the next month.
-
MonthBill (monthly bill PDF)
Monthly push file name format:
UID_MonthBill_YYYYMM, for example,169**_MonthBill_201903. The file for the previous month is pushed on the 4th of each month.
-
-
Except for MonthBill, which is a PDF file, all other file types are CSV files. If the number of rows in a bill file exceeds a certain threshold, the file is automatically split into multiple CSV files, which are then compressed into a single ZIP file. The ZIP file name follows the same format.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
bss:ModifySubscribeToOSS |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| SubscribeBucket |
string |
Yes |
The name of the OSS bucket that stores the subscribed bill files. |
xxxxxx-bucket |
| SubscribeType |
string |
No |
The type of the subscribed bill. Valid values:
|
BillingItemDetailForBillingPeriod |
| MultAccountRelSubscribe |
string |
No |
For multi-level accounts, specifies the type of bills to push. Valid values:
Default value: MA. |
MA |
| BucketOwnerId |
integer |
No |
The UID of the OSS owner that stores the files. Specify this parameter if you are a Bid/Reseller subscriber and need to push files to a sub-account's OSS. The specified account must be a sub-account of the calling account, and the AliyunConsumeDump2OSSRole permission must be granted to this account. Regular users do not need to specify this parameter. The default value is the calling account. |
12341324 |
| BeginBillingCycle |
string |
No |
The start billing cycle for pushing. After a successful subscription, the system automatically pushes data from the start billing cycle to the current time. This parameter is invalid for monthly bill PDF subscriptions, and historical data is not re-pushed. Data within the last year can be pushed. |
2021-03 |
| BucketPath |
string |
No |
The specified directory under the bucket to which the subscription is delivered. |
testpath |
| RowLimitPerFile |
integer |
No |
The maximum number of rows per file. If a bill file exceeds this limit, it is split into multiple files and compressed into a single archive. |
300000 |
| UsingSsl |
string |
No |
Specifies whether to use the Secure Sockets Layer (SSL) encryption protocol to protect network communication. Valid values:
|
true |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Code |
string |
The status code. |
Success |
| Message |
string |
The error message. |
Successful! |
| RequestId |
string |
The request ID. |
F61FCE4B-9B56-4FD9-A17E-****** |
| Success |
boolean |
Indicates whether the request was successful. |
true |
Examples
Success response
JSON format
{
"Code": "Success",
"Message": "Successful!",
"RequestId": "F61FCE4B-9B56-4FD9-A17E-******",
"Success": true
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.