X-Git-Url: https://jasonwoof.com/gitweb/?p=af-coffee.git;a=blobdiff_plain;f=api.coffee;h=60b9ad8bcd4a3faf75bfbd5cae9a6dbf7c9b151b;hp=156e91c1c313ca28691c5ece8dfd9f110cac82ba;hb=3f07c319c4ba7091ce7ef1c2df9aa0623e74ae49;hpb=36afa8a844f8dc9fc50bf6ee4da3fc55e900d9b1 diff --git a/api.coffee b/api.coffee index 156e91c..60b9ad8 100644 --- a/api.coffee +++ b/api.coffee @@ -167,12 +167,6 @@ exports.login = login = (username, password, callback) -> else callback "login: couldn't find the token in the server response: #{JSON.stringify response}" -# this is the friendly one that updates the files then restarts the app -exports.app_publish = (token, app_name, zip_file, callback) -> - exports.app_update_files token, app_name, zip_file, (err) -> - return callback err if err? - exports.app_restart token, app_name, callback - exports.app_update_files = (token, app_name, zip_file, callback) -> request( 'POST', @@ -192,29 +186,6 @@ exports.app_update_files = (token, app_name, zip_file, callback) -> exports.app_set_info = (token, app_name, info, callback) -> json_put "/apps/#{app_name}", info, token, callback -app_set_state = (token, app_name, state, callback) -> - async.waterfall [ - (callback) -> - exports.app_info token, app_name, callback - (info, callback) -> - info.state = state - exports.app_set_info token, app_name, info, callback - ], callback - -exports.app_start = (token, app_name, callback) -> - app_set_state token, app_name, 'STARTED', callback - -exports.app_stop = (token, app_name, callback) -> - app_set_state token, app_name, 'STOPPED', callback - -exports.app_restart = (token, app_name, callback) -> - # Server requires you to fetch the app state before each call to change - # it, so there's no quicker way than just calling app_stop then app_start - async.waterfall [ - (callback) -> exports.app_stop token, app_name, callback - (callback) -> exports.app_start token, app_name, callback - ], callback - app_get = (path) -> return (token, app_name, callback) -> json_get "/apps/#{app_name}#{path}", token, callback