-
Notifications
You must be signed in to change notification settings - Fork 142
/
main.go
63 lines (51 loc) · 1.28 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package main
import (
"fmt"
"github.com/cloudlibz/gocloud/gocloud"
)
func main() {
digioceancloud := gocloud.DigitalOceanProvider()
/*
image := map[string]interface{}{
"Slug": "ubuntu-16-04-x64",
}
create := map[string]interface{}{
"Name": "example.com",
"Region": "nyc3",
"Size": "s-1vcpu-1gb",
"Image": image,
"SSHKeys": nil,
"Backups": false,
"IPv6": true,
"UserData": nil,
"PrivateNetworking": nil,
"Volumes": nil,
"Monitoring": false,
"Tags": []string{"web"},
}
resp, err := digioceancloud.CreateNode(create)
if err != nil{
fmt.Println(err)
}
response := resp.(map[string]interface{})
fmt.Println(response["body"])
*/
stop := map[string]string{
"ID": "102694881",
}
resp, _ := digioceancloud.StopNode(stop)
response := resp.(map[string]interface{})
fmt.Println(response["body"])
start := map[string]string{
"ID": "102694881",
}
resp, _ = digioceancloud.StartNode(start)
response = resp.(map[string]interface{})
fmt.Println(response["body"])
delete := map[string]string{
"ID": "102694881",
}
resp, _ = digioceancloud.DeleteNode(delete)
response = resp.(map[string]interface{})
fmt.Println(response["body"])
}