Permalink
Browse files

Reflects renaming of old domain_api context

  • Loading branch information...
1 parent 41c9b24 commit 8982301ef8a2dd6ccfde4ee27a776ac5cfe98c60 @jcrossley3 jcrossley3 committed Jul 13, 2011
Showing with 13 additions and 13 deletions.
  1. +13 −13 lib/torquespec/as7.rb
View
@@ -14,46 +14,46 @@ def start_command
end
def shutdown
- domain_api( :operation => "shutdown" )
+ api( :operation => "shutdown" )
rescue EOFError
# ignorable
end
def _deploy(path)
once = true
begin
- domain_api( :operation => "add",
- :address => [ "deployment", addressify(path) ],
- :content => [ { :url=>urlify(path)} ] )
- rescue Exception=>e
+ api( :operation => "add",
+ :address => [ "deployment", addressify(path) ],
+ :content => [ { :url=>urlify(path)} ] )
+ rescue Exception
_undeploy(path)
if once
once = false
retry
else
- raise e
+ raise
end
end
- domain_api( :operation => "deploy",
- :address => [ "deployment", addressify(path) ] )
+ api( :operation => "deploy",
+ :address => [ "deployment", addressify(path) ] )
end
def _undeploy(path)
- domain_api( :operation => "remove",
- :address => [ "deployment", addressify(path) ] )
+ api( :operation => "remove",
+ :address => [ "deployment", addressify(path) ] )
end
def ready?
- response = JSON.parse( domain_api( :operation => "read-attribute",
- :name => "server-state") )
+ response = JSON.parse( api( :operation => "read-attribute",
+ :name => "server-state") )
response['outcome'].downcase=='success' && response['result'].downcase=='running'
rescue
false
end
private
- def domain_api(params)
+ def api(params)
post('/management', params.merge('json.pretty' => 1).to_json)
end

0 comments on commit 8982301

Please sign in to comment.