managedwebservice

package
v0.13.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2026 License: MIT Imports: 43 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContainerRuntimeProfileRestricted         = "restricted"
	ContainerRuntimeProfileInteractiveDesktop = "interactive_desktop"
)

Variables

This section is empty.

Functions

func ErrorDetails

func ErrorDetails(err error) (code string, message string, status int, retryable bool)

Types

type ActionCapability

type ActionCapability struct {
	Available  bool   `json:"available"`
	ReasonCode string `json:"reason_code,omitempty"`
}

type Backend

type Backend interface {
	Catalog(context.Context) ([]Template, error)
	Template(context.Context, string) (*Template, error)
	CreateTemplate(context.Context, TemplateWriteRequest) (*Template, error)
	UpdateTemplate(context.Context, string, TemplateWriteRequest) (*Template, error)
	DeleteTemplate(context.Context, string) error
	DuplicateTemplate(context.Context, string, TemplateDuplicateRequest) (*Template, error)
	ValidateTemplate(context.Context, TemplateWriteRequest) error
	TemplateReleaseCandidates(context.Context, string, ReleaseCandidateRequest) (*ReleaseCandidateResult, error)
	List(context.Context) ([]ServiceView, error)
	ServiceReleaseCandidates(context.Context, string, ReleaseCandidateRequest) (*ReleaseCandidateResult, error)
	CreateUpdatePlan(context.Context, string, UpdatePlanRequest) (*UpdatePlan, error)
	Settings(context.Context, string) (*ServiceSettingsView, error)
	UpdateSettings(context.Context, string, ServiceMetadataPatch) (*ServiceSettingsView, error)
	PreflightReconfigure(context.Context, string, ReconfigureDraft) (*ReconfigurePlan, error)
	Create(context.Context, CreateRequest) (*CreateResult, error)
	Operate(context.Context, string, OperationRequest) (*pfregistry.ManagedOperation, error)
	Cancel(context.Context, string) (*pfregistry.ManagedOperation, error)
	Operation(context.Context, string) (*pfregistry.ManagedOperation, error)
	Subscribe(string) (<-chan pfregistry.ManagedOperation, func(), error)
	Logs(context.Context, string, int) (*LogResult, error)
	OpenSession(context.Context, string, OpenSessionRequest) (*OpenSession, error)
	ReviewHostManagement(context.Context, string) (*HostManagementReview, error)
	RestoreHostManagement(context.Context, string, RestoreManagementRequest) error
}

type BuiltinCatalog

type BuiltinCatalog struct {
	// contains filtered or unexported fields
}

func LoadBuiltinCatalog

func LoadBuiltinCatalog() (*BuiltinCatalog, error)

type ContainerMountSpec

type ContainerMountSpec = templatecontract.ContainerMountSpec

type ContainerPortSpec

type ContainerPortSpec = templatecontract.ContainerPortSpec

type ContainerResourceKind

type ContainerResourceKind string
const (
	ContainerResourceContainer      ContainerResourceKind = "container"
	ContainerResourceImage          ContainerResourceKind = "image"
	ContainerResourceVolume         ContainerResourceKind = "volume"
	ContainerResourceComposeProject ContainerResourceKind = "compose_project"
)
type ContainerResourceLink struct {
	Kind       string `json:"kind"`
	Engine     string `json:"engine"`
	EndpointID string `json:"endpoint_id,omitempty"`
	View       string `json:"view"`
	Identity   string `json:"identity"`
}

type ContainerResourceOwner

type ContainerResourceOwner struct {
	Kind      string `json:"kind"`
	ServiceID string `json:"service_id"`
	Name      string `json:"name"`
}

type ContainerRuntimeSettings

type ContainerRuntimeSettings struct {
	Entrypoint    string                `json:"entrypoint,omitempty"`
	Command       []string              `json:"command,omitempty"`
	Environment   []EnvironmentSetting  `json:"environment,omitempty"`
	Labels        map[string]string     `json:"labels,omitempty"`
	RestartPolicy string                `json:"restart_policy,omitempty"`
	NetworkMode   string                `json:"network_mode,omitempty"`
	PIDMode       string                `json:"pid_mode,omitempty"`
	IPCMode       string                `json:"ipc_mode,omitempty"`
	Ports         []ContainerPortSpec   `json:"ports,omitempty"`
	Mounts        []ContainerMountSpec  `json:"mounts,omitempty"`
	CPUs          float64               `json:"cpus,omitempty"`
	MemoryBytes   int64                 `json:"memory_bytes,omitempty"`
	PIDsLimit     int64                 `json:"pids_limit,omitempty"`
	ShmSizeBytes  int64                 `json:"shm_size_bytes,omitempty"`
	CapAdd        []string              `json:"cap_add,omitempty"`
	CapDrop       []string              `json:"cap_drop,omitempty"`
	Devices       []ContainerDeviceSpec `json:"devices,omitempty"`
	Privileged    bool                  `json:"privileged,omitempty"`
	ReadOnlyRoot  bool                  `json:"read_only_root"`
	SecurityOpts  []string              `json:"security_opts,omitempty"`
	User          string                `json:"user,omitempty"`
}

