Add basic node handling

This commit is contained in:
Ingo Oppermann
2022-08-03 22:05:28 +02:00
parent 11c3fce812
commit fe889aa4e2
35 changed files with 3988 additions and 22 deletions

View File

@@ -209,6 +209,218 @@ const docTemplate = `{
}
}
},
"/api/v3/cluster/node": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Add a new node to the cluster",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"summary": "Add a new node",
"operationId": "cluster-3-add-node",
"parameters": [
{
"description": "Node config",
"name": "config",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/api.ClusterNodeConfig"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/api.Error"
}
}
}
}
},
"/api/v3/cluster/node/{id}": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "List a node by its ID",
"produces": [
"application/json"
],
"summary": "List a node by its ID",
"operationId": "cluster-3-get-node",
"parameters": [
{
"type": "string",
"description": "Node ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/api.ClusterNode"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/api.Error"
}
}
}
},
"put": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Replace an existing Node",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"summary": "Replace an existing Node",
"operationId": "cluster-3-update-node",
"parameters": [
{
"type": "string",
"description": "Node ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Node config",
"name": "config",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/api.ClusterNodeConfig"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/api.Error"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/api.Error"
}
}
}
},
"delete": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Delete a node by its ID",
"produces": [
"application/json"
],
"summary": "Delete a node by its ID",
"operationId": "cluster-3-delete-node",
"parameters": [
{
"type": "string",
"description": "Node ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/api.Error"
}
}
}
}
},
"/api/v3/cluster/node/{id}/proxy": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "List the files of a node by its ID",
"produces": [
"application/json"
],
"summary": "List the files of a node by its ID",
"operationId": "cluster-3-get-node-proxy",
"parameters": [
{
"type": "string",
"description": "Node ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/api.Error"
}
}
}
}
},
"/api/v3/config": {
"get": {
"security": [
@@ -1017,7 +1229,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
"description": "Replace an existing process. This is a shortcut for DELETE+POST.",
"description": "Replace an existing process",
"consumes": [
"application/json"
],
@@ -2291,6 +2503,31 @@ const docTemplate = `{
}
}
},
"api.ClusterNode": {
"type": "object",
"properties": {
"address": {
"type": "string"
},
"state": {
"type": "string"
}
}
},
"api.ClusterNodeConfig": {
"type": "object",
"properties": {
"address": {
"type": "string"
},
"password": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"api.Command": {
"type": "object",
"required": [
@@ -2733,9 +2970,20 @@ const docTemplate = `{
"type": "integer"
},
"types": {
"type": "array",
"items": {
"type": "string"
"type": "object",
"properties": {
"allow": {
"type": "array",
"items": {
"type": "string"
}
},
"block": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
@@ -4330,9 +4578,20 @@ const docTemplate = `{
"type": "integer"
},
"types": {
"type": "array",
"items": {
"type": "string"
"type": "object",
"properties": {
"allow": {
"type": "array",
"items": {
"type": "string"
}
},
"block": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}