Skip to content

Commit

Permalink
Update swagger docs
Browse files Browse the repository at this point in the history
Lint
  • Loading branch information
pschork committed Apr 26, 2024
1 parent 7a6ed91 commit 1063b0a
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 4 deletions.
22 changes: 21 additions & 1 deletion disperser/dataapi/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dataapi.ServiceAvailabilityResponse"
"$ref": "#/definitions/dataapi.OperatorPortCheckResponse"
}
},
"400": {
Expand Down Expand Up @@ -720,6 +720,26 @@ const docTemplate = `{
}
}
},
"dataapi.OperatorPortCheckResponse": {
"type": "object",
"properties": {
"disperser_online": {
"type": "boolean"
},
"disperser_socket": {
"type": "string"
},
"operator_id": {
"type": "string"
},
"retriever_online": {
"type": "boolean"
},
"retriever_socket": {
"type": "string"
}
}
},
"dataapi.OperatorsNonsigningPercentage": {
"type": "object",
"properties": {
Expand Down
22 changes: 21 additions & 1 deletion disperser/dataapi/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dataapi.ServiceAvailabilityResponse"
"$ref": "#/definitions/dataapi.OperatorPortCheckResponse"
}
},
"400": {
Expand Down Expand Up @@ -716,6 +716,26 @@
}
}
},
"dataapi.OperatorPortCheckResponse": {
"type": "object",
"properties": {
"disperser_online": {
"type": "boolean"
},
"disperser_socket": {
"type": "string"
},
"operator_id": {
"type": "string"
},
"retriever_online": {
"type": "boolean"
},
"retriever_socket": {
"type": "string"
}
}
},
"dataapi.OperatorsNonsigningPercentage": {
"type": "object",
"properties": {
Expand Down
15 changes: 14 additions & 1 deletion disperser/dataapi/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,19 @@ definitions:
total_unsigned_batches:
type: integer
type: object
dataapi.OperatorPortCheckResponse:
properties:
disperser_online:
type: boolean
disperser_socket:
type: string
operator_id:
type: string
retriever_online:
type: boolean
retriever_socket:
type: string
type: object
dataapi.OperatorsNonsigningPercentage:
properties:
data:
Expand Down Expand Up @@ -539,7 +552,7 @@ paths:
"200":
description: OK
schema:
$ref: '#/definitions/dataapi.ServiceAvailabilityResponse'
$ref: '#/definitions/dataapi.OperatorPortCheckResponse'
"400":
description: 'error: Bad request'
schema:
Expand Down
1 change: 1 addition & 0 deletions disperser/dataapi/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ func (g *Metrics) UpdateRequestedOperatorMetric(numOperatorsByQuorum map[uint8]i

func (g *Metrics) UpdateEjectionGasUsed(gasUsed uint64) {
g.EjectionGasUsed.Set(float64(gasUsed))
}

// IncrementNotFoundRequestNum increments the number of not found requests
func (g *Metrics) IncrementNotFoundRequestNum(method string) {
Expand Down
2 changes: 1 addition & 1 deletion disperser/dataapi/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ func (s *server) FetchDeregisteredOperators(c *gin.Context) {
// @Tags OperatorsInfo
// @Produce json
// @Param operator_id query string true "Operator ID"
// @Success 200 {object} ServiceAvailabilityResponse
// @Success 200 {object} OperatorPortCheckResponse
// @Failure 400 {object} ErrorResponse "error: Bad request"
// @Failure 404 {object} ErrorResponse "error: Not found"
// @Failure 500 {object} ErrorResponse "error: Server error"
Expand Down
1 change: 1 addition & 0 deletions disperser/dataapi/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"net/http"
"net/http/httptest"
"testing"
"time"

"github.com/Layr-Labs/eigenda/core"
coremock "github.com/Layr-Labs/eigenda/core/mock"
Expand Down

0 comments on commit 1063b0a

Please sign in to comment.