type CreateRequest

type CreateRequest struct {
	PlanDigest              string            `json:"plan_digest,omitempty"`
	RequestID               string            `json:"request_id"`
	TemplateID              string            `json:"template_id"`
	Deployment              Deployment        `json:"deployment"`
	WorkspacePath           string            `json:"workspace_path"`
	Parameters              map[string]string `json:"parameters,omitempty"`
	AcceptedNoticeRevisions map[string]int64  `json:"accepted_notice_revisions,omitempty"`
	AccessMode              string            `json:"access_mode,omitempty"`
	TargetReleaseID         string            `json:"target_release_id,omitempty"`
}

type CreateResult

type CreateResult struct {
	Service   pfregistry.ManagedService   `json:"service"`
	Operation pfregistry.ManagedOperation `json:"operation"`
}

type Deployment

type Deployment = templatecontract.Deployment
const (
	DeploymentHost      Deployment = "host"
	DeploymentContainer Deployment = "container"
	DeploymentCompose   Deployment = "compose"
)

type DeploymentAvailability

type DeploymentAvailability struct {
	Deployment Deployment `json:"deployment"`
	Available  bool       `json:"available"`
	ReasonCode string     `json:"reason_code,omitempty"`
	Reason     string     `json:"reason,omitempty"`
}

type EnvironmentSetting

type EnvironmentSetting struct {
	Name     string `json:"name"`
	Value    string `json:"value,omitempty"`
	Secret   bool   `json:"secret,omitempty"`
	HasValue bool   `json:"has_value,omitempty"`
	Clear    bool   `json:"clear,omitempty"`
}

type Error

type Error struct {
	Code       string
	Message    string
	HTTPStatus int
	Retryable  bool
	Cause      error
}

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

type HostArtifactSpec

type HostArtifactSpec = templatecontract.HostArtifactSpec

type HostLifecycleActionPlan

type HostLifecycleActionPlan struct {
	Ownership string              `json:"ownership"`
	Steps     []HostLifecycleStep `json:"steps"`
}

type HostLifecyclePackage

type HostLifecyclePackage struct {
	Reference string `json:"reference"`
	SHA256    string `json:"sha256"`
	SizeBytes int64  `json:"size_bytes"`
}

type HostLifecyclePlan

type HostLifecyclePlan struct {
	SchemaVersion int                      `json:"schema_version"`
	Driver        string                   `json:"driver"`
	RuntimeBundle string                   `json:"runtime_bundle,omitempty"`
	Package       *HostLifecyclePackage    `json:"package,omitempty"`
	NPM           *NPMHostPackageSpec      `json:"npm,omitempty"`
	Install       HostLifecycleActionPlan  `json:"install"`
	Start         HostLifecycleActionPlan  `json:"start"`
	Open          *HostLifecycleActionPlan `json:"open,omitempty"`
	OutputMode    string                   `json:"output_mode,omitempty"`
	Stop          HostLifecycleActionPlan  `json:"stop"`
	Uninstall     HostLifecycleActionPlan  `json:"uninstall"`
}

type HostLifecycleStep

type HostLifecycleStep struct {
	Kind            string `json:"kind"`
	Reference       string `json:"reference,omitempty"`
	CommandTemplate string `json:"command_template,omitempty"`
}

type HostManagementReview

type HostManagementReview struct {
	ServiceID     string `json:"service_id"`
	SavedIdentity string `json:"saved_identity"`
	Fingerprint   string `json:"fingerprint"`
	PID           int    `json:"pid"`
	ProcessGroup  int    `json:"process_group"`
	Executable    string `json:"executable"`
	UserID        string `json:"user_id"`
	Birth         string `json:"birth"`
}

Only native process facts are disclosed. Command arguments, environment, opening URLs and private credentials never enter the review response.

type HostRuntimeSettings

type HostRuntimeSettings struct {
	InstallScript   string `json:"install_script,omitempty"`
	StartScript     string `json:"start_script"`
	StopScript      string `json:"stop_script,omitempty"`
	UninstallScript string `json:"uninstall_script,omitempty"`
}

type HostTemplateSpec

type HostTemplateSpec = templatecontract.HostTemplateSpec

type InstallPlan

