Examples
The IBEE examples repository is a set of short programs that each do one task with IBEE: usually create a resource, read it, and delete it. Every product has the same task three ways, a main.py (Python SDK), an index.ts (TypeScript SDK) and a cli.sh (CLI), so you can copy the version that matches your tools.
When to use the examples
How it works
- Each folder is one product, with a README that lists the token scopes and the environment variables it reads.
- Every example reads your token and workspace from
IBEE_TOKENandIBEE_WORKSPACE_ID. - getting-started creates nothing: it checks your token and prints the site, plan and image IDs that the other examples need.
- The other examples create what they need and delete it at the end. VM examples check each operation every few seconds until it has finished (
get_compute_operationin the SDKs,ibee ops getin the CLI versions). - The examples use the 0.7.0 SDKs and CLI and Terraform provider 0.8.0, the versions the SDK, CLI and Terraform pages describe.
requirements.txt,package.jsonand eachmain.tfpin them.
Before you begin
- Git, Python 3.10 or later, and Node.js 18 or later (for the TypeScript examples).
jqfor thecli.shandapi.shscripts. - An API token with the scopes the example’s README lists, for example
vm.readfor getting-started andvm.readplusvm.writefor cloud-vms. See Authentication. - Your workspace ID. See Find your workspace ID.
- Credit in your account. Most examples create billable resources (VMs, for example, with
HOURLYbilling) for a few minutes. If an example stops halfway, delete what it created in the portal.
Run your first example
Set your token and workspace
Set IBEE_ENV=dev as well only if you use a development token (ibee_dev_key_…).
Compute
Storage
Networking and security
Terraform
Interfaces
Virtual IPs, Bare Metal Servers, SSH keys, ISOs and Email Service are managed in the portal and have no public API yet, so they have no examples.
Troubleshooting
Open an issue for questions or requests.
Related pages
- API overview: your first call with
curl - SDKs, CLI and Terraform
- Authentication: the scopes each example needs
