Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(common): project compute type, proxy type #1990

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 49 additions & 1 deletion common/src/models/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ pub struct ProjectResponse {
/// Team project belongs to
pub team_id: Option<String>,
pub created_at: DateTime<Utc>,
pub compute_type: Option<ComputeType>,
pub compute_tier: Option<ComputeTier>,
/// State of the current deployment if one exists (something has been deployed).
pub proxy_type: Option<ProxyType>,
/// State of the current deployment if one exists (something has been deployed)
pub deployment_state: Option<DeploymentState>,
/// URIs where running deployments can be reached
pub uris: Vec<String>,
Expand All @@ -47,6 +49,30 @@ 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,
" Proxy type: {}",
self.proxy_type
.map(|c| c.to_string())
.unwrap_or("N/A".to_owned())
)
.unwrap();
writeln!(
&mut s,
" Created: {}",
Expand Down Expand Up @@ -83,6 +109,10 @@ pub struct ProjectUpdateRequest {
pub remove_from_team: Option<bool>,
/// Change compute tier
pub compute_tier: Option<ComputeTier>,
/// Change compute type
pub compute_type: Option<ComputeType>,
/// Change proxy type
pub proxy_type: Option<ProxyType>,
}

#[derive(
Expand All @@ -100,3 +130,21 @@ 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,
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Display, Serialize, Deserialize, EnumString)]
#[serde(rename_all = "lowercase")]
#[strum(serialize_all = "lowercase")]
#[typeshare::typeshare]
pub enum ProxyType {
ShuttleProxy,
AwsAlb,
}
18 changes: 17 additions & 1 deletion common/types.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.