// Copyright Epic Games, Inc. All Rights Reserved. using System; using System.Collections.Generic; using EpicGames.Horde.Storage; namespace EpicGames.Horde.Tools { /// /// Describes a standalone, external tool hosted and deployed by Horde. Provides basic functionality for performing /// gradual roll-out, versioning, etc... /// /// Unique identifier for the tool /// Name of the tool /// Description for the tool /// Category to display the tool in on the dashboard /// Grouping key to control how different tools should be merged on the dashboard /// List of platforms that this tool supports, as NET runtime identifiers. /// Current deployments of this tool, sorted by time. /// Whether this tool should be exposed for download on a public endpoint without authentication /// Whether this tool is bundled with the server /// Whether to show this tool for download inside UGS /// Whether to show this tool for download on the dashboard /// Whether to show this tool for download in Unreal Toolbox /// Metadata for the tool public record class GetToolResponse(ToolId Id, string Name, string Description, string? Category, string? Group, List? Platforms, List Deployments, bool Public, bool Bundled, bool ShowInUgs, bool ShowInDashboard, bool ShowInToolbox, Dictionary? Metadata = null); /// /// Summary for a particular tool. /// /// Unique identifier for the tool /// Name of the tool /// Description for the tool /// Category to display the tool in on the dashboard /// Grouping key to control how different tools should be merged on the dashboard /// List of platforms that this tool supports, as NET runtime identifiers. /// Version number of the current deployment of this tool /// Identifier for the current deployment /// Current state of the deployment /// Current progress of the deployment /// Whether this tool is bundled with the server /// Whether to show this tool for download inside UGS /// Whether to show this tool for download on the dashboard /// Whether to show this tool for download in the launcher /// Metadata for the tool public record class GetToolSummaryResponse(ToolId Id, string Name, string Description, string? Category, string? Group, List? Platforms, string? Version, ToolDeploymentId? DeploymentId, ToolDeploymentState? DeploymentState, double? DeploymentProgress, bool Bundled, bool ShowInUgs, bool ShowInDashboard, bool ShowInToolbox, Dictionary? Metadata = null); /// /// Response when querying all tools /// /// List of tools currently available public record GetToolsSummaryResponse(List Tools); /// /// Response object describing the deployment of a tool /// /// Identifier for this deployment. A new identifier will be assigned to each created instance, so an identifier corresponds to a unique deployment. /// Descriptive version string for this tool revision /// Current state of this deployment /// Current progress of the deployment /// Last time at which the progress started. Set to null if the deployment was paused. /// Length of time over which to make the deployment /// Reference to the deployment data /// Reference to this tool in Horde Storage public record GetToolDeploymentResponse(ToolDeploymentId Id, string Version, ToolDeploymentState State, double Progress, DateTime? StartedAt, TimeSpan Duration, RefName RefName, BlobLocator Locator); /// /// Request for creating a new deployment /// /// Nominal version string for this deployment /// Number of minutes over which to do the deployment /// Whether to create the deployment in a paused state /// Handle to a directory node with the content for the deployment public record CreateToolDeploymentRequest(string Version, double? Duration, bool? CreatePaused, HashedBlobRefValue Content); /// /// Response from creating a deployment /// /// Identifier for the created deployment public record CreateToolDeploymentResponse(ToolDeploymentId Id); /// /// Current state of a tool's deployment /// public enum ToolDeploymentState { /// /// The deployment is ongoing /// Active, /// /// The deployment should be paused at its current state /// Paused, /// /// Deployment of this version is complete /// Complete, /// /// The deployment has been cancelled. /// Cancelled, } /// /// Update an existing deployment /// public class UpdateDeploymentRequest { /// /// New state for the deployment /// public ToolDeploymentState? State { get; set; } } /// /// Action for a deployment /// public enum GetToolAction { /// /// Query for information about the deployment /// Info, /// /// Download the deployment data /// Download, /// /// Download the deployment data as a zip file /// Zip, } };