Huawei Cloud Services Count
Overview
This Skill queries how many Huawei Cloud services are available through the KooCLI offline metadata cache. It reads the local services_en.json file downloaded by hcloud meta download, parses the service entries, and returns the total count. No network API calls are needed after the initial metadata download.
Use case: Quickly determine how many cloud services Huawei Cloud offers at a glance, useful for reporting, documentation, or capacity awareness.
Prerequisites
- KooCLI (hcloud) installed and configured with valid AK/SK credentials
- Python 3.6+ available for JSON parsing
- KooCLI offline metadata must be downloaded at least once (
hcloud meta download)
Workflow
1. Refresh metadata → hcloud meta download
2. Parse local JSON → Read ~/.hcloud/metaRepo/services_en.json
3. Count entries → Count the items in the services array
4. Output → Print the total number of services
Core Commands
Refresh metadata and count services
Run the following command to refresh the offline metadata and output the total service count:
echo "y" | hcloud meta download && python3 -c "
import json
import os
meta_path = os.path.expanduser('~/.hcloud/metaRepo/services_en.json')
with open(meta_path) as f:
data = json.load(f)
items = data.get('items', [])
seen = set()
unique_count = 0
for item in items:
text = item['Service']['Text']
if text not in seen:
seen.add(text)
unique_count += 1
print(f'Huawei Cloud Services Count: {len(items)} total entries, {unique_count} unique services')
"
Count services only (skip download if metadata is recent)
If metadata was already downloaded recently, you can skip the download step:
python3 -c "
import json, os
meta_path = os.path.expanduser('~/.hcloud/metaRepo/services_en.json')
with open(meta_path) as f:
data = json.load(f)
items = data.get('items', [])
print(f'Huawei Cloud Services Count: {len(items)}')
"
Parameter Confirmation
| Parameter | Required | Description | Default |
|---|---|---|---|
{region} |
No | Huawei Cloud region (not required for meta commands) | cn-north-4 |
{skip_download} |
No | Skip metadata refresh if cache is recent | false |
Reference Documents
- CLI Installation Guide — KooCLI installation and configuration
- IAM Policies — Required IAM permissions
- Verification Method — How to verify the skill works
- Data Flow Diagram — Mermaid data flow
- Acceptance Criteria — Success criteria
KooCLI Command Format Standard
hcloud meta download
- Service: Not applicable —
metais a KooCLI system command, not a service-specific command - Operation:
download— lower case (system operation) - Confirmation: Pipe
echo "y" |to auto-confirm the overwrite prompt
