You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
177 lines
5.0 KiB
JSON
177 lines
5.0 KiB
JSON
{
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"contact": {}
|
|
},
|
|
"basePath": "/api/v1",
|
|
"paths": {
|
|
"/hosts/create": {
|
|
"post": {
|
|
"description": "Create a host",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Hosts"
|
|
],
|
|
"summary": "Create a host",
|
|
"parameters": [
|
|
{
|
|
"description": "The host to create",
|
|
"name": "host",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/models.CreateHostInput"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.CreateHostInput"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/hosts/get_host_by_hostname/{hostname}": {
|
|
"get": {
|
|
"description": "Get a host by hostname",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Hosts"
|
|
],
|
|
"summary": "Get a host by hostname",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "The hostname to get the host by",
|
|
"name": "hostname",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.Host"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/hosts/hosts": {
|
|
"get": {
|
|
"description": "Lists all the hosts in LSM",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Hosts"
|
|
],
|
|
"summary": "Get all hosts in LSM",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/models.Host"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"models.CPU": {
|
|
"type": "object",
|
|
"properties": {
|
|
"cores": {
|
|
"type": "integer"
|
|
},
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"socket": {
|
|
"type": "integer"
|
|
},
|
|
"time": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"models.CreateHostInput": {
|
|
"type": "object",
|
|
"properties": {
|
|
"hostname": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"models.Host": {
|
|
"type": "object",
|
|
"properties": {
|
|
"cpus": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/models.CPU"
|
|
}
|
|
},
|
|
"hostname": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"memory": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/models.Memory"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"models.Memory": {
|
|
"type": "object",
|
|
"properties": {
|
|
"Usage": {
|
|
"type": "number"
|
|
},
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"time": {
|
|
"type": "string"
|
|
},
|
|
"total": {
|
|
"type": "integer"
|
|
},
|
|
"type": {
|
|
"type": "string"
|
|
},
|
|
"used": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |