Skip to content

Commit 30a465f

Browse files
author
Peter Jönsson
committed
Add some ISO commands
1 parent b87af07 commit 30a465f

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

iso.go

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package gopherstack
2+
3+
import (
4+
"net/url"
5+
)
6+
7+
// Deploys a Virtual Machine and returns it's id
8+
func (c CloudStackClient) AttachIso(isoid string, vmid string) (string, error) {
9+
params := url.Values{}
10+
params.Set("id", isoid)
11+
params.Set("virtualmachineid", vmid)
12+
13+
_, err := NewRequest(c, "attachIso", params)
14+
if err != nil {
15+
return "", err
16+
}
17+
//jobid := response.(AttachIsoResponse).Attachisoresponse.Jobid
18+
return "", err
19+
}
20+
21+
func (c CloudStackClient) DetachIso(vmid string) (string, error) {
22+
params := url.Values{}
23+
params.Set("virtualmachineid", vmid)
24+
_, err := NewRequest(c, "detachIso", params)
25+
if err != nil {
26+
return "", err
27+
}
28+
//jobid := response.(DetachIsoResponse).DetachIsoresponse.Jobid
29+
return "", err
30+
}
31+
32+
func (c CloudStackClient) ListIsos() (string, error) {
33+
_, err := NewRequest(c, "listIsos", nil)
34+
if err != nil {
35+
return "", err
36+
}
37+
//jobid := response.(ListIsosResponse).Listisosresponse.Jobid
38+
return "", err
39+
}

0 commit comments

Comments
 (0)