Skip to main content
Version: 1.0.0

Quick Start

Welcome to the official Go SDK for the Aruba Cloud API. This SDK provides a convenient and powerful way for Go developers to interact with the Aruba Cloud API. The primary goal is to simplify the management of cloud resources, allowing you to programmatically create, read, update, and delete resources such as compute instances, virtual private clouds (VPCs), block storage, and more.

Installation

Add the SDK to your Go project:

go get github.com/Arubacloud/sdk-go@v1.0.0

Getting Started

Getting started with the SDK is straightforward. Import the aruba package, create a client with your credentials, and start making API calls using the wrapper builder pattern.

The first and most fundamental resource in the Aruba Cloud is the Project. All other resources belong to a project.

Here's how to initialize the SDK client and create your first project:

package main

import (
"context"
"fmt"
"log"
"time"

"github.com/Arubacloud/sdk-go/pkg/aruba"
)

func main() {
// Your API credentials
clientID := "your-client-id"
clientSecret := "your-client-secret"

// 1. Initialize the SDK client using default options
arubaClient, err := aruba.NewClient(aruba.DefaultOptions(clientID, clientSecret))
if err != nil {
log.Fatalf("Failed to create SDK client: %v", err)
}

// Create a context with a timeout
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute)
defer cancel()

// 2. Create the project — build inline and pass to Create
fmt.Println("Creating a new project...")
proj, err := arubaClient.FromProject().Create(
ctx,
aruba.NewProject().
Named("my-first-project").
Tagged("go-sdk", "quick-start").
DescribedAs("A project with the Go SDK"))
if err != nil {
log.Fatalf("Error creating project: %v", err)
}

fmt.Printf("✓ Successfully created project: %s (ID: %s)\n", proj.Name(), proj.ID())
}

Next Steps