Skip to main content

API Documentation

Welcome to the PveSphere API documentation. This document provides complete API interface descriptions.

Basic Information

Base URL

http://localhost:8000/api/v1

Authentication

PveSphere API uses JWT (JSON Web Token) for authentication.

Get Token

POST /api/v1/user/login
Content-Type: application/json

{
"email": "pvesphere@gmail.com",
"password": "Ab123456"
}

Response example:

{
"code": 200,
"message": "success",
"data": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"user": {
"id": 1,
"email": "pvesphere@gmail.com",
"nickname": "PveSphere Admin"
}
}
}

Using Token

In subsequent requests, you need to include the Token in the request header:

Authorization: Bearer <your-token>

API Overview

Authentication and Authorization

Cluster Management

Node Management

Virtual Machine Management

Storage Management

Template Management

Response Format

All API responses follow a unified format:

{
"code": 200,
"message": "success",
"data": {}
}

Status Codes

  • 200 - Success
  • 400 - Bad Request
  • 401 - Unauthorized
  • 403 - Forbidden
  • 404 - Not Found
  • 500 - Internal Server Error

Swagger Documentation

You can also view the complete API documentation via Swagger UI:

http://localhost:8000/swagger/index.html

Next Steps