Skip to content

Commit

Permalink
Support operator APIs (#987)
Browse files Browse the repository at this point in the history
  • Loading branch information
jianoaix authored Dec 13, 2024
1 parent 49c878e commit cfdf4fd
Show file tree
Hide file tree
Showing 5 changed files with 505 additions and 20 deletions.
127 changes: 123 additions & 4 deletions disperser/dataapi/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,121 @@ const docTemplate = `{
}
}
}
},
"/operators/nodeinfo": {
"get": {
"produces": [
"application/json"
],
"tags": [
"OperatorsNodeInfo"
],
"summary": "Active operator semver",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dataapi.SemverReportResponse"
}
},
"500": {
"description": "error: Server error",
"schema": {
"$ref": "#/definitions/dataapi.ErrorResponse"
}
}
}
}
},
"/operators/reachability": {
"get": {
"produces": [
"application/json"
],
"tags": [
"OperatorsReachability"
],
"summary": "Operator node reachability check",
"parameters": [
{
"type": "string",
"description": "Operator ID in hex string [default: all operators if unspecified]",
"name": "operator_id",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dataapi.OperatorPortCheckResponse"
}
},
"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"
}
}
}
}
},
"/operators/stake": {
"get": {
"produces": [
"application/json"
],
"tags": [
"OperatorsStake"
],
"summary": "Operator stake distribution query",
"parameters": [
{
"type": "string",
"description": "Operator ID in hex string [default: all operators if unspecified]",
"name": "operator_id",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dataapi.OperatorsStakeResponse"
}
},
"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"
}
}
}
}
}
},
"definitions": {
Expand All @@ -849,17 +964,21 @@ const docTemplate = `{
"description": "AccountID is the ETH account address for the payer",
"type": "string"
},
"bin_index": {
"description": "BinIndex represents the range of time at which the dispersal is made",
"type": "integer"
},
"cumulative_payment": {
"description": "TODO: we are thinking the contract can use uint128 for cumulative payment,\nbut the definition on v2 uses uint64. Double check with team.",
"allOf": [
{
"$ref": "#/definitions/big.Int"
}
]
},
"reservation_period": {
"description": "ReservationPeriod represents the range of time at which the dispersal is made",
"type": "integer"
},
"salt": {
"description": "Allow same blob to be dispersed multiple times within the same reservation period",
"type": "integer"
}
}
},
Expand Down
127 changes: 123 additions & 4 deletions disperser/dataapi/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,121 @@
}
}
}
},
"/operators/nodeinfo": {
"get": {
"produces": [
"application/json"
],
"tags": [
"OperatorsNodeInfo"
],
"summary": "Active operator semver",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dataapi.SemverReportResponse"
}
},
"500": {
"description": "error: Server error",
"schema": {
"$ref": "#/definitions/dataapi.ErrorResponse"
}
}
}
}
},
"/operators/reachability": {
"get": {
"produces": [
"application/json"
],
"tags": [
"OperatorsReachability"
],
"summary": "Operator node reachability check",
"parameters": [
{
"type": "string",
"description": "Operator ID in hex string [default: all operators if unspecified]",
"name": "operator_id",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dataapi.OperatorPortCheckResponse"
}
},
"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"
}
}
}
}
},
"/operators/stake": {
"get": {
"produces": [
"application/json"
],
"tags": [
"OperatorsStake"
],
"summary": "Operator stake distribution query",
"parameters": [
{
"type": "string",
"description": "Operator ID in hex string [default: all operators if unspecified]",
"name": "operator_id",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dataapi.OperatorsStakeResponse"
}
},
"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"
}
}
}
}
}
},
"definitions": {
Expand All @@ -845,17 +960,21 @@
"description": "AccountID is the ETH account address for the payer",
"type": "string"
},
"bin_index": {
"description": "BinIndex represents the range of time at which the dispersal is made",
"type": "integer"
},
"cumulative_payment": {
"description": "TODO: we are thinking the contract can use uint128 for cumulative payment,\nbut the definition on v2 uses uint64. Double check with team.",
"allOf": [
{
"$ref": "#/definitions/big.Int"
}
]
},
"reservation_period": {
"description": "ReservationPeriod represents the range of time at which the dispersal is made",
"type": "integer"
},
"salt": {
"description": "Allow same blob to be dispersed multiple times within the same reservation period",
"type": "integer"
}
}
},
Expand Down
Loading

0 comments on commit cfdf4fd

Please sign in to comment.