mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
docs: API workspace agents and builds (#5538)
This commit is contained in:
@@ -66,24 +66,26 @@ const (
|
||||
ProvisionerJobFailed ProvisionerJobStatus = "failed"
|
||||
)
|
||||
|
||||
// ProvisionerJob describes the job executed by the provisioning daemon.
|
||||
type ProvisionerJob struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
StartedAt *time.Time `json:"started_at,omitempty"`
|
||||
CompletedAt *time.Time `json:"completed_at,omitempty"`
|
||||
CanceledAt *time.Time `json:"canceled_at,omitempty"`
|
||||
ID uuid.UUID `json:"id" format:"uuid"`
|
||||
CreatedAt time.Time `json:"created_at" format:"date-time"`
|
||||
StartedAt *time.Time `json:"started_at,omitempty" format:"date-time"`
|
||||
CompletedAt *time.Time `json:"completed_at,omitempty" format:"date-time"`
|
||||
CanceledAt *time.Time `json:"canceled_at,omitempty" format:"date-time"`
|
||||
Error string `json:"error,omitempty"`
|
||||
Status ProvisionerJobStatus `json:"status"`
|
||||
WorkerID *uuid.UUID `json:"worker_id,omitempty"`
|
||||
FileID uuid.UUID `json:"file_id"`
|
||||
Status ProvisionerJobStatus `json:"status" enums:"pending,running,succeeded,canceling,canceled,failed"`
|
||||
WorkerID *uuid.UUID `json:"worker_id,omitempty" format:"uuid"`
|
||||
FileID uuid.UUID `json:"file_id" format:"uuid"`
|
||||
Tags map[string]string `json:"tags"`
|
||||
}
|
||||
|
||||
// ProvisionerJobLog represents the provisioner log entry annotated with source and level.
|
||||
type ProvisionerJobLog struct {
|
||||
ID int64 `json:"id"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
CreatedAt time.Time `json:"created_at" format:"date-time"`
|
||||
Source LogSource `json:"log_source"`
|
||||
Level LogLevel `json:"log_level"`
|
||||
Level LogLevel `json:"log_level" enums:"trace,debug,info,warn,error"`
|
||||
Stage string `json:"stage"`
|
||||
Output string `json:"output"`
|
||||
}
|
||||
|
||||
@@ -35,15 +35,15 @@ const (
|
||||
)
|
||||
|
||||
type WorkspaceAgent struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
FirstConnectedAt *time.Time `json:"first_connected_at,omitempty"`
|
||||
LastConnectedAt *time.Time `json:"last_connected_at,omitempty"`
|
||||
DisconnectedAt *time.Time `json:"disconnected_at,omitempty"`
|
||||
Status WorkspaceAgentStatus `json:"status"`
|
||||
ID uuid.UUID `json:"id" format:"uuid"`
|
||||
CreatedAt time.Time `json:"created_at" format:"date-time"`
|
||||
UpdatedAt time.Time `json:"updated_at" format:"date-time"`
|
||||
FirstConnectedAt *time.Time `json:"first_connected_at,omitempty" format:"date-time"`
|
||||
LastConnectedAt *time.Time `json:"last_connected_at,omitempty" format:"date-time"`
|
||||
DisconnectedAt *time.Time `json:"disconnected_at,omitempty" format:"date-time"`
|
||||
Status WorkspaceAgentStatus `json:"status" enums:"connecting,connected,disconnected,timeout"`
|
||||
Name string `json:"name"`
|
||||
ResourceID uuid.UUID `json:"resource_id"`
|
||||
ResourceID uuid.UUID `json:"resource_id" format:"uuid"`
|
||||
InstanceID string `json:"instance_id,omitempty"`
|
||||
Architecture string `json:"architecture"`
|
||||
EnvironmentVariables map[string]string `json:"environment_variables"`
|
||||
@@ -115,6 +115,7 @@ type WorkspaceAgentConnectionInfo struct {
|
||||
}
|
||||
|
||||
// @typescript-ignore PostWorkspaceAgentVersionRequest
|
||||
// @Description x-apidocgen:skip
|
||||
type PostWorkspaceAgentVersionRequest struct {
|
||||
Version string `json:"version"`
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ const (
|
||||
)
|
||||
|
||||
type WorkspaceApp struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
ID uuid.UUID `json:"id" format:"uuid"`
|
||||
// URL is the address being proxied to inside the workspace.
|
||||
// If external is specified, this will be opened on the client.
|
||||
URL string `json:"url"`
|
||||
@@ -42,7 +42,7 @@ type WorkspaceApp struct {
|
||||
// and there is no app wildcard configured on the server, the app will not
|
||||
// be accessible in the UI.
|
||||
Subdomain bool `json:"subdomain"`
|
||||
SharingLevel WorkspaceAppSharingLevel `json:"sharing_level"`
|
||||
SharingLevel WorkspaceAppSharingLevel `json:"sharing_level" enums:"owner,authenticated,public"`
|
||||
// Healthcheck specifies the configuration for checking app health.
|
||||
Healthcheck Healthcheck `json:"healthcheck"`
|
||||
Health WorkspaceAppHealth `json:"health"`
|
||||
|
||||
@@ -65,13 +65,15 @@ type WorkspaceBuild struct {
|
||||
InitiatorID uuid.UUID `json:"initiator_id" format:"uuid"`
|
||||
InitiatorUsername string `json:"initiator_name"`
|
||||
Job ProvisionerJob `json:"job"`
|
||||
Reason BuildReason `db:"reason" json:"reason"`
|
||||
Reason BuildReason `db:"reason" json:"reason" enums:"initiator,autostart,autostop"`
|
||||
Resources []WorkspaceResource `json:"resources"`
|
||||
Deadline NullTime `json:"deadline,omitempty" format:"date-time"`
|
||||
Status WorkspaceStatus `json:"status" enums:"pending,starting,running,stopping,stopped,failed,canceling,canceled,deleting,deleted"`
|
||||
DailyCost int32 `json:"daily_cost"`
|
||||
}
|
||||
|
||||
// WorkspaceResource describes resources used to create a workspace, for instance:
|
||||
// containers, images, volumes.
|
||||
type WorkspaceResource struct {
|
||||
ID uuid.UUID `json:"id" format:"uuid"`
|
||||
CreatedAt time.Time `json:"created_at" format:"date-time"`
|
||||
@@ -86,6 +88,7 @@ type WorkspaceResource struct {
|
||||
DailyCost int32 `json:"daily_cost"`
|
||||
}
|
||||
|
||||
// WorkspaceResourceMetadata annotates the workspace resource with custom key-value pairs.
|
||||
type WorkspaceResourceMetadata struct {
|
||||
Key string `json:"key"`
|
||||
Value string `json:"value"`
|
||||
|
||||
Reference in New Issue
Block a user