Initial commit

This commit is contained in:
Jamie Curnow
2017-12-21 09:02:37 +10:00
parent dc830df253
commit 6e7435c35d
140 changed files with 19554 additions and 0 deletions

View File

@@ -0,0 +1,61 @@
{
"$schema": "http://json-schema.org/draft-06/schema#",
"id": "definitions",
"definitions": {
"id": {
"description": "Unique identifier",
"example": 123456,
"readOnly": true,
"type": "integer",
"minimum": 1
},
"_id": {
"description": "Unique identifier",
"example": "dfgbkjwj23asdad23gbweg",
"readOnly": true,
"type": "string",
"minLength": 1
},
"hostname": {
"definition": "Fully Qualified Host Name",
"type": "string",
"minLength": 2,
"example": "myhost.example.com"
},
"expand": {
"anyOf": [
{
"type": "null"
},
{
"type": "array",
"minItems": 1,
"items": {
"type": "string"
}
}
]
},
"sort": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": [
"field",
"dir"
],
"additionalProperties": false,
"properties": {
"field": {
"type": "string"
},
"dir": {
"type": "string",
"pattern": "^(asc|desc)$"
}
}
}
}
}
}

View File

@@ -0,0 +1,149 @@
{
"$schema": "http://json-schema.org/draft-06/schema#",
"id": "endpoints/access",
"title": "Access",
"description": "Endpoints relating to Access Lists",
"stability": "stable",
"type": "object",
"definitions": {
"_id": {
"type": "string",
"readonly": true
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 50
},
"items": {
"type": "array",
"items": {
"type": "object",
"required": [
"username",
"password"
],
"properties": {
"username": {
"type": "string",
"minLength": 1,
"maxLength": 50
},
"password": {
"type": "string",
"minLength": 0,
"maxLength": 50
},
"hint": {
"type": "string",
"minLength": 0,
"maxLength": 50
}
}
}
},
"hosts": {
"type": "array",
"items": {
"type": "object"
}
}
},
"links": [
{
"title": "List",
"description": "Returns a list of Access Lists",
"href": "/access",
"access": "public",
"method": "GET",
"rel": "self",
"targetSchema": {
"type": "array",
"items": {
"$ref": "#/properties"
}
}
},
{
"title": "Create",
"description": "Creates a new Access List",
"href": "/access",
"access": "public",
"method": "POST",
"rel": "create",
"schema": {
"type": "object",
"required": [
"name",
"items"
],
"properties": {
"name": {
"$ref": "#/definitions/name"
},
"items": {
"$ref": "#/definitions/items"
}
}
},
"targetSchema": {
"properties": {
"$ref": "#/properties"
}
}
},
{
"title": "Update",
"description": "Updates a Access List",
"href": "/hosts/{definitions.identity.example}",
"access": "public",
"method": "PUT",
"rel": "update",
"schema": {
"type": "object",
"required": [
"name",
"items"
],
"properties": {
"name": {
"$ref": "#/definitions/name"
},
"items": {
"$ref": "#/definitions/items"
}
}
},
"targetSchema": {
"properties": {
"$ref": "#/properties"
}
}
},
{
"title": "Delete",
"description": "Deletes a existing Access List",
"href": "/hosts/{definitions.identity.example}",
"access": "public",
"method": "DELETE",
"rel": "delete",
"targetSchema": {
"type": "boolean"
}
}
],
"properties": {
"_id": {
"$ref": "#/definitions/_id"
},
"name": {
"$ref": "#/definitions/name"
},
"items": {
"$ref": "#/definitions/items"
},
"hosts": {
"$ref": "#/definitions/hosts"
}
}
}

View File