type InstallPlan struct {
	PlanDigest         string `json:"plan_digest"`
	ServiceID          string `json:"service_id"`
	WorkspacePath      string `json:"workspace_path"`
	WorkspaceOwnership string `json:"workspace_ownership"`
	ExpiresAtUnixMs    int64  `json:"expires_at_unix_ms"`
}

type InstallPlanningBackend

type InstallPlanningBackend interface {
	PreflightInstall(context.Context, CreateRequest) (*InstallPlan, error)
}

type LocalizedTemplateNotice

type LocalizedTemplateNotice = templatecontract.LocalizedNotice

type LockedSetting

type LockedSetting struct {
	Path      string `json:"path"`
	Reason    string `json:"reason"`
	Duplicate bool   `json:"duplicate_to_edit,omitempty"`
}

type LogResult

type LogResult struct {
	Lines []string `json:"lines"`
}

type ManagementBackend

type ManagementBackend interface {
	PreflightManagement(context.Context, string, ManagementPlanRequest) (*ManagementPlan, error)
}

ManagementBackend extends the lifecycle boundary without granting scripts any additional permissions. Authorization still belongs to the product adapter.

type ManagementPlan

type ManagementPlan struct {
	ServiceID             string                `json:"service_id"`
	Request               ManagementPlanRequest `json:"request"`
	PlanDigest            string                `json:"plan_digest"`
	Facts                 ServiceFacts          `json:"facts"`
	Blockers              []string              `json:"blockers"`
	Path                  string                `json:"path"`
	ConflictServiceID     string                `json:"conflict_service_id,omitempty"`
	ConfigurationRevision int64                 `json:"configuration_revision"`
	RuntimeIdentity       string                `json:"-"`
	Manifest              string                `json:"-"`
	ManagementState       string                `json:"management_state"`
}

type ManagementPlanRequest

type ManagementPlanRequest struct {
	RetainResourceIDs []string        `json:"retain_resource_ids,omitempty"`
	Action            OperationAction `json:"action"`
	DeleteData        bool            `json:"delete_data,omitempty"`
	DeleteWorkspace   bool            `json:"delete_workspace,omitempty"`
	SkipHooks         bool            `json:"skip_hooks,omitempty"`
}

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func New

func New(opts ManagerOptions) (*Manager, error)

func (*Manager) Cancel

func (m *Manager) Cancel(ctx context.Context, operationID string) (*pfregistry.ManagedOperation, error)

func (*Manager) Catalog

func (m *Manager) Catalog(ctx context.Context) ([]Template, error)

func (*Manager) Close

func (m *Manager) Close() error

func (*Manager) ConfirmTemplateSource

func (m *Manager) ConfirmTemplateSource(ctx context.Context, owner string, req TemplateSourceConfirmRequest) (*Template, error)

func (*Manager) ContainerResourceOwner

func (m *Manager) ContainerResourceOwner(ctx context.Context, engine containerengine.Engine, endpointID containerengine.EndpointID, kind ContainerResourceKind, identity string) (*ContainerResourceOwner, error)

ContainerResourceOwner resolves the single Redeven product owner of a Docker resource. Container drivers uses this on both read and write paths so a caller cannot bypass the managed Web Service lifecycle through another UI.

func (*Manager) Create

func (m *Manager) Create(ctx context.Context, req CreateRequest) (*CreateResult, error)

func (*Manager) CreateTemplate

func (m *Manager) CreateTemplate(ctx context.Context, req TemplateWriteRequest) (*Template, error)

func (*Manager) CreateUpdatePlan

func (m *Manager) CreateUpdatePlan(ctx context.Context, serviceID string, request UpdatePlanRequest) (*UpdatePlan, error)

func (*Manager) DeleteTemplate

func (m *Manager) DeleteTemplate(ctx context.Context, templateID string) error

func (*Manager) DiscardTemplateSource

func (m *Manager) DiscardTemplateSource(_ context.Context, owner, id string) error

func (*Manager) DiscoverTemplateSources

func (*Manager) DuplicateTemplate

func (m *Manager) DuplicateTemplate(ctx context.Context, templateID string, req TemplateDuplicateRequest) (*Template, error)

func (*Manager) InspectTemplateSource

func (m *Manager) InspectTemplateSource(ctx context.Context, owner string, req TemplateSourceInspectRequest) (*TemplateSourcePreview, error)

func (*Manager) List

func (m *Manager) List(ctx context.Context) ([]ServiceView, error)

func (*Manager) Logs

func (m *Manager) Logs(ctx context.Context, serviceID string, tail int) (*LogResult, error)

func (*Manager) OpenSession

func (m *Manager) OpenSession(ctx context.Context, serviceID string, request OpenSessionRequest) (*OpenSession, error)

func (*Manager) Operate

func (m *Manager) Operate(ctx context.Context, serviceID string, req OperationRequest) (*pfregistry.ManagedOperation, error)

