Project

vers-sdk

0.0
The project is in a healthy, maintained state
Ruby client library for the Orchestrator Control Plane API API. Generated by Sterling.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

Vers Ruby API Library

This library provides convenient access to the Vers REST API from Ruby.

It is generated with Sterling.

Installation

Add to your Gemfile:

gem "vers-sdk"

Or install directly:

gem install vers-sdk

Usage

require "vers_sdk"

client = VersSdk::VersSdkClient.new(
  api_key: "your-api-key"  # or set VERS_API_KEY env var
)

# List all VMs
response = client.list_vms
puts JSON.parse(response.body)

# Create a new root VM
response = client.create_new_root_vm(body: { "vm_config" => {} })
puts JSON.parse(response.body)

Configuration

client = VersSdk::VersSdkClient.new(
  api_key: "your-api-key",           # or set VERS_API_KEY env var
  base_url: "https://api.vers.sh",   # or set VERS_BASE_URL env var
  max_retries: 2,
  timeout: 30
)

Error handling

require "vers_sdk"

begin
  client.delete_vm("nonexistent-id")
rescue VersSdk::NotFoundError => e
  puts "Not found: #{e.status} #{e.message}"
rescue VersSdk::APIError => e
  puts "API error: #{e.status}"
end

Retries

Requests are automatically retried up to 2 times on 5xx errors and connection failures, with exponential backoff and jitter. The client respects Retry-After headers (capped at 60s).

Per-request options

options = VersSdk::RequestOptions.new(
  headers: { "X-Custom" => "value" },
  timeout: 60
)
client.list_vms(options: options)

Requirements

  • Ruby >= 3.0
  • No external gem dependencies (uses net/http from stdlib)

License

MIT