Enabling Bill Storage
Customers can enable expenditure data storage by creating a bucket on Object Storage Service (OBS). HUAWEI CLOUD will synchronize your bills to the designated bucket on OBS.
Enabling the Bill Subscription Function
- Create a bucket on OBS. For details about how to create a bucket, see Creating a Bucket.
- Go to the Billing Center.
- Go to the Overview page.
- Turn on the toggle switch next to Bill Storage to enable the bill storage function.

- Set the bucket name.
If the bucket becomes invalid, expenditure data storage is automatically disabled.
- Click Verify.
A message indicating that the verification is successful is displayed and all eligible bills are presented.
- Select the bills that you want to export and click Enable.
Once authorized and verified, your selected bills will have corresponding files generated which are synchronized to your bucket on OBS every day.
- Click Get Code.
- Enter the received SMS verification code and click OK.
You can click Disable next to the object storage name to disable expenditure data storage.
Downloading Subscribed Bills
- Choose Service List > Storage > Object Storage Service.
- Click the bucket name.

- In the navigation bar on the left, click Objects. You can view all files of the subscribed bills that have been exported.
- You can search for bills by name prefix. For example, enter 2020-11 in the search box to view all bill files in November 2020.
- Data generated each day for customers in the monthly settlement mode is estimated. It is suggested that these customers obtain the full bill of a month on the third day of the next month.
- If the number of rows exceeds a certain threshold, the system automatically splits the bill in CSV format into multiple CSV files.
After expenditure data storage is enabled, data listed in Table 1 will be automatically exported based on your selection.
Table 1 Exported bills Bill
Billing Cycle
Data Scope
Filename Identifier
Example Filename
Path
File Format
Reconciliation list (monthly usage)
The third day of each month
All usage data of the last month
%account name%_ItemProductBillOverview_YYYYMM
20201103155350_item_product_bill_overview3b52ee42-ab5c-4ccf-bf20-a80a6d86e46b.xlsx
Bills > Cost Bills > Overview
Transaction bill
Every day
Transaction data of the previous day
%account name%_SettleBillDetail_YYYYMMDD
zhang**_SettleBillDetail_20201103_1.csv
Bills > Cost Bills > Transaction Bills
Bill details filtered by a combination of Resource and By billing cycle
Every day
Data of the month (prior to the current day)
%account name%_InstanceBillMonth_YYYYMM
zhang**_InstanceBillMonth_202011_1.csv
Bills > Cost Bills > Bill Details (with Data Type set to Resource and Data Period set to By billing cycle)
Format of Bill Details File (By Resource and By Billing Cycle)
The third day of each month
Data of the last month
Bill details filtered by a combination of Usage Type and Details
Every day
Data of the previous day
%account name%_PriceFactorBillDetail_YYYYMMDD
zhang**_PriceFactorBillDetail_20201103_1.csv
Bills > Cost Bills > Bill Details (with Data Type set to Usage Type and Data Period set to Details)
The third day of each month
Data of the last month
%account name%_PriceFactorBillDetail_YYYYMMDD-YYYYMMDD
zhang**_PriceFactorBillDetail_20201001-20201031_1.csv
- Select the bill you want to download and click Download in the Operation column.
Further Description
If you want to download subscribed bills every day, run the following script to set it up. After the setup is completed, the subscribed bills will be automatically downloaded.
The following code example is for reference only. You can make changes to it for development as needed.
#!/usr/bin/python
# -*- coding:utf-8 -*-
import string,os,sys,datetime
import commands
import json
#get date
date = datetime.date.today()-datetime.timedelta(1)
str_date = date.strftime("%Y%m%d")
AK = ''
SK = ''
server = ''
bucketName = ''
#prefix="Consumedetails_"+str_date
prefix="Resource_Expenditures_"+str_date
print prefix
from com.obs.client.obs_client import ObsClient
# Constructs a obs client instance with your account for accessing OBS
obsClient = ObsClient(access_key_id=AK, secret_access_key=SK, server=server)
#find which billing
resp=obsClient.listObjects(bucketName,prefix)
#billing name
objectKey=resp.body.contents[0].key
localFileDir='/opt/huawei/zcm/data/'+objectKey
# Download the object to a file
print('Downloading an object to dir:' + localFileDir + '\n')
obsClient.getObject(bucketName, objectKey, downloadPath=localFileDir)
Description of parameters:
- AK: access key ID on OBS. One AK maps to only one user but one user can have multiple AKs. The OBS system recognizes the users who access the system by their access key IDs. For information about how to create AK and SK, see Creating Access Keys (AK and SK).
- SK: secret access key on OBS. It is used to access OBS. Authentication information is generated for users based on their SKs and request header fields. An SK matches an AK.
- server: domain name, which is the address of the bucket on the Internet. It can be used for scenarios where the bucket is accessed directly through the domain name, such as cloud application development and data sharing. You can obtain its value from "1" in Figure 1.
- bucketName: name of the bucket used for the subscribed bills. You can obtain its value from "2" in Figure 1.
- prefix: bills that need to be automatically downloaded.
- localFileDir: local directory for storing downloaded bill files.
Last Article: Bill Storage
Next Article: Format of a Reconciliation List File (Billing by Usage)

Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.