2010-12-06 09:50:59 -05:00
|
|
|
module Fog
|
|
|
|
module Brightbox
|
|
|
|
module Nullable
|
|
|
|
module String; end
|
|
|
|
module Account; end
|
|
|
|
module Image; end
|
|
|
|
module Interface; end
|
|
|
|
module Server; end
|
|
|
|
module Zone; end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
String.send :include, Fog::Brightbox::Nullable::String
|
|
|
|
NilClass.send :include, Fog::Brightbox::Nullable::String
|
|
|
|
|
|
|
|
Hash.send :include, Fog::Brightbox::Nullable::Account
|
|
|
|
NilClass.send :include, Fog::Brightbox::Nullable::Account
|
|
|
|
|
|
|
|
Hash.send :include, Fog::Brightbox::Nullable::Image
|
|
|
|
NilClass.send :include, Fog::Brightbox::Nullable::Image
|
|
|
|
|
|
|
|
Hash.send :include, Fog::Brightbox::Nullable::Interface
|
|
|
|
NilClass.send :include, Fog::Brightbox::Nullable::Interface
|
|
|
|
|
|
|
|
Hash.send :include, Fog::Brightbox::Nullable::Server
|
|
|
|
NilClass.send :include, Fog::Brightbox::Nullable::Server
|
|
|
|
|
|
|
|
Hash.send :include, Fog::Brightbox::Nullable::Zone
|
|
|
|
NilClass.send :include, Fog::Brightbox::Nullable::Zone
|
|
|
|
|
2010-12-01 08:07:39 -05:00
|
|
|
class Brightbox
|
|
|
|
module Compute
|
2010-12-02 12:36:57 -05:00
|
|
|
module TestSupport
|
|
|
|
# image img-9vxqi = Ubuntu Maverick 10.10 server
|
|
|
|
IMAGE_IDENTIFER = "img-9vxqi"
|
|
|
|
end
|
2010-12-01 08:07:39 -05:00
|
|
|
module Formats
|
|
|
|
module Nested
|
2010-12-06 09:50:59 -05:00
|
|
|
ACCOUNT = {
|
|
|
|
"name" => String,
|
|
|
|
"ram_used" => Integer,
|
|
|
|
"resource_type" => String,
|
|
|
|
"ram_limit" => Integer,
|
|
|
|
"url" => String,
|
|
|
|
"id" => String,
|
|
|
|
"status" => String,
|
|
|
|
"limits_cloudips" => Integer
|
|
|
|
}
|
|
|
|
|
|
|
|
API_CLIENT = {
|
|
|
|
"id" => String,
|
|
|
|
"resource_type" => String,
|
|
|
|
"url" => String,
|
|
|
|
"name" => String,
|
|
|
|
"description" => String
|
|
|
|
}
|
|
|
|
|
|
|
|
CLOUD_IP = {
|
|
|
|
"id" => String,
|
|
|
|
"resource_type" => String,
|
|
|
|
"url" => String,
|
|
|
|
"public_ip" => String,
|
|
|
|
"status" => String,
|
|
|
|
"reverse_dns" => String
|
|
|
|
}
|
|
|
|
|
|
|
|
IMAGE = {
|
|
|
|
"name" => String,
|
|
|
|
"created_at" => String,
|
|
|
|
"resource_type" => String,
|
|
|
|
"arch" => String,
|
|
|
|
"url" => String,
|
|
|
|
"id" => String,
|
|
|
|
"description" => String,
|
|
|
|
"source" => String,
|
|
|
|
"status" => String,
|
|
|
|
"owner" => String
|
|
|
|
}
|
|
|
|
|
|
|
|
INTERFACE = {
|
|
|
|
"resource_type" => String,
|
|
|
|
"url" => String,
|
|
|
|
"id" => String,
|
|
|
|
"ipv4_address" => String,
|
|
|
|
"mac_address" => String
|
|
|
|
}
|
|
|
|
|
|
|
|
SERVER = {
|
|
|
|
"id" => String,
|
|
|
|
"resource_type" => String,
|
|
|
|
"url" => String,
|
|
|
|
"name" => String,
|
|
|
|
"status" => String,
|
|
|
|
"hostname" => String,
|
|
|
|
"created_at" => String,
|
|
|
|
"started_at" => Fog::Brightbox::Nullable::String,
|
|
|
|
"deleted_at" => Fog::Brightbox::Nullable::String
|
|
|
|
}
|
|
|
|
|
2010-12-01 08:07:39 -05:00
|
|
|
SERVER_TYPE = {
|
|
|
|
"name" => String,
|
|
|
|
"cores" => Integer,
|
|
|
|
"created_at" => String,
|
|
|
|
"resource_type" => String,
|
|
|
|
"updated_at" => String,
|
|
|
|
"disk_size" => Integer,
|
|
|
|
"default" => Fog::Boolean,
|
|
|
|
"url" => String,
|
|
|
|
"id" => String,
|
|
|
|
"ram" => Integer,
|
|
|
|
"status" => String
|
|
|
|
}
|
|
|
|
|
2010-12-06 09:50:59 -05:00
|
|
|
USER = {
|
|
|
|
"id" => String,
|
|
|
|
"resource_type" => String,
|
|
|
|
"url" => String,
|
|
|
|
"name" => String,
|
|
|
|
"email_address" => String
|
|
|
|
}
|
|
|
|
|
2010-12-01 08:07:39 -05:00
|
|
|
ZONE = {
|
2010-12-06 09:50:59 -05:00
|
|
|
"id" => String,
|
2010-12-01 08:07:39 -05:00
|
|
|
"resource_type" => String,
|
|
|
|
"url" => String,
|
2010-12-06 09:50:59 -05:00
|
|
|
"handle" => Fog::Brightbox::Nullable::String
|
2010-12-01 08:07:39 -05:00
|
|
|
}
|
2010-12-06 09:50:59 -05:00
|
|
|
end
|
2010-12-01 08:07:39 -05:00
|
|
|
|
2010-12-06 09:50:59 -05:00
|
|
|
module Collected
|
|
|
|
API_CLIENT = {
|
|
|
|
"id" => String,
|
|
|
|
"resource_type" => String,
|
|
|
|
"url" => String,
|
2010-12-01 08:07:39 -05:00
|
|
|
"name" => String,
|
2010-12-06 09:50:59 -05:00
|
|
|
"description" => String,
|
|
|
|
"account" => Brightbox::Compute::Formats::Nested::ACCOUNT
|
|
|
|
}
|
|
|
|
|
|
|
|
CLOUD_IP = {
|
|
|
|
"id" => String,
|
2010-12-01 08:07:39 -05:00
|
|
|
"resource_type" => String,
|
2010-12-06 09:50:59 -05:00
|
|
|
"url" => String,
|
|
|
|
"public_ip" => String,
|
|
|
|
"status" => String,
|
|
|
|
"reverse_dns" => String,
|
|
|
|
"account" => Brightbox::Compute::Formats::Nested::ACCOUNT,
|
|
|
|
"interface" => Fog::Brightbox::Nullable::Interface,
|
2010-12-09 10:50:53 -05:00
|
|
|
"server" => Fog::Brightbox::Nullable::String
|
2010-12-06 09:50:59 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
IMAGE = {
|
|
|
|
"name" => String,
|
|
|
|
"created_at" => String,
|
|
|
|
"resource_type" => String,
|
|
|
|
"arch" => String,
|
2010-12-01 08:07:39 -05:00
|
|
|
"url" => String,
|
|
|
|
"id" => String,
|
2010-12-06 09:50:59 -05:00
|
|
|
"description" => String,
|
|
|
|
"source" => String,
|
|
|
|
"source_type" => String,
|
2010-12-01 08:07:39 -05:00
|
|
|
"status" => String,
|
2010-12-06 09:50:59 -05:00
|
|
|
"owner" => String,
|
|
|
|
"public" => Fog::Boolean,
|
|
|
|
"official" => Fog::Boolean,
|
|
|
|
"compatibility_mode" => Fog::Boolean,
|
|
|
|
"virtual_size" => Integer,
|
|
|
|
"disk_size" => Integer,
|
|
|
|
"ancestor" => Fog::Brightbox::Nullable::Image
|
2010-12-01 08:07:39 -05:00
|
|
|
}
|
|
|
|
|
2010-12-06 09:50:59 -05:00
|
|
|
SERVER = {
|
|
|
|
"id" => String,
|
2010-12-01 08:07:39 -05:00
|
|
|
"resource_type" => String,
|
|
|
|
"url" => String,
|
2010-12-06 09:50:59 -05:00
|
|
|
"name" => String,
|
|
|
|
"status" => String,
|
|
|
|
"hostname" => String,
|
|
|
|
"created_at" => String,
|
|
|
|
"started_at" => Fog::Brightbox::Nullable::String,
|
|
|
|
"deleted_at" => Fog::Brightbox::Nullable::String,
|
|
|
|
"account" => Brightbox::Compute::Formats::Nested::ACCOUNT,
|
|
|
|
"server_type" => Brightbox::Compute::Formats::Nested::SERVER_TYPE,
|
|
|
|
"cloud_ips" => [Brightbox::Compute::Formats::Nested::CLOUD_IP],
|
|
|
|
"image" => Brightbox::Compute::Formats::Nested::IMAGE,
|
|
|
|
"snapshots" => [Brightbox::Compute::Formats::Nested::IMAGE],
|
|
|
|
"interfaces" => [Brightbox::Compute::Formats::Nested::INTERFACE],
|
|
|
|
"zone" => Fog::Brightbox::Nullable::Zone
|
|
|
|
}
|
|
|
|
|
|
|
|
SERVER_TYPE = {
|
2010-12-01 08:07:39 -05:00
|
|
|
"id" => String,
|
2010-12-06 09:50:59 -05:00
|
|
|
"resource_type" => String,
|
|
|
|
"url" => String,
|
|
|
|
"handle" => Fog::Brightbox::Nullable::String,
|
|
|
|
"name" => String,
|
|
|
|
"status" => String,
|
|
|
|
"cores" => Integer,
|
|
|
|
"ram" => Integer,
|
|
|
|
"disk_size" => Integer
|
|
|
|
}
|
|
|
|
|
|
|
|
USER = {
|
|
|
|
"id" => String,
|
|
|
|
"resource_type" => String,
|
|
|
|
"url" => String,
|
|
|
|
"name" => String,
|
|
|
|
"email_address" => String,
|
|
|
|
"email_verified" => Fog::Boolean,
|
2010-12-09 10:50:53 -05:00
|
|
|
"accounts" => [Brightbox::Compute::Formats::Nested::ACCOUNT],
|
2010-12-06 09:50:59 -05:00
|
|
|
"default_account" => NilClass
|
|
|
|
}
|
|
|
|
|
|
|
|
ZONE = {
|
|
|
|
"id" => String,
|
|
|
|
"resource_type" => String,
|
|
|
|
"url" => String,
|
|
|
|
"handle" => Fog::Brightbox::Nullable::String
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
module Full
|
|
|
|
ACCOUNT = {
|
|
|
|
"id" => String,
|
|
|
|
"resource_type" => String,
|
|
|
|
"url" => String,
|
|
|
|
"name" => String,
|
|
|
|
"status" => String,
|
|
|
|
"address_1" => String,
|
|
|
|
"address_2" => String,
|
|
|
|
"city" => String,
|
|
|
|
"county" => String,
|
|
|
|
"postcode" => String,
|
|
|
|
"country_code" => String,
|
|
|
|
"country_name" => String,
|
|
|
|
"vat_registration_number" => Fog::Brightbox::Nullable::String,
|
|
|
|
"telephone_number" => String,
|
|
|
|
"telephone_verified" => Fog::Boolean,
|
|
|
|
"created_at" => String,
|
|
|
|
"ram_limit" => Integer,
|
|
|
|
"ram_used" => Integer,
|
|
|
|
"limits_cloudips" => Integer,
|
|
|
|
"library_ftp_host" => String,
|
|
|
|
"library_ftp_user" => String,
|
|
|
|
"library_ftp_password" => Fog::Brightbox::Nullable::String,
|
|
|
|
"owner" => Brightbox::Compute::Formats::Nested::USER,
|
|
|
|
"users" => [Brightbox::Compute::Formats::Nested::USER],
|
|
|
|
"clients" => [Brightbox::Compute::Formats::Nested::API_CLIENT],
|
|
|
|
"servers" => [Brightbox::Compute::Formats::Nested::SERVER],
|
|
|
|
"images" => [Brightbox::Compute::Formats::Nested::IMAGE],
|
|
|
|
"zones" => [Brightbox::Compute::Formats::Nested::ZONE]
|
|
|
|
}
|
|
|
|
|
|
|
|
API_CLIENT = {
|
|
|
|
"id" => String,
|
|
|
|
"resource_type" => String,
|
|
|
|
"url" => String,
|
|
|
|
"name" => String,
|
|
|
|
"description" => String,
|
|
|
|
"secret" => Fog::Brightbox::Nullable::String,
|
|
|
|
"account" => Brightbox::Compute::Formats::Nested::ACCOUNT
|
|
|
|
}
|
|
|
|
|
|
|
|
CLOUD_IP = {
|
|
|
|
"id" => String,
|
|
|
|
"resource_type" => String,
|
|
|
|
"url" => String,
|
|
|
|
"public_ip" => String,
|
|
|
|
"status" => String,
|
|
|
|
"reverse_dns" => String,
|
|
|
|
"account" => Brightbox::Compute::Formats::Nested::ACCOUNT,
|
|
|
|
"interface" => Fog::Brightbox::Nullable::Interface,
|
|
|
|
"server" => Fog::Brightbox::Nullable::Server
|
2010-12-01 08:07:39 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
IMAGE = {
|
|
|
|
"name" => String,
|
|
|
|
"created_at" => String,
|
|
|
|
"resource_type" => String,
|
|
|
|
"arch" => String,
|
|
|
|
"url" => String,
|
|
|
|
"id" => String,
|
|
|
|
"description" => String,
|
|
|
|
"source" => String,
|
2010-12-06 09:50:59 -05:00
|
|
|
"source_type" => String,
|
2010-12-01 08:07:39 -05:00
|
|
|
"status" => String,
|
2010-12-06 09:50:59 -05:00
|
|
|
"owner" => String, # Account ID not object
|
|
|
|
"public" => Fog::Boolean,
|
|
|
|
"official" => Fog::Boolean,
|
|
|
|
"compatibility_mode" => Fog::Boolean,
|
|
|
|
"virtual_size" => Integer,
|
|
|
|
"disk_size" => Integer,
|
|
|
|
"ancestor" => Fog::Brightbox::Nullable::Image
|
2010-12-01 08:07:39 -05:00
|
|
|
}
|
|
|
|
|
2010-12-06 09:50:59 -05:00
|
|
|
INTERFACE = {
|
|
|
|
"resource_type" => String,
|
|
|
|
"url" => String,
|
|
|
|
"id" => String,
|
|
|
|
"ipv4_address" => String,
|
|
|
|
"mac_address" => String,
|
|
|
|
"server" => Brightbox::Compute::Formats::Nested::SERVER
|
2010-12-01 08:07:39 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
SERVER = {
|
2010-12-06 09:50:59 -05:00
|
|
|
"id" => String,
|
|
|
|
"resource_type" => String,
|
|
|
|
"url" => String,
|
|
|
|
"name" => String,
|
|
|
|
"status" => String,
|
|
|
|
"hostname" => String,
|
|
|
|
"created_at" => String,
|
|
|
|
"started_at" => Fog::Brightbox::Nullable::String,
|
|
|
|
"deleted_at" => Fog::Brightbox::Nullable::String,
|
|
|
|
"user_data" => Fog::Brightbox::Nullable::String,
|
|
|
|
"account" => Brightbox::Compute::Formats::Nested::ACCOUNT,
|
|
|
|
"server_type" => Brightbox::Compute::Formats::Nested::SERVER_TYPE,
|
|
|
|
"cloud_ips" => [Brightbox::Compute::Formats::Nested::CLOUD_IP],
|
|
|
|
"image" => Brightbox::Compute::Formats::Nested::IMAGE,
|
|
|
|
"snapshots" => [Brightbox::Compute::Formats::Nested::IMAGE],
|
|
|
|
"interfaces" => [Brightbox::Compute::Formats::Nested::INTERFACE],
|
|
|
|
"zone" => Brightbox::Compute::Formats::Nested::ZONE
|
|
|
|
}
|
|
|
|
|
|
|
|
SERVER_TYPE = {
|
|
|
|
"id" => String,
|
|
|
|
"resource_type" => String,
|
|
|
|
"url" => String,
|
|
|
|
"handle" => Fog::Brightbox::Nullable::String,
|
|
|
|
"name" => String,
|
|
|
|
"status" => String,
|
|
|
|
"cores" => Integer,
|
|
|
|
"ram" => Integer,
|
|
|
|
"disk_size" => Integer
|
|
|
|
}
|
|
|
|
|
|
|
|
USER = {
|
|
|
|
"id" => String,
|
|
|
|
"resource_type" => String,
|
|
|
|
"url" => String,
|
|
|
|
"name" => String,
|
|
|
|
"email_address" => String,
|
|
|
|
"email_verified" => Fog::Boolean,
|
|
|
|
"accounts" => [Brightbox::Compute::Formats::Nested::ACCOUNT],
|
|
|
|
"default_account" => Fog::Brightbox::Nullable::Account,
|
|
|
|
"ssh_key" => Fog::Brightbox::Nullable::String
|
|
|
|
}
|
|
|
|
|
|
|
|
ZONE = {
|
|
|
|
"id" => String,
|
|
|
|
"resource_type" => String,
|
|
|
|
"url" => String,
|
2010-12-09 10:50:53 -05:00
|
|
|
"handle" => Fog::Brightbox::Nullable::String
|
2010-12-01 08:07:39 -05:00
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
module Collection
|
2010-12-06 09:50:59 -05:00
|
|
|
API_CLIENTS = [Brightbox::Compute::Formats::Collected::API_CLIENT]
|
|
|
|
CLOUD_IPS = [Brightbox::Compute::Formats::Collected::CLOUD_IP]
|
|
|
|
IMAGES = [Brightbox::Compute::Formats::Collected::IMAGE]
|
2010-12-01 08:07:39 -05:00
|
|
|
SERVERS = [Brightbox::Compute::Formats::Collected::SERVER]
|
2010-12-06 09:50:59 -05:00
|
|
|
SERVER_TYPES = [Brightbox::Compute::Formats::Collected::SERVER_TYPE]
|
|
|
|
USERS = [Brightbox::Compute::Formats::Collected::USER]
|
|
|
|
ZONES = [Brightbox::Compute::Formats::Collected::ZONE]
|
2010-12-01 08:07:39 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|