Multi-language SDK for AVIZ ONES Spectrum-X tenant management API (v4.2.1).
Provides programmatic access to:
- Tenant lifecycle management (create, read, update, delete)
- GPU server allocation and deallocation
- Fabric discovery and configuration
- VPC peering setup
- Asynchronous operation tracking (sync / async-poll / async-webhook)
Status: Production-ready (v0.1.0)
- Requirements: Python 3.9+
- Installation:
pip install ./ones-gfx-sdk-python - Use Case: Data science workflows, Jupyter notebooks, automation scripts, rapid prototyping
- Features: Full API coverage, JWT auto-refresh, timeout override, async modes
Quick Start:
from ones_gfx import ONESClient, JWTAuth
auth = JWTAuth(access_token, refresh_token, refresh_url)
client = ONESClient(base_url, auth)
tenant = client.tenants.create(fabric, "tenant1", "desc", max_gpus=8)Status: Core library production-ready (v1.0.0), CLI in development
- Requirements: Go 1.19+
- Installation:
go get github.com/aviznetworks/ones-gfx-sdk/ones-gfx-sdk-go - Use Case: Kubernetes operators, controllers, high-performance integrations, compiled binaries
- Features: Type-safe, zero dependencies, compile-time error checking, single binary deployment
Quick Start:
import (
"github.com/aviznetworks/ones-gfx-sdk/ones-gfx-sdk-go/ones"
"github.com/aviznetworks/ones-gfx-sdk/ones-gfx-sdk-go/sdk"
)
auth, err := ones.NewJWTAuth(accessToken, refreshToken, refreshURL)
if err != nil {
panic(err)
}
client := sdk.NewClient(baseURL, auth)
tenant, err := client.Tenants.Create(ctx, fabricName, req)| Feature | Python | Go | Notes |
|---|---|---|---|
| Tenant CRUD | β | β | Full parity |
| GPU allocation/deallocation | β | β | Timeout override supported |
| Async modes | β | β | sync / async-poll / async-webhook |
| JWT auto-refresh | β | β | Proactive + reactive |
| Timeout override | β | β | Per-call override for long operations |
| Library import | β | β | Use as dependency |
| Type safety | Runtime | Compile-time | Go catches errors before deployment |
# From PyPI (when published)
pip install ones-gfx-sdk
# From source
cd ones-gfx-sdk/ones-gfx-sdk-python
pip install -e .
# CLI usage
python examples/usage_examples.py --mode sync --action lifecycle# As library
go get github.com/aviznetworks/ones-gfx-sdk/ones-gfx-sdk-go
# From source
cd ones-gfx-sdk/ones-gfx-sdk-go
make build-lib
# CLI usage (coming in v1.1)
# ones-gfx-sdk-mod lifecycle --mode sync --fabric sdkimport subprocess
import json
result = subprocess.run([
"python", "examples/usage_examples.py",
"--action", "create",
"--tenant-name", "controller-tenant",
"--fabric", "sdk",
"--output", "json"
], capture_output=True, text=True)
tenant = json.loads(result.stdout)
print(f"Created tenant ID: {tenant['tenant']['id']}")import "github.com/aviznetworks/ones-gfx-sdk/ones-gfx-sdk-go/ones"
client := sdk.NewClient(baseURL, auth)
tenant, err := client.Tenants.Create(ctx, "sdk", ones.CreateTenantRequest{
Name: "controller-tenant", MaxGPUsAllowed: 8,
})ones-gfx-sdk/
βββ README.md # This file (language picker)
βββ LICENSE # Apache 2.0
βββ ones-gfx-sdk-python/ # Python implementation
β βββ ones_gfx/ # Core library package
β βββ examples/ # CLI with 8 commands
β βββ pyproject.toml
β βββ README.md
βββ ones-gfx-sdk-go/ # Go implementation
βββ ones/ # Core library (importable)
βββ cmd/ # CLI binary (v1.1)
βββ go.mod
βββ README.md
cd ones-gfx-sdk-python
python examples/usage_examples.py --mode sync --action lifecycle --fabric sdk// See ones-gfx-sdk-go/README.md for complete example
tenant, _ := client.Tenants.Create(ctx, fabricName, req)
_ = client.Tenants.AllocateGPUs(ctx, fabricName, name, servers)
_ = client.Tenants.DeallocateGPUs(ctx, fabricName, name, servers)
_ = client.Tenants.Delete(ctx, fabricName, name)Both SDKs wrap the same ONES Spectrum-X API. For raw curl examples, see:
π api_reference.txt β Language-agnostic API examples
Endpoints covered:
POST /fabrics/{fabricName}/tenantsβ Create tenantGET /fabrics/{fabricName}/tenantsβ List tenantsGET /fabrics/{fabricName}/tenants/{name}β Get tenantDELETE /fabrics/{fabricName}/tenants/{name}β Delete tenantPATCH /fabrics/{fabricName}/tenants/{name}β Allocate/deallocate GPUsGET /fabricsβ List fabricsGET /operations/{id}β Poll async operationPOST /fabrics/{fabricName}/vpcpeeringβ VPC peering
| ONES API Version | Python SDK | Go SDK |
|---|---|---|
| 4.2.1 | β v1.0.0 | β v1.0.0 |
Both SDKs target ONES 4.2.1.
See language-specific contribution guidelines:
- Python Contributing Guide (coming soon)
- Go Contributing Guide (coming soon)
- Documentation: See language-specific READMEs
- Issues: GitHub Issues
- Security: Report vulnerabilities to security@aviznetworks.com
Developed by AVIZ Networks
For questions or support, visit https://aviznetworks.com