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

476 split environmental impact by k8s #477

Open
wants to merge 2 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
149 changes: 149 additions & 0 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions cloud-scanner-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ rocket = { version = "0.5.0", default-features = false, features = [
rocket_okapi = { version = "0.8.0", features = ["swagger", "rapidoc"] }
aws-types = "1"
thiserror = "1.0.57"
openssl = { version = "0.10", features = ["vendored"] }
prometheus-http-query = "0.8.2"

[dependencies.boavizta_api_sdk]
version = "1.2.0"
Expand Down
1 change: 1 addition & 0 deletions cloud-scanner-cli/src/aws_cloud_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ impl AwsCloudProvider {
location: location.clone(),
resource_details: ResourceDetails::Instance {
instance_type: instance.instance_type().unwrap().as_str().to_owned(),
private_ip_dns_name: instance.private_dns_name.unwrap().as_str().to_owned(),
usage: Some(usage),
},

Expand Down
10 changes: 10 additions & 0 deletions cloud-scanner-cli/src/boavizta_api_v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ impl BoaviztaApiV1 {
match resource_details {
ResourceDetails::Instance {
instance_type,
private_ip_dns_name,
usage,
} => {
let mut usage_cloud: UsageCloud = UsageCloud::new();
Expand Down Expand Up @@ -242,6 +243,7 @@ pub fn boa_impacts_to_cloud_resource_with_impacts(
match resource_details {
ResourceDetails::Instance {
instance_type: _,
private_ip_dns_name: _,
usage: _,
} => {
resource_impacts = Some(ImpactsValues {
Expand Down Expand Up @@ -339,6 +341,7 @@ mod tests {
location: UsageLocation::try_from("eu-west-3").unwrap(),
resource_details: ResourceDetails::Instance {
instance_type: "m6g.xlarge".to_string(),
private_ip_dns_name: "ip-XXXXXX.eu-west-1.compute.internal".to_string(),
usage: Some(InstanceUsage {
average_cpu_load: 100.0,
usage_duration_seconds: 3600,
Expand Down Expand Up @@ -424,6 +427,7 @@ mod tests {
location: UsageLocation::try_from("eu-west-3").unwrap(),
resource_details: ResourceDetails::Instance {
instance_type: "m6g.xlarge".to_string(),
private_ip_dns_name: "ip-XXXXXX.eu-west-1.compute.internal".to_string(),
usage: Some(InstanceUsage {
average_cpu_load: 100.0,
usage_duration_seconds: 3600,
Expand All @@ -439,6 +443,7 @@ mod tests {
location: UsageLocation::try_from("eu-west-3").unwrap(),
resource_details: ResourceDetails::Instance {
instance_type: "m6g.xlarge".to_string(),
private_ip_dns_name: "ip-XXXXXX.eu-west-1.compute.internal".to_string(),
usage: Some(InstanceUsage {
average_cpu_load: 1.0,
usage_duration_seconds: 3600,
Expand Down Expand Up @@ -476,6 +481,7 @@ mod tests {
location: UsageLocation::try_from("eu-west-3").unwrap(),
resource_details: ResourceDetails::Instance {
instance_type: "m6g.xlarge".to_string(),
private_ip_dns_name: "ip-XXXXXX.eu-west-1.compute.internal".to_string(),
usage: Some(InstanceUsage {
average_cpu_load: 100.0,
usage_duration_seconds: 3600,
Expand All @@ -491,6 +497,7 @@ mod tests {
location: UsageLocation::try_from("eu-west-3").unwrap(),
resource_details: ResourceDetails::Instance {
instance_type: "m6g.xlarge".to_string(),
private_ip_dns_name: "ip-XXXXXX.eu-west-1.compute.internal".to_string(),
usage: Some(InstanceUsage {
average_cpu_load: 100.0,
usage_duration_seconds: 3600,
Expand All @@ -506,6 +513,7 @@ mod tests {
location: UsageLocation::try_from("eu-west-3").unwrap(),
resource_details: ResourceDetails::Instance {
instance_type: "type-not-in-boa".to_string(),
private_ip_dns_name: "ip-XXXXXX.eu-west-1.compute.internal".to_string(),
usage: Some(InstanceUsage {
average_cpu_load: 100.0,
usage_duration_seconds: 3600,
Expand Down Expand Up @@ -552,6 +560,7 @@ mod tests {
location: UsageLocation::try_from("eu-west-3").unwrap(),
resource_details: ResourceDetails::Instance {
instance_type: "m6g.xlarge".to_string(),
private_ip_dns_name: "ip-XXXXXX.eu-west-1.compute.internal".to_string(),
usage: Some(InstanceUsage {
average_cpu_load: 100.0,
usage_duration_seconds: 3600,
Expand Down Expand Up @@ -599,6 +608,7 @@ mod tests {
location: UsageLocation::try_from("eu-west-3").unwrap(),
resource_details: ResourceDetails::Instance {
instance_type: "m6g.xlarge".to_string(),
private_ip_dns_name: "ip-XXXXXX.eu-west-1.compute.internal".to_string(),
usage: Some(InstanceUsage {
average_cpu_load: 100.0,
usage_duration_seconds: 3600,
Expand Down
Loading
Loading