Module: Ubicloud

Defined in:
lib/ubicloud.rb,
lib/ubicloud/model.rb,
lib/ubicloud/adapter.rb,
lib/ubicloud/context.rb,
lib/ubicloud/model/vm.rb,
lib/ubicloud/adapter/rack.rb,
lib/ubicloud/model_adapter.rb,
lib/ubicloud/model/firewall.rb,
lib/ubicloud/model/postgres.rb,
lib/ubicloud/adapter/net_http.rb,
lib/ubicloud/model/load_balancer.rb,
lib/ubicloud/model/private_subnet.rb

Overview

The Ubicloud module is the namespace for Ubicloud’s Ruby SDK, and also the primary entry point. Even though it is a module, users are expected to call Ubicloud.new to return an appropriate context (Ubicloud::Context) that is used to make requests to Ubicloud’s API.

Defined Under Namespace

Classes: Adapter, Context, Error, Firewall, LoadBalancer, Model, ModelAdapter, Postgres, PrivateSubnet, Vm

Class Method Summary collapse

Class Method Details

.new(adapter_type, **params) ⇒ Object

Create a new Ubicloud::Context for the given adapter type and parameters. This is the main entry point to the library. In general, users of the SDK will want to use the :net_http adapter type:

Ubicloud.new(:net_http, token: "YOUR_API_TOKEN", project_id: "pj...")


45
46
47
# File 'lib/ubicloud.rb', line 45

def self.new(adapter_type, **params)
  Context.new(Adapter.adapter_class(adapter_type).new(**params))
end