func (*Manager) Operation

func (m *Manager) Operation(ctx context.Context, operationID string) (*pfregistry.ManagedOperation, error)

func (*Manager) PreflightInstall

func (m *Manager) PreflightInstall(ctx context.Context, req CreateRequest) (*InstallPlan, error)

func (*Manager) PreflightManagement

func (m *Manager) PreflightManagement(ctx context.Context, serviceID string, req ManagementPlanRequest) (*ManagementPlan, error)

func (*Manager) PreflightReconfigure

func (m *Manager) PreflightReconfigure(ctx context.Context, serviceID string, draft ReconfigureDraft) (*ReconfigurePlan, error)

func (*Manager) PreviewTemplateSourceFile

func (m *Manager) PreviewTemplateSourceFile(_ context.Context, owner, id, path string) (*TemplateSourceFilePreview, error)

func (*Manager) RestoreHostManagement

func (m *Manager) RestoreHostManagement(ctx context.Context, serviceID string, request RestoreManagementRequest) error

func (*Manager) ReviewHostManagement

func (m *Manager) ReviewHostManagement(ctx context.Context, serviceID string) (*HostManagementReview, error)

func (*Manager) ServiceReleaseCandidates

func (m *Manager) ServiceReleaseCandidates(ctx context.Context, serviceID string, request ReleaseCandidateRequest) (*ReleaseCandidateResult, error)

func (*Manager) Settings

func (m *Manager) Settings(ctx context.Context, serviceID string) (*ServiceSettingsView, error)

func (*Manager) Start

func (m *Manager) Start(ctx context.Context)

func (*Manager) Subscribe

func (m *Manager) Subscribe(operationID string) (<-chan pfregistry.ManagedOperation, func(), error)

func (*Manager) Template

func (m *Manager) Template(ctx context.Context, templateID string) (*Template, error)

func (*Manager) TemplateReleaseCandidates

func (m *Manager) TemplateReleaseCandidates(ctx context.Context, templateID string, request ReleaseCandidateRequest) (*ReleaseCandidateResult, error)

func (*Manager) UpdateSettings

func (m *Manager) UpdateSettings(ctx context.Context, serviceID string, patch ServiceMetadataPatch) (*ServiceSettingsView, error)

func (*Manager) UpdateTemplate

func (m *Manager) UpdateTemplate(ctx context.Context, templateID string, req TemplateWriteRequest) (*Template, error)

func (*Manager) ValidateTemplate

func (m *Manager) ValidateTemplate(_ context.Context, req TemplateWriteRequest) error

type ManagerOptions

type ManagerOptions struct {
	Logger     *slog.Logger
	StateDir   string
	Registry   *pfregistry.Registry
	Scope      *filesystemscope.Registry
	Containers *containerengine.Adapter
	Catalog    *BuiltinCatalog
}

type NPMHostPackageSpec

type NPMHostPackageSpec = templatecontract.NPMHostPackageSpec

type OpenSession

type OpenSession struct {
	State     string                       `json:"state"`
	Forward   *pfregistry.Forward          `json:"forward,omitempty"`
	AppPath   string                       `json:"app_path,omitempty"`
	Operation *pfregistry.ManagedOperation `json:"operation,omitempty"`
}

type OpenSessionRequest

type OpenSessionRequest struct {
	RequestID string `json:"request_id"`
}

type OperationAction

type OperationAction string
const (
	ActionInstall      OperationAction = "install"
	ActionStart        OperationAction = "start"
	ActionStop         OperationAction = "stop"
	ActionRestart      OperationAction = "restart"
	ActionRetry        OperationAction = "retry"
	ActionRetryInstall OperationAction = "retry_install"
	ActionUpdate       OperationAction = "update"
	ActionReconfigure  OperationAction = "reconfigure"
	ActionUninstall    OperationAction = "uninstall"
	ActionDetach       OperationAction = "detach"
	ActionRestore      OperationAction = "restore"
	ActionRecover      OperationAction = "recover"
)

type OperationRequest

type OperationRequest struct {
	RetainResourceIDs       []string            `json:"retain_resource_ids,omitempty"`
	PlanDigest              string              `json:"plan_digest,omitempty"`
	SkipHooks               bool                `json:"skip_hooks,omitempty"`
	RequestID               string              `json:"request_id"`
	Action                  OperationAction     `json:"action"`
	DeleteData              bool                `json:"delete_data,omitempty"`
	DeleteWorkspace         bool                `json:"delete_workspace,omitempty"`
	AcceptedNoticeRevisions map[string]int64    `json:"accepted_notice_revisions,omitempty"`
	Reconfigure             *ReconfigureRequest `json:"reconfigure,omitempty"`
	UpdatePlanID            string              `json:"update_plan_id,omitempty"`
	Administrator           bool                `json:"-"`
}

