mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-07 17:17:41 +03:00
M #: Add new monitoring parameter to GOCA
This commit is contained in:
parent
924d5d9018
commit
4e1e3e54dd
@ -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)
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user