api.fabaccess-api/machine.capnp
2021-02-01 23:23:12 +01:00

96 lines
2.3 KiB
Cap'n Proto

@0x8c2f829df1930cd5;
using Rust = import "programming_language/rust.capnp";
$Rust.parentModule("schema");
using CSharp = import "programming_language/csharp.capnp";
$CSharp.namespace("FabAccessAPI.Schema");
using General = import "general.capnp";
using User = import "user.capnp".User;
using Space = import "space.capnp".Space;
struct Machine {
enum MachineState {
free @0;
inUse @1;
toCheck @2;
blocked @3;
disabled @4;
reserved @5;
}
struct MachineInfo {
id @0 :General.UUID;
space @1 :Space;
name @2 :Text;
info @3 :Text;
state @4 :MachineState;
user @5 :User;
transferuser @6 :User;
manager @7:User;
}
struct Reservation {
user @0 :User;
start @1: UInt64;
end @2: UInt64;
}
info @0 :Info;
interface Info $CSharp.name("InfoInterface") {
getMachineInfo @0 () -> ( machineInfo :MachineInfo);
getPropertyList @1 () -> (propertyList :List(General.KeyValuePair));
getReservationList @2 () -> (reservationList :List(Reservation));
}
use @1 :Use;
interface Use $CSharp.name("UseInterface") {
use @0 () -> ();
reserve @1 () -> ();
reserveto @2 (start :UInt64, end :UInt64);
}
inuse @2 :InUse;
interface InUse $CSharp.name("InUseInterface") {
giveBack @0 ();
transfer @1 (user: User);
sendRawData @2 (data :Data);
}
transfer @3 :Transfer;
interface Transfer $CSharp.name("TransferInterface") {
accept @0 ();
reject @1 ();
}
check @4 :Check;
interface Check $CSharp.name("CheckInterface") {
check @0 ();
reject @1 ();
}
manage @5 :Manage;
interface Manage $CSharp.name("ManageInterface") {
setProperty @0 (property :General.KeyValuePair);
removeProperty @1(property :General.KeyValuePair);
}
admin @6 :Admin;
interface Admin $CSharp.name("AdminInterface") {
forceSetState @0 ( state :MachineState );
forceSetUser @1 ( user :User );
getAdminPropertyList @2 () -> (propertyList :List(General.KeyValuePair));
setAdminProperty @3 (property :General.KeyValuePair);
removeAdminProperty @4(property :General.KeyValuePair);
}
}