Skip to content

Commit

Permalink
[DataApi] Add Registered Operators endpt (#508)
Browse files Browse the repository at this point in the history
Co-authored-by: Siddharth More <Siddhi More>
  • Loading branch information
siddimore authored May 3, 2024
1 parent b7387ee commit 61ab512
Show file tree
Hide file tree
Showing 10 changed files with 538 additions and 207 deletions.
107 changes: 72 additions & 35 deletions disperser/dataapi/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dataapi.DeregisteredOperatorsResponse"
"$ref": "#/definitions/dataapi.QueriedStateOperatorsResponse"
}
},
"400": {
Expand Down Expand Up @@ -569,6 +569,43 @@ const docTemplate = `{
}
}
}
},
"/operators-info/registered-operators": {
"get": {
"produces": [
"application/json"
],
"tags": [
"OperatorsInfo"
],
"summary": "Fetch list of operators that have been registered for days. Days is a query parameter with a default value of 14 and max value of 30.",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dataapi.QueriedStateOperatorsResponse"
}
},
"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 Down Expand Up @@ -662,40 +699,6 @@ const docTemplate = `{
}
}
},
"dataapi.DeregisteredOperatorMetadata": {
"type": "object",
"properties": {
"block_number": {
"type": "integer"
},
"is_online": {
"type": "boolean"
},
"operator_id": {
"type": "string"
},
"operator_process_error": {
"type": "string"
},
"socket": {
"type": "string"
}
}
},
"dataapi.DeregisteredOperatorsResponse": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/dataapi.DeregisteredOperatorMetadata"
}
},
"meta": {
"$ref": "#/definitions/dataapi.Meta"
}
}
},
"dataapi.ErrorResponse": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -808,6 +811,40 @@ const docTemplate = `{
}
}
},
"dataapi.QueriedStateOperatorMetadata": {
"type": "object",
"properties": {
"block_number": {
"type": "integer"
},
"is_online": {
"type": "boolean"
},
"operator_id": {
"type": "string"
},
"operator_process_error": {
"type": "string"
},
"socket": {
"type": "string"
}
}
},
"dataapi.QueriedStateOperatorsResponse": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/dataapi.QueriedStateOperatorMetadata"
}
},
"meta": {
"$ref": "#/definitions/dataapi.Meta"
}
}
},
"dataapi.ServiceAvailability": {
"type": "object",
"properties": {
Expand Down
109 changes: 73 additions & 36 deletions disperser/dataapi/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dataapi.DeregisteredOperatorsResponse"
"$ref": "#/definitions/dataapi.QueriedStateOperatorsResponse"
}
},
"400": {
Expand Down Expand Up @@ -565,6 +565,43 @@
}
}
}
},
"/operators-info/registered-operators": {
"get": {
"produces": [
"application/json"
],
"tags": [
"OperatorsInfo"
],
"summary": "Fetch list of operators that have been registered for days. Days is a query parameter with a default value of 14 and max value of 30.",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dataapi.QueriedStateOperatorsResponse"
}
},
"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 Down Expand Up @@ -658,40 +695,6 @@
}
}
},
"dataapi.DeregisteredOperatorMetadata": {
"type": "object",
"properties": {
"block_number": {
"type": "integer"
},
"is_online": {
"type": "boolean"
},
"operator_id": {
"type": "string"
},
"operator_process_error": {
"type": "string"
},
"socket": {
"type": "string"
}
}
},
"dataapi.DeregisteredOperatorsResponse": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/dataapi.DeregisteredOperatorMetadata"
}
},
"meta": {
"$ref": "#/definitions/dataapi.Meta"
}
}
},
"dataapi.ErrorResponse": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -804,6 +807,40 @@
}
}
},
"dataapi.QueriedStateOperatorMetadata": {
"type": "object",
"properties": {
"block_number": {
"type": "integer"
},
"is_online": {
"type": "boolean"
},
"operator_id": {
"type": "string"
},
"operator_process_error": {
"type": "string"
},
"socket": {
"type": "string"
}
}
},
"dataapi.QueriedStateOperatorsResponse": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/dataapi.QueriedStateOperatorMetadata"
}
},
"meta": {
"$ref": "#/definitions/dataapi.Meta"
}
}
},
"dataapi.ServiceAvailability": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -915,4 +952,4 @@
}
}
}
}
}
71 changes: 48 additions & 23 deletions disperser/dataapi/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,28 +66,6 @@ definitions:
meta:
$ref: '#/definitions/dataapi.Meta'
type: object
dataapi.DeregisteredOperatorMetadata:
properties:
block_number:
type: integer
is_online:
type: boolean
operator_id:
type: string
operator_process_error:
type: string
socket:
type: string
type: object
dataapi.DeregisteredOperatorsResponse:
properties:
data:
items:
$ref: '#/definitions/dataapi.DeregisteredOperatorMetadata'
type: array
meta:
$ref: '#/definitions/dataapi.Meta'
type: object
dataapi.ErrorResponse:
properties:
error:
Expand Down Expand Up @@ -160,6 +138,28 @@ definitions:
meta:
$ref: '#/definitions/dataapi.Meta'
type: object
dataapi.QueriedStateOperatorMetadata:
properties:
block_number:
type: integer
is_online:
type: boolean
operator_id:
type: string
operator_process_error:
type: string
socket:
type: string
type: object
dataapi.QueriedStateOperatorsResponse:
properties:
data:
items:
$ref: '#/definitions/dataapi.QueriedStateOperatorMetadata'
type: array
meta:
$ref: '#/definitions/dataapi.Meta'
type: object
dataapi.ServiceAvailability:
properties:
service_name:
Expand Down Expand Up @@ -557,7 +557,7 @@ paths:
"200":
description: OK
schema:
$ref: '#/definitions/dataapi.DeregisteredOperatorsResponse'
$ref: '#/definitions/dataapi.QueriedStateOperatorsResponse'
"400":
description: 'error: Bad request'
schema:
Expand Down Expand Up @@ -604,6 +604,31 @@ paths:
summary: Operator node reachability port check
tags:
- OperatorsInfo
/operators-info/registered-operators:
get:
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/dataapi.QueriedStateOperatorsResponse'
"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: Fetch list of operators that have been registered for days. Days is
a query parameter with a default value of 14 and max value of 30.
tags:
- OperatorsInfo
schemes:
- https
- http
Expand Down
Loading

0 comments on commit 61ab512

Please sign in to comment.