Adding os type id to the usage record response for virtual machines (#4266)

This commit is contained in:
Greg Goodrich 2020-08-25 06:24:08 -05:00 committed by GitHub
parent 39734afcbc
commit 9b72e5dfb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -88,6 +88,10 @@ public class UsageRecordResponse extends BaseResponseWithTagInformation implemen
@Param(description = "template ID")
private String templateId;
@SerializedName(ApiConstants.OS_TYPE_ID)
@Param(description = "virtual machine os type id")
private Long osTypeId;
@SerializedName("usageid")
@Param(description = "id of the resource")
private String usageId;
@ -198,6 +202,10 @@ public class UsageRecordResponse extends BaseResponseWithTagInformation implemen
this.templateId = templateId;
}
public void setOsTypeId(Long osTypeId) {
this.osTypeId = osTypeId;
}
public void setUsageId(String usageId) {
this.usageId = usageId;
}

View File

@ -3387,6 +3387,7 @@ public class ApiResponseHelper implements ResponseGenerator {
resourceType = ResourceTag.ResourceObjectType.UserVm;
usageRecResponse.setUsageId(vm.getUuid());
resourceId = vm.getId();
usageRecResponse.setOsTypeId(vm.getGuestOSId());
}
//Hypervisor Type
usageRecResponse.setType(usageRecord.getType());