package equinoxe-hlc

  1. Overview
  2. Docs

This module manages API parts related to devices.

type id

Unique identifier for the Equinix API.

val id_of_string : string -> id

id_of_string str creates a unique identifier from str.

type action =
  1. | Power_on
  2. | Power_off
  3. | Reboot
  4. | Reinstall
  5. | Rescue

Actions executable with a device.

val action_to_string : action -> string

action_of_string action returns a readable action as a string.

type os =
  1. | Debian_9
  2. | Debian_10
  3. | NixOs_21_05
  4. | Ubuntu_18_04
  5. | Ubuntu_20_04
  6. | Ubuntu_21_04
  7. | FreeBSD_11_2
  8. | Centos_8
  9. | Alpine_3

Os available when creating a new device.

val os_to_string : os -> string

os_to_string os converts an os into a string understandable by the API.

type location =
  1. | Washington
  2. | Dallas
  3. | Silicon_valley
  4. | Sao_paulo
  5. | Amsterdam
  6. | Frankfurt
  7. | Singapore
  8. | Sydney

Locations available when deploying a new device.

val location_to_string : location -> string

location_to_string metro converts a metro into a string understandable by the API.

type plan =
  1. | C3_small_x86
  2. | C3_medium_x86

Server type when deploying a new device.

val plan_to_string : plan -> string

plan_to_string plan converts a plan into a string understandable by the API.

type builder

This type represents the configuration wanted for a device.

val build : ?hostname:string -> plan:plan -> os:os -> location:location -> unit -> builder
type config = {
  1. id : id;
  2. hostname : string;
  3. location : location;
  4. plan : plan;
  5. os : os;
  6. state : State.t;
  7. tags : string list;
  8. user : string;
  9. created_at : Equinoxe__.Equinoxe_intf.Date.t;
  10. 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.

val get_from : t -> id:id -> config io

get_from t t ~id returns a config that contains information about the device specified by id.

val get_events_from : t -> id:id -> Event.t list io

get_events_from t ~id retrieves information about the device events.

val execute_action_on : t -> id:id -> action:action -> unit io

execute_action_on t ~id ~action executes an action on the device specified by its id.

val delete : t -> id:id -> ?force:bool -> unit -> unit io

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.

OCaml

Innovation. Community. Security.