type ReconfigureDraft

type ReconfigureDraft struct {
	SecretParameters      map[string]string      `json:"secret_parameters,omitempty"`
	ConfigurationRevision int64                  `json:"configuration_revision"`
	Parameters            map[string]string      `json:"parameters,omitempty"`
	Runtime               ServiceRuntimeSettings `json:"runtime"`
}

type ReconfigurePlan

type ReconfigurePlan struct {
	ConfigurationRevision int64        `json:"configuration_revision"`
	PlanDigest            string       `json:"plan_digest"`
	ChangedSections       []string     `json:"changed_sections"`
	Risks                 []RiskNotice `json:"risks,omitempty"`
	RequiresRebuild       bool         `json:"requires_rebuild"`
}

type ReconfigureRequest

type ReconfigureRequest struct {
	Draft           ReconfigureDraft `json:"draft"`
	PlanDigest      string           `json:"plan_digest"`
	AcceptedRiskIDs []string         `json:"accepted_risk_ids,omitempty"`
	Administrator   bool             `json:"-"`
}

type ReleaseCandidate

type ReleaseCandidate struct {
	SchemaVersion        int    `json:"schema_version"`
	CandidateID          string `json:"candidate_id"`
	SourceKind           string `json:"source_kind"`
	Source               string `json:"source"`
	Registry             string `json:"registry,omitempty"`
	Version              string `json:"version,omitempty"`
	Tag                  string `json:"tag,omitempty"`
	PublishedAtUnixMs    int64  `json:"published_at_unix_ms,omitempty"`
	Channel              string `json:"channel"`
	Deprecated           bool   `json:"deprecated,omitempty"`
	DeprecationMessage   string `json:"deprecation_message,omitempty"`
	Trust                string `json:"trust"`
	Selectable           bool   `json:"selectable"`
	ReasonCode           string `json:"reason_code,omitempty"`
	Reason               string `json:"reason,omitempty"`
	Platform             string `json:"platform,omitempty"`
	IndexDigest          string `json:"index_digest,omitempty"`
	Digest               string `json:"digest,omitempty"`
	Integrity            string `json:"integrity,omitempty"`
	TagMoved             bool   `json:"tag_moved,omitempty"`
	IsCurrent            bool   `json:"is_current,omitempty"`
	IsRecommended        bool   `json:"is_recommended,omitempty"`
	RecommendationStatus string `json:"recommendation_status,omitempty"`
	DigestVerified       bool   `json:"digest_verified,omitempty"`
	IsLatestStable       bool   `json:"is_latest_stable,omitempty"`
	IsLatestPreview      bool   `json:"is_latest_preview,omitempty"`
	Relation             string `json:"relation"`
	VerificationStatus   string `json:"verification_status"`
}

type ReleaseCandidateRequest

type ReleaseCandidateRequest struct {
	Action       string            `json:"action"`
	Parameters   map[string]string `json:"parameters,omitempty"`
	CursorID     string            `json:"cursor_id,omitempty"`
	CandidateIDs []string          `json:"candidate_ids,omitempty"`
}

type ReleaseCandidateResult

type ReleaseCandidateResult struct {
	SchemaVersion        int                `json:"schema_version"`
	CurrentRelease       *ReleaseIdentity   `json:"current_release,omitempty"`
	RecommendedRelease   *ReleaseIdentity   `json:"recommended_release,omitempty"`
	LatestStableRelease  *ReleaseCandidate  `json:"latest_stable_release,omitempty"`
	LatestPreviewRelease *ReleaseCandidate  `json:"latest_preview_release,omitempty"`
	Candidates           []ReleaseCandidate `json:"candidates"`
	CatalogStatus        string             `json:"catalog_status"`
	HasMore              bool               `json:"has_more"`
	CursorID             string             `json:"cursor_id,omitempty"`
	LoadedCount          int                `json:"loaded_count"`
	CheckStatus          string             `json:"check_status"`
	CheckedAtUnixMs      int64              `json:"checked_at_unix_ms"`
	NextCheckAtUnixMs    int64              `json:"next_check_at_unix_ms,omitempty"`
	LastErrorCode        string             `json:"last_error_code,omitempty"`
	LastErrorMessage     string             `json:"-"`
}

type ReleaseIdentity

type ReleaseIdentity struct {
	SchemaVersion     int    `json:"schema_version"`
	Kind              string `json:"kind"`
	Source            string `json:"source,omitempty"`
	Registry          string `json:"registry,omitempty"`
	Version           string `json:"version,omitempty"`
	Tag               string `json:"tag,omitempty"`
	Digest            string `json:"digest,omitempty"`
	Integrity         string `json:"integrity,omitempty"`
	Platform          string `json:"platform,omitempty"`
	ArtifactReference string `json:"artifact_reference,omitempty"`
	Trust             string `json:"trust,omitempty"`
}

