https://github.com/megamsys/opennebula-go
Open Nebula golang API used by megam vertice
https://github.com/megamsys/opennebula-go
Last synced: about 2 months ago
JSON representation
Open Nebula golang API used by megam vertice
- Host: GitHub
- URL: https://github.com/megamsys/opennebula-go
- Owner: megamsys
- License: apache-2.0
- Created: 2015-08-17T07:13:47.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2021-06-28T08:08:43.000Z (over 4 years ago)
- Last Synced: 2025-04-02T06:04:36.519Z (6 months ago)
- Language: Go
- Homepage: https://www.megam.io
- Size: 195 KB
- Stars: 23
- Watchers: 11
- Forks: 22
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
OpenNebula API
===============OpenNebula golang API
### Example:
```
import (
"github.com/megamsys/opennebula-go/api"
"github.com/megamsys/opennebula-go/compute"
"fmt"
)func main() {
cm := make(map[string]string)
cm[api.ENDPOINT] = "http://192.168.0.118:2633/RPC2"
cm[api.USERID] = "oneadmin"
cm[api.PASSWORD] = "oneadmin"cl, _ := api.NewClient(cm)
v := compute.VirtualMachine {
Name: "testmegam4",
TemplateName: "megam",
Cpu: "1",
Memory: "1024",
Image: "megam",
ClusterId: "100" ,
T: cl,
ContextMap: map[string]string{"assembly_id": "ASM-007", "assemblies_id": "AMS-007", ACCOUNTS_ID: "info@megam.io"},
Vnets:map[string]string{"0":"ipv4-pub"},
} //memory in terms of MB! duh!response, err := v.Create()
if err != nil {
// handle error
}vmid := response.(string)
fmt.Println("VirtualMachine created successfully")
}
```