Module api_autoscale

Simple auto-scaling service API.

Copyright © 2013 Zuse Institute Berlin

Version: $Id$

Authors: Ufuk Celebi (celebi@zib.de).

Description

Simple auto-scaling service API.

Data Types

autoscale_error_resp()

autoscale_error_resp() = 
    {error, resp_timeout | autoscale_false}

Function Index

activate_alarms/0Set all alarms to active.
check_config/0Checks whether config parameters exist and are valid (requires a pull configuration, i.e.
deactivate_alarms/0Set all alarms to inactive.
lock_scale_req/0
pull_scale_req/0Pull current scale request from autoscale leader.
reset_plot_data/0
toggle_alarm/1Toggle state of alarm Name from active to inactive and vice versa.
unlock_scale_req/0
write_plot_data/0

Function Details

check_config/0

check_config() -> boolean()

Checks whether config parameters exist and are valid (requires a pull configuration, i.e. cloud_cps as cloud_module).

pull_scale_req/0

pull_scale_req() ->
                  {ok, Req :: integer()} | autoscale_error_resp()

Pull current scale request from autoscale leader. If the request is not 0, further requests should be locked with lock_scale_req/0 until a unlock_scale_req/0 call has been made. Autoscale defines a timeout, after which the lock will be automatically freed, i.e. the caller has $timeout seconds to satisfy the request and notify autoscale by unlock_scale_req/0.

lock_scale_req/0

lock_scale_req() -> ok | {error, locked} | autoscale_error_resp()

unlock_scale_req/0

unlock_scale_req() ->
                    ok |
                    {error, not_locked} |
                    autoscale_error_resp()

toggle_alarm/1

toggle_alarm(Name :: atom()) ->
                {ok, {new_state, NewState :: active | inactive}} |
                {error, unknown_alarm | tx_fail} |
                autoscale_error_resp()

Toggle state of alarm Name from active to inactive and vice versa.

activate_alarms/0

activate_alarms() ->
                   ok | {error, tx_fail} | autoscale_error_resp()

Set all alarms to active.

deactivate_alarms/0

deactivate_alarms() ->
                     ok |
                     {error, tx_fail} |
                     autoscale_error_resp()

Set all alarms to inactive.

write_plot_data/0

write_plot_data() ->
                   ok |
                   {error,
                    mgmt_server_false | autoscale_server_false}

reset_plot_data/0

reset_plot_data() ->
                   ok |
                   {error,
                    mgmt_server_false | autoscale_server_false}


Generated by EDoc, Feb 29 2016, 16:16:25.