linodeapi 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +4 -0
  3. data/.rspec +2 -0
  4. data/.rubocop.yml +2 -0
  5. data/.travis.yml +14 -0
  6. data/Gemfile +4 -0
  7. data/Gemfile.lock +75 -0
  8. data/LICENSE +22 -0
  9. data/README.md +21 -0
  10. data/Rakefile +25 -0
  11. data/dev/update_spec.rb +55 -0
  12. data/lib/linodeapi.rb +22 -0
  13. data/lib/linodeapi/api.rb +7 -0
  14. data/lib/linodeapi/raw.rb +103 -0
  15. data/lib/linodeapi/spec.rb +1176 -0
  16. data/linodeapi.gemspec +25 -0
  17. data/spec/linodeapi_spec.rb +7 -0
  18. data/spec/spec_helper.rb +10 -0
  19. data/vendor/cache/ast-1.1.0.gem +0 -0
  20. data/vendor/cache/coveralls-0.7.0.gem +0 -0
  21. data/vendor/cache/diff-lcs-1.2.5.gem +0 -0
  22. data/vendor/cache/docile-1.1.1.gem +0 -0
  23. data/vendor/cache/fuubar-1.3.2.gem +0 -0
  24. data/vendor/cache/hashr-0.0.22.gem +0 -0
  25. data/vendor/cache/httparty-0.12.0.gem +0 -0
  26. data/vendor/cache/json-1.8.1.gem +0 -0
  27. data/vendor/cache/mime-types-2.0.gem +0 -0
  28. data/vendor/cache/multi_json-1.8.2.gem +0 -0
  29. data/vendor/cache/multi_xml-0.5.5.gem +0 -0
  30. data/vendor/cache/parser-2.1.2.gem +0 -0
  31. data/vendor/cache/powerpack-0.0.9.gem +0 -0
  32. data/vendor/cache/rainbow-1.99.1.gem +0 -0
  33. data/vendor/cache/rake-10.1.1.gem +0 -0
  34. data/vendor/cache/rest-client-1.6.7.gem +0 -0
  35. data/vendor/cache/rspec-2.14.1.gem +0 -0
  36. data/vendor/cache/rspec-core-2.14.7.gem +0 -0
  37. data/vendor/cache/rspec-expectations-2.14.4.gem +0 -0
  38. data/vendor/cache/rspec-mocks-2.14.4.gem +0 -0
  39. data/vendor/cache/rubocop-0.16.0.gem +0 -0
  40. data/vendor/cache/ruby-progressbar-1.4.0.gem +0 -0
  41. data/vendor/cache/simplecov-0.8.2.gem +0 -0
  42. data/vendor/cache/simplecov-html-0.8.0.gem +0 -0
  43. data/vendor/cache/slop-3.4.7.gem +0 -0
  44. data/vendor/cache/term-ansicolor-1.2.2.gem +0 -0
  45. data/vendor/cache/thor-0.18.1.gem +0 -0
  46. data/vendor/cache/tins-0.13.1.gem +0 -0
  47. data/vendor/cache/travis-lint-1.7.0.gem +0 -0
  48. metadata +203 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1d86a47e855cda5413f6b29faecba76f7e172385
