Declare cluster-client-token resource.
curl --request POST \
--url http://localhost:8099/api/v1/cluster_token \
--header 'content-type: application/json' \
--data '{"cluster_uuid": "00000000000000000000000000000000","uuid": "00000000000000000000000000000001","name": "test cluster client token","summary": "test cluster client token summary","token": "CLIENT_AUTHENTICATION_TOKEN"}'
output:
{"uuid":"00000000000000000000000000000001","name":"test cluster client token","summary":"test cluster client token summary","cluster_uuid":"00000000000000000000000000000000","token":"CLIENT_AUTHENTICATION_TOKEN","issued_at_time":"2023-07-06T01:29:23.53447061Z","expiration_time":"2024-07-05T00:00:00Z","created":"2023-07-06T01:29:23.53447061Z","updated":"2023-07-06T01:29:23.53447061Z"}
-
cluster's uuid
The cluster's uuid refers to the value generated and outputted when creating the cluster resource.
-
cluster-client-token's uuid is optional.
-
cluster-client-token's token is optional.
The token of the cluster-client-token is the assertion information used by the claiflow-client for authentication.
Deploy the pre-defined templates used by claiflow-client
REPLACE INTO `template` (`uuid`, `name`, `summary`, `flow`, `inputs`, `origin`, `created`) VALUES ('example_simple', 'example_simple', '', '[{"$id":"step1","$command":"helloworld","inputs":"$inputs"}]', '{}', 'userdefined', NOW());
REPLACE INTO `template` (`uuid`, `name`, `summary`, `flow`, `inputs`, `origin`, `created`) VALUES ('example_iter', 'example_iter', '', '[{"$id":"step1","$range":"$inputs.x_list","$steps":[{"$id":"step2","$command":"math_pow","inputs":{"x":"$step1.val","y":2}}]}]', '{}', 'userdefined', NOW());
REPLACE INTO `template` (`uuid`, `name`, `summary`, `flow`, `inputs`, `origin`, `created`) VALUES ('example_pass_val', 'example_pass_val', '', '[{"$id":"step1","$command":"swap_command","inputs":{"param1":"$inputs.input1","param2":"$inputs.input2"}},{"$id":"step2","$command":"swap_command","inputs":{"param1":"$step1.outputs.value1","param2":"$step1.outputs.value2"}}]', '{}', 'userdefined', NOW());
Create the tasks using the template you want to execute.
curl --request POST \
--url http://localhost:8099/api/v1/service \
--header 'Content-Type: application/json' \
--data '{"cluster_uuids":["00000000000000000000000000000000"],"uuid":"c8590e761af64c6891a47b6570c0f93e","name":"example_simple","template_uuid":"example_simple","inputs":{"name":"world"}}'
output:
[{"cluster_uuid":"00000000000000000000000000000000","uuid":"c8590e761af64c6891a47b6570c0f93e","name":"example_simple","summary":"","template_uuid":"example_simple","flow":"[{"$id":"step1","$command":"helloworld","inputs":"$inputs"}]","inputs":{"name":"world"},"step_max":1,"priority":0,"created":"2023-07-06T02:08:17.580567016Z","statuses":[{"step_seq":0,"status":0,"created":"2023-07-06T02:08:17.580567016Z"}]}]
-
task's uuid is optional.
-
cluster's uuid is string or string array.
{ "cluster_uuid": "00000000000000000000000000000000"}
{ "cluster_uuid": ["00000000000000000000000000000000","00000000000000000000000000000001"]}