aha
This commit is contained in:
@ -0,0 +1,28 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Edgegap.Editor.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Used in `UpdateAppVersionRequest`, `CreateAppVersionRequest`.
|
||||
/// For GetDeploymentStatusResult, see DeploymentPortsData
|
||||
/// </summary>
|
||||
public class AppPortsData
|
||||
{
|
||||
/// <summary>1024~49151; Default 7770</summary>
|
||||
[JsonProperty("port")]
|
||||
public int Port { get; set; } = EdgegapWindowMetadata.PORT_DEFAULT;
|
||||
|
||||
/// <summary>Default "UDP"</summary>
|
||||
[JsonProperty("protocol")]
|
||||
public string ProtocolStr { get; set; } = EdgegapWindowMetadata.DEFAULT_PROTOCOL_TYPE.ToString();
|
||||
|
||||
[JsonProperty("to_check")]
|
||||
public bool ToCheck { get; set; } = true;
|
||||
|
||||
[JsonProperty("tls_upgrade")]
|
||||
public bool TlsUpgrade { get; set; }
|
||||
|
||||
[JsonProperty("name")]
|
||||
public string PortName { get; set; } = "Game Port";
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b6d4864ea3706574fb35920c6fab46fa
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 129321
|
||||
packageName: Mirror
|
||||
packageVersion: 96.0.1
|
||||
assetPath: Assets/Mirror/Hosting/Edgegap/Editor/Api/Models/AppPortsData.cs
|
||||
uploadId: 736421
|
@ -0,0 +1,29 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Edgegap.Editor.Api.Models
|
||||
{
|
||||
/// <summary>Used in `GetDeploymentStatus`.</summary>
|
||||
public class DeploymentPortsData
|
||||
{
|
||||
[JsonProperty("external")]
|
||||
public int External { get; set; }
|
||||
|
||||
[JsonProperty("internal")]
|
||||
public int Internal { get; set; }
|
||||
|
||||
[JsonProperty("protocol")]
|
||||
public string Protocol { get; set; }
|
||||
|
||||
[JsonProperty("name")]
|
||||
public string PortName { get; set; }
|
||||
|
||||
[JsonProperty("tls_upgrade")]
|
||||
public bool TlsUpgrade { get; set; }
|
||||
|
||||
[JsonProperty("link")]
|
||||
public string Link { get; set; }
|
||||
|
||||
[JsonProperty("proxy")]
|
||||
public int? Proxy { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 62d51b44b8414c9f968ca607ccb06b7e
|
||||
timeCreated: 1701522748
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 129321
|
||||
packageName: Mirror
|
||||
packageVersion: 96.0.1
|
||||
assetPath: Assets/Mirror/Hosting/Edgegap/Editor/Api/Models/DeploymentPortsData.cs
|
||||
uploadId: 736421
|
@ -0,0 +1,28 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Edgegap.Editor.Api.Models
|
||||
{
|
||||
public class LocationData
|
||||
{
|
||||
[JsonProperty("city")]
|
||||
public string City { get; set; }
|
||||
|
||||
[JsonProperty("country")]
|
||||
public string Country { get; set; }
|
||||
|
||||
[JsonProperty("continent")]
|
||||
public string Continent { get; set; }
|
||||
|
||||
[JsonProperty("administrative_division")]
|
||||
public string AdministrativeDivision { get; set; }
|
||||
|
||||
[JsonProperty("timezone")]
|
||||
public string Timezone { get; set; }
|
||||
|
||||
[JsonProperty("latitude")]
|
||||
public double Latitude { get; set; }
|
||||
|
||||
[JsonProperty("longitude")]
|
||||
public double Longitude { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 57eed0dbd556e074c992cf6599a1f6bd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 129321
|
||||
packageName: Mirror
|
||||
packageVersion: 96.0.1
|
||||
assetPath: Assets/Mirror/Hosting/Edgegap/Editor/Api/Models/LocationData.cs
|
||||
uploadId: 736421
|
@ -0,0 +1,18 @@
|
||||
namespace Edgegap.Editor.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Unity default: UDP.
|
||||
/// (!) UDP !works in WebGL.
|
||||
/// </summary>
|
||||
public enum ProtocolType
|
||||
{
|
||||
/// <summary>Unity default - fastest; !works in WebGL.</summary>
|
||||
UDP,
|
||||
|
||||
/// <summary>Slower, but more reliable; works in WebGL.</summary>
|
||||
TCP,
|
||||
|
||||
/// <summary>Slower, but more reliable; works in WebGL.</summary>
|
||||
WS,
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: be5acd63e783b364ebdbb783639e2d32
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 129321
|
||||
packageName: Mirror
|
||||
packageVersion: 96.0.1
|
||||
assetPath: Assets/Mirror/Hosting/Edgegap/Editor/Api/Models/ProtocolType.cs
|
||||
uploadId: 736421
|
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d1b2a5c481353934f906c30ba047df9b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,55 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Edgegap.Editor.Api.Models.Requests
|
||||
{
|
||||
/// <summary>
|
||||
/// Request model for https://docs.edgegap.com/api/#tag/Applications/operation/application-post
|
||||
/// </summary>
|
||||
public class CreateAppRequest
|
||||
{
|
||||
#region Required
|
||||
/// <summary>*The application name.</summary>
|
||||
[JsonProperty("name")]
|
||||
public string AppName { get; set; }
|
||||
#endregion // Required
|
||||
|
||||
|
||||
#region Optional
|
||||
/// <summary>*If the application can be deployed.</summary>
|
||||
[JsonProperty("is_active")]
|
||||
public bool IsActive { get; set; }
|
||||
|
||||
/// <summary>*Image base64 string.</summary>
|
||||
[JsonProperty("image")]
|
||||
public string Image { get; set; }
|
||||
|
||||
/// <summary>If the telemetry agent is installed on the versions of this app.</summary>
|
||||
[JsonProperty("is_telemetry_agent_active")]
|
||||
public bool IsTelemetryAgentActive { get; set; }
|
||||
#endregion // Optional
|
||||
|
||||
|
||||
/// <summary>Used by Newtonsoft</summary>
|
||||
public CreateAppRequest()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Init with required info</summary>
|
||||
/// <param name="appName">The application name</param>
|
||||
/// <param name="isActive">If the application can be deployed</param>
|
||||
/// <param name="image">Image base64 string</param>
|
||||
public CreateAppRequest(
|
||||
string appName,
|
||||
bool isActive,
|
||||
string image)
|
||||
{
|
||||
this.AppName = appName;
|
||||
this.IsActive = isActive;
|
||||
this.Image = image;
|
||||
}
|
||||
|
||||
/// <summary>Parse to json str</summary>
|
||||
public override string ToString() =>
|
||||
JsonConvert.SerializeObject(this);
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0a492d7c515b8894ea30b37db6b7efe4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 129321
|
||||
packageName: Mirror
|
||||
packageVersion: 96.0.1
|
||||
assetPath: Assets/Mirror/Hosting/Edgegap/Editor/Api/Models/Requests/CreateAppRequest.cs
|
||||
uploadId: 736421
|
@ -0,0 +1,225 @@
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Edgegap.Editor.Api.Models.Requests
|
||||
{
|
||||
/// <summary>
|
||||
/// Request model for `POST v1/app/{app_name}/version`.
|
||||
/// API Doc | https://docs.edgegap.com/api/#tag/Applications/operation/app-version-post
|
||||
/// </summary>
|
||||
public class CreateAppVersionRequest
|
||||
{
|
||||
#region Required
|
||||
/// <summary>*The name of the application associated.</summary>
|
||||
[JsonIgnore] // *Path var
|
||||
public string AppName { get; set; }
|
||||
|
||||
/// <summary>*The name of the application associated.</summary>
|
||||
[JsonProperty("name")]
|
||||
public string VersionName { get; set; } = EdgegapWindowMetadata.DEFAULT_VERSION_TAG;
|
||||
|
||||
/// <summary>*The tag of your image. Default == "latest".</summary>
|
||||
/// <example>"0.1.2" || "latest" (although "latest" !recommended; use actual versions in production)</example>
|
||||
[JsonProperty("docker_tag")]
|
||||
public string DockerTag { get; set; } = EdgegapWindowMetadata.DEFAULT_VERSION_TAG;
|
||||
|
||||
/// <summary>*The name of your image.</summary>
|
||||
/// <example>"edgegap/demo" || "myCompany-someId/mylowercaseapp"</example>
|
||||
[JsonProperty("docker_image")]
|
||||
public string DockerImage { get; set; } = "";
|
||||
|
||||
/// <summary>*The Repository where the image is.</summary>
|
||||
/// <example>"registry.edgegap.com" || "harbor.edgegap.com" || "docker.io"</example>
|
||||
[JsonProperty("docker_repository")]
|
||||
public string DockerRepository { get; set; } = "";
|
||||
|
||||
/// <summary>*Units of vCPU needed (1024 = 1vcpu)</summary>
|
||||
[JsonProperty("req_cpu")]
|
||||
public int ReqCpu { get; set; } = 256;
|
||||
|
||||
/// <summary>*Units of memory in MB needed (1024 = 1 GPU)</summary>
|
||||
[JsonProperty("req_memory")]
|
||||
public int ReqMemory { get; set; } = 256;
|
||||
|
||||
/// <summary>*Required: At least 1 { Port, ProtocolStr }.</summary>
|
||||
[JsonProperty("ports")]
|
||||
public AppPortsData[] Ports { get; set; } = {};
|
||||
|
||||
/// <summary>The username to access the docker repository</summary>
|
||||
[JsonProperty("private_username")]
|
||||
public string PrivateUsername { get; set; } = "";
|
||||
|
||||
/// <summary>The Private Password or Token of the username (We recommend to use a token)</summary>
|
||||
[JsonProperty("private_token")]
|
||||
public string PrivateToken { get; set; } = "";
|
||||
#endregion // Required
|
||||
|
||||
|
||||
// #region Optional
|
||||
// [JsonProperty("is_active")]
|
||||
// public bool IsActive { get; set; } = true;
|
||||
//
|
||||
// [JsonProperty("req_video")]
|
||||
// public int ReqVideo { get; set; } = 256;
|
||||
//
|
||||
// [JsonProperty("max_duration")]
|
||||
// public int MaxDuration { get; set; } = 30;
|
||||
//
|
||||
// [JsonProperty("use_telemetry")]
|
||||
// public bool UseTelemetry { get; set; } = true;
|
||||
//
|
||||
// [JsonProperty("inject_context_env")]
|
||||
// public bool InjectContextEnv { get; set; } = true;
|
||||
//
|
||||
// [JsonProperty("whitelisting_active")]
|
||||
// public bool WhitelistingActive { get; set; } = true;
|
||||
//
|
||||
// [JsonProperty("force_cache")]
|
||||
// public bool ForceCache { get; set; }
|
||||
//
|
||||
// [JsonProperty("cache_min_hour")]
|
||||
// public int CacheMinHour { get; set; }
|
||||
//
|
||||
// [JsonProperty("cache_max_hour")]
|
||||
// public int CacheMaxHour { get; set; }
|
||||
//
|
||||
// [JsonProperty("time_to_deploy")]
|
||||
// public int TimeToDeploy { get; set; } = 15;
|
||||
//
|
||||
// [JsonProperty("enable_all_locations")]
|
||||
// public bool EnableAllLocations { get; set; }
|
||||
//
|
||||
// [JsonProperty("termination_grace_period_seconds")]
|
||||
// public int TerminationGracePeriodSeconds { get; set; } = 5;
|
||||
//
|
||||
// [JsonProperty("endpoint_storage")]
|
||||
// public string EndpointStorage { get; set; } = "";
|
||||
//
|
||||
// [JsonProperty("command")]
|
||||
// public string Command { get; set; }
|
||||
//
|
||||
// [JsonProperty("arguments")]
|
||||
// public string Arguments { get; set; }
|
||||
//
|
||||
// [JsonProperty("verify_image")]
|
||||
// public bool VerifyImage { get; set; }
|
||||
//
|
||||
// [JsonProperty("session_config")]
|
||||
// public SessionConfigData SessionConfig { get; set; } = new();
|
||||
//
|
||||
// [JsonProperty("probe")]
|
||||
// public ProbeData Probe { get; set; } = new();
|
||||
//
|
||||
// [JsonProperty("envs")]
|
||||
// public EnvsData[] Envs { get; set; } = {};
|
||||
//
|
||||
// public class SessionConfigData
|
||||
// {
|
||||
// [JsonProperty("kind")]
|
||||
// public string Kind { get; set; } = "Seat";
|
||||
//
|
||||
// [JsonProperty("sockets")]
|
||||
// public int Sockets { get; set; } = 10;
|
||||
//
|
||||
// [JsonProperty("autodeploy")]
|
||||
// public bool Autodeploy { get; set; } = true;
|
||||
//
|
||||
// [JsonProperty("empty_ttl")]
|
||||
// public int EmptyTtl { get; set; } = 60;
|
||||
//
|
||||
// [JsonProperty("session_max_duration")]
|
||||
// public int SessionMaxDuration { get; set; } = 60;
|
||||
// }
|
||||
//
|
||||
//
|
||||
// public class ProbeData
|
||||
// {
|
||||
// [JsonProperty("optimal_ping")]
|
||||
// public int OptimalPing { get; set; } = 60;
|
||||
//
|
||||
// [JsonProperty("rejected_ping")]
|
||||
// public int RejectedPing { get; set; } = 180;
|
||||
// }
|
||||
//
|
||||
// public class EnvsData
|
||||
// {
|
||||
// [JsonProperty("key")]
|
||||
// public string Key { get; set; }
|
||||
//
|
||||
// [JsonProperty("value")]
|
||||
// public string Value { get; set; }
|
||||
//
|
||||
// [JsonProperty("is_secret")]
|
||||
// public bool IsSecret { get; set; } = true;
|
||||
// }
|
||||
// #endregion // Optional
|
||||
|
||||
/// <summary>Used by Newtonsoft</summary>
|
||||
public CreateAppVersionRequest()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Init with required info.
|
||||
/// (!) If looking for refs, also see FromUpdateRequest() builder below.
|
||||
/// </summary>
|
||||
/// <param name="appName">The name of the application.</param>
|
||||
/// <param name="containerRegistryUsername"></param>
|
||||
/// <param name="containerRegistryPasswordToken"></param>
|
||||
/// <param name="portNum"></param>
|
||||
/// <param name="protocolType"></param>
|
||||
public CreateAppVersionRequest(
|
||||
string appName,
|
||||
string containerRegistryUsername,
|
||||
string containerRegistryPasswordToken,
|
||||
int portNum,
|
||||
ProtocolType protocolType)
|
||||
{
|
||||
this.AppName = appName;
|
||||
this.PrivateUsername = containerRegistryUsername;
|
||||
this.PrivateToken = containerRegistryPasswordToken;
|
||||
this.Ports = new AppPortsData[]
|
||||
{
|
||||
new AppPortsData() // MIRROR CHANGE: 'new()' not supported in Unity 2020
|
||||
{
|
||||
Port = portNum,
|
||||
ProtocolStr = protocolType.ToString(),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Port from Update PATCH model: If you tried to Update, but !exists, you probably want to create it next.
|
||||
/// </summary>
|
||||
/// <param name="updateRequest"></param>
|
||||
public static CreateAppVersionRequest FromUpdateRequest(UpdateAppVersionRequest updateRequest)
|
||||
{
|
||||
// Convert the updateRequest to JSON
|
||||
string json = JsonConvert.SerializeObject(updateRequest);
|
||||
|
||||
// Deserialize the JSON back to CreateAppVersionRequest
|
||||
CreateAppVersionRequest createReq = null;
|
||||
|
||||
try
|
||||
{
|
||||
createReq = JsonConvert.DeserializeObject<CreateAppVersionRequest>(json);
|
||||
createReq.AppName = updateRequest.AppName; // Normally JsonIgnored in Update
|
||||
createReq.VersionName = updateRequest.VersionName; // Normally JsonIgnored in Update
|
||||
createReq.PrivateUsername = updateRequest.PrivateUsername;
|
||||
createReq.PrivateToken = updateRequest.PrivateToken;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError($"Error (when parsing CreateAppVersionRequest from CreateAppVersionRequest): {e}");
|
||||
throw;
|
||||
}
|
||||
|
||||
return createReq;
|
||||
}
|
||||
|
||||
/// <summary>Parse to json str</summary>
|
||||
public override string ToString() =>
|
||||
JsonConvert.SerializeObject(this);
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0bb645e2f9d04384a85739269cc8a4e1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 129321
|
||||
packageName: Mirror
|
||||
packageVersion: 96.0.1
|
||||
assetPath: Assets/Mirror/Hosting/Edgegap/Editor/Api/Models/Requests/CreateAppVersionRequest.cs
|
||||
uploadId: 736421
|
@ -0,0 +1,62 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Edgegap.Editor.Api.Models.Requests
|
||||
{
|
||||
/// <summary>
|
||||
/// Request model for `POST v1/deploy`.
|
||||
/// API Doc | https://docs.edgegap.com/api/#tag/Deployments/operation/deploy
|
||||
/// </summary>
|
||||
public class CreateDeploymentRequest
|
||||
{
|
||||
#region Required
|
||||
/// <summary>*Required: The name of the App you want to deploy.</summary>
|
||||
[JsonProperty("app_name")]
|
||||
public string AppName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// *Required: The name of the App Version you want to deploy;
|
||||
/// if not present, the last version created is picked.
|
||||
/// </summary>
|
||||
[JsonProperty("version_name")]
|
||||
public string VersionName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// *Required: The List of IP of your user.
|
||||
/// </summary>
|
||||
[JsonProperty("ip_list")]
|
||||
public string[] IpList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// *Required: The list of IP of your user with their location (latitude, longitude).
|
||||
/// </summary>
|
||||
[JsonProperty("geo_ip_list")]
|
||||
public string[] GeoIpList { get; set; } = { };
|
||||
#endregion // Required
|
||||
|
||||
/// <summary>
|
||||
/// The list of tags assigned to the deployment
|
||||
/// </summary>
|
||||
[JsonProperty("tags")]
|
||||
public string[] Tags { get; set; } = { EdgegapWindowMetadata.DEFAULT_DEPLOYMENT_TAG };
|
||||
|
||||
/// <summary>Used by Newtonsoft</summary>
|
||||
public CreateDeploymentRequest() { }
|
||||
|
||||
/// <summary>Init with required info; used for a single external IP address.</summary>
|
||||
/// <param name="appName">The name of the application.</param>
|
||||
/// <param name="versionName">
|
||||
/// The name of the App Version you want to deploy, if not present,
|
||||
/// the last version created is picked.
|
||||
/// </param>
|
||||
/// <param name="externalIp">Obtain from IpApi.</param>
|
||||
public CreateDeploymentRequest(string appName, string versionName, string externalIp)
|
||||
{
|
||||
this.AppName = appName;
|
||||
this.VersionName = versionName;
|
||||
this.IpList = new[] { externalIp };
|
||||
}
|
||||
|
||||
/// <summary>Parse to json str</summary>
|
||||
public override string ToString() => JsonConvert.SerializeObject(this);
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aae7b317093230e419bc0f8be1097ea6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 129321
|
||||
packageName: Mirror
|
||||
packageVersion: 96.0.1
|
||||
assetPath: Assets/Mirror/Hosting/Edgegap/Editor/Api/Models/Requests/CreateDeploymentRequest.cs
|
||||
uploadId: 736421
|
@ -0,0 +1,175 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Edgegap.Editor.Api.Models.Requests
|
||||
{
|
||||
/// <summary>
|
||||
/// Request model for `PATCH v1/app/{app_name}/version/{version_name}`.
|
||||
/// Request model for https://docs.edgegap.com/api/#tag/Applications/operation/app-versions-patch
|
||||
/// TODO: Split "Create" and "Update" into their own, separate models: CTRL+F for "(!)" for more info.
|
||||
/// </summary>
|
||||
public class UpdateAppVersionRequest
|
||||
{
|
||||
#region Required
|
||||
/// <summary>*Required: The name of the application.</summary>
|
||||
[JsonIgnore] // *Path var
|
||||
public string AppName { get; set; }
|
||||
#endregion // Required
|
||||
|
||||
|
||||
#region Optional
|
||||
/// <summary>The name of the application version.</summary>
|
||||
[JsonIgnore] // *Path var
|
||||
public string VersionName { get; set; } = EdgegapWindowMetadata.DEFAULT_VERSION_TAG;
|
||||
|
||||
/// <summary>At least 1 { Port, ProtocolStr }</summary>
|
||||
[JsonProperty("ports")]
|
||||
public AppPortsData[] Ports { get; set; } = {};
|
||||
|
||||
/// <summary>The Repository where the image is.</summary>
|
||||
/// <example>"registry.edgegap.com" || "harbor.edgegap.com" || "docker.io"</example>
|
||||
[JsonProperty("docker_repository")]
|
||||
public string DockerRepository { get; set; } = "";
|
||||
|
||||
/// <summary>The name of your image.</summary>
|
||||
/// <example>"edgegap/demo" || "myCompany-someId/mylowercaseapp"</example>
|
||||
[JsonProperty("docker_image")]
|
||||
public string DockerImage { get; set; } = "";
|
||||
|
||||
/// <summary>The tag of your image. Default == "latest".</summary>
|
||||
/// <example>"0.1.2" || "latest" (although "latest" !recommended; use actual versions in production)</example>
|
||||
[JsonProperty("docker_tag")]
|
||||
public string DockerTag { get; set; } = EdgegapWindowMetadata.DEFAULT_VERSION_TAG;
|
||||
|
||||
[JsonProperty("is_active")]
|
||||
public bool IsActive { get; set; } = true;
|
||||
|
||||
[JsonProperty("private_username")]
|
||||
public string PrivateUsername { get; set; } = "";
|
||||
|
||||
[JsonProperty("private_token")]
|
||||
public string PrivateToken { get; set; } = "";
|
||||
|
||||
#region (!) Shows in API docs for PATCH, but could be CREATE only? "Unknown Args"
|
||||
// [JsonProperty("req_cpu")]
|
||||
// public int ReqCpu { get; set; } = 256;
|
||||
//
|
||||
// [JsonProperty("req_memory")]
|
||||
// public int ReqMemory { get; set; } = 256;
|
||||
//
|
||||
// [JsonProperty("req_video")]
|
||||
// public int ReqVideo { get; set; } = 256;
|
||||
#endregion // (!) Shows in API docs for PATCH, but could be CREATE only? "Unknown Args"
|
||||
|
||||
[JsonProperty("max_duration")]
|
||||
public int MaxDuration { get; set; } = 60;
|
||||
|
||||
[JsonProperty("use_telemetry")]
|
||||
public bool UseTelemetry { get; set; } = true;
|
||||
|
||||
[JsonProperty("inject_context_env")]
|
||||
public bool InjectContextEnv { get; set; } = true;
|
||||
|
||||
[JsonProperty("whitelisting_active")]
|
||||
public bool WhitelistingActive { get; set; } = false;
|
||||
|
||||
[JsonProperty("force_cache")]
|
||||
public bool ForceCache { get; set; }
|
||||
|
||||
[JsonProperty("cache_min_hour")]
|
||||
public int CacheMinHour { get; set; }
|
||||
|
||||
[JsonProperty("cache_max_hour")]
|
||||
public int CacheMaxHour { get; set; }
|
||||
|
||||
[JsonProperty("time_to_deploy")]
|
||||
public int TimeToDeploy { get; set; } = 120;
|
||||
|
||||
[JsonProperty("enable_all_locations")]
|
||||
public bool EnableAllLocations { get; set; }
|
||||
|
||||
[JsonProperty("termination_grace_period_seconds")]
|
||||
public int TerminationGracePeriodSeconds { get; set; } = 5;
|
||||
|
||||
// // (!) BUG: Expects empty string "" at minimum; however, empty string will throw server err
|
||||
// [JsonProperty("endpoint_storage")]
|
||||
// public string EndpointStorage { get; set; }
|
||||
|
||||
[JsonProperty("command")]
|
||||
public string Command { get; set; }
|
||||
|
||||
[JsonProperty("arguments")]
|
||||
public string Arguments { get; set; }
|
||||
|
||||
// /// <summary>
|
||||
// /// (!) Setting this will trigger a very specific type of game that will affect the AppVersion.
|
||||
// /// TODO: Is leaving as null the same as commenting out?
|
||||
// /// </summary>
|
||||
// [JsonProperty("session_config")]
|
||||
// public SessionConfigData SessionConfig { get; set; }
|
||||
|
||||
[JsonProperty("probe")]
|
||||
public ProbeData Probe { get; set; } = new ProbeData(); // MIRROR CHANGE: 'new()' not supported in Unity 2020
|
||||
|
||||
[JsonProperty("envs")]
|
||||
public EnvsData[] Envs { get; set; } = {};
|
||||
|
||||
public class SessionConfigData
|
||||
{
|
||||
[JsonProperty("kind")]
|
||||
public string Kind { get; set; } = "Seat";
|
||||
|
||||
[JsonProperty("sockets")]
|
||||
public int Sockets { get; set; } = 10;
|
||||
|
||||
[JsonProperty("autodeploy")]
|
||||
public bool Autodeploy { get; set; } = true;
|
||||
|
||||
[JsonProperty("empty_ttl")]
|
||||
public int EmptyTtl { get; set; } = 60;
|
||||
|
||||
[JsonProperty("session_max_duration")]
|
||||
public int SessionMaxDuration { get; set; } = 60;
|
||||
}
|
||||
|
||||
public class ProbeData
|
||||
{
|
||||
[JsonProperty("optimal_ping")]
|
||||
public int OptimalPing { get; set; } = 60;
|
||||
|
||||
[JsonProperty("rejected_ping")]
|
||||
public int RejectedPing { get; set; } = 180;
|
||||
}
|
||||
|
||||
public class EnvsData
|
||||
{
|
||||
[JsonProperty("key")]
|
||||
public string Key { get; set; }
|
||||
|
||||
[JsonProperty("value")]
|
||||
public string Value { get; set; }
|
||||
|
||||
[JsonProperty("is_secret")]
|
||||
public bool IsSecret { get; set; } = true;
|
||||
}
|
||||
#endregion // Optional
|
||||
|
||||
/// <summary>Used by Newtonsoft</summary>
|
||||
public UpdateAppVersionRequest()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Init with required info. Default version/tag == "default".
|
||||
/// Since we're updating, we only require the AppName.
|
||||
/// </summary>
|
||||
/// <param name="appName">The name of the application.</param>
|
||||
public UpdateAppVersionRequest(string appName)
|
||||
{
|
||||
this.AppName = appName;
|
||||
}
|
||||
|
||||
/// <summary>Parse to json str</summary>
|
||||
public override string ToString() =>
|
||||
JsonConvert.SerializeObject(this);
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8da9712633ee1e64faca0b960d4bed31
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 129321
|
||||
packageName: Mirror
|
||||
packageVersion: 96.0.1
|
||||
assetPath: Assets/Mirror/Hosting/Edgegap/Editor/Api/Models/Requests/UpdateAppVersionRequest.cs
|
||||
uploadId: 736421
|
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aa4ceffbc97b8254885a63937def2324
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,53 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Edgegap.Editor.Api.Models.Results
|
||||
{
|
||||
/// <summary>
|
||||
/// Result model for `POST v1/deploy`.
|
||||
/// </summary>
|
||||
public class CreateDeploymentResult
|
||||
{
|
||||
[JsonProperty("request_id")]
|
||||
public string RequestId { get; set; }
|
||||
|
||||
[JsonProperty("request_dns")]
|
||||
public string RequestDns { get; set; }
|
||||
|
||||
[JsonProperty("request_app")]
|
||||
public string RequestApp { get; set; }
|
||||
|
||||
[JsonProperty("request_version")]
|
||||
public string RequestVersion { get; set; }
|
||||
|
||||
[JsonProperty("request_user_count")]
|
||||
public int RequestUserCount { get; set; }
|
||||
|
||||
[JsonProperty("city")]
|
||||
public string City { get; set; }
|
||||
|
||||
[JsonProperty("country")]
|
||||
public string Country { get; set; }
|
||||
|
||||
[JsonProperty("continent")]
|
||||
public string Continent { get; set; }
|
||||
|
||||
[JsonProperty("administrative_division")]
|
||||
public string AdministrativeDivision { get; set; }
|
||||
|
||||
[JsonProperty("tags")]
|
||||
public string[] Tags { get; set; }
|
||||
|
||||
[JsonProperty("container_log_storage")]
|
||||
public ContainerLogStorageData ContainerLogStorage { get; set; }
|
||||
|
||||
|
||||
public class ContainerLogStorageData
|
||||
{
|
||||
[JsonProperty("enabled")]
|
||||
public bool Enabled { get; set; }
|
||||
|
||||
[JsonProperty("endpoint_storage")]
|
||||
public string EndpointStorage { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8361abc6f84fccd4cba26dc285d335dd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 129321
|
||||
packageName: Mirror
|
||||
packageVersion: 96.0.1
|
||||
assetPath: Assets/Mirror/Hosting/Edgegap/Editor/Api/Models/Results/CreateDeploymentResult.cs
|
||||
uploadId: 736421
|
@ -0,0 +1,12 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Edgegap.Editor.Api.Models.Results
|
||||
{
|
||||
/// <summary>Edgegap error, generally just containing `message`</summary>
|
||||
public class EdgegapErrorResult
|
||||
{
|
||||
/// <summary>Friendly, UI-facing error message from Edgegap; can be lengthy.</summary>
|
||||
[JsonProperty("message")]
|
||||
public string ErrorMessage { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5b29093cb10cf3040b76f4fbe77a435d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 129321
|
||||
packageName: Mirror
|
||||
packageVersion: 96.0.1
|
||||
assetPath: Assets/Mirror/Hosting/Edgegap/Editor/Api/Models/Results/EdgegapErrorResult.cs
|
||||
uploadId: 736421
|
@ -0,0 +1,120 @@
|
||||
using System;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Edgegap.Editor.Api.Models.Results
|
||||
{
|
||||
/// <summary>
|
||||
/// Wraps the inner json data with outer http info.
|
||||
/// This class overload contains no json-deserialiable data result.
|
||||
/// </summary>
|
||||
public class EdgegapHttpResult
|
||||
{
|
||||
/// <summary>HTTP Status code for the request.</summary>
|
||||
public HttpStatusCode StatusCode { get; }
|
||||
|
||||
/// <summary>This could be err, success, or null.</summary>
|
||||
public string Json { get; }
|
||||
|
||||
/// <summary>eg: "POST"</summary>
|
||||
public HttpMethod HttpMethod;
|
||||
|
||||
/// <summary>
|
||||
/// Typically is sent by servers together with the status code.
|
||||
/// Useful for fallback err descriptions, often based on the status code.
|
||||
/// </summary>
|
||||
public string ReasonPhrase { get; }
|
||||
|
||||
/// <summary>Contains `message` with friendly info.</summary>
|
||||
public bool HasErr => Error != null;
|
||||
public EdgegapErrorResult Error
|
||||
{
|
||||
get { return JsonConvert.DeserializeObject<EdgegapErrorResult>(Json); }
|
||||
}
|
||||
|
||||
#region Common Shortcuts
|
||||
/// <summary>OK</summary>
|
||||
public bool IsResultCode200 => StatusCode == HttpStatusCode.OK;
|
||||
|
||||
/// <summary>NoContent</summary>
|
||||
public bool IsResultCode204 => StatusCode == HttpStatusCode.NoContent;
|
||||
|
||||
/// <summary>Forbidden</summary>
|
||||
public bool IsResultCode403 => StatusCode == HttpStatusCode.Forbidden;
|
||||
|
||||
/// <summary>Conflict</summary>
|
||||
public bool IsResultCode409 => StatusCode == HttpStatusCode.Conflict;
|
||||
|
||||
/// <summary>BadRequest</summary>
|
||||
public bool IsResultCode400 => StatusCode == HttpStatusCode.BadRequest;
|
||||
|
||||
/// <summary>Gone</summary>
|
||||
public bool IsResultCode410 => StatusCode == HttpStatusCode.Gone;
|
||||
#endregion // Common Shortcuts
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Constructor that initializes the class based on an HttpResponseMessage.
|
||||
/// </summary>
|
||||
public EdgegapHttpResult(HttpResponseMessage httpResponse)
|
||||
{
|
||||
this.ReasonPhrase = httpResponse.ReasonPhrase;
|
||||
this.StatusCode = httpResponse.StatusCode;
|
||||
|
||||
try
|
||||
{
|
||||
// TODO: This can be read async with `await`, but can't do this in a Constructor.
|
||||
// Instead, make a factory builder Task =>
|
||||
Json = httpResponse.Content.ReadAsStringAsync().Result;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError(
|
||||
$"Couldn't parse error response. HTTP {httpResponse.StatusCode}.\n{e}"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Wraps the inner json data with outer http info.
|
||||
/// This class overload contains json-deserialiable data result.
|
||||
/// </summary>
|
||||
public class EdgegapHttpResult<TResult> : EdgegapHttpResult
|
||||
{
|
||||
/// <summary>The actual result model from Json. Could be null!</summary>
|
||||
public TResult Data { get; set; }
|
||||
|
||||
public EdgegapHttpResult(HttpResponseMessage httpResponse, bool isLogLevelDebug = false)
|
||||
: base(httpResponse)
|
||||
{
|
||||
this.HttpMethod = httpResponse.RequestMessage.Method;
|
||||
|
||||
// Assuming JSON content and using Newtonsoft.Json for deserialization
|
||||
bool isDeserializable =
|
||||
httpResponse.Content != null
|
||||
&& httpResponse.Content.Headers.ContentType.MediaType == "application/json";
|
||||
|
||||
if (isDeserializable)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.Data = JsonConvert.DeserializeObject<TResult>(Json);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError(
|
||||
$"Error (deserializing EdgegapHttpResult.Data): {e} - json: {Json}"
|
||||
);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
if (isLogLevelDebug)
|
||||
UnityEngine.Debug.Log($"{typeof(TResult).Name} result: {JObject.Parse(Json)}"); // Prettified
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 888bfc2c113487b44a3103648d2c2ae3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 129321
|
||||
packageName: Mirror
|
||||
packageVersion: 96.0.1
|
||||
assetPath: Assets/Mirror/Hosting/Edgegap/Editor/Api/Models/Results/EdgegapHttpResult.cs
|
||||
uploadId: 736421
|
@ -0,0 +1,15 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Edgegap.Editor.Api.Models.Results
|
||||
{
|
||||
/// <summary>
|
||||
/// Result model for `[GET] v1/app/{app_name}/versions`.
|
||||
/// GET API Doc | https://docs.edgegap.com/api/#tag/Applications/operation/app-versions-get
|
||||
/// </summary>
|
||||
public class GetAppVersionsResult
|
||||
{
|
||||
[JsonProperty("versions")]
|
||||
public List<VersionData> Versions { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 39dff8eb2a96db14581701965c2663c2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 129321
|
||||
packageName: Mirror
|
||||
packageVersion: 96.0.1
|
||||
assetPath: Assets/Mirror/Hosting/Edgegap/Editor/Api/Models/Results/GetAppVersionsResult.cs
|
||||
uploadId: 736421
|
@ -0,0 +1,15 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Edgegap.Editor.Api.Models.Results
|
||||
{
|
||||
/// <summary>
|
||||
/// Result model for `[GET] v1/apps`.
|
||||
/// GET API Doc | https://docs.edgegap.com/api/#tag/Applications/operation/applications-get
|
||||
/// </summary>
|
||||
public class GetAppsResult
|
||||
{
|
||||
[JsonProperty("applications")]
|
||||
public List<GetCreateAppResult> Applications { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 88f306b7c80ebad4eada4c62e875d2a6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 129321
|
||||
packageName: Mirror
|
||||
packageVersion: 96.0.1
|
||||
assetPath: Assets/Mirror/Hosting/Edgegap/Editor/Api/Models/Results/GetAppsResult.cs
|
||||
uploadId: 736421
|
@ -0,0 +1,31 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Edgegap.Editor.Api.Models.Results
|
||||
{
|
||||
/// <summary>
|
||||
/// Result model for `[GET | POST] v1/app`.
|
||||
/// POST API Doc | https://docs.edgegap.com/api/#tag/Applications/operation/application-post
|
||||
/// GET API Doc | https://docs.edgegap.com/api/#tag/Applications/operation/application-get
|
||||
/// </summary>
|
||||
public class GetCreateAppResult
|
||||
{
|
||||
[JsonProperty("name")]
|
||||
public string AppName { get; set; }
|
||||
|
||||
[JsonProperty("is_active")]
|
||||
public bool IsActive { get; set; }
|
||||
|
||||
/// <summary>Optional</summary>
|
||||
[JsonProperty("is_telemetry_agent_active")]
|
||||
public bool IsTelemetryAgentActive { get; set; }
|
||||
|
||||
[JsonProperty("image")]
|
||||
public string Image { get; set; }
|
||||
|
||||
[JsonProperty("create_time")]
|
||||
public string CreateTimeStr { get; set; }
|
||||
|
||||
[JsonProperty("last_updated")]
|
||||
public string LastUpdatedStr { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a66c935238edd8846b1e9e9e19cfab70
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 129321
|
||||
packageName: Mirror
|
||||
packageVersion: 96.0.1
|
||||
assetPath: Assets/Mirror/Hosting/Edgegap/Editor/Api/Models/Results/GetCreateAppResult.cs
|
||||
uploadId: 736421
|
@ -0,0 +1,20 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Edgegap.Editor.Api.Models.Results
|
||||
{
|
||||
/// <summary>
|
||||
/// Result model of a deployment for `GET v1/deployments`.
|
||||
/// API Doc | https://docs.edgegap.com/api/#tag/Deployments/operation/deployments-get
|
||||
/// </summary>
|
||||
public class GetDeploymentResult
|
||||
{
|
||||
[JsonProperty("request_id")]
|
||||
public string RequestId { get; set; }
|
||||
|
||||
[JsonProperty("ready")]
|
||||
public bool Ready { get; set; }
|
||||
|
||||
[JsonProperty("tags")]
|
||||
public string[] Tags { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 87df84c48a738aa48b66d0c42aacb3db
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 129321
|
||||
packageName: Mirror
|
||||
packageVersion: 96.0.1
|
||||
assetPath: Assets/Mirror/Hosting/Edgegap/Editor/Api/Models/Results/GetDeploymentResult.cs
|
||||
uploadId: 736421
|
@ -0,0 +1,89 @@
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Edgegap.Editor.Api.Models.Results
|
||||
{
|
||||
/// <summary>
|
||||
/// Result model for `GET v1/status/{request_id}`.
|
||||
/// API Doc | https://docs.edgegap.com/api/#tag/Deployments/operation/deployment-status-get
|
||||
/// </summary>
|
||||
public class GetDeploymentStatusResult
|
||||
{
|
||||
[JsonProperty("request_id")]
|
||||
public string RequestId { get; set; }
|
||||
|
||||
[JsonProperty("fqdn")]
|
||||
public string Fqdn { get; set; }
|
||||
|
||||
[JsonProperty("app_name")]
|
||||
public string AppName { get; set; }
|
||||
|
||||
[JsonProperty("app_version")]
|
||||
public string AppVersion { get; set; }
|
||||
|
||||
[JsonProperty("current_status")]
|
||||
public string CurrentStatus { get; set; }
|
||||
|
||||
[JsonProperty("running")]
|
||||
public bool Running { get; set; }
|
||||
|
||||
[JsonProperty("whitelisting_active")]
|
||||
public bool WhitelistingActive { get; set; }
|
||||
|
||||
[JsonProperty("start_time")]
|
||||
public string StartTime { get; set; }
|
||||
|
||||
[JsonProperty("removal_time")]
|
||||
public string RemovalTime { get; set; }
|
||||
|
||||
[JsonProperty("elapsed_time")]
|
||||
public int? ElapsedTime { get; set; }
|
||||
|
||||
[JsonProperty("last_status")]
|
||||
public string LastStatus { get; set; }
|
||||
|
||||
[JsonProperty("error")]
|
||||
public bool Error { get; set; }
|
||||
|
||||
[JsonProperty("error_detail")]
|
||||
public string ErrorDetail { get; set; }
|
||||
|
||||
[JsonProperty("public_ip")]
|
||||
public string PublicIp { get; set; }
|
||||
|
||||
[JsonProperty("sessions")]
|
||||
public SessionData[] Sessions { get; set; }
|
||||
|
||||
[JsonProperty("location")]
|
||||
public LocationData Location { get; set; }
|
||||
|
||||
[JsonProperty("tags")]
|
||||
public string[] Tags { get; set; }
|
||||
|
||||
[JsonProperty("sockets")]
|
||||
public string Sockets { get; set; }
|
||||
|
||||
[JsonProperty("sockets_usage")]
|
||||
public string SocketsUsage { get; set; }
|
||||
|
||||
[JsonProperty("command")]
|
||||
public string Command { get; set; }
|
||||
|
||||
[JsonProperty("arguments")]
|
||||
public string Arguments { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// TODO: Server should swap `ports` to an array of DeploymentPortsData (instead of an object of dynamic unknown objects).
|
||||
/// <example>
|
||||
/// {
|
||||
/// "7777", {}
|
||||
/// },
|
||||
/// {
|
||||
/// "Some Port Name", {}
|
||||
/// }
|
||||
/// </example>
|
||||
/// </summary>
|
||||
[JsonProperty("ports")]
|
||||
public Dictionary<string, DeploymentPortsData> PortsDict { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c658b7f5c5d5d0648934b0ae1d71de9a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 129321
|
||||
packageName: Mirror
|
||||
packageVersion: 96.0.1
|
||||
assetPath: Assets/Mirror/Hosting/Edgegap/Editor/Api/Models/Results/GetDeploymentStatusResult.cs
|
||||
uploadId: 736421
|
@ -0,0 +1,14 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Edgegap.Editor.Api.Models.Results
|
||||
{
|
||||
/// <summary>
|
||||
/// Result model for `GET v1/deployments`.
|
||||
/// API Doc | https://docs.edgegap.com/api/#tag/Deployments/operation/deployments-get
|
||||
/// </summary>
|
||||
public class GetDeploymentsResult
|
||||
{
|
||||
[JsonProperty("data")]
|
||||
public GetDeploymentResult[] Data { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d39faf2ee20bb0647b63b9b72910d2c8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 129321
|
||||
packageName: Mirror
|
||||
packageVersion: 96.0.1
|
||||
assetPath: Assets/Mirror/Hosting/Edgegap/Editor/Api/Models/Results/GetDeploymentsResult.cs
|
||||
uploadId: 736421
|
@ -0,0 +1,22 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Edgegap.Editor.Api.Models.Results
|
||||
{
|
||||
/// <summary>
|
||||
/// Result model for `GET v1/wizard/registry-credentials`.
|
||||
/// </summary>
|
||||
public class GetRegistryCredentialsResult
|
||||
{
|
||||
[JsonProperty("registry_url")]
|
||||
public string RegistryUrl { get; set; }
|
||||
|
||||
[JsonProperty("project")]
|
||||
public string Project { get; set; }
|
||||
|
||||
[JsonProperty("username")]
|
||||
public string Username { get; set; }
|
||||
|
||||
[JsonProperty("token")]
|
||||
public string Token { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8e6af130c329d2b43b2f4b0dc8639477
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 129321
|
||||
packageName: Mirror
|
||||
packageVersion: 96.0.1
|
||||
assetPath: Assets/Mirror/Hosting/Edgegap/Editor/Api/Models/Results/GetRegistryCredentialsResult.cs
|
||||
uploadId: 736421
|
@ -0,0 +1,14 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Edgegap.Editor.Api.Models.Results
|
||||
{
|
||||
/// <summary>
|
||||
/// Result model for `GET v1/ip`.
|
||||
/// GET API Doc | https://docs.edgegap.com/api/#tag/IP-Lookup/operation/IP
|
||||
/// </summary>
|
||||
public class GetYourPublicIpResult
|
||||
{
|
||||
[JsonProperty("public_ip")]
|
||||
public string PublicIp { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 73c9651ef0fdfcb449ec0120016963a0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 129321
|
||||
packageName: Mirror
|
||||
packageVersion: 96.0.1
|
||||
assetPath: Assets/Mirror/Hosting/Edgegap/Editor/Api/Models/Results/GetYourPublicIpResult.cs
|
||||
uploadId: 736421
|
@ -0,0 +1,84 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Edgegap.Editor.Api.Models.Results
|
||||
{
|
||||
public class StopActiveDeploymentResult
|
||||
{
|
||||
[JsonProperty("message")]
|
||||
public string Message { get; set; }
|
||||
|
||||
[JsonProperty("deployment_summary")]
|
||||
public DeploymentSummaryData DeploymentSummary { get; set; }
|
||||
|
||||
public class DeploymentSummaryData
|
||||
{
|
||||
[JsonProperty("request_id")]
|
||||
public string RequestId { get; set; }
|
||||
|
||||
[JsonProperty("fqdn")]
|
||||
public string Fqdn { get; set; }
|
||||
|
||||
[JsonProperty("app_name")]
|
||||
public string AppName { get; set; }
|
||||
|
||||
[JsonProperty("app_version")]
|
||||
public string AppVersion { get; set; }
|
||||
|
||||
[JsonProperty("current_status")]
|
||||
public string CurrentStatus { get; set; }
|
||||
|
||||
[JsonProperty("running")]
|
||||
public bool Running { get; set; }
|
||||
|
||||
[JsonProperty("whitelisting_active")]
|
||||
public bool WhitelistingActive { get; set; }
|
||||
|
||||
[JsonProperty("start_time")]
|
||||
public string StartTime { get; set; }
|
||||
|
||||
[JsonProperty("removal_time")]
|
||||
public string RemovalTime { get; set; }
|
||||
|
||||
[JsonProperty("elapsed_time")]
|
||||
public int? ElapsedTime { get; set; }
|
||||
|
||||
[JsonProperty("last_status")]
|
||||
public string LastStatus { get; set; }
|
||||
|
||||
[JsonProperty("error")]
|
||||
public bool Error { get; set; }
|
||||
|
||||
[JsonProperty("error_detail")]
|
||||
public string ErrorDetail { get; set; }
|
||||
|
||||
[JsonProperty("ports")]
|
||||
public PortsData Ports { get; set; }
|
||||
|
||||
[JsonProperty("public_ip")]
|
||||
public string PublicIp { get; set; }
|
||||
|
||||
[JsonProperty("sessions")]
|
||||
public SessionData[] Sessions { get; set; }
|
||||
|
||||
[JsonProperty("location")]
|
||||
public LocationData Location { get; set; }
|
||||
|
||||
[JsonProperty("tags")]
|
||||
public string[] Tags { get; set; }
|
||||
|
||||
[JsonProperty("sockets")]
|
||||
public string Sockets { get; set; }
|
||||
|
||||
[JsonProperty("sockets_usage")]
|
||||
public string SocketsUsage { get; set; }
|
||||
|
||||
[JsonProperty("command")]
|
||||
public string Command { get; set; }
|
||||
|
||||
[JsonProperty("arguments")]
|
||||
public string Arguments { get; set; }
|
||||
}
|
||||
|
||||
public class PortsData { }
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9e2e4d9424ca8f7459803e631acf912f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 129321
|
||||
packageName: Mirror
|
||||
packageVersion: 96.0.1
|
||||
assetPath: Assets/Mirror/Hosting/Edgegap/Editor/Api/Models/Results/StopActiveDeploymentResult.cs
|
||||
uploadId: 736421
|
@ -0,0 +1,165 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Edgegap.Editor.Api.Models.Results
|
||||
{
|
||||
/// <summary>
|
||||
/// Result model for:
|
||||
/// - `POST 1/app/{app_name}/version`
|
||||
/// - `PATCH v1/app/{app_name}/version/{version_name}`
|
||||
/// POST API Doc | https://docs.edgegap.com/api/#tag/Applications/operation/application-post
|
||||
/// PATCH API Doc | https://docs.edgegap.com/api/#tag/Applications/operation/app-versions-patch
|
||||
/// </summary>
|
||||
public class UpsertAppVersionResult
|
||||
{
|
||||
[JsonProperty("success")]
|
||||
public bool Success { get; set; }
|
||||
|
||||
[JsonProperty("version")]
|
||||
public VersionData Version { get; set; }
|
||||
|
||||
public class VersionData
|
||||
{
|
||||
[JsonProperty("name")]
|
||||
public string VersionName { get; set; }
|
||||
|
||||
[JsonProperty("is_active")]
|
||||
public bool IsActive { get; set; }
|
||||
|
||||
[JsonProperty("docker_repository")]
|
||||
public string DockerRepository { get; set; }
|
||||
|
||||
[JsonProperty("docker_image")]
|
||||
public string DockerImage { get; set; }
|
||||
|
||||
[JsonProperty("docker_tag")]
|
||||
public string DockerTag { get; set; }
|
||||
|
||||
[JsonProperty("private_username")]
|
||||
public string PrivateUsername { get; set; }
|
||||
|
||||
[JsonProperty("private_token")]
|
||||
public string PrivateToken { get; set; }
|
||||
|
||||
[JsonProperty("req_cpu")]
|
||||
public int? ReqCpu { get; set; }
|
||||
|
||||
[JsonProperty("req_memory")]
|
||||
public int? ReqMemory { get; set; }
|
||||
|
||||
[JsonProperty("req_video")]
|
||||
public int? ReqVideo { get; set; }
|
||||
|
||||
[JsonProperty("max_duration")]
|
||||
public int? MaxDuration { get; set; }
|
||||
|
||||
[JsonProperty("use_telemetry")]
|
||||
public bool UseTelemetry { get; set; }
|
||||
|
||||
[JsonProperty("inject_context_env")]
|
||||
public bool InjectContextEnv { get; set; }
|
||||
|
||||
[JsonProperty("whitelisting_active")]
|
||||
public bool WhitelistingActive { get; set; }
|
||||
|
||||
[JsonProperty("force_cache")]
|
||||
public bool ForceCache { get; set; }
|
||||
|
||||
[JsonProperty("cache_min_hour")]
|
||||
public int? CacheMinHour { get; set; }
|
||||
|
||||
[JsonProperty("cache_max_hour")]
|
||||
public int? CacheMaxHour { get; set; }
|
||||
|
||||
[JsonProperty("time_to_deploy")]
|
||||
public int? TimeToDeploy { get; set; }
|
||||
|
||||
[JsonProperty("enable_all_locations")]
|
||||
public bool EnableAllLocations { get; set; }
|
||||
|
||||
[JsonProperty("session_config")]
|
||||
public SessionConfigData SessionConfig { get; set; }
|
||||
|
||||
[JsonProperty("ports")]
|
||||
public PortsData[] Ports { get; set; }
|
||||
|
||||
[JsonProperty("probe")]
|
||||
public ProbeData Probe { get; set; }
|
||||
|
||||
[JsonProperty("envs")]
|
||||
public EnvsData[] Envs { get; set; }
|
||||
|
||||
[JsonProperty("verify_image")]
|
||||
public bool VerifyImage { get; set; }
|
||||
|
||||
[JsonProperty("termination_grace_period_seconds")]
|
||||
public int? TerminationGracePeriodSeconds { get; set; }
|
||||
|
||||
[JsonProperty("endpoint_storage")]
|
||||
public string EndpointStorage { get; set; }
|
||||
|
||||
[JsonProperty("command")]
|
||||
public string Command { get; set; }
|
||||
|
||||
[JsonProperty("arguments")]
|
||||
public string Arguments { get; set; }
|
||||
}
|
||||
|
||||
public class SessionConfigData
|
||||
{
|
||||
[JsonProperty("kind")]
|
||||
public string Kind { get; set; }
|
||||
|
||||
[JsonProperty("sockets")]
|
||||
public int? Sockets { get; set; }
|
||||
|
||||
[JsonProperty("autodeploy")]
|
||||
public bool Autodeploy { get; set; }
|
||||
|
||||
[JsonProperty("empty_ttl")]
|
||||
public int? EmptyTtl { get; set; }
|
||||
|
||||
[JsonProperty("session_max_duration")]
|
||||
public int? SessionMaxDuration { get; set; }
|
||||
}
|
||||
|
||||
public class PortsData
|
||||
{
|
||||
[JsonProperty("port")]
|
||||
public int? Port { get; set; }
|
||||
|
||||
[JsonProperty("protocol")]
|
||||
public string Protocol { get; set; }
|
||||
|
||||
[JsonProperty("to_check")]
|
||||
public bool ToCheck { get; set; }
|
||||
|
||||
[JsonProperty("tls_upgrade")]
|
||||
public bool TlsUpgrade { get; set; }
|
||||
|
||||
[JsonProperty("name")]
|
||||
public string PortName { get; set; }
|
||||
}
|
||||
|
||||
public class ProbeData
|
||||
{
|
||||
[JsonProperty("optimal_ping")]
|
||||
public int? OptimalPing { get; set; }
|
||||
|
||||
[JsonProperty("rejected_ping")]
|
||||
public int? RejectedPing { get; set; }
|
||||
}
|
||||
|
||||
public class EnvsData
|
||||
{
|
||||
[JsonProperty("key")]
|
||||
public string Key { get; set; }
|
||||
|
||||
[JsonProperty("value")]
|
||||
public string Value { get; set; }
|
||||
|
||||
[JsonProperty("is_secret")]
|
||||
public bool IsSecret { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a7dde7d59c66d8c44b86af35e853f9f5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 129321
|
||||
packageName: Mirror
|
||||
packageVersion: 96.0.1
|
||||
assetPath: Assets/Mirror/Hosting/Edgegap/Editor/Api/Models/Results/UpsertAppVersionResult.cs
|
||||
uploadId: 736421
|
@ -0,0 +1,28 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Edgegap.Editor.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Shared model for `GetDeploymentStatusResult`, `StopActiveDeploymentResult`.
|
||||
/// </summary>
|
||||
public class SessionData
|
||||
{
|
||||
[JsonProperty("session_id")]
|
||||
public string SessionId { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public string Status { get; set; }
|
||||
|
||||
[JsonProperty("ready")]
|
||||
public bool Ready { get; set; }
|
||||
|
||||
[JsonProperty("linked")]
|
||||
public bool Linked { get; set; }
|
||||
|
||||
[JsonProperty("kind")]
|
||||
public string Kind { get; set; }
|
||||
|
||||
[JsonProperty("user_count")]
|
||||
public string UserCount { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5f9024e4ca5438e4788e461387313531
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 129321
|
||||
packageName: Mirror
|
||||
packageVersion: 96.0.1
|
||||
assetPath: Assets/Mirror/Hosting/Edgegap/Editor/Api/Models/SessionData.cs
|
||||
uploadId: 736421
|
@ -0,0 +1,13 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Edgegap.Editor.Api.Models
|
||||
{
|
||||
public class VersionData
|
||||
{
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[JsonProperty("is_active")]
|
||||
public bool IsActive { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7dfe72e265bef484ea78bd7e105e0e77
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 129321
|
||||
packageName: Mirror
|
||||
packageVersion: 96.0.1
|
||||
assetPath: Assets/Mirror/Hosting/Edgegap/Editor/Api/Models/VersionData.cs
|
||||
uploadId: 736421
|
Reference in New Issue
Block a user