type ReleaseStatus

type ReleaseStatus struct {
	SchemaVersion         int              `json:"schema_version"`
	CurrentRelease        *ReleaseIdentity `json:"current_release,omitempty"`
	RecommendedRelease    *ReleaseIdentity `json:"recommended_release,omitempty"`
	LatestStableRelease   *ReleaseIdentity `json:"latest_stable_release,omitempty"`
	LatestPreviewRelease  *ReleaseIdentity `json:"latest_preview_release,omitempty"`
	LatestStableRelation  string           `json:"latest_stable_relation,omitempty"`
	LatestPreviewRelation string           `json:"latest_preview_relation,omitempty"`
	CheckStatus           string           `json:"check_status"`
	CheckedAtUnixMs       int64            `json:"checked_at_unix_ms,omitempty"`
	NextCheckAtUnixMs     int64            `json:"next_check_at_unix_ms,omitempty"`
	LastErrorCode         string           `json:"last_error_code,omitempty"`
}

type RestoreManagementRequest

type RestoreManagementRequest struct {
	SavedIdentity string `json:"saved_identity"`
	Fingerprint   string `json:"fingerprint"`
	Confirmed     bool   `json:"confirmed"`
}

type RiskNotice

type RiskNotice struct {
	ID            string `json:"id"`
	Title         string `json:"title"`
	Description   string `json:"description"`
	RequiresAdmin bool   `json:"requires_admin"`
}

type ServiceActions

type ServiceActions struct {
	Inspect           ActionCapability `json:"inspect"`
	Uninstall         ActionCapability `json:"uninstall"`
	Recover           ActionCapability `json:"recover"`
	Detach            ActionCapability `json:"detach"`
	Open              ActionCapability `json:"open"`
	RestoreManagement ActionCapability `json:"restore_management"`
	Start             ActionCapability `json:"start"`
	Stop              ActionCapability `json:"stop"`
	Restart           ActionCapability `json:"restart"`
	Retry             ActionCapability `json:"retry"`
}

type ServiceFacts

type ServiceFacts struct {
	InstanceIDs       []string              `json:"instance_ids,omitempty"`
	Presence          string                `json:"presence"`
	Ownership         string                `json:"ownership"`
	Runtime           string                `json:"runtime"`
	CheckedAtUnixMs   int64                 `json:"checked_at_unix_ms"`
	ProblemCode       string                `json:"problem_code,omitempty"`
	Resources         []ServiceResourceFact `json:"resources,omitempty"`
	ResourcesComplete bool                  `json:"resources_complete"`
}

ServiceFacts is the authoritative observation used by management and opening. Unknown existence never authorizes creation, stopping, or deletion.

type ServiceFailure

type ServiceFailure struct {
	Action            string `json:"action,omitempty"`
	Stage             string `json:"stage,omitempty"`
	ErrorCode         string `json:"error_code"`
	Message           string `json:"message"`
	ArtifactReference string `json:"artifact_reference,omitempty"`
	OperationID       string `json:"operation_id,omitempty"`
	OccurredAtUnixMs  int64  `json:"occurred_at_unix_ms,omitempty"`
}

type ServiceMetadataPatch

type ServiceMetadataPatch struct {
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	AccessMode  string `json:"access_mode"`
}

type ServiceOpening

type ServiceOpening struct {
	State     string `json:"state"`
	ErrorCode string `json:"error_code,omitempty"`
}

type ServiceResourceFact

type ServiceResourceFact struct {
	StableIdentity string                              `json:"stable_identity,omitempty"`
	ResourceID     string                              `json:"resource_id"`
	Kind           string                              `json:"kind"`
	Identity       string                              `json:"identity"`
	Generation     int64                               `json:"generation,omitempty"`
	Presence       string                              `json:"presence"`
	Ownership      string                              `json:"ownership"`
	ProblemCode    string                              `json:"problem_code,omitempty"`
	References     []containerengine.ResourceReference `json:"references,omitempty"`
}

type ServiceRuntimeSettings

type ServiceRuntimeSettings struct {
	Container *ContainerRuntimeSettings           `json:"container,omitempty"`
	Compose   map[string]ContainerRuntimeSettings `json:"compose,omitempty"`
	Host      *HostRuntimeSettings                `json:"host,omitempty"`
}

type ServiceSettingsView

