Skip to content
This repository has been archived by the owner on Nov 3, 2022. It is now read-only.

Services and sample JSONs

Piotr Chromiec edited this page Nov 16, 2018 · 15 revisions

gu-provider

Following REST queries have POST requst type and are on endpoints:

http://{providerAddr}/m/{operationID}

CreateSession - 37

will return session_id

{
  "image": {
    "url": "http://10.30.8.179:61622/app/images/monero-linux.tar.gz"
    "hash": "dc4d9e0c100b36c46b6355311ab853996a1448936068283cd7fafb5a90014877"
  },
  "name": "monero mining",
  "tags": [],
  "note": "None"
}

SessionUpdate - 38

Will return Vec<String> with consecutive commands output. In case of error will stop processing further commands, and return shorter vec with failed command last.

Exec (sync)

Exec will return command output.

{
  "sessionId" : "6a7ad4ff-1b78-4c6e-9210-72ef3f9a3ff8",
  "commands": [ 
    { "Exec": {
       "executable": "gu-mine",
       "args": ["spec"]
    } }
  ]
}

Start (async)

Start will return child_id

{
  "sessionId" : "6a7ad4ff-1b78-4c6e-9210-72ef3f9a3ff8",
  "commands": [ 
    { "Start": {
       "executable": "gu-mine",
       "args": ["mine-cpu"]
    } }
  ]
}

Stop (sync)

will return Killed

{
  "sessionId": "9b4b4356-c73f-4e2d-9a7f-d38dd2aa2550",
  "commands": [
    {"Stop": {"childId": "78ebe66e-14b4-4ff7-aeba-8c148516e4ae"} }
  ]
}

Add and Del Tags

will return tags inserted. Current tags are: ["zima", "lato"]

{"sessionId" : "441631ad-8f10-427b-ad72-c1da9013b625", "commands": [ 
  {"Add/Del-Tags": ["zima", "lato"]  }
] }

GetSessions - 39

will return Vec<PeerSessionInfo>

{}

empty json body

DestroySession - 40

will return Session closed.

{"sessionId" : "cc2410e4-b287-43c1-9620-450a9ed200a6"}

empty json body