AzureAPI.VirtualMachineController (azure_billing_dashboard v0.2.0)
Interface for making API calls.
This module uses a GenServer to store data required for API requests.
Link to this section Summary
Public Facing
Public facing call for getting availability
Public facing call for retreiving cost data
Starts the GenServer.
Public facing call for starting a virtual machine
Public facing call for stopping (deallocating) a virtual machine
Functions
Returns a specification to start this module under a supervisor.
Callback implementation for GenServer.init/1.
Link to this section Public Facing
get_availability(pid)
Public facing call for getting availability
get_cost_data(vm, pid)
Public facing call for retreiving cost data
start_link(user)
Starts the GenServer.
Implicitly calls init/1 with the user passed in.
start_virtual_machine(name, pid)
Public facing call for starting a virtual machine
stop_virtual_machine(name, pid)
Public facing call for stopping (deallocating) a virtual machine
Link to this section Callbacks
handle_call(msg, from, state)
Server callbacks for messages
Possible msgs:
- :get_virtual_machines (deprecated)
- :get_availability - calls AzureCalls.get_availability/1
- [:start_virtual_machine, name] - calls AzureCalls.start_azure_machine/1
- [:stop_virtual_machine, name] - calls AzureCalls.stop_azure_machine/1
- [:get_cost_data, vm] - calls AzureCalls.get_azure_cost_data/1
handle_info(msg, state)
Handles messages sent to the server
Possible messages:
- :refresh_token - calls AzureCalls.get_token/1
- :refresh_sync - calls AzureCalls.list_azure_machines_and_statuses/1
Link to this section Callbacks
handle_call(msg, from, state)
Server callbacks for messages
Possible msgs:
- :get_virtual_machines (deprecated)
- :get_availability - calls AzureCalls.get_availability/1
- [:start_virtual_machine, name] - calls AzureCalls.start_azure_machine/1
- [:stop_virtual_machine, name] - calls AzureCalls.stop_azure_machine/1
- [:get_cost_data, vm] - calls AzureCalls.get_azure_cost_data/1
handle_info(msg, state)
Handles messages sent to the server
Possible messages:
- :refresh_token - calls AzureCalls.get_token/1
- :refresh_sync - calls AzureCalls.list_azure_machines_and_statuses/1
Link to this section Functions
child_spec(init_arg)
Returns a specification to start this module under a supervisor.
See Supervisor.
init(user)
Callback implementation for GenServer.init/1.