This library implements Tutum's API. Tutum is a docker host PaaS. See the tutum documentation for a full list of parameters for each method call.
##Installation
$ gem install tutum-api
To make requests, you must secure your username and API key.
require 'tutum'
session = Tutum.new(username, api_key)
tutum.containers.create({
:image_name => "tutum/hello-world",
:name => "my-awesome-app",
:container_size => "XS",
:web_public_dns => "awesome-app.example.com"
})
tutum.containers.list({})
container_uuid = "7eaf7fff-882c-4f3d-9a8f-a22317ac00ce"
tutum.containers.get(container_uuid)
container_uuid = "7eaf7fff-882c-4f3d-9a8f-a22317ac00ce"
tutum.containers.start(container_uuid)
container_uuid = "7eaf7fff-882c-4f3d-9a8f-a22317ac00ce"
tutum.containers.stop(container_uuid)
container_uuid = "7eaf7fff-882c-4f3d-9a8f-a22317ac00ce"
tutum.containers.logs(container_uuid)
container_uuid = "7eaf7fff-882c-4f3d-9a8f-a22317ac00ce"
tutum.containers.redeploy(container_uuid, {})
container_uuid = "7eaf7fff-882c-4f3d-9a8f-a22317ac00ce"
tutum.containers.delete(container_uuid)
tutum.actions.list({})
action = tutum.actions.get(ACTION_UUID)
tutum.providers.list({})
tutum.providers.get(PROVIDER_NAME)
tutum.regions.list({})
tutum.regions.get(REGION_NAME)
TODO: Not implemented on tutum yet
tutum.node_types.list({})
node_type = tutum.node_types.get("digitalocean/1gb")
node_clusters = tutum.node_clusters.list({})
region = tutum.regions.get("digitalocean/lon1")
node_type = tutum.node_types.get("digitalocean/1gb")
number_of_nodes = 1
node_cluster = tutum.node_cluster.create( "my_cluster", node_type, region, number_of_nodes)
service = tutum.node_clusters.get(NODE_CLUSTER_UUID)
tutum.node_clusters.deploy(NODE_CLUSTER_UUID)
tutum.node_clusters.update(NODE_CLUSTER_UUID, :target_num_nodes => 3)
tutum.node_clusters.delete!(NODE_CLUSTER_UUID)
tutum.nodes.list({})
tutum.nodes.get(NODE_UUID)
tutum.nodes.deploy(NODE_UUID)
tutum.nodes.terminate(NODE_UUID)
tutum.services.list({})
service = tutum.services.create(:image => "tutum.co/tutum/hello-world", :name => "my-new-app", :target_num_containers => 1)
service_uuid = "7eaf7fff-882c-4f3d-9a8f-a22317ac00ce"
service = tutum.services.get(service_uuid)
service_uuid = "7eaf7fff-882c-4f3d-9a8f-a22317ac00ce"
tutum.services.logs(service_uuid)
service_uuid = "7eaf7fff-882c-4f3d-9a8f-a22317ac00ce"
tutum.services.update(service_uuid, :target_num_containers => 3)
service_uuid = "7eaf7fff-882c-4f3d-9a8f-a22317ac00ce"
tutum.services.start(service_uuid)
service_uuid = "7eaf7fff-882c-4f3d-9a8f-a22317ac00ce"
tutum.services.stop(service_uuid)
service_uuid = "7eaf7fff-882c-4f3d-9a8f-a22317ac00ce"
tutum.services.redeploy(service_uuid)
service_uuid = "7eaf7fff-882c-4f3d-9a8f-a22317ac00ce"
tutum.services.terminate(service_uuid)
##Testing
To test locally, you must set two environmental variables.
$ export TUTUM_USERNAME=<your_username>
$ export TUTUM_API_KEY=<your_api_key>
Then, bundle and run the tests.
$ bundle
$ rake
The ruby tutum API is provided by 255 BITS LLC. Please star it if you like it.
MIT
v0.2.0 Support for tutum 2.0 + new example v0.1.1 Fix runtime dependency v0.1.0 Initial release