1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

B #2619: align Go bindings with OpenNebula Documentation (#2620)

* B #2576: Add missing XML RPC call for image GO bindings

This commit adds the following call in image.go:
* clone
* enable
* persistent
* chtype
* update
* chmod
* chown
* rename
* snapshotdelete
* snapshotrevert
* snapshotflatten
* lock
* unlock

* B #2619: Align go bindings call with XML RPC

following bindings do not fit with XML RPC Documentation:
* datastore.go: Chown
* document.go: Chown
* user.go: Login
* virtualnetwork.go: Chown
* vm.go: Deploy

This commit fixes this issue
This commit is contained in:
Jean-Philippe Fourès 2018-12-05 17:38:18 +01:00 committed by Ruben S. Montero
parent cb5c6402fc
commit 0e8f8b3bab
5 changed files with 11 additions and 10 deletions

View File

@ -91,8 +91,8 @@ func (datastore *Datastore) Chmod(uu, um, ua, gu, gm, ga, ou, om, oa int) error
// Chown changes the ownership of a datastore.
// * userID: The User ID of the new owner. If set to -1, it will not change.
// * groupID: The Group ID of the new group. If set to -1, it will not change.
func (datastore *Datastore) Chown(userID, groupID uint) error {
_, err := client.Call("one.datastore.chown", datastore.ID, int(userID), int(groupID))
func (datastore *Datastore) Chown(userID, groupID int) error {
_, err := client.Call("one.datastore.chown", datastore.ID, userID, groupID)
return err
}

View File

@ -117,8 +117,8 @@ func (document *Document) Chmod(uu, um, ua, gu, gm, ga, ou, om, oa int) error {
// Chown changes the ownership of a document.
// * userID: The User ID of the new owner. If set to -1, it will not change.
// * groupID: The Group ID of the new group. If set to -1, it will not change.
func (document *Document) Chown(userID, groupID uint) error {
_, err := client.Call("one.document.chown", document.ID, int(userID), int(groupID))
func (document *Document) Chown(userID, groupID int) error {
_, err := client.Call("one.document.chown", document.ID, userID, groupID)
return err
}

View File

@ -78,8 +78,8 @@ func (user *User) Passwd(password string) error {
// * token: The token
// * timeSeconds: Valid period in seconds; 0 reset the token and -1 for a non-expiring token.
// * effectiveGID: Effective GID to use with this token. To use the current GID and user groups set it to -1
func (user *User) Login(token string, timeSeconds int, effectiveGID uint) error {
_, err := client.Call("one.user.login", user.ID, token, timeSeconds, int(effectiveGID))
func (user *User) Login(token string, timeSeconds int, effectiveGID int) error {
_, err := client.Call("one.user.login", user.ID, token, timeSeconds, effectiveGID)
return err
}

View File

@ -161,8 +161,8 @@ func (vn *VirtualNetwork) Chmod(uu, um, ua, gu, gm, ga, ou, om, oa int) error {
// Chown changes the ownership of a virtual network.
// * userID: The User ID of the new owner. If set to -1, it will not change.
// * groupID: The Group ID of the new group. If set to -1, it will not change.
func (vn *VirtualNetwork) Chown(userID, groupID uint) error {
_, err := client.Call("one.vn.chown", vn.ID, int(userID), int(groupID))
func (vn *VirtualNetwork) Chown(userID, groupID int) error {
_, err := client.Call("one.vn.chown", vn.ID, userID, groupID)
return err
}

View File

@ -637,8 +637,9 @@ func (vm *VM) Delete() error {
// Deploy in the selected hostID and/or dsID. Enforce to return error in case of
// overcommitment. Enforce is automatically enabled for non-oneadmin users.
func (vm *VM) Deploy(hostID uint, enforce bool, dsID uint) error {
_, err := client.Call("one.vm.deploy", vm.ID, int(hostID), enforce, int(dsID))
// Set dsID to -1 to let OpenNebula choose the datastore.
func (vm *VM) Deploy(hostID uint, enforce bool, dsID int) error {
_, err := client.Call("one.vm.deploy", vm.ID, int(hostID), enforce, dsID)
return err
}