Complete SCUM controlled deployment lifecycle
This commit is contained in:
+88
-26
@@ -92,21 +92,51 @@ type RunJobResultRequest struct {
|
||||
}
|
||||
|
||||
type RunJobExecutionInputBody struct {
|
||||
WorkspaceScope string `json:"workspaceScope,omitempty"`
|
||||
Content string `json:"content,omitempty"`
|
||||
ExpectedVersion int `json:"expectedVersion,omitempty"`
|
||||
ExpectedChecksum string `json:"expectedChecksum,omitempty"`
|
||||
MaxReadBytes int `json:"maxReadBytes,omitempty"`
|
||||
RemoteAdapterKey string `json:"remoteAdapterKey,omitempty"`
|
||||
RemoteAdapterKind string `json:"remoteAdapterKind,omitempty"`
|
||||
TimeoutSeconds int `json:"timeoutSeconds,omitempty"`
|
||||
PluginID string `json:"pluginId,omitempty"`
|
||||
LifecycleOperation string `json:"lifecycleOperation,omitempty"`
|
||||
TargetVersion string `json:"targetVersion,omitempty"`
|
||||
Inputs map[string]string `json:"inputs,omitempty"`
|
||||
DLLExtensions []RuntimeDLLExtensionPlanBody `json:"dllExtensions,omitempty"`
|
||||
SourceRCON *RuntimeSourceRCONPlanBody `json:"sourceRcon,omitempty"`
|
||||
Deployment *ServerDeploymentExecutionBody `json:"deployment,omitempty"`
|
||||
WorkspaceScope string `json:"workspaceScope,omitempty"`
|
||||
Content string `json:"content,omitempty"`
|
||||
ExpectedVersion int `json:"expectedVersion,omitempty"`
|
||||
ExpectedChecksum string `json:"expectedChecksum,omitempty"`
|
||||
MaxReadBytes int `json:"maxReadBytes,omitempty"`
|
||||
RemoteAdapterKey string `json:"remoteAdapterKey,omitempty"`
|
||||
RemoteAdapterKind string `json:"remoteAdapterKind,omitempty"`
|
||||
TimeoutSeconds int `json:"timeoutSeconds,omitempty"`
|
||||
PluginID string `json:"pluginId,omitempty"`
|
||||
LifecycleOperation string `json:"lifecycleOperation,omitempty"`
|
||||
TargetVersion string `json:"targetVersion,omitempty"`
|
||||
Inputs map[string]string `json:"inputs,omitempty"`
|
||||
DLLExtensions []RuntimeDLLExtensionPlanBody `json:"dllExtensions,omitempty"`
|
||||
SourceRCON *RuntimeSourceRCONPlanBody `json:"sourceRcon,omitempty"`
|
||||
Deployment *ServerDeploymentExecutionBody `json:"deployment,omitempty"`
|
||||
ServerDeploymentPlan *ServerDeploymentPlanBody `json:"serverDeploymentPlan,omitempty"`
|
||||
}
|
||||
|
||||
type ServerDeploymentPlanBody struct {
|
||||
SchemaVersion string `json:"schemaVersion"`
|
||||
Operation string `json:"operation"`
|
||||
PluginID string `json:"pluginId"`
|
||||
TemplateKey string `json:"templateKey"`
|
||||
TemplateVersion string `json:"templateVersion"`
|
||||
SteamAppID string `json:"steamAppId"`
|
||||
ExecutableKey string `json:"executableKey"`
|
||||
InstallRootKey string `json:"installRootKey"`
|
||||
ConfigKey string `json:"configKey"`
|
||||
ConfigFormat string `json:"configFormat"`
|
||||
ConfigMappings []RuntimeServerConfigMappingBody `json:"configMappings"`
|
||||
DiscoveryMarkers []RuntimeServerDiscoveryMarkerBody `json:"discoveryMarkers"`
|
||||
VerificationChecks []RuntimeServerVerificationCheckBody `json:"verificationChecks"`
|
||||
}
|
||||
|
||||
type ServerDeploymentEvidenceBody struct {
|
||||
TemplateKey string `json:"templateKey,omitempty"`
|
||||
TemplateVersion string `json:"templateVersion,omitempty"`
|
||||
PreflightState string `json:"preflightState,omitempty"`
|
||||
DiscoveryState string `json:"discoveryState,omitempty"`
|
||||
MappingState string `json:"mappingState,omitempty"`
|
||||
VerificationState string `json:"verificationState,omitempty"`
|
||||
DiscoveredFacts map[string]string `json:"discoveredFacts,omitempty"`
|
||||
MappingResults map[string]string `json:"mappingResults,omitempty"`
|
||||
VerificationResults map[string]string `json:"verificationResults,omitempty"`
|
||||
FailureCode string `json:"failureCode,omitempty"`
|
||||
}
|
||||
|
||||
// ServerDeploymentExecutionBody is included only in a leased Run assignment.
|
||||
@@ -136,15 +166,16 @@ type RuntimeSourceRCONPlanBody struct {
|
||||
}
|
||||
|
||||
type RunJobExecutionResultBody struct {
|
||||
Kind string `json:"kind,omitempty"`
|
||||
ProcessState string `json:"processState,omitempty"`
|
||||
ExitClassification string `json:"exitClassification,omitempty"`
|
||||
ExitCode int `json:"exitCode,omitempty"`
|
||||
Version int `json:"version,omitempty"`
|
||||
Checksum string `json:"checksum,omitempty"`
|
||||
SizeBytes int64 `json:"sizeBytes,omitempty"`
|
||||
AuditSummary string `json:"auditSummary,omitempty"`
|
||||
Content string `json:"content,omitempty"`
|
||||
Kind string `json:"kind,omitempty"`
|
||||
ProcessState string `json:"processState,omitempty"`
|
||||
ExitClassification string `json:"exitClassification,omitempty"`
|
||||
ExitCode int `json:"exitCode,omitempty"`
|
||||
Version int `json:"version,omitempty"`
|
||||
Checksum string `json:"checksum,omitempty"`
|
||||
SizeBytes int64 `json:"sizeBytes,omitempty"`
|
||||
AuditSummary string `json:"auditSummary,omitempty"`
|
||||
Content string `json:"content,omitempty"`
|
||||
ServerDeploymentEvidence *ServerDeploymentEvidenceBody `json:"serverDeploymentEvidence,omitempty"`
|
||||
}
|
||||
|
||||
type RunJobResultResponse struct {
|
||||
@@ -377,7 +408,7 @@ func (request RunJobResultRequest) ToDomain() domain.RunJobResult {
|
||||
Message: request.Message,
|
||||
ErrorCode: request.ErrorCode,
|
||||
Retryable: request.Retryable,
|
||||
ExecutionResult: domain.JobExecutionResult{Kind: request.ExecutionResult.Kind, ProcessState: request.ExecutionResult.ProcessState, ExitClassification: request.ExecutionResult.ExitClassification, ExitCode: request.ExecutionResult.ExitCode, Version: request.ExecutionResult.Version, Checksum: request.ExecutionResult.Checksum, SizeBytes: request.ExecutionResult.SizeBytes, AuditSummary: request.ExecutionResult.AuditSummary, Content: request.ExecutionResult.Content},
|
||||
ExecutionResult: domain.JobExecutionResult{Kind: request.ExecutionResult.Kind, ProcessState: request.ExecutionResult.ProcessState, ExitClassification: request.ExecutionResult.ExitClassification, ExitCode: request.ExecutionResult.ExitCode, Version: request.ExecutionResult.Version, Checksum: request.ExecutionResult.Checksum, SizeBytes: request.ExecutionResult.SizeBytes, AuditSummary: request.ExecutionResult.AuditSummary, Content: request.ExecutionResult.Content, ServerDeploymentEvidence: serverDeploymentEvidenceToDomain(request.ExecutionResult.ServerDeploymentEvidence)},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -583,7 +614,7 @@ func RunJobAssignmentFromDomain(assignment domain.RunJobAssignment) RunJobAssign
|
||||
State: assignment.State,
|
||||
Progress: progressReportFromDomain(assignment.Progress),
|
||||
ResultRef: assignment.ResultRef,
|
||||
ExecutionInput: RunJobExecutionInputBody{WorkspaceScope: assignment.ExecutionInput.WorkspaceScope, Content: assignment.ExecutionInput.Content, ExpectedVersion: assignment.ExecutionInput.ExpectedVersion, ExpectedChecksum: assignment.ExecutionInput.ExpectedChecksum, MaxReadBytes: assignment.ExecutionInput.MaxReadBytes, RemoteAdapterKey: assignment.ExecutionInput.RemoteAdapterKey, RemoteAdapterKind: assignment.ExecutionInput.RemoteAdapterKind, TimeoutSeconds: assignment.ExecutionInput.TimeoutSeconds, PluginID: assignment.ExecutionInput.PluginID, LifecycleOperation: assignment.ExecutionInput.LifecycleOperation, TargetVersion: assignment.ExecutionInput.TargetVersion, Inputs: domain.CopyStringMap(assignment.ExecutionInput.Inputs), DLLExtensions: dllExtensionPlansFromDomain(assignment.ExecutionInput.DLLExtensions), SourceRCON: runtimeSourceRCONPlanFromDomain(assignment.ExecutionInput.SourceRCON), Deployment: deploymentExecutionFromDomain(assignment.ExecutionInput.Deployment)},
|
||||
ExecutionInput: RunJobExecutionInputBody{WorkspaceScope: assignment.ExecutionInput.WorkspaceScope, Content: assignment.ExecutionInput.Content, ExpectedVersion: assignment.ExecutionInput.ExpectedVersion, ExpectedChecksum: assignment.ExecutionInput.ExpectedChecksum, MaxReadBytes: assignment.ExecutionInput.MaxReadBytes, RemoteAdapterKey: assignment.ExecutionInput.RemoteAdapterKey, RemoteAdapterKind: assignment.ExecutionInput.RemoteAdapterKind, TimeoutSeconds: assignment.ExecutionInput.TimeoutSeconds, PluginID: assignment.ExecutionInput.PluginID, LifecycleOperation: assignment.ExecutionInput.LifecycleOperation, TargetVersion: assignment.ExecutionInput.TargetVersion, Inputs: domain.CopyStringMap(assignment.ExecutionInput.Inputs), DLLExtensions: dllExtensionPlansFromDomain(assignment.ExecutionInput.DLLExtensions), SourceRCON: runtimeSourceRCONPlanFromDomain(assignment.ExecutionInput.SourceRCON), Deployment: deploymentExecutionFromDomain(assignment.ExecutionInput.Deployment), ServerDeploymentPlan: serverDeploymentPlanFromDomain(assignment.ExecutionInput.ServerDeploymentPlan)},
|
||||
LeaseToken: assignment.LeaseToken,
|
||||
Attempt: assignment.Attempt,
|
||||
MaxAttempts: assignment.MaxAttempts,
|
||||
@@ -596,6 +627,37 @@ func RunJobAssignmentFromDomain(assignment domain.RunJobAssignment) RunJobAssign
|
||||
}
|
||||
}
|
||||
|
||||
func serverDeploymentPlanFromDomain(plan *domain.ServerDeploymentPlan) *ServerDeploymentPlanBody {
|
||||
if plan == nil {
|
||||
return nil
|
||||
}
|
||||
body := &ServerDeploymentPlanBody{SchemaVersion: plan.SchemaVersion, Operation: plan.Operation, PluginID: plan.PluginID, TemplateKey: plan.TemplateKey, TemplateVersion: plan.TemplateVersion, SteamAppID: plan.SteamAppID, ExecutableKey: plan.ExecutableKey, InstallRootKey: plan.InstallRootKey, ConfigKey: plan.ConfigKey, ConfigFormat: plan.ConfigFormat}
|
||||
for _, mapping := range plan.ConfigMappings {
|
||||
body.ConfigMappings = append(body.ConfigMappings, RuntimeServerConfigMappingBody{FieldKey: mapping.FieldKey, ConfigKey: mapping.ConfigKey, ValueType: mapping.ValueType, Required: mapping.Required})
|
||||
}
|
||||
for _, marker := range plan.DiscoveryMarkers {
|
||||
body.DiscoveryMarkers = append(body.DiscoveryMarkers, RuntimeServerDiscoveryMarkerBody{Key: marker.Key, Kind: marker.Kind, TargetKey: marker.TargetKey, Expected: marker.Expected, Required: marker.Required})
|
||||
}
|
||||
for _, check := range plan.VerificationChecks {
|
||||
body.VerificationChecks = append(body.VerificationChecks, RuntimeServerVerificationCheckBody{Key: check.Key, Kind: check.Kind, TargetKey: check.TargetKey, Required: check.Required})
|
||||
}
|
||||
return body
|
||||
}
|
||||
|
||||
func serverDeploymentEvidenceToDomain(body *ServerDeploymentEvidenceBody) *domain.ServerDeploymentEvidence {
|
||||
if body == nil {
|
||||
return nil
|
||||
}
|
||||
return &domain.ServerDeploymentEvidence{TemplateKey: body.TemplateKey, TemplateVersion: body.TemplateVersion, PreflightState: body.PreflightState, DiscoveryState: body.DiscoveryState, MappingState: body.MappingState, VerificationState: body.VerificationState, DiscoveredFacts: domain.CopyStringMap(body.DiscoveredFacts), MappingResults: domain.CopyStringMap(body.MappingResults), VerificationResults: domain.CopyStringMap(body.VerificationResults), FailureCode: body.FailureCode}
|
||||
}
|
||||
|
||||
func serverDeploymentEvidenceFromDomain(evidence *domain.ServerDeploymentEvidence) *ServerDeploymentEvidenceBody {
|
||||
if evidence == nil {
|
||||
return nil
|
||||
}
|
||||
return &ServerDeploymentEvidenceBody{TemplateKey: evidence.TemplateKey, TemplateVersion: evidence.TemplateVersion, PreflightState: evidence.PreflightState, DiscoveryState: evidence.DiscoveryState, MappingState: evidence.MappingState, VerificationState: evidence.VerificationState, DiscoveredFacts: domain.CopyStringMap(evidence.DiscoveredFacts), MappingResults: domain.CopyStringMap(evidence.MappingResults), VerificationResults: domain.CopyStringMap(evidence.VerificationResults), FailureCode: evidence.FailureCode}
|
||||
}
|
||||
|
||||
func deploymentExecutionFromDomain(definition *domain.ServerDeploymentDefinition) *ServerDeploymentExecutionBody {
|
||||
if definition == nil {
|
||||
return nil
|
||||
|
||||
+40
-37
@@ -492,20 +492,21 @@ type ServerMemberListResponse struct {
|
||||
}
|
||||
|
||||
type ServerInstanceResponse struct {
|
||||
ID string `json:"id"`
|
||||
PluginID string `json:"pluginId"`
|
||||
PluginVersion string `json:"pluginVersion"`
|
||||
RunEndpointID string `json:"runEndpointId"`
|
||||
Name string `json:"name"`
|
||||
OwnerUserID string `json:"ownerUserId,omitempty"`
|
||||
AdminUserIDs []string `json:"adminUserIds"`
|
||||
State domain.ServerInstanceState `json:"state"`
|
||||
ConfigVersion int `json:"configVersion"`
|
||||
ConfigKey string `json:"configKey,omitempty"`
|
||||
ConfigChecksum string `json:"configChecksum,omitempty"`
|
||||
ConfigUpdatedAt *time.Time `json:"configUpdatedAt,omitempty"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
ID string `json:"id"`
|
||||
PluginID string `json:"pluginId"`
|
||||
PluginVersion string `json:"pluginVersion"`
|
||||
RunEndpointID string `json:"runEndpointId"`
|
||||
Name string `json:"name"`
|
||||
OwnerUserID string `json:"ownerUserId,omitempty"`
|
||||
AdminUserIDs []string `json:"adminUserIds"`
|
||||
State domain.ServerInstanceState `json:"state"`
|
||||
ConfigVersion int `json:"configVersion"`
|
||||
ConfigKey string `json:"configKey,omitempty"`
|
||||
ConfigChecksum string `json:"configChecksum,omitempty"`
|
||||
ConfigUpdatedAt *time.Time `json:"configUpdatedAt,omitempty"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
DeploymentProjection ServerDeploymentProjectionBody `json:"deploymentProjection,omitempty"`
|
||||
}
|
||||
|
||||
type ServerInstanceListResponse struct {
|
||||
@@ -708,14 +709,15 @@ type JobResponse struct {
|
||||
}
|
||||
|
||||
type JobExecutionResultResponse struct {
|
||||
Kind string `json:"kind,omitempty"`
|
||||
ProcessState string `json:"processState,omitempty"`
|
||||
ExitClassification string `json:"exitClassification,omitempty"`
|
||||
ExitCode int `json:"exitCode,omitempty"`
|
||||
Version int `json:"version,omitempty"`
|
||||
Checksum string `json:"checksum,omitempty"`
|
||||
SizeBytes int64 `json:"sizeBytes,omitempty"`
|
||||
AuditSummary string `json:"auditSummary,omitempty"`
|
||||
Kind string `json:"kind,omitempty"`
|
||||
ProcessState string `json:"processState,omitempty"`
|
||||
ExitClassification string `json:"exitClassification,omitempty"`
|
||||
ExitCode int `json:"exitCode,omitempty"`
|
||||
Version int `json:"version,omitempty"`
|
||||
Checksum string `json:"checksum,omitempty"`
|
||||
SizeBytes int64 `json:"sizeBytes,omitempty"`
|
||||
AuditSummary string `json:"auditSummary,omitempty"`
|
||||
ServerDeploymentEvidence *ServerDeploymentEvidenceBody `json:"serverDeploymentEvidence,omitempty"`
|
||||
}
|
||||
|
||||
type JobListResponse struct {
|
||||
@@ -1440,20 +1442,21 @@ func ServerInstanceFromDomain(instance domain.ServerInstance) ServerInstanceResp
|
||||
adminUserIDs = []string{}
|
||||
}
|
||||
return ServerInstanceResponse{
|
||||
ID: instance.ID,
|
||||
PluginID: instance.PluginID,
|
||||
PluginVersion: instance.PluginVersion,
|
||||
RunEndpointID: instance.RunEndpointID,
|
||||
Name: instance.Name,
|
||||
OwnerUserID: instance.OwnerUserID,
|
||||
AdminUserIDs: adminUserIDs,
|
||||
State: instance.State,
|
||||
ConfigVersion: instance.ConfigVersion,
|
||||
ConfigKey: instance.ConfigKey,
|
||||
ConfigChecksum: instance.ConfigChecksum,
|
||||
ConfigUpdatedAt: optionalTime(instance.ConfigUpdatedAt),
|
||||
CreatedAt: instance.CreatedAt,
|
||||
UpdatedAt: instance.UpdatedAt,
|
||||
ID: instance.ID,
|
||||
PluginID: instance.PluginID,
|
||||
PluginVersion: instance.PluginVersion,
|
||||
RunEndpointID: instance.RunEndpointID,
|
||||
Name: instance.Name,
|
||||
OwnerUserID: instance.OwnerUserID,
|
||||
AdminUserIDs: adminUserIDs,
|
||||
State: instance.State,
|
||||
ConfigVersion: instance.ConfigVersion,
|
||||
ConfigKey: instance.ConfigKey,
|
||||
ConfigChecksum: instance.ConfigChecksum,
|
||||
ConfigUpdatedAt: optionalTime(instance.ConfigUpdatedAt),
|
||||
CreatedAt: instance.CreatedAt,
|
||||
UpdatedAt: instance.UpdatedAt,
|
||||
DeploymentProjection: deploymentProjectionFromDomain(instance.DeploymentProjection),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1618,7 +1621,7 @@ func JobFromDomain(job domain.Job) JobResponse {
|
||||
State: job.State,
|
||||
Progress: progressFromDomain(job.Progress),
|
||||
ResultRef: job.ResultRef,
|
||||
ExecutionResult: JobExecutionResultResponse{Kind: job.ExecutionResult.Kind, ProcessState: job.ExecutionResult.ProcessState, ExitClassification: job.ExecutionResult.ExitClassification, ExitCode: job.ExecutionResult.ExitCode, Version: job.ExecutionResult.Version, Checksum: job.ExecutionResult.Checksum, SizeBytes: job.ExecutionResult.SizeBytes, AuditSummary: job.ExecutionResult.AuditSummary},
|
||||
ExecutionResult: JobExecutionResultResponse{Kind: job.ExecutionResult.Kind, ProcessState: job.ExecutionResult.ProcessState, ExitClassification: job.ExecutionResult.ExitClassification, ExitCode: job.ExecutionResult.ExitCode, Version: job.ExecutionResult.Version, Checksum: job.ExecutionResult.Checksum, SizeBytes: job.ExecutionResult.SizeBytes, AuditSummary: job.ExecutionResult.AuditSummary, ServerDeploymentEvidence: serverDeploymentEvidenceFromDomain(job.ExecutionResult.ServerDeploymentEvidence)},
|
||||
RetryPolicy: JobRetryPolicyResponse{
|
||||
MaxAttempts: job.RetryPolicy.MaxAttempts,
|
||||
InitialBackoffSeconds: job.RetryPolicy.InitialBackoffSeconds,
|
||||
|
||||
@@ -58,6 +58,42 @@ type RuntimeInstallPlanBody struct {
|
||||
Steps []RuntimeInstallStepBody `json:"steps"`
|
||||
}
|
||||
|
||||
type RuntimeServerConfigMappingBody struct {
|
||||
FieldKey string `json:"fieldKey"`
|
||||
ConfigKey string `json:"configKey"`
|
||||
ValueType string `json:"valueType"`
|
||||
Required bool `json:"required,omitempty"`
|
||||
}
|
||||
|
||||
type RuntimeServerDiscoveryMarkerBody struct {
|
||||
Key string `json:"key"`
|
||||
Kind string `json:"kind"`
|
||||
TargetKey string `json:"targetKey"`
|
||||
Expected string `json:"expected,omitempty"`
|
||||
Required bool `json:"required,omitempty"`
|
||||
}
|
||||
|
||||
type RuntimeServerVerificationCheckBody struct {
|
||||
Key string `json:"key"`
|
||||
Kind string `json:"kind"`
|
||||
TargetKey string `json:"targetKey"`
|
||||
Required bool `json:"required,omitempty"`
|
||||
}
|
||||
|
||||
type RuntimeServerDeploymentProfileBody struct {
|
||||
Key string `json:"key"`
|
||||
Version string `json:"version"`
|
||||
SupportedTargets []RuntimeTargetBody `json:"supportedTargets"`
|
||||
SteamAppID string `json:"steamAppId"`
|
||||
ExecutableKey string `json:"executableKey"`
|
||||
InstallRootKey string `json:"installRootKey"`
|
||||
ConfigKey string `json:"configKey"`
|
||||
ConfigFormat string `json:"configFormat"`
|
||||
ConfigMappings []RuntimeServerConfigMappingBody `json:"configMappings"`
|
||||
DiscoveryMarkers []RuntimeServerDiscoveryMarkerBody `json:"discoveryMarkers"`
|
||||
VerificationChecks []RuntimeServerVerificationCheckBody `json:"verificationChecks"`
|
||||
}
|
||||
|
||||
type RuntimeLogSourceBody struct {
|
||||
Key string `json:"key"`
|
||||
Kind string `json:"kind"`
|
||||
@@ -213,15 +249,16 @@ type RuntimeDLLExtensionPlanBody struct {
|
||||
}
|
||||
|
||||
type GamePluginRuntimeProfilesBody struct {
|
||||
Discovery []RuntimeDiscoveryProbeBody `json:"discovery,omitempty"`
|
||||
LifecycleProfiles []RuntimeLifecycleProfileBody `json:"lifecycleProfiles,omitempty"`
|
||||
DependencyProbes []RuntimeDependencyProbeBody `json:"dependencyProbes,omitempty"`
|
||||
InstallPlans []RuntimeInstallPlanBody `json:"installPlans,omitempty"`
|
||||
LogSources []RuntimeLogSourceBody `json:"logSources,omitempty"`
|
||||
LogEvents []RuntimeLogEventBody `json:"logEvents,omitempty"`
|
||||
TransportProfiles []RuntimeTransportProfileBody `json:"transportProfiles,omitempty"`
|
||||
ClientManagers []RuntimeClientManagerProfileBody `json:"clientManagers,omitempty"`
|
||||
DLLExtensions []RuntimeDLLExtensionProfileBody `json:"dllExtensions,omitempty"`
|
||||
Discovery []RuntimeDiscoveryProbeBody `json:"discovery,omitempty"`
|
||||
LifecycleProfiles []RuntimeLifecycleProfileBody `json:"lifecycleProfiles,omitempty"`
|
||||
DependencyProbes []RuntimeDependencyProbeBody `json:"dependencyProbes,omitempty"`
|
||||
InstallPlans []RuntimeInstallPlanBody `json:"installPlans,omitempty"`
|
||||
ServerDeployments []RuntimeServerDeploymentProfileBody `json:"serverDeployments,omitempty"`
|
||||
LogSources []RuntimeLogSourceBody `json:"logSources,omitempty"`
|
||||
LogEvents []RuntimeLogEventBody `json:"logEvents,omitempty"`
|
||||
TransportProfiles []RuntimeTransportProfileBody `json:"transportProfiles,omitempty"`
|
||||
ClientManagers []RuntimeClientManagerProfileBody `json:"clientManagers,omitempty"`
|
||||
DLLExtensions []RuntimeDLLExtensionProfileBody `json:"dllExtensions,omitempty"`
|
||||
}
|
||||
|
||||
// GamePluginRuntimeProfilesResponseBody is intentionally distinct from the
|
||||
@@ -232,6 +269,7 @@ type GamePluginRuntimeProfilesResponseBody struct {
|
||||
LifecycleProfiles []RuntimeLifecycleProfileBody `json:"lifecycleProfiles,omitempty"`
|
||||
DependencyProbes []RuntimeDependencyProbeBody `json:"dependencyProbes,omitempty"`
|
||||
InstallPlans []RuntimeInstallPlanBody `json:"installPlans,omitempty"`
|
||||
ServerDeployments []RuntimeServerDeploymentProfileBody `json:"serverDeployments,omitempty"`
|
||||
LogSources []RuntimeLogSourceBody `json:"logSources,omitempty"`
|
||||
LogEvents []RuntimeLogEventBody `json:"logEvents,omitempty"`
|
||||
TransportProfiles []RuntimeTransportProfileBody `json:"transportProfiles,omitempty"`
|
||||
@@ -257,6 +295,22 @@ func (body GamePluginRuntimeProfilesBody) ToDomain() domain.GamePluginRuntimePro
|
||||
}
|
||||
profiles.InstallPlans = append(profiles.InstallPlans, plan)
|
||||
}
|
||||
for _, item := range body.ServerDeployments {
|
||||
profile := domain.RuntimeServerDeploymentProfile{Key: item.Key, Version: item.Version, SteamAppID: item.SteamAppID, ExecutableKey: item.ExecutableKey, InstallRootKey: item.InstallRootKey, ConfigKey: item.ConfigKey, ConfigFormat: item.ConfigFormat}
|
||||
for _, target := range item.SupportedTargets {
|
||||
profile.SupportedTargets = append(profile.SupportedTargets, domain.RuntimeTarget{OS: target.OS, Arch: target.Arch})
|
||||
}
|
||||
for _, mapping := range item.ConfigMappings {
|
||||
profile.ConfigMappings = append(profile.ConfigMappings, domain.RuntimeServerConfigMapping{FieldKey: mapping.FieldKey, ConfigKey: mapping.ConfigKey, ValueType: mapping.ValueType, Required: mapping.Required})
|
||||
}
|
||||
for _, marker := range item.DiscoveryMarkers {
|
||||
profile.DiscoveryMarkers = append(profile.DiscoveryMarkers, domain.RuntimeServerDiscoveryMarker{Key: marker.Key, Kind: marker.Kind, TargetKey: marker.TargetKey, Expected: marker.Expected, Required: marker.Required})
|
||||
}
|
||||
for _, check := range item.VerificationChecks {
|
||||
profile.VerificationChecks = append(profile.VerificationChecks, domain.RuntimeServerVerificationCheck{Key: check.Key, Kind: check.Kind, TargetKey: check.TargetKey, Required: check.Required})
|
||||
}
|
||||
profiles.ServerDeployments = append(profiles.ServerDeployments, profile)
|
||||
}
|
||||
for _, item := range body.LogSources {
|
||||
profiles.LogSources = append(profiles.LogSources, domain.RuntimeLogSource{Key: item.Key, Kind: item.Kind, TargetKey: item.TargetKey, StreamKey: item.StreamKey, CursorKind: item.CursorKind, RetentionDays: item.RetentionDays})
|
||||
}
|
||||
@@ -314,6 +368,22 @@ func runtimeProfilesFromDomain(profiles domain.GamePluginRuntimeProfiles) GamePl
|
||||
}
|
||||
body.InstallPlans = append(body.InstallPlans, plan)
|
||||
}
|
||||
for _, item := range profiles.ServerDeployments {
|
||||
bodyProfile := RuntimeServerDeploymentProfileBody{Key: item.Key, Version: item.Version, SteamAppID: item.SteamAppID, ExecutableKey: item.ExecutableKey, InstallRootKey: item.InstallRootKey, ConfigKey: item.ConfigKey, ConfigFormat: item.ConfigFormat}
|
||||
for _, target := range item.SupportedTargets {
|
||||
bodyProfile.SupportedTargets = append(bodyProfile.SupportedTargets, RuntimeTargetBody{OS: target.OS, Arch: target.Arch})
|
||||
}
|
||||
for _, mapping := range item.ConfigMappings {
|
||||
bodyProfile.ConfigMappings = append(bodyProfile.ConfigMappings, RuntimeServerConfigMappingBody{FieldKey: mapping.FieldKey, ConfigKey: mapping.ConfigKey, ValueType: mapping.ValueType, Required: mapping.Required})
|
||||
}
|
||||
for _, marker := range item.DiscoveryMarkers {
|
||||
bodyProfile.DiscoveryMarkers = append(bodyProfile.DiscoveryMarkers, RuntimeServerDiscoveryMarkerBody{Key: marker.Key, Kind: marker.Kind, TargetKey: marker.TargetKey, Expected: marker.Expected, Required: marker.Required})
|
||||
}
|
||||
for _, check := range item.VerificationChecks {
|
||||
bodyProfile.VerificationChecks = append(bodyProfile.VerificationChecks, RuntimeServerVerificationCheckBody{Key: check.Key, Kind: check.Kind, TargetKey: check.TargetKey, Required: check.Required})
|
||||
}
|
||||
body.ServerDeployments = append(body.ServerDeployments, bodyProfile)
|
||||
}
|
||||
for _, item := range profiles.LogSources {
|
||||
body.LogSources = append(body.LogSources, RuntimeLogSourceBody{Key: item.Key, Kind: item.Kind, TargetKey: item.TargetKey, StreamKey: item.StreamKey, CursorKind: item.CursorKind, RetentionDays: item.RetentionDays})
|
||||
}
|
||||
|
||||
@@ -22,19 +22,36 @@ type ServerDeploymentRequest struct {
|
||||
}
|
||||
|
||||
type ServerDeploymentResponse struct {
|
||||
ServerInstanceID string `json:"serverInstanceId"`
|
||||
Mode domain.ServerDeploymentMode `json:"mode,omitempty"`
|
||||
ProfileKey string `json:"profileKey,omitempty"`
|
||||
CreateInputs map[string]string `json:"createInputs,omitempty"`
|
||||
ServerRootConfigured bool `json:"serverRootConfigured"`
|
||||
WorkingDirectoryConfigured bool `json:"workingDirectoryConfigured"`
|
||||
InstallCommandConfigured bool `json:"installCommandConfigured"`
|
||||
StartCommandConfigured bool `json:"startCommandConfigured"`
|
||||
StopCommandConfigured bool `json:"stopCommandConfigured"`
|
||||
StatusCommandConfigured bool `json:"statusCommandConfigured"`
|
||||
Shell domain.ServerCommandShell `json:"shell,omitempty"`
|
||||
Revision int `json:"revision"`
|
||||
UpdatedAt *time.Time `json:"updatedAt,omitempty"`
|
||||
ServerInstanceID string `json:"serverInstanceId"`
|
||||
Mode domain.ServerDeploymentMode `json:"mode,omitempty"`
|
||||
ProfileKey string `json:"profileKey,omitempty"`
|
||||
CreateInputs map[string]string `json:"createInputs,omitempty"`
|
||||
ServerRootConfigured bool `json:"serverRootConfigured"`
|
||||
WorkingDirectoryConfigured bool `json:"workingDirectoryConfigured"`
|
||||
InstallCommandConfigured bool `json:"installCommandConfigured"`
|
||||
StartCommandConfigured bool `json:"startCommandConfigured"`
|
||||
StopCommandConfigured bool `json:"stopCommandConfigured"`
|
||||
StatusCommandConfigured bool `json:"statusCommandConfigured"`
|
||||
Shell domain.ServerCommandShell `json:"shell,omitempty"`
|
||||
Revision int `json:"revision"`
|
||||
UpdatedAt *time.Time `json:"updatedAt,omitempty"`
|
||||
Projection ServerDeploymentProjectionBody `json:"projection,omitempty"`
|
||||
}
|
||||
|
||||
type ServerDeploymentProjectionBody struct {
|
||||
State string `json:"state,omitempty"`
|
||||
Operation string `json:"operation,omitempty"`
|
||||
TemplateKey string `json:"templateKey,omitempty"`
|
||||
TemplateVersion string `json:"templateVersion,omitempty"`
|
||||
PreflightState string `json:"preflightState,omitempty"`
|
||||
DiscoveryState string `json:"discoveryState,omitempty"`
|
||||
MappingState string `json:"mappingState,omitempty"`
|
||||
VerificationState string `json:"verificationState,omitempty"`
|
||||
DiscoveredFacts map[string]string `json:"discoveredFacts,omitempty"`
|
||||
MappingResults map[string]string `json:"mappingResults,omitempty"`
|
||||
VerificationResults map[string]string `json:"verificationResults,omitempty"`
|
||||
FailureCode string `json:"failureCode,omitempty"`
|
||||
UpdatedAt *time.Time `json:"updatedAt,omitempty"`
|
||||
}
|
||||
|
||||
type ServerLifecycleCreateRequest struct {
|
||||
@@ -85,7 +102,11 @@ func (request ServerDeploymentRequest) deploymentDefinition() domain.ServerDeplo
|
||||
}
|
||||
|
||||
func ServerDeploymentFromDomain(view domain.ServerDeploymentView) ServerDeploymentResponse {
|
||||
return ServerDeploymentResponse{ServerInstanceID: view.ServerInstanceID, Mode: view.Mode, ProfileKey: view.ProfileKey, CreateInputs: domain.CopyStringMap(view.CreateInputs), ServerRootConfigured: view.ServerRootConfigured, WorkingDirectoryConfigured: view.WorkingDirectoryConfigured, InstallCommandConfigured: view.InstallCommandConfigured, StartCommandConfigured: view.StartCommandConfigured, StopCommandConfigured: view.StopCommandConfigured, StatusCommandConfigured: view.StatusCommandConfigured, Shell: view.Shell, Revision: view.Revision, UpdatedAt: optionalTime(view.UpdatedAt)}
|
||||
return ServerDeploymentResponse{ServerInstanceID: view.ServerInstanceID, Mode: view.Mode, ProfileKey: view.ProfileKey, CreateInputs: domain.CopyStringMap(view.CreateInputs), ServerRootConfigured: view.ServerRootConfigured, WorkingDirectoryConfigured: view.WorkingDirectoryConfigured, InstallCommandConfigured: view.InstallCommandConfigured, StartCommandConfigured: view.StartCommandConfigured, StopCommandConfigured: view.StopCommandConfigured, StatusCommandConfigured: view.StatusCommandConfigured, Shell: view.Shell, Revision: view.Revision, UpdatedAt: optionalTime(view.UpdatedAt), Projection: deploymentProjectionFromDomain(view.Projection)}
|
||||
}
|
||||
|
||||
func deploymentProjectionFromDomain(projection domain.ServerDeploymentProjection) ServerDeploymentProjectionBody {
|
||||
return ServerDeploymentProjectionBody{State: projection.State, Operation: projection.Operation, TemplateKey: projection.TemplateKey, TemplateVersion: projection.TemplateVersion, PreflightState: projection.PreflightState, DiscoveryState: projection.DiscoveryState, MappingState: projection.MappingState, VerificationState: projection.VerificationState, DiscoveredFacts: domain.CopyStringMap(projection.DiscoveredFacts), MappingResults: domain.CopyStringMap(projection.MappingResults), VerificationResults: domain.CopyStringMap(projection.VerificationResults), FailureCode: projection.FailureCode, UpdatedAt: optionalTime(projection.UpdatedAt)}
|
||||
}
|
||||
|
||||
func (request ServerLifecycleCommandRequest) ToDomain(serverInstanceID string) domain.ServerLifecycleCommand {
|
||||
|
||||
Reference in New Issue
Block a user