Larrot 🦜
Larrot repeats Huawei Cloud. Perfectly.
A local Huawei Cloud API simulator — like LocalStack, but for Huawei Cloud.
Larrot is a parrot. Larrot listens to Huawei Cloud and repeats it — every endpoint,
every error envelope, every async job, every quirk we observed in production.
Yes, even Ecs.0005 "device is illegal".
Can your SDK tell the difference? That's the point.
It runs the REST APIs of Huawei Cloud's international site (*.myhuaweicloud.com)
on your machine: 59 services — IAM, ECS, EVS, VPC, EIP, IMS, CBR, RDS, OBS, CCE,
ModelArts + MaaS, and 50 more — on ports 8200/8201.
Quick start
# Install
pip install larrot
# Run
larrot-server
# → REST on http://127.0.0.1:8200, OBS on http://127.0.0.1:8201
# Or with Docker
docker compose up
# Or from source
pip install -e .
python -m larrot
CLI
larrot projects
larrot ecs list
larrot --wait ecs create --image <id> --flavor s6.large.2 --name myvm
larrot --wait ecs stop <server-id>
larrot evs list
larrot cbr vaults
larrot obs buckets
larrot --json ecs list
Wire real SDKs
Point any @huaweicloud SDK at the simulator with a custom endpoint:
from huaweicloudsdkcore.auth.credentials import BasicCredentials
from huaweicloudsdkecs.v2 import EcsClient, CreateServersRequest
credentials = BasicCredentials() \
.with_ak("HWYSIMAK00000001") \
.with_sk("HWYSIMSK00000001") \
.with_project_id("06f1c15e6f0010672f86c003006c5f17")
client = EcsClient.newBuilder() \
.withCredential(credentials) \
.withEndpoint("http://127.0.0.1:8200") \
.build()
Your existing scripts run unchanged — just change the endpoint.
Services
59 distinct Huawei Cloud services across 71 router modules:
| Service | Port | What it covers |
|---|---|---|
| IAM | 8200 | Projects, tokens |
| ECS | 8200 | Servers: lifecycle, attach/detach, state guards, batch ops, flavors |
| EVS | 8200 | Volumes: CRUD, snapshots (detached-only), os-vendor detail, extend |
| VPC | 8200 | VPCs, subnets, ports, peering, network ACLs, route tables |
| EIP | 8200 | Allocate/bind/unbind/release, bandwidths (v2.0) |
| IMS | 8200 | Images: 3 registration routes, Glance v2, whole images |
| CBR | 8200 | Vaults, policies, checkpoints (on-demand backup), backups, restore |
| RDS | 8200 | Database instances, flavors, backups, params, replicas, users, logs |
| OBS | 8201 | Buckets, objects, multipart upload, ListObjects XML |
| ELB / NAT / VPN / DNS | 8200 | Load balancers, NAT gateways, VPN gateways, zones + recordsets |
| CCE / CCI / SWR | 8200 | Kubernetes clusters, serverless pods, container registry |
| DWS / CSS / MRS | 8200 | Data warehouse, Elasticsearch clusters, Hadoop/Spark clusters |
| RDS-family | 8200 | DDS, GaussDB, GeminiDB, DDM, DBSS |
| DCS / DMS / DIS | 8200 | Redis, Kafka/RocketMQ, streaming ingestion |
| ModelArts + MaaS | 8200 | Notebooks, training, model registry, inference services, fine-tuning, OpenAI-compatible chat/embeddings |
| HSS / CFW / DSC / WAF / Anti-DDoS / KMS | 8200 | Host security, cloud firewall, data security, WAF, DDoS, keys |
| CDN | 8200 | Domains, origins, purge/preheat, statistics |
| SMS / OMS / DES | 8200 | Server migration, OBS migration, physical data transfer |
| DC / ER | 8200 | Direct Connect, Enterprise Router (attachments, route tables) |
| CodeArts / ServiceStage / CSE | 8200 | Repos, pipelines, builds; environments/apps/components; microservice engines |
| VOD / IEF | 8200 | Media assets + transcode, edge nodes + deployments |
| DataArts / DLI / AOM / CES / LTS / SMN | 8200 | Data governance, SQL jobs, ops, monitoring, logs, notifications |
| BMS / AS / SFS / TMS / EPS / APIG / IoTDA / BSS | 8200 | Bare metal, auto scaling, file shares, tags, enterprise projects, API gateway, IoT, billing |
What makes it different from a mock
- State machines with preconditions — can't stop a stopped server, can't snapshot an in-use volume, can't detach a system disk
- Async job model — every mutation returns
job_id, completes after 1–3s, clients poll - Per-region quirk profiles — tr-west-1 (HCS) behaves differently from ap-southeast-1
- Exact error codes —
Ecs.0005 "device is illegal",APIGW.0301,SecurityGroupRuleExists - Rate limiting — rapid calls → 401
APIGW.0301, 30s backoff clears it - Signature verification — recomputes SDK-HMAC-SHA256 and OBS v2 signatures (accept-and-check)
Configuration
| Env var | Default | Meaning |
|---|---|---|
SIM_PORT |
8200 | REST port |
SIM_OBS_PORT |
8201 | OBS port |
SIM_PROFILE |
public | Default quirk profile |
SIM_AK / SIM_SK |
HWYSIMAK… / HWYSIMSK… | Credentials |
SIM_RATE_LIMIT |
100 | Per-AK requests / 10s (0 = disabled) |
SIM_RATE_COOLDOWN_MS |
30000 | Throttle backoff |
Dashboard
Open http://127.0.0.1:8200/ for a live dashboard showing resource counts.
Open http://127.0.0.1:8200/docs for auto-generated API documentation.
Testing
python3 tools/smoke.py # 23-check smoke suite
python3 -m pytest tests/ # unit tests
License
Apache 2.0 — see LICENSE
Contributing
See CONTRIBUTING.md
Metadata
Release files for larrot 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| larrot-1.0.0.tar.gz | 282.4 kB | Without provenance | Details for larrot-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| larrot-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for larrot-1.0.0-py3-none-any.whl |
Total release size: 414.3 kB
Release files / larrot-1.0.0.tar.gz
| Download URL | larrot-1.0.0.tar.gz |
|---|---|
| Size | 282.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
585d6de7f361c513a421e451477053407b35f9ca9a532d62989a6e7e99eb61d6
|
|
BLAKE2b-256 checksum How to use checksums |
46bcdab33400eecbf2e5b5d40500fd9d5f5035168de38c9111a14f385a0b90af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.2
|
Release files / larrot-1.0.0-py3-none-any.whl
| Download URL | larrot-1.0.0-py3-none-any.whl |
|---|---|
| Size | 131.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a5737625aad8aef05863e0ee53bd07be93bb4ce43bba7dce56f77d6b6ecdd863
|
|
BLAKE2b-256 checksum How to use checksums |
0c41ead41cba76ea67112dec609820f2e4a3b9a372e92124d795e0b78e914989
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.2
|
Security for larrot 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.