@@ -140,6 +140,8 @@ Else it will contain the reply JSON data, e.g:
140140* Credentials: A valid Colony Private Key
141141* Returns: An [ Executor object] ( ../pkg/core/executor.go )
142142
143+ * Note: The state and commissiontime fields are set by the server. The executor is always created in a PENDING state.*
144+
143145#### Payload
144146``` json
145147{
@@ -148,13 +150,14 @@ Else it will contain the reply JSON data, e.g:
148150 "executorid" : " 38df5bbbcf0ccb438d2e4151638e3967bf28a5654af6a7e5acc590c0e49fae06" ,
149151 "executortype" : " test_executor_type" ,
150152 "name" : " test_executor_name" ,
151- "colonyid" : " 405acc69052cf19ce23ddd238b73c74bfd78c65cf6ef57613b870470a26d6f95" ,
152- "cpu" : " AMD Ryzen 9 5950X (32) @ 3.400GHz" ,
153- "cores" : 32 ,
154- "mem" : 80326 ,
155- "gpu" : " NVIDIA GeForce RTX 2080 Ti Rev. A" ,
156- "gpus" : 1 ,
157- "state" : 0
153+ "colonyname" : " my_colony_name" ,
154+ "capabilities" : {
155+ "hardware" : {
156+ "cpu" : " AMD Ryzen 9 5950X" ,
157+ "mem" : " 80326MB" ,
158+ "nodes" : 1
159+ }
160+ }
158161 }
159162}
160163```
@@ -773,12 +776,13 @@ The state attribute can have the following values:
773776* Credentials: A valid Executor Private Key and the Executor ID needs to match the ExecutorID assigned to the process
774777* Returns: An [ Attribute object] ( ../pkg/core/attribute.go )
775778
779+ * Note: The attributeid and targetprocessgraphid fields are generated by the server and will be ignored if provided.*
780+
776781#### Payload
777782``` json
778783{
779784 "msgtype" : " addattributemsg" ,
780785 "attribute" : {
781- "attributeid" : " 216e26cb089032d2f941454e7db5f3ae1591eeb43eb477c3f8ed545b96d4f690" ,
782786 "targetid" : " c4775cab695da8a77b503bbe29df8ae39dafd1c7fed3275dac11b436c1724dbf" ,
783787 "attributetype" : 1 ,
784788 "key" : " result" ,
@@ -1148,21 +1152,20 @@ The state attribute can have the following values:
11481152* Credentials: A valid Executor Private Key
11491153* Returns: A [ Cron object] ( ../pkg/core/cron.go )
11501154
1155+ * Note: The cronid, initiatorid, initiatorname, and all state fields (nextrun, lastrun, prevprocessgraphid) are managed by the server and will be ignored if provided.*
1156+
11511157#### Payload
11521158``` json
11531159{
11541160 "msgtype" : " addcronmsg" ,
11551161 "cron" : {
1156- "cronid" : " a-valid-sha256-hash-id" ,
11571162 "name" : " my_cron_job" ,
11581163 "colonyname" : " my_colony_name" ,
11591164 "cronexpression" : " 0 0 * * *" ,
1160- "interval" : 86400 ,
1165+ "interval" : -1 ,
11611166 "random" : false ,
1162- "nextrun" : " 2022-01-03T00:00:00Z" ,
1163- "lastrun" : " 0001-01-01T00:00:00Z" ,
1164- "prevprocessgraphid" : " " ,
1165- "workflowspec" : " {\" name\" :\" my_workflow\" ,\" colonyname\" :\" my_colony_name\" ,\" funcspecs\" :[{\" timeout\" :-1,\" maxretries\" :3,\" conditions\" :{\" colonyname\" :\" my_colony_name\" ,\" executortype\" :\" test_executor_type\" ,\" mem\" :1000,\" cores\" :10,\" gpus\" :1},\" env\" :{\" test_key\" :\" test_value\" }}]}"
1167+ "waitforprevprocessgraph" : true ,
1168+ "workflowspec" : " {\" name\" :\" my_workflow\" ,\" colonyname\" :\" my_colony_name\" ,\" funcspecs\" :[{\" timeout\" :-1,\" maxretries\" :3,\" conditions\" :{\" colonyname\" :\" my_colony_name\" ,\" executortype\" :\" test_executor_type\" }}]}"
11661169 }
11671170}
11681171```
@@ -1302,18 +1305,18 @@ The state attribute can have the following values:
13021305* Credentials: A valid Executor Private Key
13031306* Returns: A [ Generator object] ( ../pkg/core/generator.go )
13041307
1308+ * Note: The generatorid, initiatorid, initiatorname, and all state fields (lastrun, counter) are managed by the server and will be ignored if provided.*
1309+
13051310#### Payload
13061311``` json
13071312{
13081313 "msgtype" : " addgeneratormsg" ,
13091314 "generator" : {
1310- "generatorid" : " a-valid-sha256-hash-id" ,
13111315 "name" : " my_generator" ,
13121316 "colonyname" : " my_colony_name" ,
1313- "workflowspec" : " {\" name\" :\" my_workflow\" ,\" colonyname\" :\" my_colony_name\" ,\" funcspecs\" :[{\" timeout\" :-1,\" maxretries\" :3,\" conditions\" :{\" colonyname\" :\" my_colony_name\" ,\" executortype\" :\" test_executor_type\" , \" mem \" :1000, \" cores \" :10, \" gpus \" :1}, \" env \" :{ \" test_key \" : \" test_value \" }}]}" ,
1317+ "workflowspec" : " {\" name\" :\" my_workflow\" ,\" colonyname\" :\" my_colony_name\" ,\" funcspecs\" :[{\" timeout\" :-1,\" maxretries\" :3,\" conditions\" :{\" colonyname\" :\" my_colony_name\" ,\" executortype\" :\" test_executor_type\" }}]}" ,
13141318 "trigger" : 5 ,
1315- "counter" : 0 ,
1316- "lastrun" : " 0001-01-01T00:00:00Z"
1319+ "timeout" : 60
13171320 }
13181321}
13191322```
@@ -1465,19 +1468,19 @@ The state attribute can have the following values:
14651468* Credentials: A valid Executor Private Key
14661469* Returns: A [ File object] ( ../pkg/core/file.go )
14671470
1471+ * Note: The fileid and added timestamp are set by the server and will be ignored if provided.*
1472+
14681473#### Payload
14691474``` json
14701475{
14711476 "msgtype" : " addfilemsg" ,
14721477 "file" : {
1473- "fileid" : " a-valid-sha256-hash-id" ,
14741478 "colonyname" : " my_colony_name" ,
14751479 "label" : " my_file_label" ,
14761480 "name" : " example.txt" ,
14771481 "size" : 1024 ,
14781482 "checksum" : " checksum-hash" ,
1479- "checksumtype" : " SHA256" ,
1480- "added" : " 2022-01-02T12:00:00Z"
1483+ "checksumalg" : " SHA256"
14811484 }
14821485}
14831486```
@@ -1502,14 +1505,19 @@ The state attribute can have the following values:
15021505* Returns: An array of [ File objects] ( ../pkg/core/file.go )
15031506
15041507#### Payload
1508+ * Note: Comments (//) are for documentation and must be removed before sending the request.*
15051509``` json
15061510{
15071511 "msgtype" : " getfilemsg" ,
15081512 "colonyname" : " my_colony_name" ,
1513+ // Use one of the following methods to identify the file(s).
1514+ // Method 1: Get a specific file by its unique ID (highest priority).
15091515 "fileid" : " a-valid-sha256-hash-id" ,
1516+
1517+ // Method 2: Get files by label and name (used if fileid is empty).
15101518 "label" : " my_file_label" ,
15111519 "name" : " example.txt" ,
1512- "latest" : true
1520+ "latest" : true // Set to true to get only the most recent version.
15131521}
15141522```
15151523
@@ -1594,11 +1602,16 @@ The state attribute can have the following values:
15941602* Returns: An empty JSON object {}
15951603
15961604#### Payload
1605+ * Note: Comments (//) are for documentation and must be removed before sending the request.*
15971606``` json
15981607{
15991608 "msgtype" : " removefilemsg" ,
16001609 "colonyname" : " my_colony_name" ,
1610+ // Use one of the following methods to identify the file(s) for deletion.
1611+ // Method 1: Delete a specific file by its unique ID (highest priority).
16011612 "fileid" : " a-valid-sha256-hash-id" ,
1613+
1614+ // Method 2: Delete all versions of a file by label and name (used if fileid is empty).
16021615 "label" : " my_file_label" ,
16031616 "name" : " example.txt"
16041617}
@@ -1636,10 +1649,13 @@ The state attribute can have the following values:
16361649* Returns: An array of [ Log objects] ( ../pkg/core/log.go )
16371650
16381651#### Payload
1652+ * Note: Comments (//) are for documentation and must be removed before sending the request.*
16391653``` json
16401654{
16411655 "msgtype" : " getlogsmsg" ,
16421656 "colonyname" : " my_colony_name" ,
1657+ // Specify either executorname or processid.
1658+ // If executorname is provided, processid is ignored.
16431659 "processid" : " a-valid-sha256-hash-id" ,
16441660 "executorname" : " my_executor_name" ,
16451661 "count" : 100 ,
@@ -1832,11 +1848,16 @@ The state attribute can have the following values:
18321848* Returns: A [ Snapshot object] ( ../pkg/core/snapshot.go )
18331849
18341850#### Payload
1851+ * Note: Comments (//) are for documentation and must be removed before sending the request.*
18351852``` json
18361853{
18371854 "msgtype" : " getsnapshotmsg" ,
18381855 "colonyname" : " my_colony_name" ,
1856+ // Use one of the following methods to identify the snapshot.
1857+ // Method 1: Get by unique snapshot ID (highest priority).
18391858 "snapshotid" : " a-valid-sha256-hash-id" ,
1859+
1860+ // Method 2: Get by unique name (used if snapshotid is empty).
18401861 "name" : " snapshot_2022_01_02"
18411862}
18421863```
@@ -1884,11 +1905,16 @@ The state attribute can have the following values:
18841905* Returns: An empty JSON object {}
18851906
18861907#### Payload
1908+ * Note: Comments (//) are for documentation and must be removed before sending the request.*
18871909``` json
18881910{
18891911 "msgtype" : " removesnapshotmsg" ,
18901912 "colonyname" : " my_colony_name" ,
1913+ // Use one of the following methods to identify the snapshot for deletion.
1914+ // Method 1: Delete by unique snapshot ID (highest priority).
18911915 "snapshotid" : " a-valid-sha256-hash-id" ,
1916+
1917+ // Method 2: Delete by unique name (used if snapshotid is empty).
18921918 "name" : " snapshot_2022_01_02"
18931919}
18941920```
@@ -2000,23 +2026,16 @@ The state attribute can have the following values:
20002026* Credentials: A valid Executor Private Key
20012027* Returns: A [ Function object] ( ../pkg/core/function.go )
20022028
2029+ * Note: The functionid and executortype fields are set by the server and will be ignored if provided.*
2030+
20032031#### Payload
20042032``` json
20052033{
20062034 "msgtype" : " addfunctionmsg" ,
20072035 "fun" : {
2008- "functionid" : " a-valid-sha256-hash-id" ,
20092036 "executorname" : " my_executor_name" ,
2010- "executortype" : " test_executor_type" ,
20112037 "colonyname" : " my_colony_name" ,
2012- "funcname" : " calculate_sum" ,
2013- "counter" : 5 ,
2014- "minwaittime" : 2.0 ,
2015- "maxwaittime" : 3.0 ,
2016- "minexectime" : 9.5 ,
2017- "maxexectime" : 10.8 ,
2018- "avgwaittime" : 2.5 ,
2019- "avgexectime" : 10.1
2038+ "funcname" : " calculate_sum"
20202039 }
20212040}
20222041```
@@ -2046,10 +2065,14 @@ The state attribute can have the following values:
20462065* Comments: If ` executorname ` is not provided, the functions of all executors in the specified colony will be returned.
20472066
20482067#### Payload
2068+ * Note: Comments (//) are for documentation and must be removed before sending the request.*
20492069``` json
20502070{
20512071 "msgtype" : " getfunctionsmsg" ,
20522072 "colonyname" : " my_colony_name" ,
2073+ // This field is optional.
2074+ // If provided, returns functions for a specific executor.
2075+ // If omitted, returns all functions in the colony.
20532076 "executorname" : " my_executor"
20542077}
20552078```
0 commit comments