diff --git a/common/src/models/project.rs b/common/src/models/project.rs index 249ebb230..e31fcc1cc 100644 --- a/common/src/models/project.rs +++ b/common/src/models/project.rs @@ -26,8 +26,9 @@ pub struct ProjectResponse { /// Team project belongs to pub team_id: Option, pub created_at: DateTime, + pub compute_type: Option, pub compute_tier: Option, - /// State of the current deployment if one exists (something has been deployed). + /// State of the current deployment if one exists (something has been deployed) pub deployment_state: Option, /// URIs where running deployments can be reached pub uris: Vec, @@ -47,6 +48,22 @@ impl ProjectResponse { self.team_id.as_deref().unwrap_or("N/A") ) .unwrap(); + writeln!( + &mut s, + " Compute type: {}", + self.compute_type + .map(|c| c.to_string()) + .unwrap_or("N/A".to_owned()) + ) + .unwrap(); + writeln!( + &mut s, + " Compute tier: {}", + self.compute_tier + .map(|c| c.to_string()) + .unwrap_or("N/A".to_owned()) + ) + .unwrap(); writeln!( &mut s, " Created: {}", @@ -83,6 +100,8 @@ pub struct ProjectUpdateRequest { pub remove_from_team: Option, /// Change compute tier pub compute_tier: Option, + /// Change compute type + pub compute_type: Option, } #[derive( @@ -100,3 +119,12 @@ pub enum ComputeTier { XL, XXL, } + +#[derive(Debug, Clone, Copy, PartialEq, Eq, Display, Serialize, Deserialize, EnumString)] +#[serde(rename_all = "lowercase")] +#[strum(serialize_all = "lowercase")] +#[typeshare::typeshare] +pub enum ComputeType { + Fargate, + FargateSpot, +} diff --git a/common/types.ts b/common/types.ts index 05a080f06..1a5de0961 100644 --- a/common/types.ts +++ b/common/types.ts @@ -166,6 +166,11 @@ export interface ProjectCreateRequest { name: string; } +export enum ComputeType { + Fargate = "fargate", + FargateSpot = "fargatespot", +} + export enum ComputeTier { XS = "xs", S = "s", @@ -184,8 +189,9 @@ export interface ProjectResponse { /** Team project belongs to */ team_id?: string; created_at: string; + compute_type?: ComputeType; compute_tier?: ComputeTier; - /** State of the current deployment if one exists (something has been deployed). */ + /** State of the current deployment if one exists (something has been deployed) */ deployment_state?: DeploymentState; /** URIs where running deployments can be reached */ uris: string[]; @@ -207,6 +213,8 @@ export interface ProjectUpdateRequest { remove_from_team?: boolean; /** Change compute tier */ compute_tier?: ComputeTier; + /** Change compute type */ + compute_type?: ComputeType; } export enum ResourceType {