@luminati-io/luminati-proxy
Version:
A configurable local proxy for luminati.io
1,286 lines (1,285 loc) • 63.1 kB
JSON
{
"swagger": "2.0",
"info": {
"version": "1.221.905",
"title": "Luminati Proxy Manager",
"license": {
"name": "MIT",
"url": "http://opensource.org/licenses/MIT"
}
},
"host": "127.0.0.1:22999",
"basePath": "/api",
"schemes": ["http"],
"consumes": ["application/json"],
"produces": ["application/json"],
"paths": {
"/swagger": {
"get": {
"description": "Returns the swagger definition json",
"tags": [
"Manager"
],
"responses": {
"200": {
"description": "Successful response"
}
}
}
},
"/version": {
"get": {
"description": "Returns the version of the running Luminati Proxy Manager\n",
"tags": [
"Manager"
],
"responses": {
"200": {
"description": "Successful response",
"schema": {
"type": "object",
"properties": {
"version": {
"description": "LPM version",
"type": "string"
},
"argv": {
"description": "Command line arguments passed to LPM",
"type": "string"
}
}
}
}
}
}
},
"/last_version": {
"get": {
"description": "Returns the latest public version available\n",
"tags": [
"Manager"
],
"responses": {
"200": {
"description": "Successful response",
"schema": {
"type": "object",
"properties": {
"version": {
"description": "Latest LPM version",
"type": "string"
},
"newer": {
"description": "Whether or not latest version is newer than current LPM version",
"type": "boolean"
},
"versions": {
"description": "LPM versions changelog",
"type": "array",
"items": {
"type": "object",
"properties": {
"ver": {"type": "string"},
"type": {
"type": "string",
"enum": ["stable", "dev"]
},
"changes": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": ["star", "sparkles", "bug", "boom"]
},
"text": {"type": "string"}
}
}
}
}
}
}
}
}
}
}
}
},
"/node_version": {
"get": {
"description": "Return the currently running node version\n",
"tags": ["Manager"],
"responses": {
"200": {
"description": "Successful response",
"schema": {
"type": "object",
"properties": {
"current": {
"type": "object",
"properties": {
"raw": {"type": "string"},
"major": {"type": "number"},
"minor": {"type": "number"},
"patch": {"type": "number"},
"prerelease": {
"type": "array",
"items": {"type": "string"}
},
"build": {
"type": "array",
"items": {"type": "string"}
},
"version": {"type": "string"}
},
"description": "Current Node information"
},
"recommended": {
"type": "string",
"description": "Recommended Node version"
},
"satisfied": {
"type": "boolean",
"description": "Whether or not recommended Node version condition is satisfied"
}
}
}
}
}
}
},
"/gen_token": {
"get": {
"description": "Generate token for token based authentication",
"tags": ["Manager"],
"responses": {
"200": {
"description": "Successful response",
"schema": {
"type": "object",
"properties": {
"token": {"type": "string"}
}
}
}
}
}
},
"/add_wip": {
"post": {
"description": "An alternative to adding IPs to whitelist in the UI. This call needs to be authenticated by token and does not need to be sent from whitelisted IP",
"tags": ["Manager"],
"parameters": [
{
"name": "Authorization",
"in": "header",
"description": "Authorization token",
"type": "string"
},
{
"name": "options",
"in": "body",
"required": true,
"schema": {
"type": "object",
"required": ["ip"],
"properties": {
"ip": {
"type": "string",
"description": "IP to whitelist",
"example": "10.0.0.0"
}
}
}
}
],
"responses": {
"200": {
"description": "Successful response"
},
"400": {
"description": "Bad request. No IP was passed"
},
"403": {
"description": "Forbidden. No authentication provided"
},
"422": {
"description": "Unprocessable entity. Invalid IP was passed"
}
}
}
},
"/add_whitelist_ip": {
"post": {
"description": "Grants access to an IP to browse admin UI",
"tags": ["Manager"],
"parameters": [
{
"name": "options",
"in": "body",
"required": true,
"schema": {
"type": "object",
"required": ["ip"],
"properties": {
"ip": {
"type": "string",
"description": "IP to whitelist",
"example": "10.0.0.0"
}
}
}
}
],
"responses": {
"200": {
"description": "Successful response"
},
"400": {
"description": "Bad request. No IP was passed"
},
"422": {
"description": "Unprocessable entity. Invalid IP was passed"
}
}
}
},
"/proxies_running": {
"get": {
"description": "Return the effective configuration for all running proxies\n",
"tags": ["Proxy", "Manager"],
"responses": {
"200": {
"description": "Successful response",
"schema": {
"type": "array",
"items": {"$ref": "#/definitions/proxy"}
}
}
}
}
},
"/recent_stats": {
"get": {
"description": "Return recent stats of all proxies",
"tags": ["Manager"],
"responses": {
"200": {
"description": "Successful response",
"schema": {
"type": "object",
"properties": {
"hostname": {
"type": "array",
"items": {
"$ref": "#/definitions/stat"
},
"description": "An array containing statistics grouped by host name"
},
"ports": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"$ref": "#/definitions/stat"
}
},
"description": "An object containing statistics grouped by proxy port",
"example": {
"24001": {
"key": 24007,
"in_bw": 1453,
"out_bw": 579,
"reqs": 2,
"success": 2
},
"24002": {
"key": 24257,
"in_bw": 728,
"out_bw": 277,
"reqs": 1,
"success": 1
}
}
},
"protocol": {
"type": "array",
"items": {
"$ref": "#/definitions/stat"
},
"description": "An array containing statistics grouped by protocol"
},
"status_code": {
"type": "array",
"items": {
"$ref": "#/definitions/stat"
},
"description": "An array containing statistics grouped by status code"
},
"ssl_enable": {
"type": "boolean",
"description": "Whether or not SSL Analyzing is enabled on all proxy ports"
},
"success": {
"type": "number",
"description": "Total number of successful requests"
},
"total": {
"type": "number",
"description": "Total number of requests"
}
}
}
}
}
}
},
"/proxies": {
"get": {
"description": "Return the explicit configuration for all running proxies\n",
"tags": ["Proxy", "Manager"],
"responses": {
"200": {
"description": "Successful response",
"schema": {
"type": "array",
"items": {"$ref": "#/definitions/proxy"}
}
}
}
},
"post": {
"description": "Add a new proxy",
"tags": ["Proxy"],
"parameters": [
{
"name": "proxy",
"in": "body",
"description": "The proxy explicit configuration",
"schema": {
"type": "object",
"properties": {
"proxy": {
"$ref": "#/definitions/proxy"
}
}
},
"required": true
}
],
"responses": {
"200": {
"description": "Successful response",
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/proxy"
}
}
}
},
"400": {
"description": "Error response",
"schema": {
"type": "object",
"properties": {
"errors": {
"type": "array",
"items": {
"type": "object",
"properties": {
"msg": {"type": "string"},
"field": {"type": "string"}
}
}
}
}
}
}
}
}
},
"/zones": {
"get": {
"description": "Return current customer's enabled zones' information",
"tags": ["Manager"],
"responses": {
"200": {
"description": "Successful response",
"schema": {
"type": "object",
"properties": {
"zones": {
"description": "Zones' information",
"type": "array",
"items": {
"$ref": "#/definitions/zone"
}
},
"def": {
"description": "Current default zone",
"type": "string"
}
}
}
}
}
}
},
"/enable_ssl": {
"post": {
"description": "Enables SSL Analyzing on all proxy ports",
"tags": ["Manager"],
"responses": {
"200": {
"description": "Successful response"
}
}
}
},
"/shutdown": {
"post": {
"description": "Shutdown LPM",
"tags": ["Manager"],
"responses": {
"200": {
"description": "Successful response"
}
}
}
},
"/upgrade": {
"post": {
"description": "Upgrade LPM",
"tags": ["Manager"],
"responses": {
"200": {
"description": "Successful response"
}
}
}
},
"/restart": {
"post": {
"description": "Restart LPM",
"tags": ["Manager"],
"responses": {
"200": {
"description": "Successful response"
}
}
}
},
"/proxies/delete": {
"post": {
"description": "Delete existing proxies",
"tags": ["Proxy"],
"parameters": [
{
"name": "options",
"in": "body",
"required": true,
"schema": {
"type": "object",
"required": ["ports"],
"properties": {
"ports": {
"type": "array",
"items": {"type": "number"},
"description": "Existing proxy ports",
"example": [24000, 24001]
}
}
}
}
],
"responses": {
"204": {
"description": "Successful response"
}
}
}
},
"/proxies/{port}": {
"put": {
"description": "Update existing proxy",
"tags": ["Proxy"],
"parameters": [
{
"name": "port",
"in": "path",
"description": "Existing proxy port",
"required": true,
"type": "integer"
},
{
"name": "proxy",
"in": "body",
"description": "The proxy explicit configuration",
"schema": {
"type": "object",
"properties": {
"proxy": {
"$ref": "#/definitions/proxy"
}
}
},
"required": true
}
],
"responses": {
"200": {
"description": "Successful response",
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/proxy"
}
}
}
},
"400": {
"description": "Error response"
}
}
},
"delete": {
"description": "Delete existing proxy",
"tags": ["Proxy"],
"parameters": [
{
"name": "port",
"in": "path",
"description": "Existing proxy port",
"required": true,
"type": "integer"
}
],
"responses": {
"204": {
"description": "Successful response"
}
}
}
},
"/proxies/{port}/banip": {
"post": {
"description": "Ban an IP on a specific port for a certain amount of time",
"tags": ["Proxy"],
"parameters": [
{
"name": "port",
"in": "path",
"description": "Existing proxy port",
"required": true,
"type": "integer"
},
{
"name": "options",
"in": "body",
"required": true,
"description": "IP ban options",
"schema": {
"type": "object",
"required": ["ip"],
"properties": {
"ip": {
"type": "string",
"example": "10.0.0.0"
},
"domain": {
"type": "string",
"example": "facebook.com"
},
"ms": {
"type": "integer",
"example": 60000
}
}
}
}
],
"responses": {
"204": {"description": "Successful response"}
}
}
},
"/proxies/{port}/unbanip": {
"post": {
"description": "Unban an IP on a specific port ban",
"tags": ["Proxy"],
"parameters": [
{
"name": "port",
"in": "path",
"description": "Existing proxy port",
"required": true,
"type": "integer"
},
{
"name": "options",
"in": "body",
"required": true,
"description": "IP unban options",
"schema": {
"type": "object",
"required": ["ip"],
"properties": {
"ip": {
"type": "string",
"example": "10.0.0.0"
},
"domain": {
"type": "string",
"example": "lumtest.com"
}
}
}
}
],
"responses": {
"200": {
"description": "Successful response",
"schema": {
"type": "object",
"properties": {
"ips": {
"type": "array",
"items": {
"type": "object",
"properties": {
"ip": {
"type": "string"
},
"domain": {
"type": "string"
},
"to": {
"type": "number",
"description": "Timestamp of when this IP will be unbanned in millisseconds"
}
}
}
}
}
}
}
}
}
},
"/proxies/{port}/unbanips": {
"post": {
"description": "Unban all IPs on a specific port",
"tags": ["Proxy"],
"parameters": [
{
"name": "port",
"in": "path",
"description": "Existing proxy port",
"required": true,
"type": "integer"
}
],
"responses": {
"200": {
"description": "Successful response"
}
}
}
},
"/banlist/{port}": {
"get": {
"description": "Get the banned IPs of a specific port",
"tags": ["Proxy"],
"parameters": [
{
"name": "port",
"in": "path",
"description": "Existing proxy port",
"required": true,
"type": "integer"
}
],
"responses": {
"200": {
"description": "Successful response",
"schema": {
"type": "object",
"properties": {
"ips": {
"type": "array",
"items": {"type": "string"},
"example": ["10.0.0.0", "10.0.0.1"]
}
}
}
},
"400": {
"description": "Server with port does not exist"
}
}
}
},
"/proxies/{port}/banips": {
"post": {
"description": "Ban a list of IPs on a specific port for a certain amunt of time",
"tags": ["Proxy"],
"parameters": [
{
"name": "port",
"in": "path",
"description": "Existing proxy port",
"required": true,
"type": "integer"
},
{
"name": "options",
"in": "body",
"required": true,
"description": "Ips ban options",
"schema": {
"type": "object",
"required": ["ips"],
"properties": {
"ips": {
"type": "array",
"items": {"type": "string"},
"example": ["10.0.0.0", "10.0.0.1"]
},
"domain": {
"type": "string",
"example": "facebook.com"
},
"ms": {
"type": "integer",
"example": 60000
}
}
}
}
],
"responses": {
"200": {"description": "Successful response"}
}
}
},
"/banip": {
"post": {
"description": "Ban an IP on all ports for a certain amount of time",
"tags": ["Proxy"],
"parameters": [
{
"name": "options",
"in": "body",
"required": true,
"description": "IP ban options",
"schema": {
"type": "object",
"required": ["ip"],
"properties": {
"ip": {
"type": "string",
"example": "10.0.0.0"
},
"domain": {
"type": "string",
"example": "facebook.com"
},
"ms": {
"type": "integer",
"example": 60000
}
}
}
}
],
"responses": {
"204": {"description": "Successful response"}
}
}
},
"/refresh_sessions/{port}": {
"get": {
"description": "Switch luminati sessions to new sessions (get new IPs)",
"tags": ["Proxy"],
"parameters": [
{
"name": "port",
"in": "path",
"description": "Proxy port",
"required": true,
"type": "integer"
}
],
"responses": {
"200": {
"description": "Successful response"
}
}
},
"post": {
"description": "Switch luminati sessions to new sessions (get new IPs)",
"tags": ["Proxy"],
"parameters": [
{
"name": "port",
"in": "path",
"description": "Proxy port",
"required": true,
"type": "integer"
}
],
"responses": {
"200": {
"description": "Successful response"
}
}
}
},
"/proxy_status/{port}": {
"get": {
"description": "Return the status of the proxy",
"tags": ["Proxy"],
"parameters": [
{
"name": "port",
"in": "path",
"description": "Proxy port",
"required": true,
"type": "integer"
},
{
"name": "force",
"in": "query",
"description": "Force an updated check of the status",
"type": "boolean"
}
],
"responses": {
"200": {
"description": "Successful response",
"schema": {
"type": "object",
"properties": {
"status": {"type": "string"}
}
}
}
}
}
},
"/settings": {
"get": {
"description": "Return current LPM general settings",
"tags": ["Proxy"],
"responses": {
"200": {
"description": "Successful response",
"schema": {
"$ref": "#/definitions/settings"
}
}
}
},
"put": {
"description": "Update LPM general settings",
"tags": ["Proxy"],
"parameters": [
{
"name": "settings",
"in": "body",
"description": "New settings",
"required": true,
"schema": {
"$ref": "#/definitions/updatable_settings"
}
}
],
"responses": {
"200": {
"description": "Successful response",
"schema": {
"$ref": "#/definitions/settings"
}
}
}
}
},
"/refresh_zones": {
"post": {
"description": "Refresh zones",
"tags": ["Proxy"],
"responses": {
"200": {
"description": "Successful response"
},
"400": {
"description": "Bad request. User is not currently logged in"
}
}
}
},
"/allocated_ips": {
"get": {
"description": "Return allocated IPs in determined zone",
"tags": ["Proxy"],
"parameters": [
{
"name": "zone",
"in": "query",
"description": "Zone",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "Successful response",
"schema": {
"type": "object",
"properties": {
"ips": {
"type": "array",
"items": {"type": "string"},
"example": ["10.0.0.0", "10.0.0.1"]
}
}
}
}
}
}
},
"/allocated_vips": {
"get": {
"description": "Return allocated gIPs in determined zone",
"tags": ["Proxy"],
"parameters": [
{
"name": "zone",
"in": "query",
"description": "Zone",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "Successful response",
"schema": {
"type": "object",
"properties": {
"vips": {
"type": "array",
"items": {"type": "string"},
"example": ["gip1", "gip2"]
}
}
}
}
}
}
},
"/refresh_ips": {
"post": {
"description": "Refresh allocated IPs or gIPs in determined zone",
"tags": ["Proxy"],
"parameters": [
{
"name": "options",
"in": "body",
"description": "Refresh IP options",
"required": true,
"schema": {
"type": "object",
"properties": {
"zone": {
"description": "Zone",
"type": "string"
},
"ips": {
"description": "IPs to be refreshed",
"type": "array",
"items": {"type": "string"},
"example": ["10.0.0.0", "10.0.0.1"]
},
"vips": {
"description": "gIPs to be refreshed",
"type": "array",
"items": {"type": "string"},
"example": ["gIP_1", "gIP_2"]
}
}
}
}
],
"responses": {
"200": {
"description": "Successful response",
"schema": {
"type": "object",
"properties": {
"ips": {
"type": "array",
"items": {
"$ref": "#/definitions/ip_object"
}
}
}
}
}
}
}
},
"/lpm_users": {
"get": {
"description": "List of all the available LPM users for the account",
"tags": ["Manager"],
"responses": {
"200": {
"description": "Successful response",
"schema": {
"type": "object",
"properties": {
"vips": {
"type": "array",
"items": {
"$ref": "#/definitions/lpm_user_object"
}
}
}
}
}
}
}
},
"/lpm_user": {
"post": {
"description": "Creates a new LPM user",
"tags": ["Manager"],
"responses": {
"200": {
"description": "Successful response"
}
}
}
},
"/general_logs": {
"get": {
"description": "Returns the tail from the log file",
"tags": ["Manager"],
"parameters": [
{
"name": "limit",
"in": "query",
"description": "Number of the lines from the log file",
"type": "number"
}
],
"responses": {
"200": {
"description": "Successful response"
}
}
}
},
"/logs": {
"get": {
"description": "Returns e",
"tags": ["Manager"],
"parameters": [
{
"name": "skip",
"in": "query",
"description": "Number of requests to be skipped from the beginning",
"type": "number"
},
{
"name": "limit",
"in": "query",
"description": "Maximum number of requests to be fetched",
"type": "number"
},
{
"name": "search",
"in": "query",
"description": "Regex search query for the URL",
"type": "string"
},
{
"name": "port_from",
"in": "query",
"description": "Lower bound for port number",
"type": "number"
},
{
"name": "port_to",
"in": "query",
"description": "Upper bound for port number",
"type": "number"
},
{
"name": "status_code",
"in": "query",
"description": "Filter requests by status code",
"type": "number"
},
{
"name": "sort",
"in": "query",
"description": "Parameter to be sorted by",
"type": "string"
},
{
"name": "sort_desc",
"in": "query",
"description": "Sorting asc or desc",
"type": "boolean"
}
],
"responses": {
"200": {
"description": "Successful response"
}
}
}
}
},
"definitions": {
"ip_object": {
"type": "object",
"properties": {
"ip": {"type": "string"},
"maxmind": {"type": "string"},
"ext": {
"type": "object",
"properties": {
"dbip": {"type": "string"},
"ip2location": {"type": "string"},
"google": {"type": "string"},
"def": {"type": "string"}
}
}
}
},
"vip_object": {
"type": "object",
"properties": {
"vip": {"type": "string"},
"mapping": {"type": "string"},
"country": {"type": "string"}
}
},
"lpm_user_object": {
"type": "object",
"properties": {
"email": {"type": "string"},
"password": {"type": "string"}
}
},
"stat": {
"type": "object",
"properties": {
"key": {"type": "string"},
"in_bw": {"type": "number"},
"out_bw": {"type": "number"},
"reqs": {"type": "number"},
"success": {"type": "number"}
}
},
"zone": {
"type": "object",
"properties": {
"name": {"type": "string"},
"perm": {"type": "string"},
"plan": {"type": "object"},
"password": {"type": "string"}
}
},
"settings": {
"type": "object",
"properties": {
"customer": {
"type": "string",
"description": "Default customer"
},
"zone": {
"type": "string",
"description": "Default zone"
},
"password": {
"type": "string",
"description": "Default password"
},
"www_whitelist_ips": {
"type": "array",
"items": {"type": "string"},
"description": "Whitelist ip list for granting access to browser admin UI"
},
"whitelist_ips": {
"type": "array",
"items": {"type": "string"},
"description": "Default for all proxies whitelist ip list for granting access to them"
},
"fixed_whitelist_ips": {
"type": "array",
"items": {"type": "string"},
"description": "Default whitelisted IPs list with granted access for all proxies passed via command line or from www_whitelist_ips"
},
"config": {
"type": "string",
"description": "Config file containing proxy definitions"
},
"read_only": {
"type": "boolean",
"description": "Avoid saving current config in the config file"
},
"test_url": {
"type": "string",
"description": "Url for testing proxy"
},
"api": {
"type": "string",
"description": "Alternative domain url to luminati API"
},
"mail_domain": {
"type": "string",
"description": "Luminati support email domain (used in the UI)"
},
"logs": {
"type": "boolean",
"description": "Enable logs for all proxies"
},
"request_stats": {
"type": "boolean",
"description": "Enable requests statistics"
},
"dropin": {
"type": "boolean",
"description": "Create dropin mode proxy port (default: 22225)"
},
"pending_www_ips": {
"type": "array",
"items": {"type": "string"},
"description": "List of IPs not whitelisted that recently tried to access LPM"
}
}
},
"updatable_settings": {
"type": "object",
"properties": {
"zone": {
"type": "string",
"description": "Default zone"
},
"www_whitelist_ips": {
"type": "array",
"items": {"type": "string"},
"description": "Whitelist ip list for granting access to browser admin UI"
},
"whitelist_ips": {
"type": "array",
"items": {"type": "string"},
"description": "Default for all proxies whitelist ip list for granting access to them"