- Update openapi.yaml spec - Regenerate server_gen.go with oapi-codegen - Update adapter, routes, and server configuration
1214 lines
45 KiB
Go
1214 lines
45 KiB
Go
// Package api provides primitives to interact with the openapi HTTP API.
|
|
//
|
|
// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.1 DO NOT EDIT.
|
|
package api
|
|
|
|
import (
|
|
"fmt"
|
|
"net/http"
|
|
"time"
|
|
|
|
"github.com/labstack/echo/v4"
|
|
"github.com/oapi-codegen/runtime"
|
|
)
|
|
|
|
const (
|
|
ApiKeyAuthScopes = "ApiKeyAuth.Scopes"
|
|
)
|
|
|
|
// Defines values for AuditEventEventType.
|
|
const (
|
|
AuditEventEventTypeAuditVerified AuditEventEventType = "audit_verified"
|
|
AuditEventEventTypeAuthAttempt AuditEventEventType = "auth_attempt"
|
|
AuditEventEventTypeFileAccess AuditEventEventType = "file_access"
|
|
AuditEventEventTypeJobCompleted AuditEventEventType = "job_completed"
|
|
AuditEventEventTypeJobQueued AuditEventEventType = "job_queued"
|
|
AuditEventEventTypeJobStarted AuditEventEventType = "job_started"
|
|
AuditEventEventTypePluginConfigured AuditEventEventType = "plugin_configured"
|
|
AuditEventEventTypeSchedulerDrain AuditEventEventType = "scheduler_drain"
|
|
)
|
|
|
|
// Defines values for ErrorResponseCode.
|
|
const (
|
|
BADREQUEST ErrorResponseCode = "BAD_REQUEST"
|
|
CONFLICT ErrorResponseCode = "CONFLICT"
|
|
FORBIDDEN ErrorResponseCode = "FORBIDDEN"
|
|
INTERNALERROR ErrorResponseCode = "INTERNAL_ERROR"
|
|
NOTFOUND ErrorResponseCode = "NOT_FOUND"
|
|
RATELIMITED ErrorResponseCode = "RATE_LIMITED"
|
|
SERVICEUNAVAILABLE ErrorResponseCode = "SERVICE_UNAVAILABLE"
|
|
UNAUTHORIZED ErrorResponseCode = "UNAUTHORIZED"
|
|
VALIDATIONERROR ErrorResponseCode = "VALIDATION_ERROR"
|
|
)
|
|
|
|
// Defines values for ExperimentStatus.
|
|
const (
|
|
ExperimentStatusActive ExperimentStatus = "active"
|
|
ExperimentStatusArchived ExperimentStatus = "archived"
|
|
ExperimentStatusDeleted ExperimentStatus = "deleted"
|
|
)
|
|
|
|
// Defines values for HealthResponseStatus.
|
|
const (
|
|
HealthResponseStatusDegraded HealthResponseStatus = "degraded"
|
|
HealthResponseStatusHealthy HealthResponseStatus = "healthy"
|
|
HealthResponseStatusUnhealthy HealthResponseStatus = "unhealthy"
|
|
)
|
|
|
|
// Defines values for JupyterServiceStatus.
|
|
const (
|
|
JupyterServiceStatusError JupyterServiceStatus = "error"
|
|
JupyterServiceStatusRunning JupyterServiceStatus = "running"
|
|
JupyterServiceStatusStarting JupyterServiceStatus = "starting"
|
|
JupyterServiceStatusStopped JupyterServiceStatus = "stopped"
|
|
JupyterServiceStatusStopping JupyterServiceStatus = "stopping"
|
|
)
|
|
|
|
// Defines values for PluginMode.
|
|
const (
|
|
PluginModeDisabled PluginMode = "disabled"
|
|
PluginModeRemote PluginMode = "remote"
|
|
PluginModeSidecar PluginMode = "sidecar"
|
|
)
|
|
|
|
// Defines values for PluginConfigMode.
|
|
const (
|
|
PluginConfigModeDisabled PluginConfigMode = "disabled"
|
|
PluginConfigModeRemote PluginConfigMode = "remote"
|
|
PluginConfigModeSidecar PluginConfigMode = "sidecar"
|
|
)
|
|
|
|
// Defines values for PluginStatusStatus.
|
|
const (
|
|
PluginStatusStatusHealthy PluginStatusStatus = "healthy"
|
|
PluginStatusStatusStarting PluginStatusStatus = "starting"
|
|
PluginStatusStatusStopped PluginStatusStatus = "stopped"
|
|
PluginStatusStatusUnhealthy PluginStatusStatus = "unhealthy"
|
|
)
|
|
|
|
// Defines values for ReservationStatus.
|
|
const (
|
|
ReservationStatusActive ReservationStatus = "active"
|
|
ReservationStatusClaimed ReservationStatus = "claimed"
|
|
ReservationStatusExpired ReservationStatus = "expired"
|
|
)
|
|
|
|
// Defines values for TaskStatus.
|
|
const (
|
|
TaskStatusCollecting TaskStatus = "collecting"
|
|
TaskStatusCompleted TaskStatus = "completed"
|
|
TaskStatusFailed TaskStatus = "failed"
|
|
TaskStatusPreparing TaskStatus = "preparing"
|
|
TaskStatusQueued TaskStatus = "queued"
|
|
TaskStatusRunning TaskStatus = "running"
|
|
)
|
|
|
|
// Defines values for WorkerStatus.
|
|
const (
|
|
Active WorkerStatus = "active"
|
|
Draining WorkerStatus = "draining"
|
|
Offline WorkerStatus = "offline"
|
|
)
|
|
|
|
// Defines values for GetV1AuditEventsParamsEventType.
|
|
const (
|
|
GetV1AuditEventsParamsEventTypeAuditVerified GetV1AuditEventsParamsEventType = "audit_verified"
|
|
GetV1AuditEventsParamsEventTypeAuthAttempt GetV1AuditEventsParamsEventType = "auth_attempt"
|
|
GetV1AuditEventsParamsEventTypeFileAccess GetV1AuditEventsParamsEventType = "file_access"
|
|
GetV1AuditEventsParamsEventTypeJobCompleted GetV1AuditEventsParamsEventType = "job_completed"
|
|
GetV1AuditEventsParamsEventTypeJobQueued GetV1AuditEventsParamsEventType = "job_queued"
|
|
GetV1AuditEventsParamsEventTypeJobStarted GetV1AuditEventsParamsEventType = "job_started"
|
|
GetV1AuditEventsParamsEventTypePluginConfigured GetV1AuditEventsParamsEventType = "plugin_configured"
|
|
GetV1AuditEventsParamsEventTypeSchedulerDrain GetV1AuditEventsParamsEventType = "scheduler_drain"
|
|
)
|
|
|
|
// Defines values for GetV1TasksParamsStatus.
|
|
const (
|
|
Completed GetV1TasksParamsStatus = "completed"
|
|
Failed GetV1TasksParamsStatus = "failed"
|
|
Queued GetV1TasksParamsStatus = "queued"
|
|
Running GetV1TasksParamsStatus = "running"
|
|
)
|
|
|
|
// AuditEvent defines model for AuditEvent.
|
|
type AuditEvent struct {
|
|
// Action Action performed
|
|
Action *string `json:"action,omitempty"`
|
|
Error *string `json:"error,omitempty"`
|
|
|
|
// EventHash This event's hash
|
|
EventHash *string `json:"event_hash,omitempty"`
|
|
EventType *AuditEventEventType `json:"event_type,omitempty"`
|
|
IpAddress *string `json:"ip_address,omitempty"`
|
|
Metadata *map[string]interface{} `json:"metadata,omitempty"`
|
|
|
|
// PrevHash Previous event hash in chain
|
|
PrevHash *string `json:"prev_hash,omitempty"`
|
|
|
|
// Resource Resource being acted upon
|
|
Resource *string `json:"resource,omitempty"`
|
|
|
|
// SequenceNum Position in audit chain
|
|
SequenceNum *int `json:"sequence_num,omitempty"`
|
|
Success *bool `json:"success,omitempty"`
|
|
Timestamp *time.Time `json:"timestamp,omitempty"`
|
|
UserId *string `json:"user_id,omitempty"`
|
|
}
|
|
|
|
// AuditEventEventType defines model for AuditEvent.EventType.
|
|
type AuditEventEventType string
|
|
|
|
// AuditEventList defines model for AuditEventList.
|
|
type AuditEventList struct {
|
|
Events *[]AuditEvent `json:"events,omitempty"`
|
|
Limit *int `json:"limit,omitempty"`
|
|
Offset *int `json:"offset,omitempty"`
|
|
Total *int `json:"total,omitempty"`
|
|
}
|
|
|
|
// CreateExperimentRequest defines model for CreateExperimentRequest.
|
|
type CreateExperimentRequest struct {
|
|
Description *string `json:"description,omitempty"`
|
|
Name string `json:"name"`
|
|
}
|
|
|
|
// CreateReservationRequest defines model for CreateReservationRequest.
|
|
type CreateReservationRequest struct {
|
|
ExpiresMinutes *int `json:"expires_minutes,omitempty"`
|
|
GpuCount int `json:"gpu_count"`
|
|
GpuType *string `json:"gpu_type,omitempty"`
|
|
NodeCount *int `json:"node_count,omitempty"`
|
|
}
|
|
|
|
// CreateTaskRequest defines model for CreateTaskRequest.
|
|
type CreateTaskRequest struct {
|
|
// Args Command-line arguments for the entrypoint
|
|
Args *string `json:"args,omitempty"`
|
|
|
|
// Cpu CPU cores requested
|
|
Cpu *int `json:"cpu,omitempty"`
|
|
DatasetSpecs *[]DatasetSpec `json:"dataset_specs,omitempty"`
|
|
Datasets *[]string `json:"datasets,omitempty"`
|
|
|
|
// Entrypoint Entrypoint script or command (e.g., train.py, run.sh, /bin/bash -c "echo hello")
|
|
Entrypoint *string `json:"entrypoint,omitempty"`
|
|
|
|
// Gpu GPUs requested
|
|
Gpu *int `json:"gpu,omitempty"`
|
|
|
|
// JobName Unique identifier for the job
|
|
JobName string `json:"job_name"`
|
|
|
|
// MemoryGb Memory (GB) requested
|
|
MemoryGb *int `json:"memory_gb,omitempty"`
|
|
Metadata *map[string]string `json:"metadata,omitempty"`
|
|
Priority *int `json:"priority,omitempty"`
|
|
|
|
// SnapshotId Reference to experiment snapshot
|
|
SnapshotId *string `json:"snapshot_id,omitempty"`
|
|
}
|
|
|
|
// DatasetSpec defines model for DatasetSpec.
|
|
type DatasetSpec struct {
|
|
MountPath *string `json:"mount_path,omitempty"`
|
|
Name *string `json:"name,omitempty"`
|
|
Sha256 *string `json:"sha256,omitempty"`
|
|
Source *string `json:"source,omitempty"`
|
|
}
|
|
|
|
// ErrorResponse defines model for ErrorResponse.
|
|
type ErrorResponse struct {
|
|
Code ErrorResponseCode `json:"code"`
|
|
|
|
// Error Sanitized error message
|
|
Error string `json:"error"`
|
|
|
|
// TraceId Support correlation ID
|
|
TraceId string `json:"trace_id"`
|
|
}
|
|
|
|
// ErrorResponseCode defines model for ErrorResponse.Code.
|
|
type ErrorResponseCode string
|
|
|
|
// Experiment defines model for Experiment.
|
|
type Experiment struct {
|
|
CommitId *string `json:"commit_id,omitempty"`
|
|
CreatedAt *time.Time `json:"created_at,omitempty"`
|
|
Id *string `json:"id,omitempty"`
|
|
Name *string `json:"name,omitempty"`
|
|
Status *ExperimentStatus `json:"status,omitempty"`
|
|
}
|
|
|
|
// ExperimentStatus defines model for Experiment.Status.
|
|
type ExperimentStatus string
|
|
|
|
// HealthResponse defines model for HealthResponse.
|
|
type HealthResponse struct {
|
|
Status *HealthResponseStatus `json:"status,omitempty"`
|
|
Timestamp *time.Time `json:"timestamp,omitempty"`
|
|
Version *string `json:"version,omitempty"`
|
|
}
|
|
|
|
// HealthResponseStatus defines model for HealthResponse.Status.
|
|
type HealthResponseStatus string
|
|
|
|
// JupyterService defines model for JupyterService.
|
|
type JupyterService struct {
|
|
CreatedAt *time.Time `json:"created_at,omitempty"`
|
|
Id *string `json:"id,omitempty"`
|
|
Name *string `json:"name,omitempty"`
|
|
Status *JupyterServiceStatus `json:"status,omitempty"`
|
|
Token *string `json:"token,omitempty"`
|
|
Url *string `json:"url,omitempty"`
|
|
}
|
|
|
|
// JupyterServiceStatus defines model for JupyterService.Status.
|
|
type JupyterServiceStatus string
|
|
|
|
// NodeAssignment defines model for NodeAssignment.
|
|
type NodeAssignment struct {
|
|
NodeId *int `json:"node_id,omitempty"`
|
|
SlotAssigned *bool `json:"slot_assigned,omitempty"`
|
|
WorkerId *string `json:"worker_id,omitempty"`
|
|
}
|
|
|
|
// Plugin defines model for Plugin.
|
|
type Plugin struct {
|
|
Config *PluginConfig `json:"config,omitempty"`
|
|
|
|
// Enabled Whether plugin is enabled
|
|
Enabled *bool `json:"enabled,omitempty"`
|
|
|
|
// Mode Provisioning mode
|
|
Mode *PluginMode `json:"mode,omitempty"`
|
|
|
|
// Name Plugin name
|
|
Name *string `json:"name,omitempty"`
|
|
|
|
// RequiresRestart Whether plugin requires restart on config change
|
|
RequiresRestart *bool `json:"requires_restart,omitempty"`
|
|
Status *PluginStatus `json:"status,omitempty"`
|
|
|
|
// Version Plugin version
|
|
Version *string `json:"version,omitempty"`
|
|
}
|
|
|
|
// PluginMode Provisioning mode
|
|
type PluginMode string
|
|
|
|
// PluginConfig defines model for PluginConfig.
|
|
type PluginConfig struct {
|
|
Enabled *bool `json:"enabled,omitempty"`
|
|
Image *string `json:"image,omitempty"`
|
|
Mode *PluginConfigMode `json:"mode,omitempty"`
|
|
Settings *map[string]interface{} `json:"settings,omitempty"`
|
|
}
|
|
|
|
// PluginConfigMode defines model for PluginConfig.Mode.
|
|
type PluginConfigMode string
|
|
|
|
// PluginStatus defines model for PluginStatus.
|
|
type PluginStatus struct {
|
|
LastCheck *time.Time `json:"last_check,omitempty"`
|
|
Name *string `json:"name,omitempty"`
|
|
Status *PluginStatusStatus `json:"status,omitempty"`
|
|
Url *string `json:"url,omitempty"`
|
|
}
|
|
|
|
// PluginStatusStatus defines model for PluginStatus.Status.
|
|
type PluginStatusStatus string
|
|
|
|
// QueueStats defines model for QueueStats.
|
|
type QueueStats struct {
|
|
// Completed Tasks completed today
|
|
Completed *int `json:"completed,omitempty"`
|
|
|
|
// Failed Tasks failed today
|
|
Failed *int `json:"failed,omitempty"`
|
|
|
|
// Queued Tasks waiting to run
|
|
Queued *int `json:"queued,omitempty"`
|
|
|
|
// Running Tasks currently executing
|
|
Running *int `json:"running,omitempty"`
|
|
|
|
// Workers Active workers
|
|
Workers *int `json:"workers,omitempty"`
|
|
}
|
|
|
|
// Reservation defines model for Reservation.
|
|
type Reservation struct {
|
|
ExpiresAt *time.Time `json:"expires_at,omitempty"`
|
|
GpuCount *int `json:"gpu_count,omitempty"`
|
|
GpuType *string `json:"gpu_type,omitempty"`
|
|
Id *string `json:"id,omitempty"`
|
|
NodeCount *int `json:"node_count,omitempty"`
|
|
Status *ReservationStatus `json:"status,omitempty"`
|
|
UserId *string `json:"user_id,omitempty"`
|
|
}
|
|
|
|
// ReservationStatus defines model for Reservation.Status.
|
|
type ReservationStatus string
|
|
|
|
// SchedulerStatus defines model for SchedulerStatus.
|
|
type SchedulerStatus struct {
|
|
BatchQueueDepth *int `json:"batch_queue_depth,omitempty"`
|
|
ReservationsActive *int `json:"reservations_active,omitempty"`
|
|
ServiceQueueDepth *int `json:"service_queue_depth,omitempty"`
|
|
TasksCompleted24h *int `json:"tasks_completed_24h,omitempty"`
|
|
TasksRunning *int `json:"tasks_running,omitempty"`
|
|
Timestamp *time.Time `json:"timestamp,omitempty"`
|
|
WorkersActive *int `json:"workers_active,omitempty"`
|
|
WorkersDraining *int `json:"workers_draining,omitempty"`
|
|
WorkersTotal *int `json:"workers_total,omitempty"`
|
|
}
|
|
|
|
// StartJupyterRequest defines model for StartJupyterRequest.
|
|
type StartJupyterRequest struct {
|
|
Image *string `json:"image,omitempty"`
|
|
Name string `json:"name"`
|
|
Workspace *string `json:"workspace,omitempty"`
|
|
}
|
|
|
|
// Task defines model for Task.
|
|
type Task struct {
|
|
Cpu *int `json:"cpu,omitempty"`
|
|
CreatedAt *time.Time `json:"created_at,omitempty"`
|
|
Datasets *[]string `json:"datasets,omitempty"`
|
|
EndedAt *time.Time `json:"ended_at,omitempty"`
|
|
|
|
// Entrypoint Entrypoint script or command executed for this task
|
|
Entrypoint *string `json:"entrypoint,omitempty"`
|
|
Error *string `json:"error,omitempty"`
|
|
Gpu *int `json:"gpu,omitempty"`
|
|
|
|
// Id Unique task identifier
|
|
Id *string `json:"id,omitempty"`
|
|
JobName *string `json:"job_name,omitempty"`
|
|
MaxRetries *int `json:"max_retries,omitempty"`
|
|
MemoryGb *int `json:"memory_gb,omitempty"`
|
|
|
|
// NodeAssignments Worker node assignments for multi-node jobs
|
|
NodeAssignments *[]NodeAssignment `json:"node_assignments,omitempty"`
|
|
Output *string `json:"output,omitempty"`
|
|
|
|
// PluginStatus Status of tracking plugins for this task
|
|
PluginStatus *map[string]PluginStatus `json:"plugin_status,omitempty"`
|
|
Priority *int `json:"priority,omitempty"`
|
|
|
|
// PriorityAged Effective priority with aging applied
|
|
PriorityAged *float32 `json:"priority_aged,omitempty"`
|
|
RetryCount *int `json:"retry_count,omitempty"`
|
|
SnapshotId *string `json:"snapshot_id,omitempty"`
|
|
StartedAt *time.Time `json:"started_at,omitempty"`
|
|
Status *TaskStatus `json:"status,omitempty"`
|
|
UserId *string `json:"user_id,omitempty"`
|
|
WorkerId *string `json:"worker_id,omitempty"`
|
|
}
|
|
|
|
// TaskStatus defines model for Task.Status.
|
|
type TaskStatus string
|
|
|
|
// TaskList defines model for TaskList.
|
|
type TaskList struct {
|
|
Limit *int `json:"limit,omitempty"`
|
|
Offset *int `json:"offset,omitempty"`
|
|
Tasks *[]Task `json:"tasks,omitempty"`
|
|
Total *int `json:"total,omitempty"`
|
|
}
|
|
|
|
// VerificationResult defines model for VerificationResult.
|
|
type VerificationResult struct {
|
|
ChainRootHash *string `json:"chain_root_hash,omitempty"`
|
|
|
|
// FirstTampered Sequence number of first tampered event (if any)
|
|
FirstTampered *int `json:"first_tampered,omitempty"`
|
|
TotalEvents *int `json:"total_events,omitempty"`
|
|
Valid *bool `json:"valid,omitempty"`
|
|
VerifiedAt *time.Time `json:"verified_at,omitempty"`
|
|
}
|
|
|
|
// Worker defines model for Worker.
|
|
type Worker struct {
|
|
// ActiveTasks IDs of tasks currently running on this worker
|
|
ActiveTasks *[]string `json:"active_tasks,omitempty"`
|
|
Capabilities *struct {
|
|
CpuCores *int `json:"cpu_cores,omitempty"`
|
|
|
|
// GpuCount Number of GPUs
|
|
GpuCount *int `json:"gpu_count,omitempty"`
|
|
|
|
// GpuType GPU type (e.g., A100, H100)
|
|
GpuType *string `json:"gpu_type,omitempty"`
|
|
MemoryGb *int `json:"memory_gb,omitempty"`
|
|
} `json:"capabilities,omitempty"`
|
|
|
|
// ConnectedAt When worker connected
|
|
ConnectedAt *time.Time `json:"connected_at,omitempty"`
|
|
|
|
// Id Worker unique identifier
|
|
Id *string `json:"id,omitempty"`
|
|
|
|
// LastHeartbeat Last heartbeat timestamp
|
|
LastHeartbeat *time.Time `json:"last_heartbeat,omitempty"`
|
|
Slots *struct {
|
|
BatchAvailable *int `json:"batch_available,omitempty"`
|
|
BatchTotal *int `json:"batch_total,omitempty"`
|
|
ServiceAvailable *int `json:"service_available,omitempty"`
|
|
ServiceTotal *int `json:"service_total,omitempty"`
|
|
} `json:"slots,omitempty"`
|
|
Status *WorkerStatus `json:"status,omitempty"`
|
|
}
|
|
|
|
// WorkerStatus defines model for Worker.Status.
|
|
type WorkerStatus string
|
|
|
|
// BadRequest defines model for BadRequest.
|
|
type BadRequest = ErrorResponse
|
|
|
|
// Forbidden defines model for Forbidden.
|
|
type Forbidden = ErrorResponse
|
|
|
|
// NotFound defines model for NotFound.
|
|
type NotFound = ErrorResponse
|
|
|
|
// RateLimited defines model for RateLimited.
|
|
type RateLimited = ErrorResponse
|
|
|
|
// Unauthorized defines model for Unauthorized.
|
|
type Unauthorized = ErrorResponse
|
|
|
|
// ValidationError defines model for ValidationError.
|
|
type ValidationError = ErrorResponse
|
|
|
|
// GetV1AuditEventsParams defines parameters for GetV1AuditEvents.
|
|
type GetV1AuditEventsParams struct {
|
|
// From Start timestamp
|
|
From *time.Time `form:"from,omitempty" json:"from,omitempty"`
|
|
|
|
// To End timestamp
|
|
To *time.Time `form:"to,omitempty" json:"to,omitempty"`
|
|
|
|
// EventType Filter by event type
|
|
EventType *GetV1AuditEventsParamsEventType `form:"event_type,omitempty" json:"event_type,omitempty"`
|
|
|
|
// UserId Filter by user
|
|
UserId *string `form:"user_id,omitempty" json:"user_id,omitempty"`
|
|
Limit *int `form:"limit,omitempty" json:"limit,omitempty"`
|
|
Offset *int `form:"offset,omitempty" json:"offset,omitempty"`
|
|
}
|
|
|
|
// GetV1AuditEventsParamsEventType defines parameters for GetV1AuditEvents.
|
|
type GetV1AuditEventsParamsEventType string
|
|
|
|
// PatchV1SchedulerJobsJobIdPriorityJSONBody defines parameters for PatchV1SchedulerJobsJobIdPriority.
|
|
type PatchV1SchedulerJobsJobIdPriorityJSONBody struct {
|
|
Priority int `json:"priority"`
|
|
}
|
|
|
|
// GetV1TasksParams defines parameters for GetV1Tasks.
|
|
type GetV1TasksParams struct {
|
|
Status *GetV1TasksParamsStatus `form:"status,omitempty" json:"status,omitempty"`
|
|
Limit *int `form:"limit,omitempty" json:"limit,omitempty"`
|
|
Offset *int `form:"offset,omitempty" json:"offset,omitempty"`
|
|
|
|
// UserId Filter by user who submitted the task
|
|
UserId *string `form:"user_id,omitempty" json:"user_id,omitempty"`
|
|
|
|
// PluginConfigs Plugin configurations for this task
|
|
PluginConfigs *map[string]PluginConfig `form:"plugin_configs,omitempty" json:"plugin_configs,omitempty"`
|
|
|
|
// NodeCount Number of nodes for multi-node jobs
|
|
NodeCount *int `form:"node_count,omitempty" json:"node_count,omitempty"`
|
|
|
|
// ReservationId Pre-reserved capacity for this task
|
|
ReservationId *string `form:"reservation_id,omitempty" json:"reservation_id,omitempty"`
|
|
}
|
|
|
|
// GetV1TasksParamsStatus defines parameters for GetV1Tasks.
|
|
type GetV1TasksParamsStatus string
|
|
|
|
// PostV1ExperimentsJSONRequestBody defines body for PostV1Experiments for application/json ContentType.
|
|
type PostV1ExperimentsJSONRequestBody = CreateExperimentRequest
|
|
|
|
// PostV1JupyterServicesJSONRequestBody defines body for PostV1JupyterServices for application/json ContentType.
|
|
type PostV1JupyterServicesJSONRequestBody = StartJupyterRequest
|
|
|
|
// PutV1PluginsPluginNameConfigJSONRequestBody defines body for PutV1PluginsPluginNameConfig for application/json ContentType.
|
|
type PutV1PluginsPluginNameConfigJSONRequestBody = PluginConfig
|
|
|
|
// PatchV1SchedulerJobsJobIdPriorityJSONRequestBody defines body for PatchV1SchedulerJobsJobIdPriority for application/json ContentType.
|
|
type PatchV1SchedulerJobsJobIdPriorityJSONRequestBody PatchV1SchedulerJobsJobIdPriorityJSONBody
|
|
|
|
// PostV1SchedulerReservationsJSONRequestBody defines body for PostV1SchedulerReservations for application/json ContentType.
|
|
type PostV1SchedulerReservationsJSONRequestBody = CreateReservationRequest
|
|
|
|
// PostV1TasksJSONRequestBody defines body for PostV1Tasks for application/json ContentType.
|
|
type PostV1TasksJSONRequestBody = CreateTaskRequest
|
|
|
|
// ServerInterface represents all server handlers.
|
|
type ServerInterface interface {
|
|
// Health check
|
|
// (GET /health)
|
|
GetHealth(ctx echo.Context) error
|
|
// Get current chain root hash
|
|
// (GET /v1/audit/chain-root)
|
|
GetV1AuditChainRoot(ctx echo.Context) error
|
|
// Query audit events
|
|
// (GET /v1/audit/events)
|
|
GetV1AuditEvents(ctx echo.Context, params GetV1AuditEventsParams) error
|
|
// Verify audit chain integrity
|
|
// (POST /v1/audit/verify)
|
|
PostV1AuditVerify(ctx echo.Context) error
|
|
// List experiments
|
|
// (GET /v1/experiments)
|
|
GetV1Experiments(ctx echo.Context) error
|
|
// Create experiment
|
|
// (POST /v1/experiments)
|
|
PostV1Experiments(ctx echo.Context) error
|
|
// List Jupyter services
|
|
// (GET /v1/jupyter/services)
|
|
GetV1JupyterServices(ctx echo.Context) error
|
|
// Start Jupyter service
|
|
// (POST /v1/jupyter/services)
|
|
PostV1JupyterServices(ctx echo.Context) error
|
|
// Stop Jupyter service
|
|
// (DELETE /v1/jupyter/services/{serviceId})
|
|
DeleteV1JupyterServicesServiceId(ctx echo.Context, serviceId string) error
|
|
// List available plugins
|
|
// (GET /v1/plugins)
|
|
GetV1Plugins(ctx echo.Context) error
|
|
// Get plugin details
|
|
// (GET /v1/plugins/{pluginName})
|
|
GetV1PluginsPluginName(ctx echo.Context, pluginName string) error
|
|
// Disable/unload plugin
|
|
// (DELETE /v1/plugins/{pluginName}/config)
|
|
DeleteV1PluginsPluginNameConfig(ctx echo.Context, pluginName string) error
|
|
// Get plugin configuration
|
|
// (GET /v1/plugins/{pluginName}/config)
|
|
GetV1PluginsPluginNameConfig(ctx echo.Context, pluginName string) error
|
|
// Update plugin configuration
|
|
// (PUT /v1/plugins/{pluginName}/config)
|
|
PutV1PluginsPluginNameConfig(ctx echo.Context, pluginName string) error
|
|
// Check plugin health
|
|
// (GET /v1/plugins/{pluginName}/health)
|
|
GetV1PluginsPluginNameHealth(ctx echo.Context, pluginName string) error
|
|
// Queue status
|
|
// (GET /v1/queue)
|
|
GetV1Queue(ctx echo.Context) error
|
|
// Update job priority
|
|
// (PATCH /v1/scheduler/jobs/{jobId}/priority)
|
|
PatchV1SchedulerJobsJobIdPriority(ctx echo.Context, jobId string) error
|
|
// SSE stream of job progress
|
|
// (GET /v1/scheduler/jobs/{jobId}/stream)
|
|
GetV1SchedulerJobsJobIdStream(ctx echo.Context, jobId string) error
|
|
// List active reservations
|
|
// (GET /v1/scheduler/reservations)
|
|
GetV1SchedulerReservations(ctx echo.Context) error
|
|
// Create reservation
|
|
// (POST /v1/scheduler/reservations)
|
|
PostV1SchedulerReservations(ctx echo.Context) error
|
|
// Get scheduler status
|
|
// (GET /v1/scheduler/status)
|
|
GetV1SchedulerStatus(ctx echo.Context) error
|
|
// SSE stream of scheduler state changes
|
|
// (GET /v1/scheduler/status/stream)
|
|
GetV1SchedulerStatusStream(ctx echo.Context) error
|
|
// List connected workers
|
|
// (GET /v1/scheduler/workers)
|
|
GetV1SchedulerWorkers(ctx echo.Context) error
|
|
// Disconnect/drain worker
|
|
// (DELETE /v1/scheduler/workers/{workerId})
|
|
DeleteV1SchedulerWorkersWorkerId(ctx echo.Context, workerId string) error
|
|
// Get worker details
|
|
// (GET /v1/scheduler/workers/{workerId})
|
|
GetV1SchedulerWorkersWorkerId(ctx echo.Context, workerId string) error
|
|
// List tasks
|
|
// (GET /v1/tasks)
|
|
GetV1Tasks(ctx echo.Context, params GetV1TasksParams) error
|
|
// Create task
|
|
// (POST /v1/tasks)
|
|
PostV1Tasks(ctx echo.Context) error
|
|
// Cancel/delete task
|
|
// (DELETE /v1/tasks/{taskId})
|
|
DeleteV1TasksTaskId(ctx echo.Context, taskId string) error
|
|
// Get task details
|
|
// (GET /v1/tasks/{taskId})
|
|
GetV1TasksTaskId(ctx echo.Context, taskId string) error
|
|
// WebSocket connection
|
|
// (GET /ws)
|
|
GetWs(ctx echo.Context) error
|
|
}
|
|
|
|
// ServerInterfaceWrapper converts echo contexts to parameters.
|
|
type ServerInterfaceWrapper struct {
|
|
Handler ServerInterface
|
|
}
|
|
|
|
// GetHealth converts echo context to params.
|
|
func (w *ServerInterfaceWrapper) GetHealth(ctx echo.Context) error {
|
|
var err error
|
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
err = w.Handler.GetHealth(ctx)
|
|
return err
|
|
}
|
|
|
|
// GetV1AuditChainRoot converts echo context to params.
|
|
func (w *ServerInterfaceWrapper) GetV1AuditChainRoot(ctx echo.Context) error {
|
|
var err error
|
|
|
|
ctx.Set(ApiKeyAuthScopes, []string{})
|
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
err = w.Handler.GetV1AuditChainRoot(ctx)
|
|
return err
|
|
}
|
|
|
|
// GetV1AuditEvents converts echo context to params.
|
|
func (w *ServerInterfaceWrapper) GetV1AuditEvents(ctx echo.Context) error {
|
|
var err error
|
|
|
|
ctx.Set(ApiKeyAuthScopes, []string{})
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params GetV1AuditEventsParams
|
|
// ------------- Optional query parameter "from" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "from", ctx.QueryParams(), ¶ms.From)
|
|
if err != nil {
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter from: %s", err))
|
|
}
|
|
|
|
// ------------- Optional query parameter "to" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "to", ctx.QueryParams(), ¶ms.To)
|
|
if err != nil {
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter to: %s", err))
|
|
}
|
|
|
|
// ------------- Optional query parameter "event_type" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "event_type", ctx.QueryParams(), ¶ms.EventType)
|
|
if err != nil {
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter event_type: %s", err))
|
|
}
|
|
|
|
// ------------- Optional query parameter "user_id" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "user_id", ctx.QueryParams(), ¶ms.UserId)
|
|
if err != nil {
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter user_id: %s", err))
|
|
}
|
|
|
|
// ------------- Optional query parameter "limit" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit)
|
|
if err != nil {
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err))
|
|
}
|
|
|
|
// ------------- Optional query parameter "offset" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset)
|
|
if err != nil {
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err))
|
|
}
|
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
err = w.Handler.GetV1AuditEvents(ctx, params)
|
|
return err
|
|
}
|
|
|
|
// PostV1AuditVerify converts echo context to params.
|
|
func (w *ServerInterfaceWrapper) PostV1AuditVerify(ctx echo.Context) error {
|
|
var err error
|
|
|
|
ctx.Set(ApiKeyAuthScopes, []string{})
|
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
err = w.Handler.PostV1AuditVerify(ctx)
|
|
return err
|
|
}
|
|
|
|
// GetV1Experiments converts echo context to params.
|
|
func (w *ServerInterfaceWrapper) GetV1Experiments(ctx echo.Context) error {
|
|
var err error
|
|
|
|
ctx.Set(ApiKeyAuthScopes, []string{})
|
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
err = w.Handler.GetV1Experiments(ctx)
|
|
return err
|
|
}
|
|
|
|
// PostV1Experiments converts echo context to params.
|
|
func (w *ServerInterfaceWrapper) PostV1Experiments(ctx echo.Context) error {
|
|
var err error
|
|
|
|
ctx.Set(ApiKeyAuthScopes, []string{})
|
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
err = w.Handler.PostV1Experiments(ctx)
|
|
return err
|
|
}
|
|
|
|
// GetV1JupyterServices converts echo context to params.
|
|
func (w *ServerInterfaceWrapper) GetV1JupyterServices(ctx echo.Context) error {
|
|
var err error
|
|
|
|
ctx.Set(ApiKeyAuthScopes, []string{})
|
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
err = w.Handler.GetV1JupyterServices(ctx)
|
|
return err
|
|
}
|
|
|
|
// PostV1JupyterServices converts echo context to params.
|
|
func (w *ServerInterfaceWrapper) PostV1JupyterServices(ctx echo.Context) error {
|
|
var err error
|
|
|
|
ctx.Set(ApiKeyAuthScopes, []string{})
|
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
err = w.Handler.PostV1JupyterServices(ctx)
|
|
return err
|
|
}
|
|
|
|
// DeleteV1JupyterServicesServiceId converts echo context to params.
|
|
func (w *ServerInterfaceWrapper) DeleteV1JupyterServicesServiceId(ctx echo.Context) error {
|
|
var err error
|
|
// ------------- Path parameter "serviceId" -------------
|
|
var serviceId string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "serviceId", ctx.Param("serviceId"), &serviceId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
if err != nil {
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter serviceId: %s", err))
|
|
}
|
|
|
|
ctx.Set(ApiKeyAuthScopes, []string{})
|
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
err = w.Handler.DeleteV1JupyterServicesServiceId(ctx, serviceId)
|
|
return err
|
|
}
|
|
|
|
// GetV1Plugins converts echo context to params.
|
|
func (w *ServerInterfaceWrapper) GetV1Plugins(ctx echo.Context) error {
|
|
var err error
|
|
|
|
ctx.Set(ApiKeyAuthScopes, []string{})
|
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
err = w.Handler.GetV1Plugins(ctx)
|
|
return err
|
|
}
|
|
|
|
// GetV1PluginsPluginName converts echo context to params.
|
|
func (w *ServerInterfaceWrapper) GetV1PluginsPluginName(ctx echo.Context) error {
|
|
var err error
|
|
// ------------- Path parameter "pluginName" -------------
|
|
var pluginName string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "pluginName", ctx.Param("pluginName"), &pluginName, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
if err != nil {
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter pluginName: %s", err))
|
|
}
|
|
|
|
ctx.Set(ApiKeyAuthScopes, []string{})
|
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
err = w.Handler.GetV1PluginsPluginName(ctx, pluginName)
|
|
return err
|
|
}
|
|
|
|
// DeleteV1PluginsPluginNameConfig converts echo context to params.
|
|
func (w *ServerInterfaceWrapper) DeleteV1PluginsPluginNameConfig(ctx echo.Context) error {
|
|
var err error
|
|
// ------------- Path parameter "pluginName" -------------
|
|
var pluginName string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "pluginName", ctx.Param("pluginName"), &pluginName, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
if err != nil {
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter pluginName: %s", err))
|
|
}
|
|
|
|
ctx.Set(ApiKeyAuthScopes, []string{})
|
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
err = w.Handler.DeleteV1PluginsPluginNameConfig(ctx, pluginName)
|
|
return err
|
|
}
|
|
|
|
// GetV1PluginsPluginNameConfig converts echo context to params.
|
|
func (w *ServerInterfaceWrapper) GetV1PluginsPluginNameConfig(ctx echo.Context) error {
|
|
var err error
|
|
// ------------- Path parameter "pluginName" -------------
|
|
var pluginName string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "pluginName", ctx.Param("pluginName"), &pluginName, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
if err != nil {
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter pluginName: %s", err))
|
|
}
|
|
|
|
ctx.Set(ApiKeyAuthScopes, []string{})
|
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
err = w.Handler.GetV1PluginsPluginNameConfig(ctx, pluginName)
|
|
return err
|
|
}
|
|
|
|
// PutV1PluginsPluginNameConfig converts echo context to params.
|
|
func (w *ServerInterfaceWrapper) PutV1PluginsPluginNameConfig(ctx echo.Context) error {
|
|
var err error
|
|
// ------------- Path parameter "pluginName" -------------
|
|
var pluginName string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "pluginName", ctx.Param("pluginName"), &pluginName, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
if err != nil {
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter pluginName: %s", err))
|
|
}
|
|
|
|
ctx.Set(ApiKeyAuthScopes, []string{})
|
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
err = w.Handler.PutV1PluginsPluginNameConfig(ctx, pluginName)
|
|
return err
|
|
}
|
|
|
|
// GetV1PluginsPluginNameHealth converts echo context to params.
|
|
func (w *ServerInterfaceWrapper) GetV1PluginsPluginNameHealth(ctx echo.Context) error {
|
|
var err error
|
|
// ------------- Path parameter "pluginName" -------------
|
|
var pluginName string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "pluginName", ctx.Param("pluginName"), &pluginName, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
if err != nil {
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter pluginName: %s", err))
|
|
}
|
|
|
|
ctx.Set(ApiKeyAuthScopes, []string{})
|
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
err = w.Handler.GetV1PluginsPluginNameHealth(ctx, pluginName)
|
|
return err
|
|
}
|
|
|
|
// GetV1Queue converts echo context to params.
|
|
func (w *ServerInterfaceWrapper) GetV1Queue(ctx echo.Context) error {
|
|
var err error
|
|
|
|
ctx.Set(ApiKeyAuthScopes, []string{})
|
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
err = w.Handler.GetV1Queue(ctx)
|
|
return err
|
|
}
|
|
|
|
// PatchV1SchedulerJobsJobIdPriority converts echo context to params.
|
|
func (w *ServerInterfaceWrapper) PatchV1SchedulerJobsJobIdPriority(ctx echo.Context) error {
|
|
var err error
|
|
// ------------- Path parameter "jobId" -------------
|
|
var jobId string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "jobId", ctx.Param("jobId"), &jobId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
if err != nil {
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter jobId: %s", err))
|
|
}
|
|
|
|
ctx.Set(ApiKeyAuthScopes, []string{})
|
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
err = w.Handler.PatchV1SchedulerJobsJobIdPriority(ctx, jobId)
|
|
return err
|
|
}
|
|
|
|
// GetV1SchedulerJobsJobIdStream converts echo context to params.
|
|
func (w *ServerInterfaceWrapper) GetV1SchedulerJobsJobIdStream(ctx echo.Context) error {
|
|
var err error
|
|
// ------------- Path parameter "jobId" -------------
|
|
var jobId string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "jobId", ctx.Param("jobId"), &jobId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
if err != nil {
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter jobId: %s", err))
|
|
}
|
|
|
|
ctx.Set(ApiKeyAuthScopes, []string{})
|
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
err = w.Handler.GetV1SchedulerJobsJobIdStream(ctx, jobId)
|
|
return err
|
|
}
|
|
|
|
// GetV1SchedulerReservations converts echo context to params.
|
|
func (w *ServerInterfaceWrapper) GetV1SchedulerReservations(ctx echo.Context) error {
|
|
var err error
|
|
|
|
ctx.Set(ApiKeyAuthScopes, []string{})
|
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
err = w.Handler.GetV1SchedulerReservations(ctx)
|
|
return err
|
|
}
|
|
|
|
// PostV1SchedulerReservations converts echo context to params.
|
|
func (w *ServerInterfaceWrapper) PostV1SchedulerReservations(ctx echo.Context) error {
|
|
var err error
|
|
|
|
ctx.Set(ApiKeyAuthScopes, []string{})
|
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
err = w.Handler.PostV1SchedulerReservations(ctx)
|
|
return err
|
|
}
|
|
|
|
// GetV1SchedulerStatus converts echo context to params.
|
|
func (w *ServerInterfaceWrapper) GetV1SchedulerStatus(ctx echo.Context) error {
|
|
var err error
|
|
|
|
ctx.Set(ApiKeyAuthScopes, []string{})
|
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
err = w.Handler.GetV1SchedulerStatus(ctx)
|
|
return err
|
|
}
|
|
|
|
// GetV1SchedulerStatusStream converts echo context to params.
|
|
func (w *ServerInterfaceWrapper) GetV1SchedulerStatusStream(ctx echo.Context) error {
|
|
var err error
|
|
|
|
ctx.Set(ApiKeyAuthScopes, []string{})
|
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
err = w.Handler.GetV1SchedulerStatusStream(ctx)
|
|
return err
|
|
}
|
|
|
|
// GetV1SchedulerWorkers converts echo context to params.
|
|
func (w *ServerInterfaceWrapper) GetV1SchedulerWorkers(ctx echo.Context) error {
|
|
var err error
|
|
|
|
ctx.Set(ApiKeyAuthScopes, []string{})
|
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
err = w.Handler.GetV1SchedulerWorkers(ctx)
|
|
return err
|
|
}
|
|
|
|
// DeleteV1SchedulerWorkersWorkerId converts echo context to params.
|
|
func (w *ServerInterfaceWrapper) DeleteV1SchedulerWorkersWorkerId(ctx echo.Context) error {
|
|
var err error
|
|
// ------------- Path parameter "workerId" -------------
|
|
var workerId string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "workerId", ctx.Param("workerId"), &workerId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
if err != nil {
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter workerId: %s", err))
|
|
}
|
|
|
|
ctx.Set(ApiKeyAuthScopes, []string{})
|
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
err = w.Handler.DeleteV1SchedulerWorkersWorkerId(ctx, workerId)
|
|
return err
|
|
}
|
|
|
|
// GetV1SchedulerWorkersWorkerId converts echo context to params.
|
|
func (w *ServerInterfaceWrapper) GetV1SchedulerWorkersWorkerId(ctx echo.Context) error {
|
|
var err error
|
|
// ------------- Path parameter "workerId" -------------
|
|
var workerId string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "workerId", ctx.Param("workerId"), &workerId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
if err != nil {
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter workerId: %s", err))
|
|
}
|
|
|
|
ctx.Set(ApiKeyAuthScopes, []string{})
|
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
err = w.Handler.GetV1SchedulerWorkersWorkerId(ctx, workerId)
|
|
return err
|
|
}
|
|
|
|
// GetV1Tasks converts echo context to params.
|
|
func (w *ServerInterfaceWrapper) GetV1Tasks(ctx echo.Context) error {
|
|
var err error
|
|
|
|
ctx.Set(ApiKeyAuthScopes, []string{})
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params GetV1TasksParams
|
|
// ------------- Optional query parameter "status" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "status", ctx.QueryParams(), ¶ms.Status)
|
|
if err != nil {
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter status: %s", err))
|
|
}
|
|
|
|
// ------------- Optional query parameter "limit" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit)
|
|
if err != nil {
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err))
|
|
}
|
|
|
|
// ------------- Optional query parameter "offset" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset)
|
|
if err != nil {
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err))
|
|
}
|
|
|
|
// ------------- Optional query parameter "user_id" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "user_id", ctx.QueryParams(), ¶ms.UserId)
|
|
if err != nil {
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter user_id: %s", err))
|
|
}
|
|
|
|
// ------------- Optional query parameter "plugin_configs" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "plugin_configs", ctx.QueryParams(), ¶ms.PluginConfigs)
|
|
if err != nil {
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter plugin_configs: %s", err))
|
|
}
|
|
|
|
// ------------- Optional query parameter "node_count" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "node_count", ctx.QueryParams(), ¶ms.NodeCount)
|
|
if err != nil {
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter node_count: %s", err))
|
|
}
|
|
|
|
// ------------- Optional query parameter "reservation_id" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "reservation_id", ctx.QueryParams(), ¶ms.ReservationId)
|
|
if err != nil {
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter reservation_id: %s", err))
|
|
}
|
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
err = w.Handler.GetV1Tasks(ctx, params)
|
|
return err
|
|
}
|
|
|
|
// PostV1Tasks converts echo context to params.
|
|
func (w *ServerInterfaceWrapper) PostV1Tasks(ctx echo.Context) error {
|
|
var err error
|
|
|
|
ctx.Set(ApiKeyAuthScopes, []string{})
|
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
err = w.Handler.PostV1Tasks(ctx)
|
|
return err
|
|
}
|
|
|
|
// DeleteV1TasksTaskId converts echo context to params.
|
|
func (w *ServerInterfaceWrapper) DeleteV1TasksTaskId(ctx echo.Context) error {
|
|
var err error
|
|
// ------------- Path parameter "taskId" -------------
|
|
var taskId string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "taskId", ctx.Param("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
if err != nil {
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter taskId: %s", err))
|
|
}
|
|
|
|
ctx.Set(ApiKeyAuthScopes, []string{})
|
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
err = w.Handler.DeleteV1TasksTaskId(ctx, taskId)
|
|
return err
|
|
}
|
|
|
|
// GetV1TasksTaskId converts echo context to params.
|
|
func (w *ServerInterfaceWrapper) GetV1TasksTaskId(ctx echo.Context) error {
|
|
var err error
|
|
// ------------- Path parameter "taskId" -------------
|
|
var taskId string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "taskId", ctx.Param("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
if err != nil {
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter taskId: %s", err))
|
|
}
|
|
|
|
ctx.Set(ApiKeyAuthScopes, []string{})
|
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
err = w.Handler.GetV1TasksTaskId(ctx, taskId)
|
|
return err
|
|
}
|
|
|
|
// GetWs converts echo context to params.
|
|
func (w *ServerInterfaceWrapper) GetWs(ctx echo.Context) error {
|
|
var err error
|
|
|
|
ctx.Set(ApiKeyAuthScopes, []string{})
|
|
|
|
// Invoke the callback with all the unmarshaled arguments
|
|
err = w.Handler.GetWs(ctx)
|
|
return err
|
|
}
|
|
|
|
// This is a simple interface which specifies echo.Route addition functions which
|
|
// are present on both echo.Echo and echo.Group, since we want to allow using
|
|
// either of them for path registration
|
|
type EchoRouter interface {
|
|
CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
|
|
DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
|
|
GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
|
|
HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
|
|
OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
|
|
PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
|
|
POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
|
|
PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
|
|
TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
|
|
}
|
|
|
|
// RegisterHandlers adds each server route to the EchoRouter.
|
|
func RegisterHandlers(router EchoRouter, si ServerInterface) {
|
|
RegisterHandlersWithBaseURL(router, si, "")
|
|
}
|
|
|
|
// Registers handlers, and prepends BaseURL to the paths, so that the paths
|
|
// can be served under a prefix.
|
|
func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string) {
|
|
|
|
wrapper := ServerInterfaceWrapper{
|
|
Handler: si,
|
|
}
|
|
|
|
router.GET(baseURL+"/health", wrapper.GetHealth)
|
|
router.GET(baseURL+"/v1/audit/chain-root", wrapper.GetV1AuditChainRoot)
|
|
router.GET(baseURL+"/v1/audit/events", wrapper.GetV1AuditEvents)
|
|
router.POST(baseURL+"/v1/audit/verify", wrapper.PostV1AuditVerify)
|
|
router.GET(baseURL+"/v1/experiments", wrapper.GetV1Experiments)
|
|
router.POST(baseURL+"/v1/experiments", wrapper.PostV1Experiments)
|
|
router.GET(baseURL+"/v1/jupyter/services", wrapper.GetV1JupyterServices)
|
|
router.POST(baseURL+"/v1/jupyter/services", wrapper.PostV1JupyterServices)
|
|
router.DELETE(baseURL+"/v1/jupyter/services/:serviceId", wrapper.DeleteV1JupyterServicesServiceId)
|
|
router.GET(baseURL+"/v1/plugins", wrapper.GetV1Plugins)
|
|
router.GET(baseURL+"/v1/plugins/:pluginName", wrapper.GetV1PluginsPluginName)
|
|
router.DELETE(baseURL+"/v1/plugins/:pluginName/config", wrapper.DeleteV1PluginsPluginNameConfig)
|
|
router.GET(baseURL+"/v1/plugins/:pluginName/config", wrapper.GetV1PluginsPluginNameConfig)
|
|
router.PUT(baseURL+"/v1/plugins/:pluginName/config", wrapper.PutV1PluginsPluginNameConfig)
|
|
router.GET(baseURL+"/v1/plugins/:pluginName/health", wrapper.GetV1PluginsPluginNameHealth)
|
|
router.GET(baseURL+"/v1/queue", wrapper.GetV1Queue)
|
|
router.PATCH(baseURL+"/v1/scheduler/jobs/:jobId/priority", wrapper.PatchV1SchedulerJobsJobIdPriority)
|
|
router.GET(baseURL+"/v1/scheduler/jobs/:jobId/stream", wrapper.GetV1SchedulerJobsJobIdStream)
|
|
router.GET(baseURL+"/v1/scheduler/reservations", wrapper.GetV1SchedulerReservations)
|
|
router.POST(baseURL+"/v1/scheduler/reservations", wrapper.PostV1SchedulerReservations)
|
|
router.GET(baseURL+"/v1/scheduler/status", wrapper.GetV1SchedulerStatus)
|
|
router.GET(baseURL+"/v1/scheduler/status/stream", wrapper.GetV1SchedulerStatusStream)
|
|
router.GET(baseURL+"/v1/scheduler/workers", wrapper.GetV1SchedulerWorkers)
|
|
router.DELETE(baseURL+"/v1/scheduler/workers/:workerId", wrapper.DeleteV1SchedulerWorkersWorkerId)
|
|
router.GET(baseURL+"/v1/scheduler/workers/:workerId", wrapper.GetV1SchedulerWorkersWorkerId)
|
|
router.GET(baseURL+"/v1/tasks", wrapper.GetV1Tasks)
|
|
router.POST(baseURL+"/v1/tasks", wrapper.PostV1Tasks)
|
|
router.DELETE(baseURL+"/v1/tasks/:taskId", wrapper.DeleteV1TasksTaskId)
|
|
router.GET(baseURL+"/v1/tasks/:taskId", wrapper.GetV1TasksTaskId)
|
|
router.GET(baseURL+"/ws", wrapper.GetWs)
|
|
|
|
}
|