forked from fog/fog
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[linode] avail_kernels, linode_create, linode_delete, linode_list, li…
…node_reboot
- Loading branch information
Showing
8 changed files
with
182 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
module Fog | ||
module Linode | ||
class Real | ||
|
||
# Get available stack scripts | ||
# | ||
# ==== Parameters | ||
# * options<~Hash>: | ||
# * distributionId<~Integer>: Limit the results to Stackscripts that can be applied to this distribution id | ||
# * distributionVendor<~String>: Debian, Ubuntu, Fedora, etc. | ||
# * keywords<~String>: Search terms | ||
# | ||
# ==== Returns | ||
# * response<~Excon::Response>: | ||
# * body<~Array>: | ||
# TODO: docs | ||
def avail_stackscripts(options={}) | ||
request( | ||
:expects => 200, | ||
:method => 'GET', | ||
:query => { :api_action => 'avail.stackscripts' }.merge!(options) | ||
) | ||
end | ||
|
||
end | ||
|
||
class Mock | ||
|
||
def avail_stackscripts(options={}) | ||
Fog::Mock.not_implemented | ||
end | ||
|
||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
module Fog | ||
module Linode | ||
class Real | ||
|
||
# Creates a linode and assigns you full privileges | ||
# | ||
# ==== Parameters | ||
# * datacenter_id<~Integer>: id of datacenter to place new linode in | ||
# * payment_term<~Integer>: Subscription term in months, in [1, 12, 24] | ||
# * plan_id<~Integer>: id of plan to boot new linode with | ||
# | ||
# ==== Returns | ||
# * response<~Excon::Response>: | ||
# * body<~Array>: | ||
# TODO: docs | ||
def linode_create(datacenter_id, payment_term, plan_id) | ||
request( | ||
:expects => 200, | ||
:method => 'GET', | ||
:query => { | ||
:api_action => 'linode.create', | ||
:datacenterId => datacenter_id, | ||
:paymentTerm => payment_term, | ||
:planId => plan_id | ||
} | ||
) | ||
end | ||
|
||
end | ||
|
||
class Mock | ||
|
||
def linode_create(datacenter_id, payment_term, plan_id) | ||
Fog::Mock.not_implemented | ||
end | ||
|
||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
module Fog | ||
module Linode | ||
class Real | ||
|
||
# List all linodes user has access or delete to | ||
# | ||
# ==== Parameters | ||
# * linode_id<~Integer>: id of linode to delete | ||
# * options<~Hash>: | ||
# * skipChecks<~Boolean>: skips safety checks and always deletes | ||
# | ||
# ==== Returns | ||
# * response<~Excon::Response>: | ||
# * body<~Array>: | ||
# TODO: docs | ||
def linode_delete(linode_id, options={}) | ||
request( | ||
:expects => 200, | ||
:method => 'GET', | ||
:query => { :api_action => 'linode.delete', :linodeId => linode_id }.merge!(options) | ||
) | ||
end | ||
|
||
end | ||
|
||
class Mock | ||
|
||
def linode_delete(linode_id, options={}) | ||
Fog::Mock.not_implemented | ||
end | ||
|
||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
module Fog | ||
module Linode | ||
class Real | ||
|
||
# List all linodes user has access or delete to | ||
# | ||
# ==== Parameters | ||
# * options<~Hash>: | ||
# * linodeId<~Integer>: Limit the list to the specified LinodeID | ||
# | ||
# ==== Returns | ||
# * response<~Excon::Response>: | ||
# * body<~Array>: | ||
# TODO: docs | ||
def linode_list(options={}) | ||
request( | ||
:expects => 200, | ||
:method => 'GET', | ||
:query => { :api_action => 'linode.list' }.merge!(options) | ||
) | ||
end | ||
|
||
end | ||
|
||
class Mock | ||
|
||
def linode_list(options={}) | ||
Fog::Mock.not_implemented | ||
end | ||
|
||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
module Fog | ||
module Linode | ||
class Real | ||
|
||
# Issues a shutdown, and then a boot job for a given linode | ||
# | ||
# ==== Parameters | ||
# * linode_id<~Integer>: id of linode to reboot | ||
# * options<~Hash>: | ||
# * configId<~Boolean>: id of config to boot server with | ||
# | ||
# ==== Returns | ||
# * response<~Excon::Response>: | ||
# * body<~Array>: | ||
# TODO: docs | ||
def linode_reboot(linode_id, options={}) | ||
request( | ||
:expects => 200, | ||
:method => 'GET', | ||
:query => { :api_action => 'linode.reboot', :linodeId => linode_id }.merge!(options) | ||
) | ||
end | ||
|
||
end | ||
|
||
class Mock | ||
|
||
def linode_reboot(linode_id, options={}) | ||
Fog::Mock.not_implemented | ||
end | ||
|
||
end | ||
end | ||
end |