@@ -0,0 +1,228 @@
{
"$schema": "http://json-schema.org/draft-06/schema#",
"id": "endpoints/hosts",
"title": "Hosts",
"description": "Endpoints relating to Hosts",
"stability": "stable",
"type": "object",
"definitions": {
"_id": {
"type": "string",
"readonly": true
},
"hostname": {
"$ref": "../definitions.json#/definitions/hostname"
},
"forward_server": {
"type": "string",
"format": "ipv4"
},
"forward_port": {
"type": "integer",
"minumum": 1,
"maxiumum": 65535
},
"asset_caching": {
"type": "boolean"
},
"block_exploits": {
"type": "boolean"
},
"ssl": {
"type": "boolean"
},
"ssl_expires": {
"type": "integer",
"minimum": 0,
"readonly": true
},
"letsencrypt_email": {
"type": "string",
"format": "email"
},
"force_ssl": {
"type": "boolean"
},
"access_list_id": {
"type": "string"
},
"advanced": {
"type": "string"
},
"access_list": {
"type": "object",
"readonly": true
}
},
"links": [
{
"title": "List",
"description": "Returns a list of Hosts",
"href": "/hosts",
"access": "public",
"method": "GET",
"rel": "self",
"targetSchema": {
"type": "array",
"items": {
"$ref": "#/properties"
}
}
},
{
"title": "Create",
"description": "Creates a new Host",
"href": "/hosts",
"access": "public",
"method": "POST",
"rel": "create",
"schema": {
"type": "object",
"required": [
"hostname",
"forward_server",
"forward_port"
],
"properties": {
"hostname": {
"$ref": "#/definitions/hostname"
},
"forward_server": {
"$ref": "#/definitions/forward_server"
},
"forward_port": {
"$ref": "#/definitions/forward_port"
},
"asset_caching": {
"$ref": "#/definitions/asset_caching"
},
"block_exploits": {
"$ref": "#/definitions/block_exploits"
},
"ssl": {
"$ref": "#/definitions/ssl"
},
"letsencrypt_email": {
"$ref": "#/definitions/letsencrypt_email"
},
"force_ssl": {
"$ref": "#/definitions/force_ssl"
},
"advanced": {
"$ref": "#/definitions/advanced"
},
"access_list_id": {
"$ref": "#/definitions/access_list_id"
}
}
},
"targetSchema": {
"properties": {
"$ref": "#/properties"
}
}
},
{
"title": "Update",
"description": "Updates a Host",
"href": "/hosts/{definitions.identity.example}",
"access": "public",
"method": "PUT",
"rel": "update",
"schema": {
"type": "object",
"required": [],
"additionalProperties": false,
"properties": {
"hostname": {
"$ref": "#/definitions/hostname"
},
"forward_server": {
"$ref": "#/definitions/forward_server"
},
"forward_port": {
"$ref": "#/definitions/forward_port"
},
"asset_caching": {
"$ref": "#/definitions/asset_caching"
},
"block_exploits": {
"$ref": "#/definitions/block_exploits"
},
"ssl": {
"$ref": "#/definitions/ssl"
},
"letsencrypt_email": {
"$ref": "#/definitions/letsencrypt_email"
},
"force_ssl": {
"$ref": "#/definitions/force_ssl"
},
"advanced": {
"$ref": "#/definitions/advanced"
},
"access_list_id": {
"$ref": "#/definitions/access_list_id"
}
}
},
"targetSchema": {
"properties": {
"$ref": "#/properties"
}
}
},
{
"title": "Delete",
"description": "Deletes a existing Host",
"href": "/hosts/{definitions.identity.example}",
"access": "public",
"method": "DELETE",
"rel": "delete",
"targetSchema": {
"type": "boolean"
}
}
],
"properties": {
"_id": {
"$ref": "#/definitions/_id"
},
"hostname": {
"$ref": "#/definitions/hostname"
},
"forward_server": {
"$ref": "#/definitions/forward_server"
},
"forward_port": {
"$ref": "#/definitions/forward_port"
},
"asset_caching": {
"$ref": "#/definitions/asset_caching"
},
"block_exploits": {
"$ref": "#/definitions/block_exploits"
},
"ssl": {
"$ref": "#/definitions/ssl"
},
"ssl_expires": {
"$ref": "#/definitions/ssl_expires"
},
"letsencrypt_email": {
"$ref": "#/definitions/letsencrypt_email"
},
"force_ssl": {
"$ref": "#/definitions/force_ssl"
},
"access_list_id": {
"$ref": "#/definitions/access_list_id"
},
"access_list": {
"$ref": "#/definitions/access_list"
},
"advanced": {
"$ref": "#/definitions/advanced"
}
}
}

View File

@@ -0,0 +1,6 @@
{
"$schema": "http://json-schema.org/draft-06/schema#",
"id": "examples",
"type": "object",
"definitions": {}
}

View File

@@ -0,0 +1,21 @@
{
"$schema": "http://json-schema.org/draft-06/schema#",
"title": "Nginx Proxy Manager REST API",
"description": "This is the Nginx Proxy Manager REST API",
"id": "root",
"version": "1.0.0",
"links": [
{
"href": "http://localhost:81/api",
"rel": "self"
}
],
"properties": {
"hosts": {
"$ref": "endpoints/hosts.json"
},
"access": {
"$ref": "endpoints/access.json"
}
}
}