Skip to content
Snippets Groups Projects
Commit a5e56bd6 authored by Domonkos Gulyas's avatar Domonkos Gulyas
Browse files

CE-2949: Refactor host search param

parent 4d28e515
No related branches found
No related tags found
2 merge requests!497CE-2790: Prepare for 4.0.0,!491CE-2949: Refactor host search param
Checking pipeline status
......@@ -33,6 +33,9 @@
{
"name": "Statistics"
},
{
"name": "Maintenance"
},
{
"name": "Hosts"
},
......@@ -41,6 +44,241 @@
}
],
"paths": {
"/api/v1/maintenance_mode": {
"put": {
"tags": ["Maintenance"],
"summary": "Set Maintenance Mode",
"operationId": "setMaintenanceMode",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SetMaintenance"
}
}
},
"required": true
},
"responses": {
"201": {
"description": "Maintenance Mode Changed",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MaintenanceMode"
}
}
}
},
"400": {
"description": "Incomplete request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GeneralException"
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GeneralException"
}
}
}
},
"403": {
"description": "Forbidden: User doesn't have the necessary permissions",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GeneralException"
}
}
}
},
"409": {
"description": "Maintenance Mode already set to that value",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GeneralException"
}
}
}
},
"422": {
"description": "Unprocessable request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GeneralException"
}
}
}
},
"500": {
"description": "Service exception",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GeneralException"
}
}
}
},
"503": {
"description": "Remote service exception",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GeneralException"
}
}
}
}
},
"security": [
{
"bearerAuth": []
}
]
}
},
"/api/v1/maintenance_mode/current": {
"get": {
"tags": ["Maintenance"],
"summary": "Get Current Maintenance Mode",
"operationId": "getCurrentMode",
"responses": {
"200": {
"description": "Found Mode",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MaintenanceMode"
}
}
}
},
"404": {
"description": "Maintenance Mode not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GeneralException"
}
}
}
},
"500": {
"description": "Service exception",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GeneralException"
}
}
}
}
}
},
"put": {
"tags": ["Maintenance"],
"summary": "End Current Maintenance Mode",
"operationId": "endCurrentMaintenanceMode",
"responses": {
"201": {
"description": "Maintenance Mode Changed",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MaintenanceMode"
}
}
}
},
"400": {
"description": "Incomplete request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GeneralException"
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GeneralException"
}
}
}
},
"403": {
"description": "Forbidden: User doesn't have the necessary permissions",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GeneralException"
}
}
}
},
"409": {
"description": "Maintenance Mode already set to that value",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GeneralException"
}
}
}
},
"422": {
"description": "Unprocessable request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GeneralException"
}
}
}
},
"500": {
"description": "Service exception",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GeneralException"
}
}
}
},
"503": {
"description": "Remote service exception",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GeneralException"
}
}
}
}
},
"security": [
{
"bearerAuth": []
}
]
}
},
"/api/v1/iocs": {
"get": {
"tags": ["IOCs"],
......@@ -2277,9 +2515,9 @@
"operationId": "listHosts",
"parameters": [
{
"name": "query",
"name": "text",
"in": "query",
"description": "Search for host name",
"description": "Search text (Search for host name or description)",
"required": false,
"schema": {
"type": "string"
......@@ -3210,21 +3448,22 @@
},
"components": {
"schemas": {
"CreateIoc": {
"SetMaintenance": {
"type": "object",
"properties": {
"namingUuid": {
"type": "string"
"startAt": {
"type": "string",
"format": "date-time"
},
"gitProjectId": {
"type": "integer",
"format": "int64"
"endAt": {
"type": "string",
"format": "date-time"
},
"repository_name": {
"message": {
"type": "string"
}
},
"description": "IOC to create"
"description": "Maintenance Mode to set to"
},
"GeneralException": {
"type": "object",
......@@ -3237,6 +3476,38 @@
}
}
},
"MaintenanceMode": {
"type": "object",
"properties": {
"startAt": {
"type": "string",
"format": "date-time"
},
"endAt": {
"type": "string",
"format": "date-time"
},
"message": {
"type": "string"
}
}
},
"CreateIoc": {
"type": "object",
"properties": {
"namingUuid": {
"type": "string"
},
"gitProjectId": {
"type": "integer",
"format": "int64"
},
"repository_name": {
"type": "string"
}
},
"description": "IOC to create"
},
"Alert": {
"type": "object",
"properties": {
......
......@@ -119,11 +119,9 @@ export function HostListView() {
// Request new search results whenever search or pagination changes
useEffect(() => {
let requestParams = initRequestParams(
pagination,
deserialize(urlState.query)
);
let requestParams = initRequestParams(pagination);
requestParams.filter = hostFilter;
requestParams.text = deserialize(urlState.query);
getHosts(requestParams);
return () => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment