Spot Go SDK

Overview

The Rackspace Spot Go SDK is an idiomatic Go client library for programmatically managing Rackspace Spot resources. It provides a clean, type-safe interface for automating cloud infrastructure management.

GitHub Repository | Full Examples

Installation

Add the SDK to your Go project:

Bash
Copy

Then import it in your code:

Go
Copy

Authentication

Obtaining a Refresh Token

  1. Navigate to Rackspace Spot API Access
  2. Generate or copy your Refresh Token

Creating a Client

Create a SpotClient with your refresh token:

Go
Copy

Tip: Set SPOT_REFRESH_TOKEN as an environment variable instead of hardcoding it in your config.

Quick Start

List Available Regions

Go
Copy

Create a Cloudspace (K8s Cluster)

Go
Copy

Query Market Pricing

Go
Copy

Full Example: See examples/main.go for a complete cloudspace lifecycle example.

API Reference

Authentication

MethodDescription
Authenticate(ctx)Authenticate with refresh token and obtain access token

Organizations

MethodDescription
ListOrganizations(ctx)List all organizations accessible to your account

Cloudspaces

MethodDescription
CreateCloudspace(ctx, cloudspace)Create a new Kubernetes cluster with node pools
ListCloudspaces(ctx, org)List all cloudspaces in an organization
GetCloudspace(ctx, org, name)Retrieve details of a specific cloudspace
GetCloudspaceConfig(ctx, org, name)Download the kubeconfig for a cloudspace
DeleteCloudspace(ctx, org, name)Delete a cloudspace and all associated resources

Spot Node Pools

MethodDescription
CreateSpotNodePool(ctx, org, pool)Add a new spot node pool to a cloudspace
ListSpotNodePools(ctx, org, cloudspace)List all spot node pools in a cloudspace
GetSpotNodePool(ctx, org, name)Get details of a specific spot node pool
UpdateSpotNodePool(ctx, org, pool)Update spot node pool configuration
DeleteSpotNodePool(ctx, org, name)Remove a spot node pool from a cloudspace

On-Demand Node Pools

MethodDescription
CreateOnDemandNodePool(ctx, org, pool)Add an on-demand node pool to a cloudspace
ListOnDemandNodePools(ctx, org, cloudspace)List all on-demand node pools in a cloudspace
GetOnDemandNodePool(ctx, org, name)Get details of an on-demand node pool
UpdateOnDemandNodePool(ctx, org, pool)Update on-demand node pool configuration
DeleteOnDemandNodePool(ctx, org, name)Remove an on-demand node pool

Regions

MethodDescription
ListRegions(ctx)List all available Rackspace Spot regions
GetRegion(ctx, name)Get details about a specific region

Server Classes

MethodDescription
ListServerClasses(ctx, region)List all server classes available in a region
GetServerClass(ctx, name)Get specifications for a server class

Pricing

MethodDescription
GetPriceDetails(ctx)Get pricing for all server classes
GetPriceDetailsForServerClass(ctx, serverClass)Get pricing for a specific server class
GetPriceDetailsForRegion(ctx, region)Get pricing for all server classes in a region
GetMarketPriceForServerClass(ctx, status)Get current market price for a server class
GetMinimumBidPriceForServerClass(ctx, spec)Get minimum acceptable bid price

Data Types

CloudSpace

Go
Copy

SpotNodePool

Go
Copy

OnDemandNodePool

Go
Copy

Contributing

This is an open source project. Contributions are welcome!

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes with tests
  4. Submit a pull request

Report Issues

Resources

Support: For issues, open a GitHub issue. For security concerns, email product@rackspace.com.

Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard