hypersdk

HyperSDK API Endpoints Documentation

Complete list of all API endpoints available in HyperSDK with integration to hyper2kvm.

Base URL

http://localhost:8080

Core Endpoints

Health & Status

Job Management

Jobs

VM Management

VM Discovery

Scheduling & Automation

Schedules

Backup Policies

Workflows

User Management & RBAC

Users

Roles

API Keys

Sessions

Notifications & Alerts

Notifications

Alert Rules

Webhooks

Hyper2KVM Integration

VM Conversion

KVM Import

VMDK Parser

Cost Management

Cost Summary

Budget

Organization

Tags

Collections

Saved Searches

Cloud & Integration

Cloud Providers

Multi-vCenter

Integrations

Security & Compliance

Encryption

Compliance

Audit Logs

Migration

Migration Wizard

Compatibility Check

Rollback

Testing the API

Using curl

  1. Health check:
    curl http://localhost:8080/health
    
  2. List VMs:
    curl "http://localhost:8080/vms/list?server=vcenter.example.com&username=admin@vsphere.local&password=secret&insecure=true"
    
  3. Convert VM:
    curl -X POST http://localhost:8080/convert/vm \
      -H "Content-Type: application/json" \
      -d '{
     "source_path": "/vmfs/volumes/datastore1/vm1/vm1.vmdk",
     "dest_path": "/var/lib/libvirt/images/vm1.qcow2",
     "format": "qcow2",
     "compression": "gzip"
      }'
    
  4. Import to KVM:
    curl -X POST http://localhost:8080/import/kvm \
      -H "Content-Type: application/json" \
      -d '{
     "image_path": "/var/lib/libvirt/images/vm1.qcow2",
     "vm_name": "imported-vm-1",
     "memory": 2048,
     "cpus": 2,
     "network": "default"
      }'
    
  5. Create schedule:
    curl -X POST http://localhost:8080/schedules/create \
      -H "Content-Type: application/json" \
      -d '{
     "name": "Nightly Backup",
     "cron_expr": "0 1 * * *"
      }'
    

Response Format

All endpoints return JSON responses with the following structure:

Success Response

{
  "status": "success",
  "data": { ... }
}

Error Response

{
  "error": "Error message description"
}

HTTP Status Codes

Hyper2KVM Integration Notes

The API integrates with the hyper2kvm Python tool located at /home/ssahani/tt/hyper2kvm/.

Prerequisites

  1. Python 3.x installed
  2. hyper2kvm installed and accessible
  3. Required permissions for vCenter access
  4. Sufficient disk space for conversions

Conversion Workflow

  1. Call /convert/vm with source VMDK path
  2. hyper2kvm converts to target format (qcow2/raw)
  3. Call /import/kvm to import to libvirt
  4. VM is now running on KVM

Supported Formats

Error Handling

All conversion and import operations return detailed error messages:

{
  "error": "conversion failed: disk not found - /path/to/disk.vmdk"
}

Check logs for detailed Python traceback if conversion fails.