https://github.com/andrexus/goarubacloud
go library for accessing the Arubacloud API
https://github.com/andrexus/goarubacloud
aruba arubacloud arubacloud-api cloud-server go go-library golang
Last synced: 4 months ago
JSON representation
go library for accessing the Arubacloud API
- Host: GitHub
- URL: https://github.com/andrexus/goarubacloud
- Owner: andrexus
- License: mit
- Created: 2016-12-09T14:38:34.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-12-19T16:36:35.000Z (over 9 years ago)
- Last Synced: 2024-12-18T07:02:26.593Z (over 1 year ago)
- Topics: aruba, arubacloud, arubacloud-api, cloud-server, go, go-library, golang
- Language: Go
- Size: 40 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Goarubacloud
Goarubacloud is a Go client library for accessing the Arubacloud API.
Inspired by [godo](https://github.com/digitalocean/godo) library.
Current version implements basic services:
- DataCenters (basic info about services used in selected datacenter)
- CloudServers (manage cloud servers)
- CloudServerActions (cloud servers actions like PowerOn, PowerOn, PowerCycle, Reinitialize, etc.)
- PurchasedIPs (manage IP addresses)
- VLans (manage VLANs)
## Usage
```go
import "github.com/andrexus/goarubacloud"
```
Create a new Arubacloud client, then use the exposed services to
access different parts of the Arubacloud API.
```go
import "github.com/andrexus/goarubacloud"
username := "AWI-XXXXX"
password:="XXXXX"
client := goarubacloud.NewClient(goarubacloud.Germany, username, password)
```
## Examples
To create a new Cloud server **PRO**:
```go
server_name := "myServerNamePro"
os_template_id := 481
admin_password := "myPassword"
createRequest := goarubacloud.NewCloudServerProCreateRequest(server_name, admin_password, os_template_id)
err := createRequest.AddVirtualDisk(20)
if err != nil{
log.Println("[ERROR]", err)
}
createRequest.SetCPUQuantity(2)
createRequest.SetRAMQuantity(4)
createRequest.SetNote("created by goarubacloud")
cloudServer, resp, err := client.CloudServers.Create(createRequest)
if err != nil {
fmt.Println("Something bad happened:", err)
}
```
To create a new Cloud server **SMART**:
```go
server_name := "myServerNameSmart"
os_template_id := 482
admin_password := "myPassword"
createRequest := goarubacloud.NewCloudServerSmartCreateRequest(goarubacloud.MEDIUM, server_name, admin_password, os_template_id)
cloudServer, resp, err := client.CloudServers.Create(createRequest)
if err != nil {
fmt.Println("Something bad happened:", err)
}
```
## Contributing
Pull requests are appreciated!