{ "swagger": "2.0", "info": { "contact": {} }, "paths": { "/api/createModule": { "post": { "description": "Store module data into SQLite database", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "module" ], "summary": "Create module", "parameters": [ { "description": "Create module", "name": "module", "in": "body", "required": true, "schema": { "$ref": "#/definitions/http.CreateModuleReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/http.CreateModuleResp" } } } } }, "/api/deleteModule": { "get": { "description": "Delete module by id", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "module" ], "summary": "Delete module", "parameters": [ { "type": "string", "description": "delete module id", "name": "id", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/http.HTTPResp" } } } } }, "/api/deployModule": { "post": { "description": "Deploy the specified module onto every agent in the cluster", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "module" ], "summary": "Deploy module", "parameters": [ { "type": "string", "description": "deploy module id", "name": "id", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/http.DeployModuleResp" } } } } }, "/api/listModule": { "get": { "description": "List all moudle", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "module" ], "summary": "List all moudle", "parameters": [ { "type": "string", "description": "query field search like 'id,name,createTime'", "name": "fields", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/http.ListModuleResp" } } } } }, "/api/undeployModule": { "post": { "description": "Undeploy the specified module from all agents in the cluster", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "module" ], "summary": "Undeploy module", "parameters": [ { "type": "string", "description": "undeploy module id", "name": "id", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/http.HTTPResp" } } } } } }, "definitions": { "common.DataField": { "type": "object", "properties": { "name": { "type": "string" }, "type": { "$ref": "#/definitions/common.DataField_Type" } } }, "common.DataField_Type": { "type": "integer", "enum": [ 0, 1, 2, 3, 4, 5, 6 ], "x-enum-varnames": [ "DataField_BOOL", "DataField_DATE", "DataField_INT", "DataField_INTEGER", "DataField_JSON", "DataField_JSONB", "DataField_TEXT" ] }, "common.Format": { "type": "integer", "enum": [ 0, 1 ], "x-enum-varnames": [ "Format_TEXT", "Format_BINARY" ] }, "common.Lang": { "type": "integer", "enum": [ 0, 1 ], "x-enum-varnames": [ "Lang_C", "Lang_WAT" ] }, "common.Schema": { "type": "object", "properties": { "fields": { "type": "array", "items": { "$ref": "#/definitions/common.DataField" } }, "name": { "type": "string" } } }, "dao.ModuleGORM": { "type": "object", "properties": { "create_time": { "type": "string" }, "desire_state": { "type": "integer" }, "ebpf": { "type": "string" }, "ebpf_fmt": { "type": "integer" }, "ebpf_lang": { "type": "integer" }, "ebpf_perf_name": { "type": "string" }, "ebpf_probes": { "type": "string" }, "fn": { "type": "string" }, "id": { "description": "tag schema https://gorm.io/docs/models.html#Fields-Tags", "type": "string" }, "name": { "type": "string" }, "schema_attr": { "type": "string" }, "schema_name": { "type": "string" }, "wasm": { "description": "wasm store the whole wasm file content", "type": "array", "items": { "type": "integer" } }, "wasm_fmt": { "type": "integer" }, "wasm_lang": { "type": "integer" } } }, "ebpf.ProbeSpec": { "type": "object", "properties": { "binary_path": { "type": "string" }, "entry": { "type": "string" }, "return": { "type": "string" }, "sample_period_nanos": { "type": "integer" }, "target": { "type": "string" }, "type": { "$ref": "#/definitions/ebpf.ProbeSpec_Type" } } }, "ebpf.ProbeSpec_Type": { "type": "integer", "enum": [ 0, 1, 2, 3, 4, 5, 6 ], "x-enum-varnames": [ "ProbeSpec_KPROBE", "ProbeSpec_SYSCALL_PROBE", "ProbeSpec_UPROBE", "ProbeSpec_TRACEPOINT", "ProbeSpec_XDP", "ProbeSpec_SAMPLE_PROBE", "ProbeSpec_USDT" ] }, "ebpf.Program": { "type": "object", "properties": { "code": { "type": "string" }, "fmt": { "$ref": "#/definitions/common.Format" }, "lang": { "$ref": "#/definitions/common.Lang" }, "perf_buffer_name": { "type": "string" }, "probes": { "type": "array", "items": { "$ref": "#/definitions/ebpf.ProbeSpec" } } } }, "http.CreateModuleReq": { "type": "object", "properties": { "ebpf": { "$ref": "#/definitions/ebpf.Program" }, "id": { "type": "string" }, "name": { "type": "string" }, "wasm": { "$ref": "#/definitions/wasm.Program" } } }, "http.CreateModuleResp": { "type": "object", "properties": { "code": { "description": "Semantic and usage follow HTTP statues code convention.\nhttps://developer.mozilla.org/en-US/docs/Web/HTTP/Status", "type": "integer" }, "message": { "description": "A human readable message explain the details of the status.", "type": "string" } } }, "http.DeployModuleResp": { "type": "object", "properties": { "code": { "description": "Semantic and usage follow HTTP statues code convention.\nhttps://developer.mozilla.org/en-US/docs/Web/HTTP/Status", "type": "integer" }, "message": { "description": "A human readable message explain the details of the status.", "type": "string" }, "uid": { "type": "string" } } }, "http.HTTPResp": { "type": "object", "properties": { "code": { "description": "Semantic and usage follow HTTP statues code convention.\nhttps://developer.mozilla.org/en-US/docs/Web/HTTP/Status", "type": "integer" }, "message": { "description": "A human readable message explain the details of the status.", "type": "string" } } }, "http.ListModuleResp": { "type": "object", "properties": { "code": { "description": "Semantic and usage follow HTTP statues code convention.\nhttps://developer.mozilla.org/en-US/docs/Web/HTTP/Status", "type": "integer" }, "data": { "type": "array", "items": { "$ref": "#/definitions/dao.ModuleGORM" } }, "message": { "description": "A human readable message explain the details of the status.", "type": "string" } } }, "wasm.Program": { "type": "object", "properties": { "code": { "type": "array", "items": { "type": "integer" } }, "fmt": { "$ref": "#/definitions/common.Format" }, "fn_name": { "type": "string" }, "lang": { "$ref": "#/definitions/common.Lang" }, "output_schema": { "$ref": "#/definitions/common.Schema" } } } } }