Skip to content

Commit

Permalink
include mem_total to scc registration
Browse files Browse the repository at this point in the history
  • Loading branch information
rjpmestre committed Nov 16, 2023
1 parent b123307 commit 04daab9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
14 changes: 13 additions & 1 deletion java/code/src/com/suse/scc/model/SCCHwInfoJson.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 SUSE LLC
* Copyright (c) 2023 SUSE LLC
*
* This software is licensed to you under the GNU General Public License,
* version 2 (GPLv2). There is NO WARRANTY for this software, express or
Expand All @@ -23,6 +23,10 @@ public class SCCHwInfoJson {

private int cpus;
private int sockets;

@SerializedName("mem_total")
private int memTotal;

private String arch;
private String uuid;
private String hypervisor;
Expand Down Expand Up @@ -77,4 +81,12 @@ public String getCloudProvider() {
public void setCloudProvider(String cloudProviderIn) {
cloudProvider = cloudProviderIn;
}

public int getMemTotal() {
return memTotal;
}

public void setMemTotal(int memTotalIn) {
memTotal = memTotalIn;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ private SCCRegisterSystemJson getPayload(SCCRegCacheItem rci) {
ofNullable(srv.getVirtualInstance().getUuid())
.ifPresent(u -> hwInfo.setUuid(u.replaceAll("(\\w{8})(\\w{4})(\\w{4})(\\w{4})(\\w{12})",
"$1-$2-$3-$4-$5")));
hwInfo.setMemTotal(srv.getVirtualInstance().getTotalMemory().intValue());
}

String login = rci.getOptSccLogin().orElseGet(() -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,12 @@ public int getCallCnt() {
}
}


/**
* Creates a Default {@link TestSCCWebClient} instance for testing purposes.
* All systems are updated successfully.
* @return a default SccWebClient instance for testing purposes
* @throws URISyntaxException
*/
public TestSCCWebClient getDefaultTestSCCWebClient() throws URISyntaxException {
TestSCCWebClient sccWebClient = new TestSCCWebClient(new SCCConfig(
Expand Down

0 comments on commit 04daab9

Please sign in to comment.