Install
openclaw skills install @erickeyhu-hug/huawei-cloud-obs-list-excelList Huawei Cloud OBS buckets and objects, then export the inventory to a formatted Excel (.xlsx) report for storage management and auditing.
openclaw skills install @erickeyhu-hug/huawei-cloud-obs-list-excelThis skill retrieves a list of all OBS (Object Storage Service) buckets and their objects from a specified Huawei Cloud region, then generates an Excel (.xlsx) file containing the inventory data. It uses the huaweicloudsdkobs SDK to query cloud resources and openpyxl to produce the spreadsheet.
Applicable scenarios:
huaweicloudsdkobs (≥3.1.209)huaweicloudsdkcore (≥3.1.209)openpyxl (≥3.1.0)HUAWEI_CLOUD_ACCESS_KEY — Access Key IDHUAWEI_CLOUD_SECRET_KEY — Secret Access KeyHUAWEI/HW/HWC prefixed variables containing ACCESS_KEY/_AK / SECRET_KEY/_SKobs:bucket:ListAllMyBuckets and obs:object:ListObject permissions.1. Initialize OBS client with region and credentials
2. Call list_buckets() to get all buckets
3. For each bucket, call list_objects() with max_keys=1000
4. Aggregate bucket and object data into a structured report
5. Write the data to an Excel (.xlsx) file with formatted sheets
6. Report the file path to the agent or user
python3 scripts/obs-list-excel.py --region cn-north-4 --output /tmp/obs-inventory.xlsx
| Param | Required | Description | Default |
|---|---|---|---|
--region | Yes | Huawei Cloud region (e.g. cn-north-4, cn-east-3) | — |
--output | No | Output Excel file path | ./obs-inventory.xlsx |
--bucket-type | No | Filter: OBJECT, POSIX, or empty (all) | "" |
--max-keys | No | Max objects per bucket to list | 1000 |
python3 scripts/obs-list-excel.py --region=cn-north-4 --output=/tmp/obs-report.xlsx
python3 -c "
import openpyxl
wb = openpyxl.load_workbook('/tmp/obs-report.xlsx')
for sheet_name in wb.sheetnames:
ws = wb[sheet_name]
print(f'Sheet: {sheet_name} ({ws.max_row} rows, {ws.max_column} cols)')
for row in wws.iter_rows(max_row=5, values_only=True):
print(row)
"
| Parameter | Required | Description | Example |
|---|---|---|---|
{region} | Yes | Huawei Cloud region | cn-north-4, cn-east-east-2 |
{output} | No | Output Excel path | /tmp/obs-inventory.xlsx |
{max-keys} | No | Max objects to list per bucket call | 1000 |
CLI commands are NOT available for OBS on hcloud. This skill uses the Python SDK (huaweicloudsdkobs) instead. See references/cli-installation-guide.md for SDK setup.