type ServiceSettingsView struct {
	ManagementState            string                 `json:"management_state"`
	ParameterDefinitions       []TemplateParameter    `json:"parameter_definitions,omitempty"`
	ConfiguredSecretParameters []string               `json:"configured_secret_parameters,omitempty"`
	ServiceID                  string                 `json:"service_id"`
	Name                       string                 `json:"name"`
	Description                string                 `json:"description,omitempty"`
	AccessMode                 string                 `json:"access_mode"`
	Deployment                 Deployment             `json:"deployment"`
	TemplateSource             string                 `json:"template_source"`
	ObservedState              string                 `json:"observed_state"`
	ConfigurationRevision      int64                  `json:"configuration_revision"`
	ConfigurationSHA256        string                 `json:"configuration_sha256"`
	Parameters                 map[string]string      `json:"parameters,omitempty"`
	Runtime                    ServiceRuntimeSettings `json:"runtime"`
	Locked                     []LockedSetting        `json:"locked,omitempty"`
}

type ServiceView

type ServiceView struct {
	DefaultLocale string       `json:"default_locale,omitempty"`
	Facts         ServiceFacts `json:"facts"`
	PrimaryAction string       `json:"primary_action"`
	Status        string       `json:"status"`
	ProblemCode   string       `json:"problem_code,omitempty"`
	pfregistry.ManagedService
	Name               string                          `json:"name"`
	Description        string                          `json:"description,omitempty"`
	TemplateSource     string                          `json:"template_source"`
	Deployment         Deployment                      `json:"deployment"`
	Localizations      map[string]TemplateLocalization `json:"localizations,omitempty"`
	Icon               *TemplateIcon                   `json:"icon,omitempty"`
	ReleaseStatus      ReleaseStatus                   `json:"release_status"`
	ActiveOperation    *pfregistry.ManagedOperation    `json:"active_operation,omitempty"`
	LastFailure        *ServiceFailure                 `json:"last_failure,omitempty"`
	AccessMode         string                          `json:"access_mode"`
	ContainerResources []ContainerResourceLink         `json:"container_resources,omitempty"`
	Opening            ServiceOpening                  `json:"opening"`
	PendingChanges     bool                            `json:"pending_changes"`
	Actions            ServiceActions                  `json:"actions"`
}

type Template

type Template struct {
	DefaultLocale         string                            `json:"default_locale,omitempty"`
	GitSource             *pfregistry.ManagedTemplateSource `json:"git_source,omitempty"`
	SourceSHA256          string                            `json:"source_sha256,omitempty"`
	SourceDirectory       string                            `json:"-"`
	TemplateID            string                            `json:"template_id"`
	Name                  string                            `json:"name"`
	Description           string                            `json:"description"`
	RecommendedRelease    *ReleaseIdentity                  `json:"recommended_release,omitempty"`
	ReleaseSource         string                            `json:"release_source,omitempty"`
	DeveloperPreview      bool                              `json:"developer_preview"`
	DiskBytes             int64                             `json:"disk_bytes"`
	DataLocation          string                            `json:"data_location"`
	SourceURL             string                            `json:"source_url"`
	DockerSourceURL       string                            `json:"docker_source_url"`
	Localizations         map[string]TemplateLocalization   `json:"localizations,omitempty"`
	Icon                  *TemplateIcon                     `json:"icon,omitempty"`
	Notices               []TemplateNotice                  `json:"notices,omitempty"`
	Deployments           []DeploymentAvailability          `json:"deployments"`
	DefaultWorkspacePath  string                            `json:"default_workspace_path"`
	DefaultAccessMode     string                            `json:"default_access_mode"`
	WorkspaceRoots        []WorkspaceRoot                   `json:"workspace_roots"`
	Source                string                            `json:"source"`
	Deployment            Deployment                        `json:"deployment"`
	ContainerMode         string                            `json:"container_mode,omitempty"`
	Revision              int64                             `json:"revision"`
	Editable              bool                              `json:"editable"`
	Duplicateable         bool                              `json:"duplicateable"`
	DerivedFromTemplateID string                            `json:"derived_from_template_id,omitempty"`
	DerivedFromRevision   int64                             `json:"derived_from_revision,omitempty"`
	ServiceFamilyID       string                            `json:"service_family_id"`
	Available             bool                              `json:"available"`
	ReasonCode            string                            `json:"reason_code,omitempty"`
	Reason                string                            `json:"reason,omitempty"`
	Spec                  *TemplateSpec                     `json:"spec,omitempty"`
	EffectiveSpec         *TemplateSpec                     `json:"effective_spec,omitempty"`
	HostLifecyclePlan     *HostLifecyclePlan                `json:"host_lifecycle_plan,omitempty"`
	SortOrder             int                               `json:"-"`
}

type TemplateDuplicateRequest

type TemplateDuplicateRequest struct {
	RequestID string `json:"request_id"`
	Name      string `json:"name"`
}

type TemplateIcon

