class PlaceOS::Client::APIWrapper::Systems

Included Modules

Defined in:

placeos/api_wrapper/systems.cr

Constructors

Instance Method Summary

Instance methods inherited from module PlaceOS::Client::APIWrapper::Endpoint::Destroy

destroy(id : String) destroy

Instance methods inherited from module PlaceOS::Client::APIWrapper::Endpoint::Fetch(PlaceOS::Client::API::Models::System)

fetch(id : String) fetch

Instance methods inherited from class PlaceOS::Client::APIWrapper::Endpoint

base : String base

Constructor methods inherited from class PlaceOS::Client::APIWrapper::Endpoint

new(client : APIWrapper) new

Macros inherited from class PlaceOS::Client::APIWrapper::Endpoint

delete(path, params = nil, headers = nil, body = nil, as model = nil) delete, get(path, params = nil, headers = nil, body = nil, as model = nil) get, head(path, params = nil, headers = nil, body = nil, as model = nil) head, options(path, params = nil, headers = nil, body = nil, as model = nil) options, patch(path, params = nil, headers = nil, body = nil, as model = nil) patch, post(path, params = nil, headers = nil, body = nil, as model = nil) post, put(path, params = nil, headers = nil, body = nil, as model = nil) put

Constructor Detail

def self.new(client : APIWrapper) #

[View source]

Instance Method Detail

def base : String #
Description copied from class PlaceOS::Client::APIWrapper::Endpoint

The base route for the endpoint


[View source]
def count(id : String, module_name : String) : Int32 | Nil #

Gets the number of module_name instances available in system id.


[View source]
def create(name : String, zones : Array(String), description : String | Nil = nil, email : String | Nil = nil, capacity : Int | Nil = nil, bookable : Bool | Nil = nil, installed_ui_devices : Int | Nil = nil, modules : Array(String) | Nil = nil, support_url : String | Nil = nil, display_name : String | Nil = nil, timezone : String | Nil = nil, code : String | Nil = nil, type : String | Nil = nil, map_id : String | Nil = nil, images : Array(String) | Nil = nil, features : Array(String) | Nil = nil, public : Bool | Nil = nil) #

Creates a new system.

Systems must be given a unique name within the PlaceOS instance they are running from. Additionally, a system must be a member of at least one zone. All other attributes are optional at the time of creation.


[View source]
def execute(id : String, module_name : String, method : String, index : Int32 = 1, *args : Array(JSON::Any::Type)) #

Executes a behaviour exposed by a module within the passed system id.


[View source]
def functions(id : String, module_name : String, index : Int = 1) #

Queries the behaviour exposed by a module within system id.


[View source]
def search(q : String | Nil = nil, limit : Int = 1000, offset : Int = 0, zone_id : String | Nil = nil, module_id : String | Nil = nil, features : String | Nil = nil, capacity : Int32 | Nil = nil, bookable : Bool | Nil = nil) #

List or search for systems.

Results maybe filtered by specifying a query - q - to search across system attributes. A small query language is supported within this:

Operator | Action -------- | ------ + | Matches both terms | | Matches either terms - | Negates a single token " | Wraps tokens to form a phrase ( ) | Provides precedence ~N | Specifies edit distance (fuzziness) after a word ~N | Specifies slop amount (deviation) after a phrase

Up to limit systems will be returned, with a paging based on offset.


[View source]
def settings(id : String) #

[View source]
def start(id : String) #

Start all modules within a system.


[View source]
def state(id : String, module_name : String, index : Int = 1, lookup : String | Nil = nil) #

Queries the state exposed by a module within the passed system id.


[View source]
def stop(id : String) #

Stops all modules within a system.


[View source]
def types(id : String) #

Queries the types of modules available in system id.


[View source]
def update(id : String, version : Int, name : String | Nil = nil, zones : Array(String) | Nil = nil, description : String | Nil = nil, email : String | Nil = nil, capacity : Int | Nil = nil, bookable : Bool | Nil = nil, installed_ui_devices : Int | Nil = nil, modules : Array(String) | Nil = nil, support_url : String | Nil = nil, display_name : String | Nil = nil, timezone : String | Nil = nil, code : String | Nil = nil, type : String | Nil = nil, map_id : String | Nil = nil, images : Array(String) | Nil = nil, features : Array(String) | Nil = nil, public : Bool | Nil = nil) #

Requests a change to an existing system.

In addition to specifying the ID of the system to update, you must reference the the current system metadata version for the update to be allowed. This must match the current version attribute of the system and will be incrememented following a successful update.


[View source]
def with_emails(list : Array(String) | String) #

Returns systems with a specified email address(es)


[View source]