Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DataApi] Add Registered Operators endpt #508

Merged
merged 12 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading