diff options
author | Valerij Fredriksen <freva@users.noreply.github.com> | 2023-06-06 16:00:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-06 16:00:14 +0200 |
commit | cc8abf343c61b0d2b2f6a002a9eda0e68617fba1 (patch) | |
tree | 227e7dbfd3fc4590d0e69a4011525a209b42bd99 /controller-server/src | |
parent | 5ef4a39990c486740844d07c000ebd82dccf252f (diff) | |
parent | 1df03bd781512b29af7c9a6c8cf42f64703b2442 (diff) |
Merge pull request #27307 from vespa-engine/leandroalves/cluster-architecture
Add architecture to cluster resource
Diffstat (limited to 'controller-server/src')
3 files changed, 22 insertions, 6 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java index 4324b98acba..426c89ff20e 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java @@ -1427,6 +1427,14 @@ public class ApplicationApiHandler extends AuditLoggingRequestHandler { }; } + private static String valueOf(NodeResources.Architecture architecture) { + return switch (architecture) { + case x86_64 : yield "x86_64"; + case arm64 : yield "arm64"; + case any : yield "any"; + }; + } + private HttpResponse logs(String tenantName, String applicationName, String instanceName, String environment, String region, Map<String, String> queryParameters) { ApplicationId application = ApplicationId.from(tenantName, applicationName, instanceName); ZoneId zone = requireZone(environment, region); @@ -2836,6 +2844,7 @@ public class ApplicationApiHandler extends AuditLoggingRequestHandler { object.setDouble("bandwidthGbps", resources.bandwidthGbps()); object.setString("diskSpeed", valueOf(resources.diskSpeed())); object.setString("storageType", valueOf(resources.storageType())); + object.setString("architecture", valueOf(resources.architecture())); } // A tenant has different content when in a list ... antipattern, but not solvable before application/v5 diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application-clusters.json b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application-clusters.json index eb4c3294fe0..1040e809362 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application-clusters.json +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application-clusters.json @@ -11,7 +11,8 @@ "diskGb": 20.0, "bandwidthGbps": 1.0, "diskSpeed": "slow", - "storageType": "remote" + "storageType": "remote", + "architecture": "any" }, "cost": 0.11 }, @@ -24,7 +25,8 @@ "diskGb": 90.0, "bandwidthGbps": 1.0, "diskSpeed": "slow", - "storageType": "remote" + "storageType": "remote", + "architecture": "any" }, "cost": 0.43 }, @@ -40,7 +42,8 @@ "diskGb": 50.0, "bandwidthGbps": 1.0, "diskSpeed": "slow", - "storageType": "remote" + "storageType": "remote", + "architecture": "any" }, "cost": 0.22 }, @@ -56,7 +59,8 @@ "diskGb": 50.0, "bandwidthGbps": 1.0, "diskSpeed": "slow", - "storageType": "remote" + "storageType": "remote", + "architecture": "any" }, "cost": 0.29 }, @@ -98,7 +102,8 @@ "diskGb": 0.0, "bandwidthGbps": 0.0, "diskSpeed": "fast", - "storageType": "any" + "storageType": "any", + "architecture": "any" }, "cost": 0.0 }, @@ -111,7 +116,8 @@ "diskGb": 50.0, "bandwidthGbps": 1.0, "diskSpeed": "slow", - "storageType": "remote" + "storageType": "remote", + "architecture": "any" }, "cost": 0.22 }, diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application-nodes.json b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application-nodes.json index 34d2f054e0f..ffcb9ab6dc8 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application-nodes.json +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application-nodes.json @@ -12,6 +12,7 @@ "bandwidthGbps": 1.0, "diskSpeed": "slow", "storageType": "remote", + "architecture": "any", "clusterId": "default", "clusterType": "container", "down": false, |