type TemplateIcon = templatecontract.IconAsset

type TemplateLocalization

type TemplateLocalization = templatecontract.Localization

type TemplateNotice

type TemplateNotice = templatecontract.Notice

type TemplateParameter

type TemplateParameter = templatecontract.TemplateParameter

type TemplateSourceBackend

type TemplateSourceBackend interface {
	DiscoverTemplateSources(context.Context, TemplateSourceDiscoverRequest) (templatecontract.SourceCatalog, error)
	InspectTemplateSource(context.Context, string, TemplateSourceInspectRequest) (*TemplateSourcePreview, error)
	ConfirmTemplateSource(context.Context, string, TemplateSourceConfirmRequest) (*Template, error)
	DiscardTemplateSource(context.Context, string, string) error
	PreviewTemplateSourceFile(context.Context, string, string, string) (*TemplateSourceFilePreview, error)
}

type TemplateSourceConfirmRequest

type TemplateSourceConfirmRequest struct {
	RequestID      string `json:"request_id"`
	CandidateID    string `json:"candidate_id"`
	SHA256         string `json:"sha256"`
	ExpectedSHA256 string `json:"expected_sha256,omitempty"`
}

type TemplateSourceDiscoverRequest

type TemplateSourceDiscoverRequest struct {
	Source templatecontract.GitSource `json:"source"`
	Token  string                     `json:"token,omitempty"`
}

type TemplateSourceFileChange

type TemplateSourceFileChange struct {
	Path   string `json:"path"`
	Change string `json:"change"`
	Mode   string `json:"mode,omitempty"`
	Before string `json:"before,omitempty"`
	After  string `json:"after,omitempty"`
}

type TemplateSourceFileContent

type TemplateSourceFileContent struct {
	Mode   string `json:"mode"`
	SHA256 string `json:"sha256"`
	Binary bool   `json:"binary"`
	Text   string `json:"text,omitempty"`
}

type TemplateSourceFilePreview

type TemplateSourceFilePreview struct {
	Path   string                     `json:"path"`
	Before *TemplateSourceFileContent `json:"before,omitempty"`
	After  *TemplateSourceFileContent `json:"after,omitempty"`
}

type TemplateSourceInspectRequest

type TemplateSourceInspectRequest struct {
	TemplateID string                     `json:"template_id,omitempty"`
	Source     templatecontract.GitSource `json:"source"`
	Token      string                     `json:"token,omitempty"`
	Snapshot   *templatecontract.Snapshot `json:"snapshot,omitempty"`
}

type TemplateSourcePreview

type TemplateSourcePreview struct {
	CandidateID           string                     `json:"candidate_id"`
	SHA256                string                     `json:"sha256"`
	ExpectedSHA256        string                     `json:"expected_sha256"`
	ExpiresAtUnixMs       int64                      `json:"expires_at_unix_ms"`
	Changed               bool                       `json:"changed"`
	Template              Template                   `json:"template"`
	PreviousTemplate      *Template                  `json:"previous_template,omitempty"`
	Files                 []TemplateSourceFileChange `json:"files"`
	AffectedServiceIDs    []string                   `json:"affected_service_ids"`
	SourceDocumentVersion int                        `json:"source_document_version"`
	SourceSpecVersion     int                        `json:"source_spec_version"`
}

type TemplateSpec

type TemplateSpec = templatecontract.Spec

type TemplateWriteRequest

type TemplateWriteRequest struct {
	RequestID   string       `json:"request_id"`
	Name        string       `json:"name"`
	Description string       `json:"description,omitempty"`
	Spec        TemplateSpec `json:"spec"`
}

type UpdatePlan

type UpdatePlan struct {
	SchemaVersion           int              `json:"schema_version"`
	UpdatePlanID            string           `json:"update_plan_id"`
	CurrentRelease          ReleaseIdentity  `json:"current_release"`
	TargetRelease           ReleaseIdentity  `json:"target_release"`
	Notices                 []TemplateNotice `json:"notices,omitempty"`
	AcceptedNoticeRevisions map[string]int64 `json:"accepted_notice_revisions,omitempty"`
	RiskIDs                 []string         `json:"risk_ids,omitempty"`
	RequiresStopped         bool             `json:"requires_stopped,omitempty"`
	ExpiresAtUnixMs         int64            `json:"expires_at_unix_ms"`
}

type UpdatePlanRequest

type UpdatePlanRequest struct {
	TargetCandidateID string `json:"target_candidate_id,omitempty"`
}

type WebEndpointSpec

type WebEndpointSpec = templatecontract.WebEndpointSpec

type WorkspaceRoot

type WorkspaceRoot struct {
	ID    string `json:"id"`
	Label string `json:"label"`
	Path  string `json:"path"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL