Complete platform management workflows
This commit is contained in:
@@ -104,6 +104,56 @@ const (
|
||||
ArtifactStateFailed ArtifactState = "failed"
|
||||
)
|
||||
|
||||
type DistributionComponentKind string
|
||||
|
||||
const (
|
||||
DistributionComponentRun DistributionComponentKind = "run"
|
||||
DistributionComponentClientManager DistributionComponentKind = "client-manager"
|
||||
)
|
||||
|
||||
type ComponentKeyStatus string
|
||||
|
||||
const (
|
||||
ComponentKeyStatusActive ComponentKeyStatus = "active"
|
||||
ComponentKeyStatusRevoked ComponentKeyStatus = "revoked"
|
||||
)
|
||||
|
||||
type DistributionStatus string
|
||||
|
||||
const (
|
||||
DistributionStatusAvailable DistributionStatus = "available"
|
||||
DistributionStatusRevoked DistributionStatus = "revoked"
|
||||
DistributionStatusBuilding DistributionStatus = "building"
|
||||
DistributionStatusFailed DistributionStatus = "failed"
|
||||
)
|
||||
|
||||
type RuntimeBindingStatus string
|
||||
|
||||
const (
|
||||
RuntimeBindingStatusComplete RuntimeBindingStatus = "complete"
|
||||
RuntimeBindingStatusIncomplete RuntimeBindingStatus = "incomplete"
|
||||
)
|
||||
|
||||
type DependencyState string
|
||||
|
||||
const (
|
||||
DependencyStateUnknown DependencyState = "unknown"
|
||||
DependencyStatePresent DependencyState = "present"
|
||||
DependencyStateMissing DependencyState = "missing"
|
||||
DependencyStateInstalling DependencyState = "installing"
|
||||
DependencyStateFailed DependencyState = "failed"
|
||||
)
|
||||
|
||||
type DistributionJobStatus string
|
||||
|
||||
const (
|
||||
DistributionJobStatusQueued DistributionJobStatus = "queued"
|
||||
DistributionJobStatusRunning DistributionJobStatus = "running"
|
||||
DistributionJobStatusSucceeded DistributionJobStatus = "succeeded"
|
||||
DistributionJobStatusFailed DistributionJobStatus = "failed"
|
||||
DistributionJobStatusDenied DistributionJobStatus = "denied"
|
||||
)
|
||||
|
||||
type LogStreamSource string
|
||||
|
||||
const (
|
||||
@@ -208,11 +258,12 @@ type AIProviderModels struct {
|
||||
}
|
||||
|
||||
type PluginPermissions struct {
|
||||
AI bool
|
||||
Logs bool
|
||||
Files bool
|
||||
Jobs bool
|
||||
Artifacts bool
|
||||
AI bool
|
||||
Logs bool
|
||||
Files bool
|
||||
Jobs bool
|
||||
Artifacts bool
|
||||
RemoteAccess bool
|
||||
}
|
||||
|
||||
type PluginLifecycleActions struct {
|
||||
@@ -246,6 +297,14 @@ type GamePluginManifestAI struct {
|
||||
Purposes []string
|
||||
}
|
||||
|
||||
type GamePluginRemoteAccess struct {
|
||||
Methods []string
|
||||
RunCapabilities []string
|
||||
DatabaseEngines []string
|
||||
RCON bool
|
||||
LogTransfer bool
|
||||
}
|
||||
|
||||
type GamePluginManifest struct {
|
||||
ID string
|
||||
Name string
|
||||
@@ -260,6 +319,7 @@ type GamePluginManifest struct {
|
||||
Actions PluginLifecycleActions
|
||||
Pages []GamePluginPage
|
||||
AI GamePluginManifestAI
|
||||
RemoteAccess GamePluginRemoteAccess
|
||||
}
|
||||
|
||||
type GamePluginManifestRegistration struct {
|
||||
@@ -285,6 +345,7 @@ type GamePlugin struct {
|
||||
Pages []GamePluginPage
|
||||
Tags []string
|
||||
AIPurposes []string
|
||||
RemoteAccess GamePluginRemoteAccess
|
||||
ValidationViolations []string
|
||||
Status GamePluginStatus
|
||||
}
|
||||
@@ -307,6 +368,7 @@ type PluginMarketplacePlugin struct {
|
||||
Pages []GamePluginPage
|
||||
Tags []string
|
||||
AIPurposes []string
|
||||
RemoteAccess GamePluginRemoteAccess
|
||||
ValidationViolations []string
|
||||
Status GamePluginStatus
|
||||
Source string
|
||||
@@ -320,6 +382,11 @@ const (
|
||||
PluginBridgeActionLogsQuery PluginBridgeAction = "logs.query"
|
||||
PluginBridgeActionArtifactsOpen PluginBridgeAction = "artifacts.open"
|
||||
PluginBridgeActionFilesRequest PluginBridgeAction = "files.request"
|
||||
PluginBridgeActionRemoteAccessRequest PluginBridgeAction = "remote.access.request"
|
||||
PluginBridgeActionRunDistribution PluginBridgeAction = "run.distribution.request"
|
||||
PluginBridgeActionDependenciesRequest PluginBridgeAction = "dependencies.request"
|
||||
PluginBridgeActionLogsBackfillRequest PluginBridgeAction = "logs.backfill.request"
|
||||
PluginBridgeActionClientManager PluginBridgeAction = "client-manager.request"
|
||||
PluginBridgeActionAIInvoke PluginBridgeAction = "ai.invoke"
|
||||
)
|
||||
|
||||
@@ -383,6 +450,10 @@ type ServerInstance struct {
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
|
||||
type ServerInstanceUpdate struct {
|
||||
Name *string
|
||||
}
|
||||
|
||||
type PlatformResourceUsage struct {
|
||||
CPUPercent float64
|
||||
MemoryPercent float64
|
||||
@@ -493,9 +564,25 @@ type RunCapacity struct {
|
||||
}
|
||||
|
||||
const (
|
||||
JobCapabilityConfigWrite = "config.write"
|
||||
JobCapabilityFilesRead = "files.read"
|
||||
JobCapabilityFilesWrite = "files.write"
|
||||
JobCapabilityConfigWrite = "config.write"
|
||||
JobCapabilityFilesRead = "files.read"
|
||||
JobCapabilityFilesWrite = "files.write"
|
||||
JobCapabilityRemoteFTPRead = "remote.ftp.read"
|
||||
JobCapabilityRemoteFTPWrite = "remote.ftp.write"
|
||||
JobCapabilityRemoteRsyncRead = "remote.rsync.read"
|
||||
JobCapabilityRemoteRsyncWrite = "remote.rsync.write"
|
||||
JobCapabilityRemoteRunFilesRead = "remote.run.files.read"
|
||||
JobCapabilityRemoteRunFilesWrite = "remote.run.files.write"
|
||||
JobCapabilityRemoteRunProcessStart = "remote.run.process.start"
|
||||
JobCapabilityRemoteRunProcessStop = "remote.run.process.stop"
|
||||
JobCapabilityRemoteRunDBMySQLQuery = "remote.run.db.mysql.query"
|
||||
JobCapabilityRemoteRunDBSQLiteQuery = "remote.run.db.sqlite.query"
|
||||
JobCapabilityRemoteRunLogsTransfer = "remote.run.logs.transfer"
|
||||
JobCapabilityRemoteRunRCONCommand = "remote.run.rcon.command"
|
||||
JobCapabilityRunSelfUpdate = "run.self-update"
|
||||
JobCapabilityDependenciesCheck = "dependencies.check"
|
||||
JobCapabilityDependenciesInstall = "dependencies.install"
|
||||
JobCapabilityLogsBackfill = "logs.backfill"
|
||||
)
|
||||
|
||||
type RunEndpoint struct {
|
||||
@@ -539,6 +626,197 @@ type Artifact struct {
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
|
||||
type RuntimeBinding struct {
|
||||
ID string
|
||||
ServerInstanceID string
|
||||
PluginID string
|
||||
ProfileKey string
|
||||
Mode string
|
||||
Bindings map[string]string
|
||||
MissingKeys []string
|
||||
Status RuntimeBindingStatus
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
|
||||
type EncryptedComponentKey struct {
|
||||
ID string
|
||||
ServerInstanceID string
|
||||
ComponentKind DistributionComponentKind
|
||||
ComponentKey string
|
||||
EncryptedKey string
|
||||
KeyHash string
|
||||
Fingerprint string
|
||||
SecretRef string
|
||||
Generation int
|
||||
Status ComponentKeyStatus
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
ResetAt time.Time
|
||||
}
|
||||
|
||||
type RunDistribution struct {
|
||||
ID string
|
||||
ServerInstanceID string
|
||||
PluginID string
|
||||
RunEndpointID string
|
||||
TargetOS string
|
||||
TargetArch string
|
||||
PackageFormat string
|
||||
ArtifactID string
|
||||
Checksum string
|
||||
KeyGeneration int
|
||||
SecretRef string
|
||||
Status DistributionStatus
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
|
||||
type ClientManagerDistribution struct {
|
||||
ID string
|
||||
ServerInstanceID string
|
||||
PluginID string
|
||||
ProfileKey string
|
||||
TargetOS string
|
||||
TargetArch string
|
||||
RepositoryURL string
|
||||
SourceRevision string
|
||||
BuildJobID string
|
||||
ArtifactID string
|
||||
Checksum string
|
||||
KeyGeneration int
|
||||
SecretRef string
|
||||
Status DistributionStatus
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
|
||||
type DependencyStatus struct {
|
||||
ID string
|
||||
ServerInstanceID string
|
||||
PluginID string
|
||||
ProbeKey string
|
||||
TargetOS string
|
||||
TargetArch string
|
||||
State DependencyState
|
||||
Required bool
|
||||
InstallPlanKey string
|
||||
Message string
|
||||
CheckedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
|
||||
type ClientManagerBuildJob struct {
|
||||
ID string
|
||||
ServerInstanceID string
|
||||
PluginID string
|
||||
ProfileKey string
|
||||
TargetOS string
|
||||
TargetArch string
|
||||
RepositoryURL string
|
||||
SourceRevision string
|
||||
ArtifactID string
|
||||
Checksum string
|
||||
KeyGeneration int
|
||||
LogsRef string
|
||||
Status DistributionJobStatus
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
|
||||
type RunUpdateJob struct {
|
||||
ID string
|
||||
ServerInstanceID string
|
||||
RunEndpointID string
|
||||
ArtifactID string
|
||||
Checksum string
|
||||
JobID string
|
||||
IdempotencyKey string
|
||||
Status DistributionJobStatus
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
|
||||
type RunDistributionGenerateRequest struct {
|
||||
ServerInstanceID string
|
||||
TargetOS string
|
||||
TargetArch string
|
||||
IdempotencyKey string
|
||||
}
|
||||
|
||||
type ClientManagerBuildRequest struct {
|
||||
ServerInstanceID string
|
||||
ProfileKey string
|
||||
TargetOS string
|
||||
TargetArch string
|
||||
RepositoryURL string
|
||||
SourceRevision string
|
||||
IdempotencyKey string
|
||||
}
|
||||
|
||||
type ComponentKeyResetRequest struct {
|
||||
ServerInstanceID string
|
||||
ComponentKind DistributionComponentKind
|
||||
ComponentKey string
|
||||
}
|
||||
|
||||
type ComponentAuthenticationRequest struct {
|
||||
ServerInstanceID string
|
||||
ComponentKind DistributionComponentKind
|
||||
ComponentKey string
|
||||
Generation int
|
||||
Key string
|
||||
}
|
||||
|
||||
type ComponentAuthenticationResult struct {
|
||||
ServerInstanceID string
|
||||
ComponentKind DistributionComponentKind
|
||||
ComponentKey string
|
||||
Generation int
|
||||
Allowed bool
|
||||
Reason string
|
||||
}
|
||||
|
||||
type ServerRuntimeAction struct {
|
||||
Key string
|
||||
Label string
|
||||
Available bool
|
||||
Reason string
|
||||
}
|
||||
|
||||
type ServerRuntimeActions struct {
|
||||
ServerInstanceID string
|
||||
PluginID string
|
||||
RunEndpointID string
|
||||
RunStatus RunEndpointStatus
|
||||
Actions []ServerRuntimeAction
|
||||
}
|
||||
|
||||
type RunUpdateRequest struct {
|
||||
ServerInstanceID string
|
||||
ArtifactID string
|
||||
Checksum string
|
||||
IdempotencyKey string
|
||||
}
|
||||
|
||||
type DependencyJobRequest struct {
|
||||
ServerInstanceID string
|
||||
ProbeKey string
|
||||
InstallPlanKey string
|
||||
TargetOS string
|
||||
TargetArch string
|
||||
IdempotencyKey string
|
||||
Install bool
|
||||
}
|
||||
|
||||
type LogBackfillRequest struct {
|
||||
ServerInstanceID string
|
||||
SourceKey string
|
||||
CheckpointRef string
|
||||
IdempotencyKey string
|
||||
Limit int
|
||||
}
|
||||
|
||||
type LogStream struct {
|
||||
ID string
|
||||
ServerInstanceID string
|
||||
@@ -606,6 +884,51 @@ type ArtifactFilter struct {
|
||||
State ArtifactState
|
||||
}
|
||||
|
||||
type RuntimeBindingFilter struct {
|
||||
ServerInstanceID string
|
||||
ProfileKey string
|
||||
Status RuntimeBindingStatus
|
||||
}
|
||||
|
||||
type EncryptedComponentKeyFilter struct {
|
||||
ServerInstanceID string
|
||||
ComponentKind DistributionComponentKind
|
||||
ComponentKey string
|
||||
Status ComponentKeyStatus
|
||||
}
|
||||
|
||||
type RunDistributionFilter struct {
|
||||
ServerInstanceID string
|
||||
TargetOS string
|
||||
TargetArch string
|
||||
Status DistributionStatus
|
||||
}
|
||||
|
||||
type ClientManagerDistributionFilter struct {
|
||||
ServerInstanceID string
|
||||
ProfileKey string
|
||||
TargetOS string
|
||||
TargetArch string
|
||||
Status DistributionStatus
|
||||
}
|
||||
|
||||
type DependencyStatusFilter struct {
|
||||
ServerInstanceID string
|
||||
ProbeKey string
|
||||
State DependencyState
|
||||
}
|
||||
|
||||
type ClientManagerBuildJobFilter struct {
|
||||
ServerInstanceID string
|
||||
ProfileKey string
|
||||
Status DistributionJobStatus
|
||||
}
|
||||
|
||||
type RunUpdateJobFilter struct {
|
||||
ServerInstanceID string
|
||||
Status DistributionJobStatus
|
||||
}
|
||||
|
||||
type LogStreamFilter struct {
|
||||
ServerInstanceID string
|
||||
StreamKey string
|
||||
@@ -666,6 +989,7 @@ func CopyGamePlugin(plugin GamePlugin) GamePlugin {
|
||||
plugin.Pages = CopyGamePluginPageSlice(plugin.Pages)
|
||||
plugin.Tags = CopyStringSlice(plugin.Tags)
|
||||
plugin.AIPurposes = CopyStringSlice(plugin.AIPurposes)
|
||||
plugin.RemoteAccess = CopyGamePluginRemoteAccess(plugin.RemoteAccess)
|
||||
plugin.ValidationViolations = CopyStringSlice(plugin.ValidationViolations)
|
||||
return plugin
|
||||
}
|
||||
@@ -678,6 +1002,7 @@ func CopyPluginMarketplacePlugin(plugin PluginMarketplacePlugin) PluginMarketpla
|
||||
plugin.Pages = CopyGamePluginPageSlice(plugin.Pages)
|
||||
plugin.Tags = CopyStringSlice(plugin.Tags)
|
||||
plugin.AIPurposes = CopyStringSlice(plugin.AIPurposes)
|
||||
plugin.RemoteAccess = CopyGamePluginRemoteAccess(plugin.RemoteAccess)
|
||||
plugin.ValidationViolations = CopyStringSlice(plugin.ValidationViolations)
|
||||
return plugin
|
||||
}
|
||||
@@ -706,9 +1031,17 @@ func CopyGamePluginManifest(manifest GamePluginManifest) GamePluginManifest {
|
||||
manifest.Permissions = CopyStringSlice(manifest.Permissions)
|
||||
manifest.Pages = CopyGamePluginPageSlice(manifest.Pages)
|
||||
manifest.AI.Purposes = CopyStringSlice(manifest.AI.Purposes)
|
||||
manifest.RemoteAccess = CopyGamePluginRemoteAccess(manifest.RemoteAccess)
|
||||
return manifest
|
||||
}
|
||||
|
||||
func CopyGamePluginRemoteAccess(remote GamePluginRemoteAccess) GamePluginRemoteAccess {
|
||||
remote.Methods = CopyStringSlice(remote.Methods)
|
||||
remote.RunCapabilities = CopyStringSlice(remote.RunCapabilities)
|
||||
remote.DatabaseEngines = CopyStringSlice(remote.DatabaseEngines)
|
||||
return remote
|
||||
}
|
||||
|
||||
func CopyGamePluginPageSlice(pages []GamePluginPage) []GamePluginPage {
|
||||
if pages == nil {
|
||||
return nil
|
||||
@@ -807,6 +1140,86 @@ func CopyArtifact(artifact Artifact) Artifact {
|
||||
return artifact
|
||||
}
|
||||
|
||||
func CopyRuntimeBinding(binding RuntimeBinding) RuntimeBinding {
|
||||
binding.Bindings = CopyStringMap(binding.Bindings)
|
||||
binding.MissingKeys = CopyStringSlice(binding.MissingKeys)
|
||||
return binding
|
||||
}
|
||||
|
||||
func CopyEncryptedComponentKey(key EncryptedComponentKey) EncryptedComponentKey {
|
||||
return key
|
||||
}
|
||||
|
||||
func CopyRunDistribution(distribution RunDistribution) RunDistribution {
|
||||
return distribution
|
||||
}
|
||||
|
||||
func CopyClientManagerDistribution(distribution ClientManagerDistribution) ClientManagerDistribution {
|
||||
return distribution
|
||||
}
|
||||
|
||||
func CopyDependencyStatus(status DependencyStatus) DependencyStatus {
|
||||
return status
|
||||
}
|
||||
|
||||
func CopyClientManagerBuildJob(job ClientManagerBuildJob) ClientManagerBuildJob {
|
||||
return job
|
||||
}
|
||||
|
||||
func CopyRunUpdateJob(job RunUpdateJob) RunUpdateJob {
|
||||
return job
|
||||
}
|
||||
|
||||
func CopyRunDistributionGenerateRequest(request RunDistributionGenerateRequest) RunDistributionGenerateRequest {
|
||||
return request
|
||||
}
|
||||
|
||||
func CopyClientManagerBuildRequest(request ClientManagerBuildRequest) ClientManagerBuildRequest {
|
||||
return request
|
||||
}
|
||||
|
||||
func CopyComponentKeyResetRequest(request ComponentKeyResetRequest) ComponentKeyResetRequest {
|
||||
return request
|
||||
}
|
||||
|
||||
func CopyComponentAuthenticationRequest(request ComponentAuthenticationRequest) ComponentAuthenticationRequest {
|
||||
return request
|
||||
}
|
||||
|
||||
func CopyComponentAuthenticationResult(result ComponentAuthenticationResult) ComponentAuthenticationResult {
|
||||
return result
|
||||
}
|
||||
|
||||
func CopyServerRuntimeAction(action ServerRuntimeAction) ServerRuntimeAction {
|
||||
return action
|
||||
}
|
||||
|
||||
func CopyServerRuntimeActions(actions ServerRuntimeActions) ServerRuntimeActions {
|
||||
actions.Actions = CopyServerRuntimeActionSlice(actions.Actions)
|
||||
return actions
|
||||
}
|
||||
|
||||
func CopyServerRuntimeActionSlice(actions []ServerRuntimeAction) []ServerRuntimeAction {
|
||||
if actions == nil {
|
||||
return nil
|
||||
}
|
||||
out := make([]ServerRuntimeAction, len(actions))
|
||||
copy(out, actions)
|
||||
return out
|
||||
}
|
||||
|
||||
func CopyRunUpdateRequest(request RunUpdateRequest) RunUpdateRequest {
|
||||
return request
|
||||
}
|
||||
|
||||
func CopyDependencyJobRequest(request DependencyJobRequest) DependencyJobRequest {
|
||||
return request
|
||||
}
|
||||
|
||||
func CopyLogBackfillRequest(request LogBackfillRequest) LogBackfillRequest {
|
||||
return request
|
||||
}
|
||||
|
||||
func CopyLogStream(stream LogStream) LogStream {
|
||||
return stream
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user