58 lines
1.6 KiB
Markdown
58 lines
1.6 KiB
Markdown
# API Contracts: Git Integration Plugin
|
|
|
|
## Git Configuration
|
|
|
|
### `GET /api/git/config`
|
|
List all Git server configurations.
|
|
|
|
### `POST /api/git/config`
|
|
Create a new Git server configuration.
|
|
- **Body**: `GitServerConfig` (Pydantic model)
|
|
|
|
### `POST /api/git/config/test`
|
|
Test connection to a Git server.
|
|
- **Body**: `GitServerConfig`
|
|
- **Response**: `{"status": "success" | "error", "message": String}`
|
|
|
|
## Repository & Branch Management
|
|
|
|
### `GET /api/git/repositories/{dashboard_id}/branches`
|
|
List all branches for a dashboard's repository.
|
|
|
|
### `POST /api/git/repositories/{dashboard_id}/branches`
|
|
Create a new branch.
|
|
- **Body**: `{"name": String, "from_branch": String}`
|
|
|
|
### `POST /api/git/repositories/{dashboard_id}/checkout`
|
|
Switch to a specific branch.
|
|
- **Body**: `{"name": String}`
|
|
|
|
## Git Operations
|
|
|
|
### `POST /api/git/repositories/{dashboard_id}/commit`
|
|
Commit changes to the current branch.
|
|
- **Body**: `{"message": String, "files": List[String]}`
|
|
|
|
### `POST /api/git/repositories/{dashboard_id}/push`
|
|
Push local commits to remote.
|
|
|
|
### `POST /api/git/repositories/{dashboard_id}/pull`
|
|
Pull changes from remote.
|
|
|
|
## Conflict Resolution
|
|
|
|
### `GET /api/git/repositories/{dashboard_id}/conflicts`
|
|
List active conflicts for a repository.
|
|
|
|
### `POST /api/git/repositories/{dashboard_id}/resolve`
|
|
Resolve a conflict for a specific file.
|
|
- **Body**: `{"file_path": String, "resolution": "mine" | "theirs" | "manual", "content": Optional[String]}`
|
|
|
|
## Deployment
|
|
|
|
### `GET /api/git/environments`
|
|
List deployment environments.
|
|
|
|
### `POST /api/git/repositories/{dashboard_id}/deploy`
|
|
Deploy dashboard from current branch to target environment.
|
|
- **Body**: `{"environment_id": UUID}` |