4
+ data.tar.gz: a9b0503891b6e0b161f1beb2c6b30f0c6e3b9fd4
5
+ SHA512:
6
+ metadata.gz: ab7d282f83837b58d67a132b7991125ffb6733472b481be6c1efcd515fb76edf8f76c9b8cca71800cc8c56242416478104820a192d3d714c5aeb73213951c213
7
+ data.tar.gz: a8b5f02ba4c0e36442f382f572cb9720223ef0e2a40e130c6351d284c63dd90e65d034280532d407e61d40959d2ed3cba574e5d559e1784af6620addc5450a18
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ pkg/*.gem
2
+ coverage/
3
+ .coveralls.yml
4
+ .bundle
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format Fuubar
2
+ --color
data/.rubocop.yml ADDED
@@ -0,0 +1,2 @@
1
+ Encoding:
2
+ Enabled: false
data/.travis.yml ADDED
@@ -0,0 +1,14 @@
1
+ language: ruby
2
+ cache: bundler
3
+ rvm:
4
+ - 2.1.0
5
+ - 2.0.0
6
+ - 1.9.3
7
+ notifications:
8
+ email: false
9
+ irc:
10
+ channels:
11
+ - ircs://irc.oftc.net:6697#akerl
12
+ channel_key: sekrit
13
+ template:
14
+ - '%{repository}/%{branch}/%{build_number}: %{message} -- %{build_url}'
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
data/Gemfile.lock ADDED
@@ -0,0 +1,75 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ linodeapi (0.0.1)
5
+ httparty
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ ast (1.1.0)
11
+ coveralls (0.7.0)
12
+ multi_json (~> 1.3)
13
+ rest-client
14
+ simplecov (>= 0.7)
15
+ term-ansicolor
16
+ thor
17
+ diff-lcs (1.2.5)
18
+ docile (1.1.1)
19
+ fuubar (1.3.2)
20
+ rspec (>= 2.14.0, < 3.1.0)
21
+ ruby-progressbar (~> 1.3)
22
+ hashr (0.0.22)
23
+ httparty (0.12.0)
24
+ json (~> 1.8)
25
+ multi_xml (>= 0.5.2)
26
+ json (1.8.1)
27
+ mime-types (2.0)
28
+ multi_json (1.8.2)
29
+ multi_xml (0.5.5)
30
+ parser (2.1.2)
31
+ ast (~> 1.1)
32
+ slop (~> 3.4, >= 3.4.5)
33
+ powerpack (0.0.9)
34
+ rainbow (1.99.1)
35
+ rake (10.1.1)
36
+ rest-client (1.6.7)
37
+ mime-types (>= 1.16)
38
+ rspec (2.14.1)
39
+ rspec-core (~> 2.14.0)
40
+ rspec-expectations (~> 2.14.0)
41
+ rspec-mocks (~> 2.14.0)
42
+ rspec-core (2.14.7)
43
+ rspec-expectations (2.14.4)
44
+ diff-lcs (>= 1.1.3, < 2.0)
45
+ rspec-mocks (2.14.4)
46
+ rubocop (0.16.0)
47
+ parser (~> 2.1)
48
+ powerpack (~> 0.0.6)
49
+ rainbow (>= 1.1.4)
50
+ ruby-progressbar (1.4.0)
51
+ simplecov (0.8.2)
52
+ docile (~> 1.1.0)
53
+ multi_json
54
+ simplecov-html (~> 0.8.0)
55
+ simplecov-html (0.8.0)
56
+ slop (3.4.7)
57
+ term-ansicolor (1.2.2)
58
+ tins (~> 0.8)
59
+ thor (0.18.1)
60
+ tins (0.13.1)
61
+ travis-lint (1.7.0)
62
+ hashr (~> 0.0.22)
63
+
64
+ PLATFORMS
65
+ ruby
66
+
67
+ DEPENDENCIES
68
+ coveralls
69
+ fuubar
70
+ linodeapi!
71
+ parser (~> 2.1.0.pre1)
72
+ rake
73
+ rspec
74
+ rubocop
75
+ travis-lint
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2013 Les Aker
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
22
+
data/README.md ADDED
@@ -0,0 +1,21 @@
1
+ linodeapi
2
+ =========
3
+
4
+ [![Gem Version](https://badge.fury.io/rb/linodeapi.png)](http://badge.fury.io/rb/linodeapi)
5
+ [![Dependency Status](https://gemnasium.com/akerl/linodeapi.png)](https://gemnasium.com/akerl/linodeapi)
6
+ [![Code Climate](https://codeclimate.com/github/akerl/linodeapi.png)](https://codeclimate.com/github/akerl/linodeapi)
7
+ [![Coverage Status](https://coveralls.io/repos/akerl/linodeapi/badge.png?branch=master)](https://coveralls.io/r/akerl/linodeapi?branch=master)
8
+ [![Build Status](https://travis-ci.org/akerl/linodeapi.png?branch=master)](https://travis-ci.org/akerl/linodeapi)
9
+
10
+ Ruby API wrapper for the [Linode API](https://www.linode.com/api)
11
+
12
+ ## Usage
13
+
14
+ ## Installation
15
+
16
+ gem install linodeapi
17
+
18
+ ## License
19
+
20
+ linodeapi is released under the MIT License. See the bundled LICENSE file for details.
21
+
data/Rakefile ADDED
@@ -0,0 +1,25 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
+ require 'rubocop/rake_task'
4
+
5
+ desc 'Update bundle'
6
+ task :bundle do
7
+ `bundle update`
8
+ end
9
+
10
+ desc 'Run tests'
11
+ RSpec::Core::RakeTask.new(:spec)
12
+
13
+ desc 'Run Rubocop on the gem'
14
+ Rubocop::RakeTask.new(:rubocop) do |task|
15
+ task.patterns = ['lib/**/*.rb', 'spec/**/*.rb']
16
+ task.fail_on_error = true
17
+ end
18
+
19
+ desc 'Run travis-lint on .travis.yml'
20
+ task :travislint do
21
+ print 'There is an issue with your .travis.yml' unless system('travis-lint')
22
+ end
23
+
24
+ task default: [:spec, :travislint, :rubocop, :build, :install]
25
+ task release: [:bundle]
@@ -0,0 +1,55 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'httparty'
4
+ require 'pp'
5
+ require 'erb'
6
+
7
+ SPEC_PATH = 'lib/linodeapi/spec.rb'
8
+
9
+ TEMPLATE = '##
10
+ # Dynamically updated spec from the api.spec call
11
+ # rubocop:disable all
12
+
13
+ module LinodeAPI
14
+ SPEC =
15
+ <%= clean %>
16
+ end
17
+ '
18
+
19
+ raw = HTTParty.get('https://api.linode.com/?api_action=api.spec').body
20
+ raw = JSON.parse(raw)['DATA']['METHODS']
21
+
22
+ spec = raw.reduce(Hash.new) do |acc, (method, info)|
23
+ groups = method.split('.').map(&:to_sym)
24
+ name = groups.pop
25
+
26
+ params = info['PARAMETERS'].map do |k, v|
27
+ [
28
+ k.downcase.to_sym,
29
+ {
30
+ desc: v['DESCRIPTION'],
31
+ type: v['TYPE'].to_sym,
32
+ required: v['REQUIRED'],
33
+ }
34
+ ]
35
+ end
36
+
37
+ local = groups.reduce(acc) do |layout, new|
38
+ layout[new] ||= { type: :group, subs: {} }
39
+ layout[new][:subs]
40
+ end
41
+ local[name] = {
42
+ type: :call,
43
+ desc: info['DESCRIPTION'],
44
+ throws: info['THROWS'].split(','),
45
+ params: Hash[params],
46
+ }
47
+
48
+ acc
49
+ end
50
+
51
+ clean = ''
52
+ PP.pp({ type: 'group', subs: spec }, clean)
53
+ File.open(SPEC_PATH, 'w') { |fh| fh.write ERB.new(TEMPLATE).result }
54
+
55
+ puts 'Updated spec file'
data/lib/linodeapi.rb ADDED
@@ -0,0 +1,22 @@
1
+ ##
2
+ # Linode API wrapper
3
+
4
+ module LinodeAPI
5
+ ##
6
+ # Default API endpoint
7
+
8
+ DEFAULT_ENDPOINT = 'https://api.linode.com/'
9
+
10
+ class << self
11
+ ##
12
+ # Insert a helper .new() method for creating a new API object
13
+
14
+ def new(*args)
15
+ self::API.new(*args)
16
+ end
17
+ end
18
+ end
19
+
20
+ require 'linodeapi/spec'
21
+ require 'linodeapi/raw'
22
+ require 'linodeapi/api'
@@ -0,0 +1,7 @@
1
+ ##
2
+ # Friendlier Ruby interface to the Linode API
3
+
4
+ module LinodeAPI
5
+ class API
6
+ end
7
+ end
@@ -0,0 +1,103 @@
1
+ require 'httparty'
2
+
3
+ ##
4
+ # Raw API wrapper, dynamically loaded from the published spec
5
+
6
+ module LinodeAPI
7
+ ##
8
+ # Raw API object
9
+
10
+ class Raw
11
+ include HTTParty
12
+
13
+ attr_reader :apikey, :spec, :names
14
+
15
+ def initialize(params = {})
16
+ self.class.base_uri params.fetch(:endpoint, DEFAULT_ENDPOINT)
17
+ @names = params.fetch(:names) { [] }
18
+ @spec = params.fetch(:spec) { SPEC }
19
+ @apikey = params.fetch(:apikey) { authenticate(params).first }
20
+ end
21
+
22
+ def respond_to?(method, include_private = false)
23
+ super || @spec[:subs].include?(method)
24
+ end
25
+
26
+ def to_s
27
+ 'LinodeAPI::Raw object'
28
+ end
29
+ alias_method :inspect, :to_s
30
+
31
+ private
32
+
33
+ def authenticate(params = {})
34
+ return [] unless @names.empty?
35
+ unless (params.values_at :username, :password).all?
36
+ fail ArgumentError, 'You must provide either an API key or user/pass'
37
+ end
38
+ user.getapikey(params).values_at :api_key
39
+ end
40
+
41
+ def method_missing(method, *args, &block)
42
+ return super unless respond_to? method
43
+ case @spec[:subs][method][:type]
44
+ when :group then make_group method
45
+ when :call then make_call method, *args
46
+ end
47
+ end
48
+
49
+ def make_group(method)
50
+ options = {
51
+ spec: @spec[:subs][method],
52
+ apikey: @apikey,
53
+ username: @username,
54
+ names: @names + [method]
55
+ }
56
+ instance_eval "def #{method}() @#{method} end"
57
+ instance_variable_set "@#{method}".to_sym, Raw.new(options)
58
+ end
59
+
60
+ def make_call(method, *args)
61
+ instance_eval "def #{method}(*args) call(:#{method}, *args) end"
62
+ send(method, *args)
63
+ end
64
+
65
+ def call(method, params = {})
66
+ spec = @spec[:subs][method]
67
+ method = (@names + [method.to_s]).join '.'
68
+ options = self.class.validate method, spec[:params], params
69
+ options.merge! api_key: @apikey, api_action: method
70
+ self.class.parse self.class.post('', body: options).parsed_response
71
+ end
72
+
73
+ def self.parse(resp)
74
+ unless resp['ERRORARRAY'].empty?
75
+ fail "API Error on #{resp['ACTION']}: #{resp['ERRORARRAY']}"
76
+ end
77
+ data = resp['DATA']
78
+ data.is_a?(Hash) ? clean(data) : data.map { |x| clean x }
79
+ end
80
+
81
+ def self.clean(object)
82
+ Hash[object.map { |k, v| [k.downcase.to_sym, v] }]
83
+ end
84
+
85
+ def self.validate(method, spec, given)
86
+ spec.each_with_object({}) do |(param, info), options|
87
+ if given.include? param
88
+ options[param] = VALIDATION_METHODS[info[:type]].call given[param]
89
+ else
90
+ fail ArgumentError, "#{method} requires #{param}" if info[:required]
91
+ end
92
+ end
93
+ end
94
+ end
95
+
96
+ private
97
+
98
+ VALIDATION_METHODS = {
99
+ boolean: proc { |e| e == true },
100
+ numeric: proc { |e| Integer(e) },
101
+ string: proc { |e| e.to_s },
102
+ }
103
+ end
@@ -0,0 +1,1176 @@
1
+ ##
2
+ # Dynamically updated spec from the api.spec call
3
+ # rubocop:disable all
4
+
5
+ module LinodeAPI
6
+ SPEC =
7
+ {:type=>"group",
8
+ :subs=>
9
+ {:linode=>
10
+ {:type=>:group,
11
+ :subs=>
12
+ {:list=>
13
+ {:type=>:call,
14
+ :desc=>
15
+ "Returns a list of all Linodes user has access or delete to, including some properties",
16
+ :throws=>[],
17
+ :params=>
18
+ {:linodeid=>
19
+ {:desc=>"Limits the list to the specified LinodeID",
20
+ :type=>:numeric,
21
+ :required=>false}}},
22
+ :disk=>
23
+ {:type=>:group,
24
+ :subs=>
25
+ {:delete=>
26
+ {:type=>:call,
27
+ :desc=>"",
28
+ :throws=>["NOTFOUND", "VALIDATION"],
29
+ :params=>
30
+ {:linodeid=>{:desc=>"", :type=>:numeric, :required=>true},
31
+ :diskid=>{:desc=>"", :type=>:numeric, :required=>true}}},
32
+ :update=>
33
+ {:type=>:call,
34
+ :desc=>"",
35
+ :throws=>["NOTFOUND", "VALIDATION"],
36
+ :params=>
37
+ {:label=>
38
+ {:desc=>"The display label for this Disk",
39
+ :type=>:string,
40
+ :required=>false},
41
+ :isreadonly=>
42
+ {:desc=>"Enable forced read-only for this Disk",
43
+ :type=>:boolean,
44
+ :required=>false},
45
+ :linodeid=>{:desc=>"", :type=>:numeric, :required=>false},
46
+ :diskid=>{:desc=>"", :type=>:numeric, :required=>true}}},
47
+ :create=>
48
+ {:type=>:call,
49
+ :desc=>"",
50
+ :throws=>["NOTFOUND", "VALIDATION"],
51
+ :params=>
52
+ {:label=>
53
+ {:desc=>"The display label for this Disk",
54
+ :type=>:string,
55
+ :required=>true},
56
+ :size=>
57
+ {:desc=>"The size in MB of this Disk.",
58
+ :type=>:numeric,
59
+ :required=>true},
60
+ :linodeid=>{:desc=>"", :type=>:numeric, :required=>true},
61
+ :type=>
62
+ {:desc=>
63
+ "The formatted type of this disk. Valid types are: ext3, swap, raw",
64
+ :type=>:string,
65
+ :required=>true}}},
66
+ :createfromstackscript=>
67
+ {:type=>:call,
68
+ :desc=>"",
69
+ :throws=>["NOTFOUND", "VALIDATION"],
70
+ :params=>
71
+ {:stackscriptudfresponses=>
72
+ {:desc=>
73
+ "JSON encoded name/value pairs, answering this StackScript's User Defined Fields",
74
+ :type=>:string,
75
+ :required=>"yes"},
76
+ :distributionid=>
77
+ {:desc=>
78
+ "Which Distribution to apply this StackScript to. Must be one from the script's DistributionIDList",
79
+ :type=>:numeric,
80
+ :required=>true},
81
+ :rootpass=>
82
+ {:desc=>"The root user's password",
83
+ :type=>:string,
84
+ :required=>true},
85
+ :label=>
86
+ {:desc=>"The label of this new disk image",
87
+ :type=>:string,
88
+ :required=>true},
89
+ :size=>
90
+ {:desc=>"Size of this disk image in MB",
91
+ :type=>:numeric,
92
+ :required=>true},
93
+ :linodeid=>{:desc=>"", :type=>:numeric, :required=>true},
94
+ :stackscriptid=>
95
+ {:desc=>"The StackScript to create this image from",
96
+ :type=>:numeric,
97
+ :required=>"yes"}}},
98
+ :list=>
99
+ {:type=>:call,
100
+ :desc=>"",
101
+ :throws=>[],
102
+ :params=>
103
+ {:linodeid=>{:desc=>"", :type=>:numeric, :required=>true},
104
+ :diskid=>{:desc=>"", :type=>:numeric, :required=>false}}},
105
+ :createfromdistribution=>
106
+ {:type=>:call,
107
+ :desc=>"",
108
+ :throws=>["NOTFOUND", "VALIDATION"],
109
+ :params=>
110
+ {:rootsshkey=>
111
+ {:desc=>
112
+ "Optionally sets this string into /root/.ssh/authorized_keys upon distribution configuration.",
113
+ :type=>:string,
114
+ :required=>false},
115
+ :label=>
116
+ {:desc=>"The label of this new disk image",
117
+ :type=>:string,
118
+ :required=>true},
119
+ :size=>
120
+ {:desc=>"Size of this disk image in MB",
121
+ :type=>:numeric,
122
+ :required=>true},
123
+ :distributionid=>
124
+ {:desc=>
125
+ "The DistributionID to create this disk from. Found in avail.distributions()",
126
+ :type=>:numeric,
127
+ :required=>true},
128
+ :linodeid=>{:desc=>"", :type=>:numeric, :required=>true},
129
+ :rootpass=>
130
+ {:desc=>"The root user's password",
131
+ :type=>:string,
132
+ :required=>true}}},
133
+ :duplicate=>
134
+ {:type=>:call,
135
+ :desc=>"Performs a bit-for-bit copy of a disk image.",
136
+ :throws=>["NOTFOUND", "VALIDATION"],
137
+ :params=>
138
+ {:linodeid=>{:desc=>"", :type=>:numeric, :required=>true},
139
+ :diskid=>{:desc=>"", :type=>:numeric, :required=>true}}},
140
+ :resize=>
141
+ {:type=>:call,
142
+ :desc=>"",
143
+ :throws=>["NOTFOUND", "VALIDATION"],
144
+ :params=>
145
+ {:size=>
146
+ {:desc=>"The requested new size of this Disk in MB",
147
+ :type=>:numeric,
148
+ :required=>true},
149
+ :linodeid=>{:desc=>"", :type=>:numeric, :required=>true},
150
+ :diskid=>{:desc=>"", :type=>:numeric, :required=>true}}}}},
151
+ :webconsoletoken=>
152
+ {:type=>:call,
153
+ :desc=>
154
+ "Generates a console token starting a web console LISH session for the requesting IP",
155
+ :throws=>["NOTFOUND", "VALIDATION"],
156
+ :params=>{:linodeid=>{:desc=>"", :type=>:numeric, :required=>true}}},
157
+ :create=>
158
+ {:type=>:call,
159
+ :desc=>
160
+ "Creates a Linode and assigns you full privileges. There is a 75-linodes-per-hour limiter.",
161
+ :throws=>
162
+ ["NOACCESS",
163
+ "CCFAILED",
164
+ "VALIDATION",
165
+ "LINODELIMITER",
166
+ "ACCOUNTLIMIT"],
167
+ :params=>
168
+ {:planid=>
169
+ {:desc=>"The desired PlanID available from avail.LinodePlans()",
170
+ :type=>:numeric,
171
+ :required=>true},
172
+ :paymentterm=>
173
+ {:desc=>
174
+ "Subscription term in months for non-metered customers. One of: 1, 12, or 24",
175
+ :type=>:numeric,
176
+ :required=>false},
177
+ :datacenterid=>
178
+ {:desc=>
179
+ "The DatacenterID from avail.datacenters() where you wish to place this new Linode",
180
+ :type=>:numeric,
181
+ :required=>true}}},
182
+ :update=>
183
+ {:type=>:call,
184
+ :desc=>"Updates a Linode's properties.",
185
+ :throws=>["NOTFOUND", "VALIDATION"],
186
+ :params=>
187
+ {:ms_ssh_user=>{:desc=>"", :type=>:string, :required=>false},
188
+ :alert_cpu_enabled=>
189
+ {:desc=>"Enable the cpu usage email alert",
190
+ :type=>:boolean,
191
+ :required=>false},
192
+ :alert_bwin_enabled=>
193
+ {:desc=>"Enable the incoming bandwidth email alert",
194
+ :type=>:boolean,
195
+ :required=>false},
196
+ :alert_cpu_threshold=>
197
+ {:desc=>"CPU Alert threshold, percentage 0-800",
198
+ :type=>:numeric,
199
+ :required=>false},
200
+ :alert_bwquota_enabled=>
201
+ {:desc=>"Enable the bw quote email alert",
202
+ :type=>:boolean,
203
+ :required=>false},
204
+ :backupwindow=>{:desc=>"", :type=>:numeric, :required=>false},
205
+ :alert_diskio_threshold=>
206
+ {:desc=>"IO ops/sec", :type=>:numeric, :required=>false},
207
+ :backupweeklyday=>{:desc=>"", :type=>:numeric, :required=>false},
208
+ :label=>
209
+ {:desc=>"This Linode's label", :type=>:string, :required=>false},
210
+ :watchdog=>
211
+ {:desc=>"Enable the Lassie shutdown watchdog",
212
+ :type=>:boolean,
213
+ :required=>false},
214
+ :alert_diskio_enabled=>
215
+ {:desc=>"Enable the disk IO email alert",
216
+ :type=>:boolean,
217
+ :required=>false},
218
+ :ms_ssh_port=>{:desc=>"", :type=>:numeric, :required=>false},
219
+ :lpm_displaygroup=>
220
+ {:desc=>
221
+ "Display group in the Linode list inside the Linode Manager",
222
+ :type=>:string,
223
+ :required=>false},
224
+ :ms_ssh_disabled=>{:desc=>"", :type=>:boolean, :required=>false},
225
+ :alert_bwquota_threshold=>
226
+ {:desc=>"Percentage of monthly bw quota",
227
+ :type=>:numeric,
228
+ :required=>false},
229
+ :ms_ssh_ip=>{:desc=>"", :type=>:string, :required=>false},
230
+ :linodeid=>{:desc=>"", :type=>:numeric, :required=>true},
231
+ :alert_bwin_threshold=>
232
+ {:desc=>"Mb/sec", :type=>:numeric, :required=>false},
233
+ :alert_bwout_threshold=>
234
+ {:desc=>"Mb/sec", :type=>:numeric, :required=>false},
235
+ :alert_bwout_enabled=>
236
+ {:desc=>"Enable the outgoing bandwidth email alert",
237
+ :type=>:boolean,
238
+ :required=>false}}},
239
+ :ip=>
240
+ {:type=>:group,
241
+ :subs=>
242
+ {:list=>
243
+ {:type=>:call,
244
+ :desc=>"Lists a Linode's IP addresses.",
245
+ :throws=>["NOTFOUND"],
246
+ :params=>
247
+ {:ipaddressid=>
248
+ {:desc=>"If specified, limits the result to this IPAddressID",
249
+ :type=>:numeric,
250
+ :required=>false},
251
+ :linodeid=>{:desc=>"", :type=>:numeric, :required=>true}}},
252
+ :addprivate=>
253
+ {:type=>:call,
254
+ :desc=>
255
+ "Assigns a Private IP to a Linode. Returns the IPAddressID that was added.",
256
+ :throws=>["NOTFOUND"],
257
+ :params=>
258
+ {:linodeid=>{:desc=>"", :type=>:numeric, :required=>true}}}}},
259
+ :clone=>
260
+ {:type=>:call,
261
+ :desc=>
262
+ "Creates a new Linode, assigns you full privileges, and then clones the specified LinodeID to the new Linode. There is a limit of 5 active clone operations per source Linode. It is recommended that the source Linode be powered down during the clone.",
263
+ :throws=>
264
+ ["NOACCESS",
265
+ "NOTFOUND",
266
+ "CCFAILED",
267
+ "VALIDATION",
268
+ "LINODELIMITER",
269
+ "ACCOUNTLIMIT"],
270
+ :params=>
271
+ {:datacenterid=>
272
+ {:desc=>
273
+ "The DatacenterID from avail.datacenters() where you wish to place this new Linode",
274
+ :type=>:numeric,
275
+ :required=>true},
276
+ :paymentterm=>
277
+ {:desc=>
278
+ "Subscription term in months for non-metered customers. One of: 1, 12, or 24",
279
+ :type=>:numeric,
280
+ :required=>false},
281
+ :planid=>
282
+ {:desc=>"The desired PlanID available from avail.LinodePlans()",
283
+ :type=>:numeric,
284
+ :required=>true},
285
+ :linodeid=>
286
+ {:desc=>"The LinodeID that you want cloned",
287
+ :type=>:numeric,
288
+ :required=>true}}},
289
+ :delete=>
290
+ {:type=>:call,
291
+ :desc=>
292
+ "Immediately removes a Linode from your account and issues a pro-rated credit back to your account, if applicable. To prevent accidental deletes, this requires the Linode has no Disk images. You must first delete its disk images.\"",
293
+ :throws=>["NOTFOUND", "LINODENOTEMPTY"],
294
+ :params=>
295
+ {:linodeid=>
296
+ {:desc=>"The LinodeID to delete",
297
+ :type=>:numeric,
298
+ :required=>true},
299
+ :skipchecks=>
300
+ {:desc=>
301
+ "Skips the safety checks and will always delete the Linode",
302
+ :type=>:boolean,
303
+ :required=>false}}},
304
+ :reboot=>
305
+ {:type=>:call,
306
+ :desc=>"Issues a shutdown, and then boot job for a given LinodeID.",
307
+ :throws=>["NOTFOUND"],
308
+ :params=>
309
+ {:linodeid=>{:desc=>"", :type=>:numeric, :required=>true},
310
+ :configid=>{:desc=>"", :type=>:numeric, :required=>false}}},
311
+ :config=>
312
+ {:type=>:group,
313
+ :subs=>
314
+ {:list=>
315
+ {:type=>:call,
316
+ :desc=>"Lists a Linode's Configuration Profiles.",
317
+ :throws=>["NOTFOUND"],
318
+ :params=>
319
+ {:linodeid=>{:desc=>"", :type=>:numeric, :required=>true},
320
+ :configid=>{:desc=>"", :type=>:numeric, :required=>false}}},
321
+ :delete=>
322
+ {:type=>:call,
323
+ :desc=>"Deletes a Linode Configuration Profile.",
324
+ :throws=>["NOTFOUND", "VALIDATION"],
325
+ :params=>
326
+ {:linodeid=>{:desc=>"", :type=>:numeric, :required=>true},
327
+ :configid=>{:desc=>"", :type=>:numeric, :required=>true}}},
328
+ :update=>
329
+ {:type=>:call,
330
+ :desc=>"Updates a Linode Configuration Profile.",
331
+ :throws=>["NOTFOUND", "VALIDATION"],
332
+ :params=>
333
+ {:rootdevicecustom=>
334
+ {:desc=>"A custom root device setting.",
335
+ :type=>:string,
336
+ :required=>false},
337
+ :comments=>
338
+ {:desc=>"Comments you wish to save along with this profile",
339
+ :type=>:string,
340
+ :required=>false},
341
+ :devtmpfs_automount=>
342
+ {:desc=>
343
+ "Controls if pv_ops kernels should automount devtmpfs at boot. ",
344
+ :type=>:boolean,
345
+ :required=>false},
346
+ :helper_disableupdatedb=>
347
+ {:desc=>"Enable the disableUpdateDB filesystem helper",
348
+ :type=>:boolean,
349
+ :required=>false},
350
+ :label=>
351
+ {:desc=>"The Label for this profile",
352
+ :type=>:string,
353
+ :required=>false},
354
+ :configid=>{:desc=>"", :type=>:numeric, :required=>true},
355
+ :disklist=>
356
+ {:desc=>
357
+ "A comma delimited list of DiskIDs; position reflects device node. The 9th element for specifying the initrd.",
358
+ :type=>:string,
359
+ :required=>false},
360
+ :runlevel=>
361
+ {:desc=>"One of 'default', 'single', 'binbash' ",
362
+ :type=>:string,
363
+ :required=>false},
364
+ :rootdevicero=>
365
+ {:desc=>
366
+ "Enables the 'ro' kernel flag. Modern distros want this. ",
367
+ :type=>:boolean,
368
+ :required=>false},
369
+ :rootdevicenum=>
370
+ {:desc=>
371
+ "Which device number (1-8) that contains the root partition. 0 to utilize RootDeviceCustom.",
372
+ :type=>:numeric,
373
+ :required=>false},
374
+ :helper_xen=>
375
+ {:desc=>
376
+ "Enable the Xen filesystem helper. Corrects fstab and inittab/upstart entries depending on the kernel you're booting. You want this.",
377
+ :type=>:boolean,
378
+ :required=>false},
379
+ :ramlimit=>
380
+ {:desc=>"RAMLimit in MB. 0 for max.",
381
+ :type=>:numeric,
382
+ :required=>false},
383
+ :linodeid=>{:desc=>"", :type=>:numeric, :required=>false},
384
+ :kernelid=>
385
+ {:desc=>
386
+ "The KernelID for this profile. Found in avail.kernels()",
387
+ :type=>:numeric,
388
+ :required=>false},
389
+ :helper_depmod=>
390
+ {:desc=>
391
+ "Creates an empty modprobe file for the kernel you're booting. ",
392
+ :type=>:boolean,
393
+ :required=>false}}},
394
+ :create=>
395
+ {:type=>:call,
396
+ :desc=>"Creates a Linode Configuration Profile.",
397
+ :throws=>["NOTFOUND", "VALIDATION"],
398
+ :params=>
399
+ {:rootdevicecustom=>
400
+ {:desc=>"A custom root device setting.",
401
+ :type=>:string,
402
+ :required=>false},
403
+ :comments=>
404
+ {:desc=>"Comments you wish to save along with this profile",
405
+ :type=>:string,
406
+ :required=>false},
407
+ :devtmpfs_automount=>
408
+ {:desc=>
409
+ "Controls if pv_ops kernels should automount devtmpfs at boot. ",
410
+ :type=>:boolean,
411
+ :required=>false},
412
+ :helper_disableupdatedb=>
413
+ {:desc=>"Enable the disableUpdateDB filesystem helper",
414
+ :type=>:boolean,
415
+ :required=>false},
416
+ :label=>
417
+ {:desc=>"The Label for this profile",
418
+ :type=>:string,
419
+ :required=>true},
420
+ :disklist=>
421
+ {:desc=>
422
+ "A comma delimited list of DiskIDs; position reflects device node. The 9th element for specifying the initrd.",
423
+ :type=>:string,
424
+ :required=>false},
425
+ :runlevel=>
426
+ {:desc=>"One of 'default', 'single', 'binbash' ",
427
+ :type=>:string,
428
+ :required=>false},
429
+ :rootdevicero=>
430
+ {:desc=>
431
+ "Enables the 'ro' kernel flag. Modern distros want this. ",
432
+ :type=>:boolean,
433
+ :required=>false},
434
+ :rootdevicenum=>
435
+ {:desc=>
436
+ "Which device number (1-8) that contains the root partition. 0 to utilize RootDeviceCustom.",
437
+ :type=>:numeric,
438
+ :required=>false},
439
+ :helper_xen=>
440
+ {:desc=>
441
+ "Enable the Xen filesystem helper. Corrects fstab and inittab/upstart entries depending on the kernel you're booting. You want this.",
442
+ :type=>:boolean,
443
+ :required=>false},
444
+ :ramlimit=>
445
+ {:desc=>"RAMLimit in MB. 0 for max.",
446
+ :type=>:numeric,
447
+ :required=>false},
448
+ :linodeid=>{:desc=>"", :type=>:numeric, :required=>true},
449
+ :helper_depmod=>
450
+ {:desc=>
451
+ "Creates an empty modprobe file for the kernel you're booting. ",
452
+ :type=>:boolean,
453
+ :required=>false},
454
+ :kernelid=>
455
+ {:desc=>
456
+ "The KernelID for this profile. Found in avail.kernels()",
457
+ :type=>:numeric,
458
+ :required=>true}}}}},
459
+ :resize=>
460
+ {:type=>:call,
461
+ :desc=>
462
+ "Resizes a Linode from one plan to another. Immediately shuts the Linode down, charges/credits the account, and issue a migration to another host server.",
463
+ :throws=>["NOTFOUND", "CCFAILED", "VALIDATION"],
464
+ :params=>
465
+ {:planid=>
466
+ {:desc=>"The desired PlanID available from avail.LinodePlans()",
467
+ :type=>:numeric,
468
+ :required=>true},
469
+ :linodeid=>{:desc=>"", :type=>:numeric, :required=>true}}},
470
+ :job=>
471
+ {:type=>:group,
472
+ :subs=>
473
+ {:list=>
474
+ {:type=>:call,
475
+ :desc=>"",
476
+ :throws=>[],
477
+ :params=>
478
+ {:jobid=>
479
+ {:desc=>"Limits the list to the specified JobID",
480
+ :type=>:numeric,
481
+ :required=>false},
482
+ :linodeid=>{:desc=>"", :type=>:numeric, :required=>true},
483
+ :pendingonly=>
484
+ {:desc=>"", :type=>:boolean, :required=>false}}}}},
485
+ :boot=>
486
+ {:type=>:call,
487
+ :desc=>
488
+ "Issues a boot job for the provided ConfigID. If no ConfigID is provided boots the last used configuration profile, or the first configuration profile if this Linode has never been booted.",
489
+ :throws=>["NOTFOUND"],
490
+ :params=>
491
+ {:linodeid=>{:desc=>"", :type=>:numeric, :required=>true},
492
+ :configid=>
493
+ {:desc=>
494
+ "The ConfigID to boot, available from linode.config.list().",
495
+ :type=>:numeric,
496
+ :required=>false}}},
497
+ :mutate=>
498
+ {:type=>:call,
499
+ :desc=>"Upgrades a Linode to its next generation.",
500
+ :throws=>["NOTFOUND", "VALIDATION"],
501
+ :params=>{:linodeid=>{:desc=>"", :type=>:numeric, :required=>true}}},
502
+ :shutdown=>
503
+ {:type=>:call,
504
+ :desc=>"Issues a shutdown job for a given LinodeID.",
505
+ :throws=>["NOTFOUND"],
506
+ :params=>
507
+ {:linodeid=>{:desc=>"", :type=>:numeric, :required=>true}}}}},
508
+ :nodebalancer=>
509
+ {:type=>:group,
510
+ :subs=>
511
+ {:node=>
512
+ {:type=>:group,
513
+ :subs=>
514
+ {:update=>
515
+ {:type=>:call,
516
+ :desc=>"Updates a Node's properties",
517
+ :throws=>["NOTFOUND", "VALIDATION"],
518
+ :params=>
519
+ {:label=>
520
+ {:desc=>"This backend Node's label",
521
+ :type=>:string,
522
+ :required=>false},
523
+ :nodeid=>{:desc=>"", :type=>:numeric, :required=>true},
524
+ :mode=>
525
+ {:desc=>
526
+ "The connections mode for this node. One of 'accept', 'reject', or 'drain'",
527
+ :type=>:string,
528
+ :required=>false},
529
+ :weight=>
530
+ {:desc=>
531
+ "Load balancing weight, 1-255. Higher means more connections.",
532
+ :type=>:numeric,
533
+ :required=>false},
534
+ :address=>
535
+ {:desc=>
536
+ "The address:port combination used to communicate with this Node",
537
+ :type=>:string,
538
+ :required=>false}}},
539
+ :list=>
540
+ {:type=>:call,
541
+ :desc=>
542
+ "Returns a list of Nodes associated with a NodeBalancer Config",
543
+ :throws=>[],
544
+ :params=>
545
+ {:nodeid=>
546
+ {:desc=>"Limits the list to the specified NodeID",
547
+ :type=>:numeric,
548
+ :required=>false},
549
+ :configid=>{:desc=>"", :type=>:numeric, :required=>true}}},
550
+ :create=>
551
+ {:type=>:call,
552
+ :desc=>"",
553
+ :throws=>["NOTFOUND", "VALIDATION"],
554
+ :params=>
555
+ {:label=>
556
+ {:desc=>"This backend Node's label",
557
+ :type=>:string,
558
+ :required=>true},
559
+ :mode=>
560
+ {:desc=>
561
+ "The connections mode for this node. One of 'accept', 'reject', or 'drain'",
562
+ :type=>:string,
563
+ :required=>false},
564
+ :configid=>
565
+ {:desc=>"The parent ConfigID to attach this Node to",
566
+ :type=>:numeric,
567
+ :required=>true},
568
+ :weight=>
569
+ {:desc=>
570
+ "Load balancing weight, 1-255. Higher means more connections.",
571
+ :type=>:numeric,
572
+ :required=>false},
573
+ :address=>
574
+ {:desc=>
575
+ "The address:port combination used to communicate with this Node",
576
+ :type=>:string,
577
+ :required=>true}}},
578
+ :delete=>
579
+ {:type=>:call,
580
+ :desc=>"Deletes a Node from a NodeBalancer Config",
581
+ :throws=>["NOTFOUND"],
582
+ :params=>
583
+ {:nodeid=>
584
+ {:desc=>"The NodeID to delete",
585
+ :type=>:numeric,
586
+ :required=>true}}}}},
587
+ :create=>
588
+ {:type=>:call,
589
+ :desc=>"",
590
+ :throws=>["NOACCESS", "CCFAILED", "VALIDATION"],
591
+ :params=>
592
+ {:label=>
593
+ {:desc=>"This NodeBalancer's label",
594
+ :type=>:string,
595
+ :required=>false},
596
+ :clientconnthrottle=>
597
+ {:desc=>
598
+ "To help mitigate abuse, throttle connections per second, per client IP. 0 to disable. Max of 20.",
599
+ :type=>:numeric,
600
+ :required=>false},
601
+ :datacenterid=>
602
+ {:desc=>
603
+ "The DatacenterID from avail.datacenters() where you wish to place this new NodeBalancer",
604
+ :type=>:numeric,
605
+ :required=>true},
606
+ :paymentterm=>
607
+ {:desc=>"Subscription term in months. One of: 0, 1, 12, or 24",
608
+ :type=>:numeric,
609
+ :required=>true}}},
610
+ :delete=>
611
+ {:type=>:call,
612
+ :desc=>
613
+ "Immediately removes a NodeBalancer from your account and issues a pro-rated credit back to your account, if applicable.",
614
+ :throws=>["NOTFOUND"],
615
+ :params=>
616
+ {:nodebalancerid=>
617
+ {:desc=>"The NodeBalancerID to delete",
618
+ :type=>:numeric,
619
+ :required=>true}}},
620
+ :config=>
621
+ {:type=>:group,
622
+ :subs=>
623
+ {:create=>
624
+ {:type=>:call,
625
+ :desc=>"",
626
+ :throws=>["NOTFOUND", "VALIDATION"],
627
+ :params=>
628
+ {:stickiness=>
629
+ {:desc=>
630
+ "Session persistence. One of 'none', 'table', 'http_cookie'",
631
+ :type=>:string,
632
+ :required=>false},
633
+ :check_path=>
634
+ {:desc=>"When check=http, the path to request",
635
+ :type=>:string,
636
+ :required=>false},
637
+ :check_body=>
638
+ {:desc=>
639
+ "When check=http_body, a regex against the expected result body",
640
+ :type=>:string,
641
+ :required=>false},
642
+ :check_interval=>
643
+ {:desc=>"Seconds between health check probes. 2-3600",
644
+ :type=>:numeric,
645
+ :required=>false},
646
+ :algorithm=>
647
+ {:desc=>
648
+ "Balancing algorithm. One of 'roundrobin', 'leastconn', 'source'",
649
+ :type=>:string,
650
+ :required=>false},
651
+ :nodebalancerid=>
652
+ {:desc=>"The parent NodeBalancer's ID",
653
+ :type=>:numeric,
654
+ :required=>true},
655
+ :check_attempts=>
656
+ {:desc=>
657
+ "Number of failed probes before taking a node out of rotation. 1-30",
658
+ :type=>:string,
659
+ :required=>false},
660
+ :port=>
661
+ {:desc=>"Port to bind to on the public interfaces. 1-65534",
662
+ :type=>:numeric,
663
+ :required=>false},
664
+ :check=>
665
+ {:desc=>
666
+ "Perform active health checks on the backend nodes. One of 'connection', 'http', 'http_body'",
667
+ :type=>:string,
668
+ :required=>false},
669
+ :ssl_key=>
670
+ {:desc=>
671
+ "Unpassphrased private key for the SSL certificate when protocol is 'https'",
672
+ :type=>:string,
673
+ :required=>false},
674
+ :protocol=>
675
+ {:desc=>"Either 'tcp', 'http', or 'https'",
676
+ :type=>:string,
677
+ :required=>false},
678
+ :check_timeout=>
679
+ {:desc=>
680
+ "Seconds to wait before considering the probe a failure. 1-30. Must be less than check_interval.",
681
+ :type=>:string,
682
+ :required=>false},
683
+ :ssl_cert=>
684
+ {:desc=>
685
+ "SSL certificate served by the NodeBalancer when the protocol is 'https'",
686
+ :type=>:string,
687
+ :required=>false}}},
688
+ :update=>
689
+ {:type=>:call,
690
+ :desc=>"Updates a Config's properties",
691
+ :throws=>["NOTFOUND", "VALIDATION"],
692
+ :params=>
693
+ {:stickiness=>
694
+ {:desc=>
695
+ "Session persistence. One of 'none', 'table', 'http_cookie'",
696
+ :type=>:string,
697
+ :required=>false},
698
+ :check_path=>
699
+ {:desc=>"When check=http, the path to request",
700
+ :type=>:string,
701
+ :required=>false},
702
+ :check_body=>
703
+ {:desc=>
704
+ "When check=http_body, a regex against the expected result body",
705
+ :type=>:string,
706
+ :required=>false},
707
+ :check_interval=>
708
+ {:desc=>"Seconds between health check probes. 2-3600",
709
+ :type=>:numeric,
710
+ :required=>false},
711
+ :algorithm=>
712
+ {:desc=>
713
+ "Balancing algorithm. One of 'roundrobin', 'leastconn', 'source'",
714
+ :type=>:string,
715
+ :required=>false},
716
+ :configid=>{:desc=>"", :type=>:numeric, :required=>true},
717
+ :check_attempts=>
718
+ {:desc=>
719
+ "Number of failed probes before taking a node out of rotation. 1-30",
720
+ :type=>:string,
721
+ :required=>false},
722
+ :port=>
723
+ {:desc=>"Port to bind to on the public interfaces. 1-65534",
724
+ :type=>:numeric,
725
+ :required=>false},
726
+ :check=>
727
+ {:desc=>
728
+ "Perform active health checks on the backend nodes. One of 'connection', 'http', 'http_body'",
729
+ :type=>:string,
730
+ :required=>false},
731
+ :ssl_key=>
732
+ {:desc=>
733
+ "Unpassphrased private key for the SSL certificate when protocol is 'https'",
734
+ :type=>:string,
735
+ :required=>false},
736
+ :protocol=>
737
+ {:desc=>"Either 'tcp', 'http', or 'https'",
738
+ :type=>:string,
739
+ :required=>false},
740
+ :check_timeout=>
741
+ {:desc=>
742
+ "Seconds to wait before considering the probe a failure. 1-30. Must be less than check_interval.",
743
+ :type=>:string,
744
+ :required=>false},
745
+ :ssl_cert=>
746
+ {:desc=>
747
+ "SSL certificate served by the NodeBalancer when the protocol is 'https'",
748
+ :type=>:string,
749
+ :required=>false}}},
750
+ :delete=>
751
+ {:type=>:call,
752
+ :desc=>"Deletes a NodeBalancer's Config",
753
+ :throws=>["NOTFOUND"],
754
+ :params=>
755
+ {:configid=>
756
+ {:desc=>"The NodeBalancerID to delete",
757
+ :type=>:numeric,
758
+ :required=>true}}},
759
+ :list=>
760
+ {:type=>:call,
761
+ :desc=>
762
+ "Returns a list of NodeBalancers this user has access or delete to, including their properties",
763
+ :throws=>[],
764
+ :params=>
765
+ {:nodebalancerid=>{:desc=>"", :type=>:numeric, :required=>true},
766
+ :configid=>
767
+ {:desc=>"Limits the list to the specified ConfigID",
768
+ :type=>:numeric,
769
+ :required=>false}}}}},
770
+ :update=>
771
+ {:type=>:call,
772
+ :desc=>"Updates a NodeBalancer's properties",
773
+ :throws=>["NOTFOUND", "VALIDATION"],
774
+ :params=>
775
+ {:label=>
776
+ {:desc=>"This NodeBalancer's label",
777
+ :type=>:string,
778
+ :required=>false},
779
+ :clientconnthrottle=>
780
+ {:desc=>
781
+ "To help mitigate abuse, throttle connections per second, per client IP. 0 to disable. Max of 20.",
782
+ :type=>:numeric,
783
+ :required=>false},
784
+ :nodebalancerid=>{:desc=>"", :type=>:numeric, :required=>true}}},
785
+ :list=>
786
+ {:type=>:call,
787
+ :desc=>
788
+ "Returns a list of NodeBalancers this user has access or delete to, including their properties",
789
+ :throws=>[],
790
+ :params=>
791
+ {:nodebalancerid=>
792
+ {:desc=>"Limits the list to the specified NodeBalancerID",
793
+ :type=>:numeric,
794
+ :required=>false}}}}},
795
+ :domain=>
796
+ {:type=>:group,
797
+ :subs=>
798
+ {:update=>
799
+ {:type=>:call,
800
+ :desc=>"Update a domain record.",
801
+ :throws=>["NOTFOUND", "VALIDATION"],
802
+ :params=>
803
+ {:domainid=>{:desc=>"", :type=>:numeric, :required=>true},
804
+ :description=>
805
+ {:desc=>"Currently undisplayed.",
806
+ :type=>:string,
807
+ :required=>false},
808
+ :retry_sec=>{:desc=>"", :type=>:numeric, :required=>false},
809
+ :expire_sec=>{:desc=>"", :type=>:numeric, :required=>false},
810
+ :status=>
811
+ {:desc=>"0, 1, or 2 (disabled, active, edit mode)",
812
+ :type=>:numeric,
813
+ :required=>false},
814
+ :master_ips=>
815
+ {:desc=>
816
+ "When type=slave, the zone's master DNS servers list, semicolon separated ",
817
+ :type=>:string,
818
+ :required=>false},
819
+ :refresh_sec=>{:desc=>"", :type=>:numeric, :required=>false},
820
+ :lpm_displaygroup=>
821
+ {:desc=>
822
+ "Display group in the Domain list inside the Linode DNS Manager",
823
+ :type=>:string,
824
+ :required=>false},
825
+ :soa_email=>
826
+ {:desc=>"Required when type=master",
827
+ :type=>:string,
828
+ :required=>false},
829
+ :ttl_sec=>{:desc=>"", :type=>:numeric, :required=>false},
830
+ :domain=>
831
+ {:desc=>"The zone's name", :type=>:string, :required=>false},
832
+ :type=>{:desc=>"master or slave", :type=>:string, :required=>false},
833
+ :axfr_ips=>
834
+ {:desc=>
835
+ "IP addresses allowed to AXFR the entire zone, semicolon separated",
836
+ :type=>:string,
837
+ :required=>false}}},
838
+ :create=>
839
+ {:type=>:call,
840
+ :desc=>"Create a domain record.",
841
+ :throws=>["NOACCESS", "VALIDATION"],
842
+ :params=>
843
+ {:soa_email=>
844
+ {:desc=>"Required when type=master",
845
+ :type=>:string,
846
+ :required=>false},
847
+ :description=>
848
+ {:desc=>"Currently undisplayed.",
849
+ :type=>:string,
850
+ :required=>false},
851
+ :ttl_sec=>{:desc=>"", :type=>:numeric, :required=>false},
852
+ :retry_sec=>{:desc=>"", :type=>:numeric, :required=>false},
853
+ :expire_sec=>{:desc=>"", :type=>:numeric, :required=>false},
854
+ :status=>
855
+ {:desc=>"0, 1, or 2 (disabled, active, edit mode)",
856
+ :type=>:numeric,
857
+ :required=>false},
858
+ :domain=>
859
+ {:desc=>"The zone's name", :type=>:string, :required=>true},
860
+ :master_ips=>
861
+ {:desc=>
862
+ "When type=slave, the zone's master DNS servers list, semicolon separated ",
863
+ :type=>:string,
864
+ :required=>false},
865
+ :refresh_sec=>{:desc=>"", :type=>:numeric, :required=>false},
866
+ :lpm_displaygroup=>
867
+ {:desc=>
868
+ "Display group in the Domain list inside the Linode DNS Manager",
869
+ :type=>:string,
870
+ :required=>false},
871
+ :type=>{:desc=>"master or slave", :type=>:string, :required=>true},
872
+ :axfr_ips=>
873
+ {:desc=>
874
+ "IP addresses allowed to AXFR the entire zone, semicolon separated",
875
+ :type=>:string,
876
+ :required=>false}}},
877
+ :resource=>
878
+ {:type=>:group,
879
+ :subs=>
880
+ {:delete=>
881
+ {:type=>:call,
882
+ :desc=>"",
883
+ :throws=>["NOTFOUND"],
884
+ :params=>
885
+ {:domainid=>{:desc=>"", :type=>:numeric, :required=>true},
886
+ :resourceid=>{:desc=>"", :type=>:numeric, :required=>true}}},
887
+ :list=>
888
+ {:type=>:call,
889
+ :desc=>"",
890
+ :throws=>[],
891
+ :params=>
892
+ {:domainid=>{:desc=>"", :type=>:numeric, :required=>true},
893
+ :resourceid=>{:desc=>"", :type=>:numeric, :required=>false}}},
894
+ :create=>
895
+ {:type=>:call,
896
+ :desc=>"Create a domain record.",
897
+ :throws=>["NOACCESS", "VALIDATION"],
898
+ :params=>
899
+ {:domainid=>{:desc=>"", :type=>:numeric, :required=>true},
900
+ :port=>{:desc=>"", :type=>:numeric, :required=>false},
901
+ :name=>
902
+ {:desc=>
903
+ "The hostname or FQDN. When Type=MX the subdomain to delegate to the Target MX server.",
904
+ :type=>:string,
905
+ :required=>false},
906
+ :weight=>{:desc=>"", :type=>:numeric, :required=>false},
907
+ :ttl_sec=>
908
+ {:desc=>"TTL. Leave as 0 to accept our default.",
909
+ :type=>:numeric,
910
+ :required=>false},
911
+ :priority=>
912
+ {:desc=>"Priority for MX and SRV records, 0-255",
913
+ :type=>:numeric,
914
+ :required=>false},
915
+ :target=>
916
+ {:desc=>
917
+ "When Type=MX the hostname. When Type=CNAME the target of the alias. When Type=TXT the value of the record. \n\t\tWhen Type=A or AAAA the token of '[remote_addr]' will be substituted with the IP address of the request.",
918
+ :type=>:string,
919
+ :required=>false},
920
+ :protocol=>
921
+ {:desc=>
922
+ "The protocol to append to an SRV record. Ignored on other record types.",
923
+ :type=>:string,
924
+ :required=>false},
925
+ :type=>
926
+ {:desc=>"One of: NS, MX, A, AAAA, CNAME, TXT, or SRV",
927
+ :type=>:string,
928
+ :required=>true}}},
929
+ :update=>
930
+ {:type=>:call,
931
+ :desc=>"Update a domain record.",
932
+ :throws=>["NOTFOUND", "VALIDATION"],
933
+ :params=>
934
+ {:domainid=>{:desc=>"", :type=>:numeric, :required=>false},
935
+ :port=>{:desc=>"", :type=>:numeric, :required=>false},
936
+ :resourceid=>{:desc=>"", :type=>:numeric, :required=>true},
937
+ :name=>
938
+ {:desc=>
939
+ "The hostname or FQDN. When Type=MX the subdomain to delegate to the Target MX server.",
940
+ :type=>:string,
941
+ :required=>false},
942
+ :weight=>{:desc=>"", :type=>:numeric, :required=>false},
943
+ :ttl_sec=>
944
+ {:desc=>"TTL. Leave as 0 to accept our default.",
945
+ :type=>:numeric,
946
+ :required=>false},
947
+ :priority=>
948
+ {:desc=>"Priority for MX and SRV records, 0-255",
949
+ :type=>:numeric,
950
+ :required=>false},
951
+ :target=>
952
+ {:desc=>
953
+ "When Type=MX the hostname. When Type=CNAME the target of the alias. When Type=TXT the value of the record. \n\t\tWhen Type=A or AAAA the token of '[remote_addr]' will be substituted with the IP address of the request.",
954
+ :type=>:string,
955
+ :required=>false},
956
+ :protocol=>
957
+ {:desc=>
958
+ "The protocol to append to an SRV record. Ignored on other record types.",
959
+ :type=>:string,
960
+ :required=>false}}}}},
961
+ :list=>
962
+ {:type=>:call,
963
+ :desc=>"Lists domains you have access to.",
964
+ :throws=>[],
965
+ :params=>
966
+ {:domainid=>
967
+ {:desc=>"Limits the list to the specified DomainID",
968
+ :type=>:numeric,
969
+ :required=>false}}},
970
+ :delete=>
971
+ {:type=>:call,
972
+ :desc=>"",
973
+ :throws=>["NOTFOUND"],
974
+ :params=>
975
+ {:domainid=>{:desc=>"", :type=>:numeric, :required=>true}}}}},
976
+ :avail=>
977
+ {:type=>:group,
978
+ :subs=>
979
+ {:datacenters=>
980
+ {:type=>:call,
981
+ :desc=>"Returns a list of Linode data center facilities.",
982
+ :throws=>[],
983
+ :params=>{}},
984
+ :linodeplans=>
985
+ {:type=>:call,
986
+ :desc=>
987
+ "Returns a structure of Linode PlanIDs containing the Plan label and the availability in each Datacenter. Please note, this method is deprecated and will be removed in the future.",
988
+ :throws=>[],
989
+ :params=>
990
+ {:planid=>
991
+ {:desc=>"Limits the list to the specified PlanID",
992
+ :type=>:numeric,
993
+ :required=>false}}},
994
+ :stackscripts=>
995
+ {:type=>:call,
996
+ :desc=>"Returns a list of available public StackScripts.",
997
+ :throws=>[],
998
+ :params=>
999
+ {:distributionid=>
1000
+ {:desc=>
1001
+ "Limit the results to StackScripts that can be applied to this DistributionID",
1002
+ :type=>:numeric,
1003
+ :required=>false},
1004
+ :keywords=>
1005
+ {:desc=>"Search terms", :type=>:string, :required=>false},
1006
+ :distributionvendor=>
1007
+ {:desc=>"Debian, Ubuntu, Fedora, etc.",
1008
+ :type=>:string,
1009
+ :required=>false}}},
1010
+ :distributions=>
1011
+ {:type=>:call,
1012
+ :desc=>"Returns a list of available Linux Distributions.",
1013
+ :throws=>[],
1014
+ :params=>
1015
+ {:distributionid=>
1016
+ {:desc=>"Limits the results to the specified DistributionID",
1017
+ :type=>:numeric,
1018
+ :required=>false}}},
1019
+ :kernels=>
1020
+ {:type=>:call,
1021
+ :desc=>"List available kernels.",
1022
+ :throws=>[],
1023
+ :params=>
1024
+ {:isxen=>
1025
+ {:desc=>"Limits the results to show only Xen kernels",
1026
+ :type=>:boolean,
1027
+ :required=>false},
1028
+ :kernelid=>{:desc=>"", :type=>:numeric, :required=>false}}}}},
1029
+ :account=>
1030
+ {:type=>:group,
1031
+ :subs=>
1032
+ {:estimateinvoice=>
1033
+ {:type=>:call,
1034
+ :desc=>
1035
+ "Estimates the invoice for adding a new Linode or NodeBalancer as well as resizing a Linode. This returns two fields: PRICE which is the estimated cost of the invoice, and INVOICE_TO which is the date invoice would be though with timezone set to America/New_York",
1036
+ :throws=>["VALIDATION"],
1037
+ :params=>
1038
+ {:paymentterm=>
1039
+ {:desc=>
1040
+ "Subscription term in months. One of: 1, 12, or 24. This is required for modes 'linode_new' and 'nodebalancer_new'.",
1041
+ :type=>:numeric,
1042
+ :required=>false},
1043
+ :mode=>
1044
+ {:desc=>
1045
+ "This is one of the following options: 'linode_new', 'linode_resize', or 'nodebalancer_new'.",
1046
+ :type=>:string,
1047
+ :required=>true},
1048
+ :planid=>
1049
+ {:desc=>
1050
+ "The desired PlanID available from avail.LinodePlans(). This is required for modes 'linode_new' and 'linode_resize'.",
1051
+ :type=>:numeric,
1052
+ :required=>false},
1053
+ :linodeid=>
1054
+ {:desc=>
1055
+ "This is the LinodeID you want to resize and is required for mode 'linode_resize'.",
1056
+ :type=>:numeric,
1057
+ :required=>false}}},
1058
+ :updatecard=>
1059
+ {:type=>:call,
1060
+ :desc=>"",
1061
+ :throws=>[],
1062
+ :params=>
1063
+ {:ccexpmonth=>{:desc=>"", :type=>:numeric, :required=>true},
1064
+ :ccexpyear=>{:desc=>"", :type=>:numeric, :required=>true},
1065
+ :ccnumber=>{:desc=>"", :type=>:numeric, :required=>true}}},
1066
+ :info=>
1067
+ {:type=>:call,
1068
+ :desc=>
1069
+ "Shows information about your account such as the date your account was opened as well as your network utilization for the current month in gigabytes.",
1070
+ :throws=>[],
1071
+ :params=>{}},
1072
+ :paybalance=>
1073
+ {:type=>:call,
1074
+ :desc=>"Pays current balance on file, returning it in the response.",
1075
+ :throws=>
1076
+ ["CCEXPIRED",
1077
+ "CCFAILED",
1078
+ "NOACCESS",
1079
+ "PAYMENTLIMITER",
1080
+ "VALIDATION"],
1081
+ :params=>{}}}},
1082
+ :stackscript=>
1083
+ {:type=>:group,
1084
+ :subs=>
1085
+ {:create=>
1086
+ {:type=>:call,
1087
+ :desc=>"Create a StackScript.",
1088
+ :throws=>["NOACCESS", "VALIDATION"],
1089
+ :params=>
1090
+ {:label=>
1091
+ {:desc=>"The Label for this StackScript",
1092
+ :type=>:string,
1093
+ :required=>true},
1094
+ :rev_note=>{:desc=>"", :type=>:string, :required=>false},
1095
+ :script=>
1096
+ {:desc=>"The actual script", :type=>:string, :required=>true},
1097
+ :ispublic=>
1098
+ {:desc=>
1099
+ "Whether this StackScript is published in the Library, for everyone to use",
1100
+ :type=>:boolean,
1101
+ :required=>false},
1102
+ :distributionidlist=>
1103
+ {:desc=>
1104
+ "Comma delimited list of DistributionIDs that this script works on ",
1105
+ :type=>:string,
1106
+ :required=>true},
1107
+ :description=>{:desc=>"", :type=>:string, :required=>false}}},
1108
+ :delete=>
1109
+ {:type=>:call,
1110
+ :desc=>"",
1111
+ :throws=>["NOTFOUND"],
1112
+ :params=>
1113
+ {:stackscriptid=>{:desc=>"", :type=>:numeric, :required=>true}}},
1114
+ :update=>
1115
+ {:type=>:call,
1116
+ :desc=>"Update a StackScript.",
1117
+ :throws=>["NOTFOUND", "VALIDATION"],
1118
+ :params=>
1119
+ {:rev_note=>{:desc=>"", :type=>:string, :required=>false},
1120
+ :script=>
1121
+ {:desc=>"The actual script", :type=>:string, :required=>false},
1122
+ :description=>{:desc=>"", :type=>:string, :required=>false},
1123
+ :distributionidlist=>
1124
+ {:desc=>
1125
+ "Comma delimited list of DistributionIDs that this script works on ",
1126
+ :type=>:string,
1127
+ :required=>false},
1128
+ :label=>
1129
+ {:desc=>"The Label for this StackScript",
1130
+ :type=>:string,
1131
+ :required=>false},
1132
+ :ispublic=>
1133
+ {:desc=>
1134
+ "Whether this StackScript is published in the Library, for everyone to use",
1135
+ :type=>:boolean,
1136
+ :required=>false},
1137
+ :stackscriptid=>{:desc=>"", :type=>:numeric, :required=>true}}},
1138
+ :list=>
1139
+ {:type=>:call,
1140
+ :desc=>"Lists StackScripts you have access to.",
1141
+ :throws=>[],
1142
+ :params=>
1143
+ {:stackscriptid=>
1144
+ {:desc=>"Limits the list to the specified StackScriptID",
1145
+ :type=>:numeric,
1146
+ :required=>false}}}}},
1147
+ :api=>
1148
+ {:type=>:group,
1149
+ :subs=>
1150
+ {:spec=>
1151
+ {:type=>:call,
1152
+ :desc=>
1153
+ "Returns a data structure of the entire Linode API specification. This method does not require authorization.<br><br>For example: <a target=\"_blank\" href=\"https://api.linode.com/?api_action=api.spec\">https://api.linode.com/?api_action=api.spec</a>",
1154
+ :throws=>[],
1155
+ :params=>{}}}},
1156
+ :user=>
1157
+ {:type=>:group,
1158
+ :subs=>
1159
+ {:getapikey=>
1160
+ {:type=>:call,
1161
+ :desc=>
1162
+ "Returns a user's API key. If no API key exists, one is generated. This method does not require an api_key to be passed in.",
1163
+ :throws=>[],
1164
+ :params=>
1165
+ {:password=>{:desc=>"", :type=>:string, :required=>true},
1166
+ :username=>{:desc=>"", :type=>:string, :required=>true}}}}},
1167
+ :test=>
1168
+ {:type=>:group,
1169
+ :subs=>
1170
+ {:echo=>
1171
+ {:type=>:call,
1172
+ :desc=>"Echos back parameters that were passed in.",
1173
+ :throws=>[],
1174
+ :params=>{}}}}}}
1175
+
1176
+ end