Skip to main content

Larrot 🦜

Larrot repeats Huawei Cloud. Perfectly.

Huawei Cloud

the cloud Larrot repeats

A local Huawei Cloud API simulator: like LocalStack, but for Huawei Cloud.

CI


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. Full catalog grouped by category: CATALOG.md

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

Trademark notice

Huawei Cloud and the Huawei Cloud logo are trademarks of Huawei Technologies Co., Ltd. Larrot is an independent, community project and is not affiliated with, endorsed by, or sponsored by Huawei. The logo is used here only to identify the service whose APIs this project simulates.

Metadata

Release files for larrot 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for larrot 1.0.1
File Size Uploaded Provenance Actions
larrot-1.0.1.tar.gz 324.1 kB Without provenance Details for larrot-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for larrot 1.0.1
File Interpreter ABI Platform Actions
larrot-1.0.1-py3-none-any.whl Python 3 none any Details for larrot-1.0.1-py3-none-any.whl

Total release size: 455.5 kB

Release files / larrot-1.0.1.tar.gz

Download URL larrot-1.0.1.tar.gz
Size 324.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a8c400192e18055040b07ed1e2eb24a0b301a7f337e26f1667a4b1ed54963f1d
BLAKE2b-256 checksum
How to use checksums
530790f9a607f6c199f805dbfd9ddbe787f5a5c9d3ffe36b40a21e2bf773513c
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.1-py3-none-any.whl

Download URL larrot-1.0.1-py3-none-any.whl
Size 131.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
669b06b43b6a1a3cb78cf113a0440f99d36d6791fe887413b8548cc0554d44c1
BLAKE2b-256 checksum
How to use checksums
b6c81a221c4b83ecbd1f10819c4ffce43e5f84d2ecf6bb7d6a81e850fb7363ea
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.1

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.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page