Skip to content

Commit

Permalink
F #3144 monitoring methods should return the monitoring info (#3145)
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Gonz谩lez authored and Ruben S. Montero committed Mar 28, 2019
1 parent deedb38 commit 01209ed
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
11 changes: 8 additions & 3 deletions src/oca/go/src/goca/host.go
Expand Up @@ -240,9 +240,14 @@ func (host *Host) Info() error {
}

// Monitoring returns the host monitoring records.
func (host *Host) Monitoring() error {
_, err := client.Call("one.host.monitoring", host.ID)
return err
func (host *Host) Monitoring() (string, error) {
monitor_data, err := client.Call("one.host.monitoring", host.ID)

if err != nil{
return "", err
}else {
return monitor_data.Body(), err
}
}

// State looks up the state of the image and returns the ImageState
Expand Down
22 changes: 16 additions & 6 deletions src/oca/go/src/goca/vm.go
Expand Up @@ -624,9 +624,14 @@ func NewVMPool(args ...int) (*VMPool, error) {
// -2: All resources
// -1: Resources belonging to the user and any of his groups
// >= 0: UID User's Resources
func (vmpool *VMPool) Monitoring(filter int) error {
_, err := client.Call("one.vmpool.monitoring", filter)
return err
func (vmpool *VMPool) Monitoring(filter int) (string, error) {
monitor_data, err := client.Call("one.vmpool.monitoring", filter)

if err != nil{
return "", err
}else {
return monitor_data.Body(), err
}
}

// Accounting returns the virtual machine history records
Expand Down Expand Up @@ -778,9 +783,14 @@ func (vm *VM) UpdateConf(tpl string) error {
}

// Monitoring Returns the virtual machine monitoring records
func (vm *VM) Monitoring() error {
_, err := client.Call("one.vm.monitoring", vm.ID)
return err
func (vm *VM) Monitoring() (string, error) {
monitor_data, err := client.Call("one.vm.monitoring", vm.ID)

if err != nil{
return "", err
}else {
return monitor_data.Body(), err
}
}

// Chown changes the owner/group of a VM. If uid or gid is -1 it will not
Expand Down

0 comments on commit 01209ed

Please sign in to comment.