Documentation
¶
Overview ¶
Package api implements the REST handlers for environment-scoped resources (ADR-0006): /api/v1/environments and /api/v1/environments/{env}/...
Index ¶
Constants ¶
const ( StatusConnected = "connected" )
Environment statuses.
Variables ¶
This section is empty.
Functions ¶
func EnvFrom ¶
func EnvFrom(ctx context.Context) *environment.Environment
EnvFrom returns the environment resolved from the {env} path parameter.
func Namespace ¶
Namespace returns the containerd namespace for the request: the "namespace" query parameter, or the environment's default. Invalid names are rejected (ADR-0006).
func ReadOnlyReason ¶
func ReadOnlyReason(st runtime.NerdctlStatus) string
ReadOnlyReason explains why an environment is read-only.
Types ¶
type BulkActionRequest ¶
type BulkActionRequest struct {
Action runtime.Action `json:"action"`
IDs []string `json:"ids"`
Force bool `json:"force,omitempty"`
Volumes bool `json:"volumes,omitempty"`
}
BulkActionRequest is the body of POST /containers/actions. Keep in sync with api/openapi.yaml.
type BulkActionResult ¶
type BulkActionResult struct {
ID string `json:"id"`
OK bool `json:"ok"`
Error *httpjson.ErrorDetail `json:"error,omitempty"`
}
BulkActionResult is the outcome for one container.
type Environment ¶
type Environment struct {
ID string `json:"id"`
Name string `json:"name"`
Kind string `json:"kind"`
DefaultNamespace string `json:"defaultNamespace"`
}
Environment is the API representation. Keep in sync with api/openapi.yaml.
type EnvironmentStatus ¶
type EnvironmentStatus struct {
Environment
Status string `json:"status"` // connected | unavailable
Error string `json:"error,omitempty"`
Runtime *runtime.Versions `json:"runtime,omitempty"`
}
EnvironmentStatus adds live connectivity information.