GET /api/flow?project=X&id=N — one flow's steps. */
| 2939 | |
| 2940 | /* GET /api/flow?project=X&id=N — one flow's steps. */ |
| 2941 | static void handle_atlas_flow(cbm_http_conn_t *c, const cbm_http_req_t *req) { |
| 2942 | char project[256] = {0}; |
| 2943 | cbm_store_t *store = atlas_open_project(c, req, project, sizeof(project)); |
| 2944 | if (!store) |
| 2945 | return; |
| 2946 | char id_str[16] = {0}; |
| 2947 | int id = -1; |
| 2948 | if (cbm_http_query_param(req->query, "id", id_str, (int)sizeof(id_str))) |
| 2949 | id = atoi(id_str); |
| 2950 | char *json = cbm_atlas_flow_json(store, project, id); |
| 2951 | char wantg[8] = {0}; |
| 2952 | cbm_http_query_param(req->query, "guards", wantg, (int)sizeof(wantg)); |
| 2953 | if (json && wantg[0] == '1') |
| 2954 | json = atlas_flow_attach_guards(store, project, json); |
| 2955 | json = cbm_atlas_attach_observed(store, project, json); |
| 2956 | cbm_store_close(store); |
| 2957 | atlas_reply_json(c, json, 404, "{\"error\":\"unknown flow\"}"); |
| 2958 | } |
| 2959 | |
| 2960 | /* ── Handle JSON-RPC request ──────────────────────────────────── */ |
| 2961 |
no test coverage detected