diff --git a/disperser/dataapi/docs/docs.go b/disperser/dataapi/docs/docs.go index ebc77488f5..9938d7eb76 100644 --- a/disperser/dataapi/docs/docs.go +++ b/disperser/dataapi/docs/docs.go @@ -15,6 +15,60 @@ const docTemplate = `{ "host": "{{.Host}}", "basePath": "{{.BasePath}}", "paths": { + "/ejector/operators": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Ejector" + ], + "summary": "Eject operators who violate the SLAs during the given time interval", + "parameters": [ + { + "type": "integer", + "description": "Lookback window for operator ejection [default: 86400]", + "name": "interval", + "in": "query" + }, + { + "type": "integer", + "description": "End time for evaluating operator ejection [default: now]", + "name": "end", + "in": "query" + }, + { + "type": "string", + "description": "Whether it's periodic or urgent ejection request [default: periodic]", + "name": "mode", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + }, + "400": { + "description": "error: Bad request", + "schema": { + "$ref": "#/definitions/dataapi.ErrorResponse" + } + }, + "404": { + "description": "error: Not found", + "schema": { + "$ref": "#/definitions/dataapi.ErrorResponse" + } + }, + "500": { + "description": "error: Server error", + "schema": { + "$ref": "#/definitions/dataapi.ErrorResponse" + } + } + } + } + }, "/feed/blobs": { "get": { "produces": [ @@ -343,6 +397,12 @@ const docTemplate = `{ "description": "End time (2006-01-02T15:04:05Z) to query for operators nonsigning percentage [default: now]", "name": "end", "in": "query" + }, + { + "type": "string", + "description": "Whether return only live nonsigners [default: true]", + "name": "live_only", + "in": "query" } ], "responses": { @@ -769,14 +829,16 @@ const docTemplate = `{ 1, 2, 3, - 4 + 4, + 5 ], "x-enum-varnames": [ "Processing", "Confirmed", "Failed", "Finalized", - "InsufficientSignatures" + "InsufficientSignatures", + "Dispersing" ] }, "github_com_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2": { diff --git a/disperser/dataapi/docs/swagger.json b/disperser/dataapi/docs/swagger.json index c1ec725a7a..c014a54f8f 100644 --- a/disperser/dataapi/docs/swagger.json +++ b/disperser/dataapi/docs/swagger.json @@ -11,6 +11,60 @@ "version": "1" }, "paths": { + "/ejector/operators": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "Ejector" + ], + "summary": "Eject operators who violate the SLAs during the given time interval", + "parameters": [ + { + "type": "integer", + "description": "Lookback window for operator ejection [default: 86400]", + "name": "interval", + "in": "query" + }, + { + "type": "integer", + "description": "End time for evaluating operator ejection [default: now]", + "name": "end", + "in": "query" + }, + { + "type": "string", + "description": "Whether it's periodic or urgent ejection request [default: periodic]", + "name": "mode", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + }, + "400": { + "description": "error: Bad request", + "schema": { + "$ref": "#/definitions/dataapi.ErrorResponse" + } + }, + "404": { + "description": "error: Not found", + "schema": { + "$ref": "#/definitions/dataapi.ErrorResponse" + } + }, + "500": { + "description": "error: Server error", + "schema": { + "$ref": "#/definitions/dataapi.ErrorResponse" + } + } + } + } + }, "/feed/blobs": { "get": { "produces": [ @@ -339,6 +393,12 @@ "description": "End time (2006-01-02T15:04:05Z) to query for operators nonsigning percentage [default: now]", "name": "end", "in": "query" + }, + { + "type": "string", + "description": "Whether return only live nonsigners [default: true]", + "name": "live_only", + "in": "query" } ], "responses": { @@ -765,14 +825,16 @@ 1, 2, 3, - 4 + 4, + 5 ], "x-enum-varnames": [ "Processing", "Confirmed", "Failed", "Finalized", - "InsufficientSignatures" + "InsufficientSignatures", + "Dispersing" ] }, "github_com_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2": { diff --git a/disperser/dataapi/docs/swagger.yaml b/disperser/dataapi/docs/swagger.yaml index 36232b2db0..321db67826 100644 --- a/disperser/dataapi/docs/swagger.yaml +++ b/disperser/dataapi/docs/swagger.yaml @@ -205,6 +205,7 @@ definitions: - 2 - 3 - 4 + - 5 type: integer x-enum-varnames: - Processing @@ -212,6 +213,7 @@ definitions: - Failed - Finalized - InsufficientSignatures + - Dispersing github_com_consensys_gnark-crypto_ecc_bn254_internal_fptower.E2: properties: a0: @@ -225,6 +227,42 @@ info: title: EigenDA Data Access API version: "1" paths: + /ejector/operators: + get: + parameters: + - description: 'Lookback window for operator ejection [default: 86400]' + in: query + name: interval + type: integer + - description: 'End time for evaluating operator ejection [default: now]' + in: query + name: end + type: integer + - description: 'Whether it''s periodic or urgent ejection request [default: + periodic]' + in: query + name: mode + type: string + produces: + - application/json + responses: + "200": + description: OK + "400": + description: 'error: Bad request' + schema: + $ref: '#/definitions/dataapi.ErrorResponse' + "404": + description: 'error: Not found' + schema: + $ref: '#/definitions/dataapi.ErrorResponse' + "500": + description: 'error: Server error' + schema: + $ref: '#/definitions/dataapi.ErrorResponse' + summary: Eject operators who violate the SLAs during the given time interval + tags: + - Ejector /feed/blobs: get: parameters: diff --git a/disperser/dataapi/server.go b/disperser/dataapi/server.go index 8d730d93b2..62815b0080 100644 --- a/disperser/dataapi/server.go +++ b/disperser/dataapi/server.go @@ -306,14 +306,14 @@ func (s *server) Shutdown() error { // @Summary Eject operators who violate the SLAs during the given time interval // @Tags Ejector // @Produce json -// @Param interval query int false "Lookback window for operator ejection [default: 86400]" -// @Param end query int false "End time for evaluating operator ejection [default: now]" -// @Param mode query string "Whether it's periodic or urgent ejection request [default: periodic]" -// @Success 200 {object} BlobMetadataResponse -// @Failure 400 {object} ErrorResponse "error: Bad request" -// @Failure 404 {object} ErrorResponse "error: Not found" -// @Failure 500 {object} ErrorResponse "error: Server error" -// @Router /ejector/ejection [get] +// @Param interval query int false "Lookback window for operator ejection [default: 86400]" +// @Param end query int false "End time for evaluating operator ejection [default: now]" +// @Param mode query string false "Whether it's periodic or urgent ejection request [default: periodic]" +// @Success 200 +// @Failure 400 {object} ErrorResponse "error: Bad request" +// @Failure 404 {object} ErrorResponse "error: Not found" +// @Failure 500 {object} ErrorResponse "error: Server error" +// @Router /ejector/operators [get] func (s *server) EjectOperatorsHandler(c *gin.Context) { timer := prometheus.NewTimer(prometheus.ObserverFunc(func(f float64) { s.metrics.ObserveLatency("EjectOperators", f*1000) // make milliseconds @@ -551,17 +551,17 @@ func (s *server) FetchNonSigners(c *gin.Context) { // FetchOperatorsNonsigningPercentageHandler godoc // -// @Summary Fetch operators non signing percentage -// @Tags Metrics -// @Produce json -// @Param interval query int false "Interval to query for operators nonsigning percentage [default: 3600]" -// @Param end query string false "End time (2006-01-02T15:04:05Z) to query for operators nonsigning percentage [default: now]" -// @Param live_only query string false "Whether return only live nonsigners [default: true]" -// @Success 200 {object} OperatorsNonsigningPercentage -// @Failure 400 {object} ErrorResponse "error: Bad request" -// @Failure 404 {object} ErrorResponse "error: Not found" -// @Failure 500 {object} ErrorResponse "error: Server error" -// @Router /metrics/operator-nonsigning-percentage [get] +// @Summary Fetch operators non signing percentage +// @Tags Metrics +// @Produce json +// @Param interval query int false "Interval to query for operators nonsigning percentage [default: 3600]" +// @Param end query string false "End time (2006-01-02T15:04:05Z) to query for operators nonsigning percentage [default: now]" +// @Param live_only query string false "Whether return only live nonsigners [default: true]" +// @Success 200 {object} OperatorsNonsigningPercentage +// @Failure 400 {object} ErrorResponse "error: Bad request" +// @Failure 404 {object} ErrorResponse "error: Not found" +// @Failure 500 {object} ErrorResponse "error: Server error" +// @Router /metrics/operator-nonsigning-percentage [get] func (s *server) FetchOperatorsNonsigningPercentageHandler(c *gin.Context) { timer := prometheus.NewTimer(prometheus.ObserverFunc(func(f float64) { s.metrics.ObserveLatency("FetchOperatorsNonsigningPercentageHandler", f*1000) // make milliseconds