struct CrystaLXD::Client

Overview

Raise an Exception on an error.

CrystaLXD::Client.new(
  tls: OpenSSL::SSL::Context::Client.from_hash({
    "key"         => "certs/lxd.key",
    "cert"        => "certs/lxd.crt",
    "verify_mode" => "none",
  })
)

Defined in:

client.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(tls : OpenSSL::SSL::Context::Client, host : String = "::1", port : Int32 = 8443, path : String = "/") #

[View source]

Instance Method Detail

def api_path : String #

[View source]
def container(name : String) : Container #

Instantiates a new container wrapper.


[View source]
def containers(url : Bool = false) : Success(Array(String)) | Error #

List of containers, or URLs of containers, this server publishes (https://github.com/lxc/lxd/blob/master/doc/rest-api.md#get-4).


[View source]
def delete(klass : U.class, path : String = "", body = nil) : Success(U) | Error forall U #

[View source]
def get(klass : U.class, path : String = "", body = nil) : Success(U) | Error forall U #

[View source]
def http_client : HTTP::Client #

[View source]
def information : Success(Information) | Error #

Server configuration and environment information (https://github.com/lxc/lxd/blob/master/doc/rest-api.md#get-1).


[View source]
def operation(operation_or_uuid : Success(BackgroundOperation) | Error | String) : Operation #

Instantiates a new operation wrapper.


[View source]
def operations(url : Bool = false) : Success(Hash(Success::Code, Array(String))) | Error #

List of operations, or URLs of operations, that are currently going on/queued https://github.com/lxc/lxd/blob/master/doc/rest-api.md#get-23


[View source]
def parse_response(klass : U.class, response) : Success(U) | Error forall U #

[View source]
def patch(klass : U.class, path : String = "", body = nil) : Success(U) | Error forall U #

[View source]
def post(klass : U.class, path : String = "", body = nil) : Success(U) | Error forall U #

[View source]
def put(klass : U.class, path : String = "", body = nil) : Success(U) | Error forall U #

[View source]
def websocket(path : String) #

[View source]