M #: Add new monitoring parameter to GOCA

This commit is contained in:
Ruben S. Montero authored and GitHub committed 2020-05-28 18:45:12 +02:00
commit 04f5345c41
2 files changed
+13 -2

No files matched your search

+10
View File
@@ -110,6 +110,16 @@ func (hc *HostsController) Create(name, im, vm string, clusterID int) (int, erro
return response.BodyInt(), nil
}
// Monitoring Returns the Hosts monitoring records
// * num: The number of records to be retrieved. If it is -1, all the records will be retrieved.
func (hc *HostsController) Monitoring(num int) (string, error) {
monitorData, err := hc.c.Client.Call("one.hostpool.monitoring", num)
if err != nil {
return "", err
}
return monitorData.Body(), nil
}
// Delete deletes the given host from the pool
func (hc *HostController) Delete() error {
_, err := hc.c.Client.Call("one.host.delete", hc.ID)
+3 -2
View File
@@ -180,8 +180,9 @@ func (vc *VMController) Info(decrypt bool) (*vm.VM, error) {
// -2: All resources
// -1: Resources belonging to the user and any of his groups
// >= 0: UID User's Resources
func (vc *VMsController) Monitoring(filter int) (string, error) {
monitorData, err := vc.c.Client.Call("one.vmpool.monitoring", filter)
// num: the number of records to be retrieved. If -1 every record is retrieved
func (vc *VMsController) Monitoring(filter, num int) (string, error) {
monitorData, err := vc.c.Client.Call("one.vmpool.monitoring", filter, num)
if err != nil {
return "", err
}