Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Page
Library
Module
Module type
Parameter
Class
Class type
Source
API.Device
This module manages API parts related to devices.
val id_of_string : string -> id
id_of_string str
creates a unique identifier from str
.
val action_to_string : action -> string
action_of_string action
returns a readable action as a string.
val os_to_string : os -> string
os_to_string os
converts an os into a string understandable by the API.
val location_to_string : location -> string
location_to_string metro
converts a metro into a string understandable by the API.
val plan_to_string : plan -> string
plan_to_string plan
converts a plan into a string understandable by the API.
type config = {
id : id;
hostname : string;
location : location;
plan : plan;
os : os;
state : State.t;
user : string;
created_at : ODate.Unix.t;
ips : Ip.config list;
}
This type represents the current configuration for the device. ips
can be empty.
val to_string : config -> string
to_string config
returns a readable string containing the config.
get_from t t ~id
returns a config
that contains information about the device specified by id
.
get_events_from t ~id
retrieves information about the device events.
execute_action_on t ~id ~action
executes an action on the device specified by its id.
delete t ~id ~force ()
deletes a device on Equinix and returns a json
with the result. ?force
defaults to false
, if true
then it forces the deletion of the device by detaching any storage volume still active.
val create : t -> id:Project.id -> builder -> config io
create t ~id builder
creates a machine on the Equinix with the Devices.builder
specification.
val get_all_from_project : t -> id:Project.id -> config list io
get_all_from_project t ~id
returns the config
list that contains all the devices related to the project id
.
val pp : config -> unit
pp config
prints a readable string representing the config.