rubineti 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.rvmrc +1 -0
- data/Gemfile +13 -0
- data/Gemfile.lock +33 -0
- data/LICENSE +4 -0
- data/README.md +44 -0
- data/Rakefile +22 -0
- data/VERSION +1 -0
- data/lib/ganeti.rb +6 -0
- data/lib/rubineti/compute/cluster.rb +74 -0
- data/lib/rubineti/compute/instances.rb +245 -0
- data/lib/rubineti/compute/jobs.rb +42 -0
- data/lib/rubineti/compute/node.rb +140 -0
- data/lib/rubineti/compute.rb +125 -0
- data/lib/rubineti.rb +2 -0
- data/rubineti.gemspec +106 -0
- data/test/fixtures/cassettes/cluster_info.yml +96 -0
- data/test/fixtures/cassettes/cluster_oses.yml +32 -0
- data/test/fixtures/cassettes/cluster_redistribute_config.yml +32 -0
- data/test/fixtures/cassettes/cluster_version.yml +30 -0
- data/test/fixtures/cassettes/instance_create.yml +32 -0
- data/test/fixtures/cassettes/instance_delete.yml +30 -0
- data/test/fixtures/cassettes/instance_info.yml +30 -0
- data/test/fixtures/cassettes/instance_list.yml +93 -0
- data/test/fixtures/cassettes/instance_reboot.yml +32 -0
- data/test/fixtures/cassettes/instance_reinstall.yml +32 -0
- data/test/fixtures/cassettes/instance_shutdown.yml +32 -0
- data/test/fixtures/cassettes/instance_startup.yml +32 -0
- data/test/fixtures/cassettes/instances.yml +95 -0
- data/test/fixtures/cassettes/job_list.yml +135 -0
- data/test/fixtures/cassettes/jobs.yml +35 -0
- data/test/fixtures/cassettes/node_list.yml +55 -0
- data/test/fixtures/cassettes/node_role_list.yml +30 -0
- data/test/fixtures/cassettes/nodes.yml +39 -0
- data/test/lib/rubineti/compute/test_cluster.rb +71 -0
- data/test/lib/rubineti/compute/test_instances.rb +202 -0
- data/test/lib/rubineti/compute/test_jobs.rb +41 -0
- data/test/lib/rubineti/compute/test_node.rb +77 -0
- data/test/lib/rubineti/test_compute.rb +92 -0
- data/test/support.rb +35 -0
- metadata +225 -0
@@ -0,0 +1,125 @@
|
|
1
|
+
require "net/http/persistent"
|
2
|
+
require "base64"
|
3
|
+
|
4
|
+
module Rubineti
|
5
|
+
class Compute
|
6
|
+
Headers = {
|
7
|
+
:json => "application/json"
|
8
|
+
}.freeze
|
9
|
+
|
10
|
+
##
|
11
|
+
# Include endpoints.
|
12
|
+
# TODO: meta; discover the endpoints?
|
13
|
+
|
14
|
+
%w(jobs instances cluster node).each do |m|
|
15
|
+
require "rubineti/compute/#{m}"
|
16
|
+
include eval "Rubineti::#{m.capitalize}"
|
17
|
+
end
|
18
|
+
|
19
|
+
##
|
20
|
+
# Required:
|
21
|
+
# +user+: A String containing the username for use in HTTP Basic auth.
|
22
|
+
# +password+: A String containing the password for use in HTTP Basic auth.
|
23
|
+
# +host+: A String with the host to connect.
|
24
|
+
#
|
25
|
+
# TODO: force required fields.
|
26
|
+
|
27
|
+
def initialize params
|
28
|
+
@user = params[:user]
|
29
|
+
@password = params[:password]
|
30
|
+
@host = params[:host]
|
31
|
+
@port = params[:port] || 5080
|
32
|
+
@scheme = params[:scheme] || "https"
|
33
|
+
end
|
34
|
+
|
35
|
+
##
|
36
|
+
# Perform an HTTP get.
|
37
|
+
# +path+: A String with the path to the HTTP resource.
|
38
|
+
# +params+: A Hash with the following keys:
|
39
|
+
# - +:query+: Query String in the format "foo=bar"
|
40
|
+
# - +:body+: A sub Hash to be JSON encoded, and posted in
|
41
|
+
# the message body.
|
42
|
+
|
43
|
+
def get path, params = {}
|
44
|
+
parse response_for(Net::HTTP::Get, path, params)
|
45
|
+
end
|
46
|
+
|
47
|
+
##
|
48
|
+
# Perform an HTTP put.
|
49
|
+
# +path+: A String with the path to the HTTP resource.
|
50
|
+
# +params+: A Hash with the following keys:
|
51
|
+
# - +:query+: Query String in the format "foo=bar"
|
52
|
+
# - +:body+: A sub Hash to be JSON encoded, and posted in
|
53
|
+
# the message body.
|
54
|
+
|
55
|
+
def delete path, params = {}
|
56
|
+
parse response_for(Net::HTTP::Delete, path, params)
|
57
|
+
end
|
58
|
+
|
59
|
+
##
|
60
|
+
# Perform an HTTP get.
|
61
|
+
# +path+: A String with the path to the HTTP resource.
|
62
|
+
# +params+: A Hash with the following keys:
|
63
|
+
# - +:query+: Query String in the format "foo=bar"
|
64
|
+
# - +:body+: A sub Hash to be JSON encoded, and posted in
|
65
|
+
# the message body.
|
66
|
+
|
67
|
+
def post path, params = {}
|
68
|
+
parse response_for(Net::HTTP::Post, path, params)
|
69
|
+
end
|
70
|
+
|
71
|
+
##
|
72
|
+
# Perform an HTTP put.
|
73
|
+
# +path+: A String with the path to the HTTP resource.
|
74
|
+
# +params+: A Hash with the following keys:
|
75
|
+
# - +:query+: Query String in the format "foo=bar"
|
76
|
+
# - +:body+: A sub Hash to be JSON encoded, and posted in
|
77
|
+
# the message body.
|
78
|
+
|
79
|
+
def put path, params = {}
|
80
|
+
parse response_for(Net::HTTP::Put, path, params)
|
81
|
+
end
|
82
|
+
|
83
|
+
private
|
84
|
+
##
|
85
|
+
# Worker method to be called by #get, #delete, #post, #put.
|
86
|
+
# Method arguments have been documented in the callers.
|
87
|
+
|
88
|
+
def response_for request, path, params
|
89
|
+
query = params[:query] && params.delete(:query)
|
90
|
+
body = params[:body] && params.delete(:body)
|
91
|
+
|
92
|
+
@http ||= Net::HTTP::Persistent.new
|
93
|
+
@url ||= URI.parse "#{@scheme}://#{@host}:#{@port}"
|
94
|
+
|
95
|
+
@request = request.new [path, query].compact.join "?"
|
96
|
+
@request.body = encode(body) if body
|
97
|
+
common_headers @request
|
98
|
+
|
99
|
+
@http.request(@url, @request).body
|
100
|
+
end
|
101
|
+
|
102
|
+
def common_headers request
|
103
|
+
request.basic_auth @user, @password
|
104
|
+
case request.class.to_s
|
105
|
+
when Net::HTTP::Get.to_s, Net::HTTP::Delete.to_s
|
106
|
+
request.add_field "accept", Headers[:json]
|
107
|
+
when Net::HTTP::Post.to_s, Net::HTTP::Put.to_s
|
108
|
+
request.add_field "accept", Headers[:json]
|
109
|
+
request.add_field "content-type", Headers[:json]
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
def parse data
|
114
|
+
::Yajl::Parser.parse data
|
115
|
+
end
|
116
|
+
|
117
|
+
def encode hash
|
118
|
+
::Yajl::Encoder.encode hash
|
119
|
+
end
|
120
|
+
|
121
|
+
#def requires key
|
122
|
+
# raise StandardError.new "FATAL: Rubineti::Compute#initialize :#{key} required."
|
123
|
+
#end
|
124
|
+
end
|
125
|
+
end
|
data/lib/rubineti.rb
ADDED
data/rubineti.gemspec
ADDED
@@ -0,0 +1,106 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{rubineti}
|
8
|
+
s.version = "1.0.2"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["retr0h"]
|
12
|
+
s.date = %q{2010-11-29}
|
13
|
+
s.email = %q{john@dewey.ws}
|
14
|
+
s.extra_rdoc_files = [
|
15
|
+
"LICENSE",
|
16
|
+
"README.md"
|
17
|
+
]
|
18
|
+
s.files = [
|
19
|
+
".rvmrc",
|
20
|
+
"Gemfile",
|
21
|
+
"Gemfile.lock",
|
22
|
+
"LICENSE",
|
23
|
+
"README.md",
|
24
|
+
"Rakefile",
|
25
|
+
"VERSION",
|
26
|
+
"lib/ganeti.rb",
|
27
|
+
"lib/rubineti.rb",
|
28
|
+
"lib/rubineti/compute.rb",
|
29
|
+
"lib/rubineti/compute/cluster.rb",
|
30
|
+
"lib/rubineti/compute/instances.rb",
|
31
|
+
"lib/rubineti/compute/jobs.rb",
|
32
|
+
"lib/rubineti/compute/node.rb",
|
33
|
+
"rubineti.gemspec",
|
34
|
+
"test/fixtures/cassettes/cluster_info.yml",
|
35
|
+
"test/fixtures/cassettes/cluster_oses.yml",
|
36
|
+
"test/fixtures/cassettes/cluster_redistribute_config.yml",
|
37
|
+
"test/fixtures/cassettes/cluster_version.yml",
|
38
|
+
"test/fixtures/cassettes/instance_create.yml",
|
39
|
+
"test/fixtures/cassettes/instance_delete.yml",
|
40
|
+
"test/fixtures/cassettes/instance_info.yml",
|
41
|
+
"test/fixtures/cassettes/instance_list.yml",
|
42
|
+
"test/fixtures/cassettes/instance_reboot.yml",
|
43
|
+
"test/fixtures/cassettes/instance_reinstall.yml",
|
44
|
+
"test/fixtures/cassettes/instance_shutdown.yml",
|
45
|
+
"test/fixtures/cassettes/instance_startup.yml",
|
46
|
+
"test/fixtures/cassettes/instances.yml",
|
47
|
+
"test/fixtures/cassettes/job_list.yml",
|
48
|
+
"test/fixtures/cassettes/jobs.yml",
|
49
|
+
"test/fixtures/cassettes/node_list.yml",
|
50
|
+
"test/fixtures/cassettes/node_role_list.yml",
|
51
|
+
"test/fixtures/cassettes/nodes.yml",
|
52
|
+
"test/lib/rubineti/compute/test_cluster.rb",
|
53
|
+
"test/lib/rubineti/compute/test_instances.rb",
|
54
|
+
"test/lib/rubineti/compute/test_jobs.rb",
|
55
|
+
"test/lib/rubineti/compute/test_node.rb",
|
56
|
+
"test/lib/rubineti/test_compute.rb",
|
57
|
+
"test/support.rb"
|
58
|
+
]
|
59
|
+
s.homepage = %q{http://github.com/retr0h/rubineti}
|
60
|
+
s.require_paths = ["lib"]
|
61
|
+
s.rubygems_version = %q{1.3.7}
|
62
|
+
s.summary = %q{Ruby bindings to Ganeti's v2 Remote API.}
|
63
|
+
s.test_files = [
|
64
|
+
"test/lib/rubineti/compute/test_cluster.rb",
|
65
|
+
"test/lib/rubineti/compute/test_instances.rb",
|
66
|
+
"test/lib/rubineti/compute/test_jobs.rb",
|
67
|
+
"test/lib/rubineti/compute/test_node.rb",
|
68
|
+
"test/lib/rubineti/test_compute.rb",
|
69
|
+
"test/support.rb"
|
70
|
+
]
|
71
|
+
|
72
|
+
if s.respond_to? :specification_version then
|
73
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
74
|
+
s.specification_version = 3
|
75
|
+
|
76
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
77
|
+
s.add_runtime_dependency(%q<yajl-ruby>, ["~> 0.7.8"])
|
78
|
+
s.add_runtime_dependency(%q<net-http-persistent>, ["~> 1.4.1"])
|
79
|
+
s.add_development_dependency(%q<rake>, [">= 0"])
|
80
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.5.1"])
|
81
|
+
s.add_development_dependency(%q<vcr>, ["~> 1.3.3"])
|
82
|
+
s.add_development_dependency(%q<webmock>, ["~> 1.6.1"])
|
83
|
+
s.add_development_dependency(%q<minitest>, ["~> 2.0.0"])
|
84
|
+
s.add_development_dependency(%q<mocha>, ["~> 0.9.10"])
|
85
|
+
else
|
86
|
+
s.add_dependency(%q<yajl-ruby>, ["~> 0.7.8"])
|
87
|
+
s.add_dependency(%q<net-http-persistent>, ["~> 1.4.1"])
|
88
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
89
|
+
s.add_dependency(%q<jeweler>, ["~> 1.5.1"])
|
90
|
+
s.add_dependency(%q<vcr>, ["~> 1.3.3"])
|
91
|
+
s.add_dependency(%q<webmock>, ["~> 1.6.1"])
|
92
|
+
s.add_dependency(%q<minitest>, ["~> 2.0.0"])
|
93
|
+
s.add_dependency(%q<mocha>, ["~> 0.9.10"])
|
94
|
+
end
|
95
|
+
else
|
96
|
+
s.add_dependency(%q<yajl-ruby>, ["~> 0.7.8"])
|
97
|
+
s.add_dependency(%q<net-http-persistent>, ["~> 1.4.1"])
|
98
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
99
|
+
s.add_dependency(%q<jeweler>, ["~> 1.5.1"])
|
100
|
+
s.add_dependency(%q<vcr>, ["~> 1.3.3"])
|
101
|
+
s.add_dependency(%q<webmock>, ["~> 1.6.1"])
|
102
|
+
s.add_dependency(%q<minitest>, ["~> 2.0.0"])
|
103
|
+
s.add_dependency(%q<mocha>, ["~> 0.9.10"])
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
@@ -0,0 +1,96 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :get
|
5
|
+
uri: https://fake:credentials@ganeti.primary:5080/2/info
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
accept:
|
9
|
+
- application/json
|
10
|
+
connection:
|
11
|
+
- keep-alive
|
12
|
+
keep-alive:
|
13
|
+
- 30
|
14
|
+
response: !ruby/struct:VCR::Response
|
15
|
+
status: !ruby/struct:VCR::ResponseStatus
|
16
|
+
code: 200
|
17
|
+
message: OK
|
18
|
+
headers:
|
19
|
+
date:
|
20
|
+
- Sat, 27 Nov 2010 07:51:26 GMT
|
21
|
+
content-type:
|
22
|
+
- application/json
|
23
|
+
content-length:
|
24
|
+
- "1577"
|
25
|
+
server:
|
26
|
+
- Ganeti 2.1.2.1
|
27
|
+
body: |
|
28
|
+
{
|
29
|
+
"architecture": [
|
30
|
+
"64bit",
|
31
|
+
"x86_64"
|
32
|
+
],
|
33
|
+
"beparams": {
|
34
|
+
"default": {
|
35
|
+
"auto_balance": true,
|
36
|
+
"memory": 128,
|
37
|
+
"vcpus": 1
|
38
|
+
}
|
39
|
+
},
|
40
|
+
"candidate_pool_size": 10,
|
41
|
+
"config_version": 2010000,
|
42
|
+
"ctime": 1290060317.919282,
|
43
|
+
"default_hypervisor": "kvm",
|
44
|
+
"enabled_hypervisors": [
|
45
|
+
"kvm"
|
46
|
+
],
|
47
|
+
"export_version": 0,
|
48
|
+
"file_storage_dir": "/srv/ganeti/file-storage",
|
49
|
+
"hvparams": {
|
50
|
+
"kvm": {
|
51
|
+
"acpi": true,
|
52
|
+
"boot_order": "disk",
|
53
|
+
"cdrom_image_path": "",
|
54
|
+
"disk_cache": "default",
|
55
|
+
"disk_type": "paravirtual",
|
56
|
+
"initrd_path": "",
|
57
|
+
"kernel_args": "ro",
|
58
|
+
"kernel_path": "/boot/vmlinuz-2.6.35-22-server",
|
59
|
+
"kvm_flag": "",
|
60
|
+
"migration_port": 8102,
|
61
|
+
"nic_type": "paravirtual",
|
62
|
+
"root_path": "/dev/vda1",
|
63
|
+
"security_domain": "",
|
64
|
+
"security_model": "none",
|
65
|
+
"serial_console": true,
|
66
|
+
"usb_mouse": "",
|
67
|
+
"use_localtime": false,
|
68
|
+
"vnc_bind_address": "",
|
69
|
+
"vnc_password_file": "",
|
70
|
+
"vnc_tls": false,
|
71
|
+
"vnc_x509_path": "",
|
72
|
+
"vnc_x509_verify": false
|
73
|
+
}
|
74
|
+
},
|
75
|
+
"maintain_node_health": false,
|
76
|
+
"master": "g1.cloud-internal.gln.atti.com",
|
77
|
+
"master_netdev": "br0",
|
78
|
+
"mtime": 1290844138.49684,
|
79
|
+
"name": "ganeti.cloud-internal.gln.atti.com",
|
80
|
+
"nicparams": {
|
81
|
+
"default": {
|
82
|
+
"link": "br0",
|
83
|
+
"mode": "bridged"
|
84
|
+
}
|
85
|
+
},
|
86
|
+
"os_api_version": 15,
|
87
|
+
"os_hvp": {},
|
88
|
+
"protocol_version": 30,
|
89
|
+
"software_version": "2.1.2.1",
|
90
|
+
"tags": [],
|
91
|
+
"uid_pool": [],
|
92
|
+
"uuid": "057303cb-fa3f-4ca6-8276-adcff3afdf18",
|
93
|
+
"volume_group_name": "xenvg"
|
94
|
+
}
|
95
|
+
|
96
|
+
http_version: "1.1"
|
@@ -0,0 +1,32 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :get
|
5
|
+
uri: https://fake:credentials@ganeti.primary:5080/2/os
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
accept:
|
9
|
+
- application/json
|
10
|
+
connection:
|
11
|
+
- keep-alive
|
12
|
+
keep-alive:
|
13
|
+
- 30
|
14
|
+
response: !ruby/struct:VCR::Response
|
15
|
+
status: !ruby/struct:VCR::ResponseStatus
|
16
|
+
code: 200
|
17
|
+
message: OK
|
18
|
+
headers:
|
19
|
+
date:
|
20
|
+
- Sat, 27 Nov 2010 07:51:23 GMT
|
21
|
+
content-type:
|
22
|
+
- application/json
|
23
|
+
content-length:
|
24
|
+
- "28"
|
25
|
+
server:
|
26
|
+
- Ganeti 2.1.2.1
|
27
|
+
body: |
|
28
|
+
[
|
29
|
+
"debootstrap+default"
|
30
|
+
]
|
31
|
+
|
32
|
+
http_version: "1.1"
|
@@ -0,0 +1,32 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :put
|
5
|
+
uri: https://fake:credentials@ganeti.primary:5080/2/redistribute-config
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
accept:
|
9
|
+
- application/json
|
10
|
+
content-type:
|
11
|
+
- application/json
|
12
|
+
connection:
|
13
|
+
- keep-alive
|
14
|
+
keep-alive:
|
15
|
+
- 30
|
16
|
+
response: !ruby/struct:VCR::Response
|
17
|
+
status: !ruby/struct:VCR::ResponseStatus
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
date:
|
22
|
+
- Sat, 27 Nov 2010 07:51:27 GMT
|
23
|
+
content-type:
|
24
|
+
- application/json
|
25
|
+
content-length:
|
26
|
+
- "7"
|
27
|
+
server:
|
28
|
+
- Ganeti 2.1.2.1
|
29
|
+
body: |
|
30
|
+
"5259"
|
31
|
+
|
32
|
+
http_version: "1.1"
|
@@ -0,0 +1,30 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :get
|
5
|
+
uri: https://fake:credentials@ganeti.primary:5080/version
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
accept:
|
9
|
+
- application/json
|
10
|
+
connection:
|
11
|
+
- keep-alive
|
12
|
+
keep-alive:
|
13
|
+
- 30
|
14
|
+
response: !ruby/struct:VCR::Response
|
15
|
+
status: !ruby/struct:VCR::ResponseStatus
|
16
|
+
code: 200
|
17
|
+
message: OK
|
18
|
+
headers:
|
19
|
+
date:
|
20
|
+
- Sat, 27 Nov 2010 07:51:24 GMT
|
21
|
+
content-type:
|
22
|
+
- application/json
|
23
|
+
content-length:
|
24
|
+
- "2"
|
25
|
+
server:
|
26
|
+
- Ganeti 2.1.2.1
|
27
|
+
body: |
|
28
|
+
2
|
29
|
+
|
30
|
+
http_version: "1.1"
|
@@ -0,0 +1,32 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :post
|
5
|
+
uri: https://fake:credentials@ganeti.primary:5080/2/instances?dry-run=1
|
6
|
+
body: "{\"__version__\":2,\"name\":\"compute1\",\"pnode\":\"node1\",\"snode\":\"node2\",\"disk_template\":\"drbd8\",\"disks\":[4096],\"beparams\":{\"vcpus\":1,\"memory\":512},\"os\":\"debootstrap+default\"}"
|
7
|
+
headers:
|
8
|
+
accept:
|
9
|
+
- application/json
|
10
|
+
content-type:
|
11
|
+
- application/json
|
12
|
+
connection:
|
13
|
+
- keep-alive
|
14
|
+
keep-alive:
|
15
|
+
- 30
|
16
|
+
response: !ruby/struct:VCR::Response
|
17
|
+
status: !ruby/struct:VCR::ResponseStatus
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
date:
|
22
|
+
- Mon, 29 Nov 2010 01:53:17 GMT
|
23
|
+
content-type:
|
24
|
+
- application/json
|
25
|
+
content-length:
|
26
|
+
- "7"
|
27
|
+
server:
|
28
|
+
- Ganeti 2.1.2.1
|
29
|
+
body: |
|
30
|
+
"6276"
|
31
|
+
|
32
|
+
http_version: "1.1"
|
@@ -0,0 +1,30 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :delete
|
5
|
+
uri: https://fake:credentials@ganeti.primary:5080/2/instances/invalid_instance_name?dry-run=1
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
accept:
|
9
|
+
- application/json
|
10
|
+
connection:
|
11
|
+
- keep-alive
|
12
|
+
keep-alive:
|
13
|
+
- 30
|
14
|
+
response: !ruby/struct:VCR::Response
|
15
|
+
status: !ruby/struct:VCR::ResponseStatus
|
16
|
+
code: 200
|
17
|
+
message: OK
|
18
|
+
headers:
|
19
|
+
date:
|
20
|
+
- Mon, 29 Nov 2010 01:04:22 GMT
|
21
|
+
content-type:
|
22
|
+
- application/json
|
23
|
+
content-length:
|
24
|
+
- "7"
|
25
|
+
server:
|
26
|
+
- Ganeti 2.1.2.1
|
27
|
+
body: |
|
28
|
+
"6249"
|
29
|
+
|
30
|
+
http_version: "1.1"
|
@@ -0,0 +1,30 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :get
|
5
|
+
uri: https://fake:credentials@ganeti.primary:5080/2/instances/compute1.cloud-internal.gln.atti.com/info
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
accept:
|
9
|
+
- application/json
|
10
|
+
connection:
|
11
|
+
- keep-alive
|
12
|
+
keep-alive:
|
13
|
+
- 30
|
14
|
+
response: !ruby/struct:VCR::Response
|
15
|
+
status: !ruby/struct:VCR::ResponseStatus
|
16
|
+
code: 200
|
17
|
+
message: OK
|
18
|
+
headers:
|
19
|
+
date:
|
20
|
+
- Mon, 29 Nov 2010 01:56:35 GMT
|
21
|
+
content-type:
|
22
|
+
- application/json
|
23
|
+
content-length:
|
24
|
+
- "7"
|
25
|
+
server:
|
26
|
+
- Ganeti 2.1.2.1
|
27
|
+
body: |
|
28
|
+
"6280"
|
29
|
+
|
30
|
+
http_version: "1.1"
|
@@ -0,0 +1,93 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :get
|
5
|
+
uri: https://fake:credentials@ganeti.primary:5080/2/instances/compute1.cloud-internal.gln.atti.com
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
accept:
|
9
|
+
- application/json
|
10
|
+
connection:
|
11
|
+
- keep-alive
|
12
|
+
keep-alive:
|
13
|
+
- 30
|
14
|
+
response: !ruby/struct:VCR::Response
|
15
|
+
status: !ruby/struct:VCR::ResponseStatus
|
16
|
+
code: 200
|
17
|
+
message: OK
|
18
|
+
headers:
|
19
|
+
date:
|
20
|
+
- Mon, 29 Nov 2010 01:57:18 GMT
|
21
|
+
content-type:
|
22
|
+
- application/json
|
23
|
+
content-length:
|
24
|
+
- "1343"
|
25
|
+
server:
|
26
|
+
- Ganeti 2.1.2.1
|
27
|
+
body: |
|
28
|
+
{
|
29
|
+
"admin_state": true,
|
30
|
+
"beparams": {
|
31
|
+
"auto_balance": true,
|
32
|
+
"memory": 128,
|
33
|
+
"vcpus": 1
|
34
|
+
},
|
35
|
+
"ctime": 1290993813.312603,
|
36
|
+
"disk.sizes": [
|
37
|
+
10240
|
38
|
+
],
|
39
|
+
"disk_template": "plain",
|
40
|
+
"disk_usage": 10240,
|
41
|
+
"hvparams": {
|
42
|
+
"acpi": true,
|
43
|
+
"boot_order": "disk",
|
44
|
+
"cdrom_image_path": "",
|
45
|
+
"disk_cache": "default",
|
46
|
+
"disk_type": "paravirtual",
|
47
|
+
"initrd_path": "",
|
48
|
+
"kernel_args": "ro",
|
49
|
+
"kernel_path": "/boot/vmlinuz-2.6.35-22-server",
|
50
|
+
"kvm_flag": "",
|
51
|
+
"nic_type": "paravirtual",
|
52
|
+
"root_path": "/dev/vda1",
|
53
|
+
"security_domain": "",
|
54
|
+
"security_model": "none",
|
55
|
+
"serial_console": true,
|
56
|
+
"usb_mouse": "",
|
57
|
+
"use_localtime": false,
|
58
|
+
"vnc_bind_address": "",
|
59
|
+
"vnc_password_file": "",
|
60
|
+
"vnc_tls": false,
|
61
|
+
"vnc_x509_path": "",
|
62
|
+
"vnc_x509_verify": false
|
63
|
+
},
|
64
|
+
"mtime": 1290995644.090802,
|
65
|
+
"name": "compute1.cloud-internal.gln.atti.com",
|
66
|
+
"network_port": 11008,
|
67
|
+
"nic.bridges": [
|
68
|
+
"br0"
|
69
|
+
],
|
70
|
+
"nic.ips": [
|
71
|
+
null
|
72
|
+
],
|
73
|
+
"nic.links": [
|
74
|
+
"br0"
|
75
|
+
],
|
76
|
+
"nic.macs": [
|
77
|
+
"aa:00:00:3e:9c:1e"
|
78
|
+
],
|
79
|
+
"nic.modes": [
|
80
|
+
"bridged"
|
81
|
+
],
|
82
|
+
"oper_ram": 128,
|
83
|
+
"oper_state": true,
|
84
|
+
"os": "debootstrap+default",
|
85
|
+
"pnode": "g2.cloud-internal.gln.atti.com",
|
86
|
+
"serial_no": 4,
|
87
|
+
"snodes": [],
|
88
|
+
"status": "running",
|
89
|
+
"tags": [],
|
90
|
+
"uuid": "abd19091-9941-4dae-9991-39f740ec0b95"
|
91
|
+
}
|
92
|
+
|
93
|
+
http_version: "1.1"
|
@@ -0,0 +1,32 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :post
|
5
|
+
uri: https://fake:credentials@ganeti.primary:5080/2/instances/invalid_instance_name/reboot?dry-run=1
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
accept:
|
9
|
+
- application/json
|
10
|
+
content-type:
|
11
|
+
- application/json
|
12
|
+
connection:
|
13
|
+
- keep-alive
|
14
|
+
keep-alive:
|
15
|
+
- 30
|
16
|
+
response: !ruby/struct:VCR::Response
|
17
|
+
status: !ruby/struct:VCR::ResponseStatus
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
date:
|
22
|
+
- Mon, 29 Nov 2010 01:07:39 GMT
|
23
|
+
content-type:
|
24
|
+
- application/json
|
25
|
+
content-length:
|
26
|
+
- "7"
|
27
|
+
server:
|
28
|
+
- Ganeti 2.1.2.1
|
29
|
+
body: |
|
30
|
+
"6252"
|
31
|
+
|
32
|
+
http_version: "1.1"
|
@@ -0,0 +1,32 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :post
|
5
|
+
uri: https://fake:credentials@ganeti.primary:5080/2/instances/compute1.cloud-internal.gln.atti.com/reinstall
|
6
|
+
body: "{\"os\":\"debootstrap+default\"}"
|
7
|
+
headers:
|
8
|
+
accept:
|
9
|
+
- application/json
|
10
|
+
content-type:
|
11
|
+
- application/json
|
12
|
+
connection:
|
13
|
+
- keep-alive
|
14
|
+
keep-alive:
|
15
|
+
- 30
|
16
|
+
response: !ruby/struct:VCR::Response
|
17
|
+
status: !ruby/struct:VCR::ResponseStatus
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
date:
|
22
|
+
- Mon, 29 Nov 2010 01:51:51 GMT
|
23
|
+
content-type:
|
24
|
+
- application/json
|
25
|
+
content-length:
|
26
|
+
- "7"
|
27
|
+
server:
|
28
|
+
- Ganeti 2.1.2.1
|
29
|
+
body: |
|
30
|
+
"6275"
|
31
|
+
|
32
|
+
http_version: "1.1"
|