|
| 1 | +# TenantOS API Documentation |
| 2 | + |
| 3 | +This directory contains the generated TypeScript documentation for the TenantOS API wrapper library. |
| 4 | + |
| 5 | +## Official Documentation |
| 6 | + |
| 7 | +For the complete TenantOS API reference, please visit the [official TenantOS API documentation](https://api.tenantos.com/docs/). |
| 8 | + |
| 9 | +## Wrapper Documentation |
| 10 | + |
| 11 | +This TypeScript wrapper provides: |
| 12 | + |
| 13 | +- **Type-safe API calls** with full IntelliSense support |
| 14 | +- **Comprehensive error handling** with custom error types |
| 15 | +- **Automatic retry logic** for transient failures |
| 16 | +- **Resource-based organization** for intuitive API usage |
| 17 | +- **Complete TypeScript definitions** for all API endpoints |
| 18 | + |
| 19 | +## Quick Start |
| 20 | + |
| 21 | +```typescript |
| 22 | +import { TenantosClient } from '@tenantos/api'; |
| 23 | + |
| 24 | +const client = new TenantosClient({ |
| 25 | + baseUrl: 'https://your-tenant.tenantos.com', |
| 26 | + apiKey: 'your-api-key' |
| 27 | +}); |
| 28 | + |
| 29 | +// List servers |
| 30 | +const servers = await client.servers.list(); |
| 31 | + |
| 32 | +// Get server details |
| 33 | +const server = await client.servers.get(123); |
| 34 | + |
| 35 | +// Server power management |
| 36 | +await client.servers.power.on(123); |
| 37 | +``` |
| 38 | + |
| 39 | +## API Coverage |
| 40 | + |
| 41 | +This wrapper covers 100% of the TenantOS API endpoints as documented in the [official API docs](https://api.tenantos.com/docs/), including: |
| 42 | + |
| 43 | +### Core Resources |
| 44 | +- **Servers** - Complete server lifecycle management |
| 45 | +- **Network Devices** - Network infrastructure management |
| 46 | +- **Users & Roles** - User account and permission management |
| 47 | +- **IP Management** - IP address allocation and management |
| 48 | +- **Inventory** - Hardware inventory tracking |
| 49 | + |
| 50 | +### Server Extensions |
| 51 | +- **BMC Users** - Baseboard Management Controller user management |
| 52 | +- **Backups** - Server backup operations |
| 53 | +- **Snapshots** - VM snapshot management |
| 54 | +- **Statistics** - Performance monitoring and metrics |
| 55 | +- **Console** - Remote console access |
| 56 | +- **Provisioning** - OS installation and configuration |
| 57 | + |
| 58 | +### System Management |
| 59 | +- **PXE Profiles** - Boot profile configuration |
| 60 | +- **Remote Agents** - Agent management and monitoring |
| 61 | +- **Subnets** - Network subnet configuration |
| 62 | +- **RDNS** - Reverse DNS management |
| 63 | +- **System Settings** - Global system configuration |
| 64 | + |
| 65 | +## Error Handling |
| 66 | + |
| 67 | +The wrapper provides comprehensive error handling with specific error types: |
| 68 | + |
| 69 | +```typescript |
| 70 | +import { isTenantosApiError, isTenantosNetworkError } from '@tenantos/api'; |
| 71 | + |
| 72 | +try { |
| 73 | + const server = await client.servers.get(999); |
| 74 | +} catch (error) { |
| 75 | + if (isTenantosApiError(error)) { |
| 76 | + console.log(`API Error ${error.statusCode}: ${error.message}`); |
| 77 | + if (error.isNotFound()) { |
| 78 | + console.log('Server not found'); |
| 79 | + } |
| 80 | + } else if (isTenantosNetworkError(error)) { |
| 81 | + console.log('Network connectivity issue'); |
| 82 | + } |
| 83 | +} |
| 84 | +``` |
| 85 | + |
| 86 | +## License |
| 87 | + |
| 88 | +This TypeScript wrapper library was created by **Salim Shadman** and is released under the **MIT License**. The underlying TenantOS API is managed by TenantOS. |
| 89 | + |
0 commit comments