# Module api_vm

- Description
- Function Index
- Function Details

Administrative functions available for external programs.

Copyright © 2011-2014 Zuse Institute Berlin

Version: $Id$

Authors: Nico Kruber (`kruber@zib.de`).

## Description

Administrative functions available for external programs.

## Function Index

add_nodes/1 | Adds Number Scalaris nodes to this VM.
add_nodes_at_ids/1 |
get_info/0 | Gets some information about the VM and Scalaris.
get_nodes/0 | Gets the names of all Scalaris nodes inside this VM.
get_other_vms/1 | Gets connection info for a random subset of known nodes by the cyclon processes of the dht_node processes in this VM.
get_version/0 | Gets the version of Scalaris.
kill_node/1 | Kills a given node.
kill_nodes/1 | Kills multiple nodes.
kill_nodes_by_name/1 |
kill_vm/0 | Kills this VM.
number_of_nodes/0 | Gets the number of Scalaris nodes inside this VM.
shutdown_node/1 | Sends a graceful leave request to a given node.
shutdown_nodes/1 | Sends a graceful leave request to multiple nodes.
shutdown_nodes_by_name/1 |
shutdown_vm/0 | Graceful shutdown of this VM.
wait_for_scalaris_to_start/0 | waits until the supervisor has started and the VM has IP+port.

## Function Details

### get_version/0

    get_version() -> string()

Gets the version of Scalaris.

### get_info/0

    get_info() ->
                [{scalaris_version | erlang_version, string()} |
                 {mem_total, non_neg_integer()} |
                 {uptime, Ms :: non_neg_integer()} |
                 {erlang_node, node()} |
                 {ip, inet:ip_address()} |
                 {port, non_neg_integer()} |
                 {yaws_port, non_neg_integer()}]

Gets some information about the VM and Scalaris.

### number_of_nodes/0

    number_of_nodes() -> non_neg_integer()

Gets the number of Scalaris nodes inside this VM.

### get_nodes/0

    get_nodes() -> [pid_groups:groupname()]

Gets the names of all Scalaris nodes inside this VM.

### add_nodes/1

    add_nodes(Number :: non_neg_integer()) ->
                 {[pid_groups:groupname()], [{error, term()}]}

Adds Number Scalaris nodes to this VM.

### add_nodes_at_ids/1

    add_nodes_at_ids(Keys :: [rt_chord:key()]) ->
                        {[pid_groups:groupname()], [{error, term()}]}

### shutdown_node/1

    shutdown_node(Name :: pid_groups:groupname()) -> ok | not_found

Sends a graceful leave request to a given node.

### shutdown_nodes/1

    shutdown_nodes(Count :: non_neg_integer()) ->
                      Ok :: [pid_groups:groupname()]

Sends a graceful leave request to multiple nodes.

### shutdown_nodes_by_name/1

    shutdown_nodes_by_name(Names :: [pid_groups:groupname()]) ->
                              {Ok :: [pid_groups:groupname()],
                               NotFound :: [pid_groups:groupname()]}

### kill_node/1

    kill_node(Name :: pid_groups:groupname()) -> ok | not_found

Kills a given node.

### kill_nodes/1

    kill_nodes(Count :: non_neg_integer()) ->
                  Ok :: [pid_groups:groupname()]

Kills multiple nodes.

### kill_nodes_by_name/1

    kill_nodes_by_name(Names :: [pid_groups:groupname()]) ->
                          {Ok :: [pid_groups:groupname()],
                           NotFound :: [pid_groups:groupname()]}

### get_other_vms/1

    get_other_vms(MaxVMs :: pos_integer()) ->
                     [{ErlNode :: node(),
                       Ip :: inet:ip_address(),
                       Port :: non_neg_integer(),
                       YawsPort :: non_neg_integer()}]

Gets connection info for a random subset of known nodes by the cyclon processes of the dht_node processes in this VM.

### shutdown_vm/0

    shutdown_vm() -> ok | no_partner_found

Graceful shutdown of this VM. If the last Scalaris node of this VM cannot gracefully shut down because it doesn't know any other node to move its data to, 'no_partner_found' will be returned.

### kill_vm/0

    kill_vm() -> ok

Kills this VM.

### wait_for_scalaris_to_start/0

    wait_for_scalaris_to_start() -> ok

waits until the supervisor has started and the VM has IP+port

Generated by EDoc, Feb 29 2016, 16:12:22.