Table of contents
Directory
Updated at 2020-03-20 16:00:22

Tars Web API

Auth

Please use web>=2.0.0.

Create a new token in the user center, and use the web API after obtaining the token

The usage of Web API is as follows:

http://xx.xx.xx.xx/api/[command]?ticket=[token]

Ticket: token generated in Web Platform

Tree

/api/tree

tree

Get Application Tree

Parameter

None

Return Value

{
    "id": "",                  // Node ID
    "name": "",                // Node Name
    "pid": "",                 // Parent Node ID
    "open": true,              // Expand
    "is_parent": true,         // Is Parent Node
    "children": []             // Children
}

Server

Deploy Server

/api/deploy_server

Parameter

{                                  
    "application": "",             // Application
    "server_name": "",             // Server Name
    "node_name": "",               // Node Name
    "server_type": "",             // Server Type
    "template_name": "",           // Template Name
    "enable_set": true,            // Open Set
    "set_name": "",                // Set Name
    "set_area": "",                // Set Region
    "set_group": "",               // Set Group
    "adapters": [{ 
        "obj_name": "",            // OBJ Name
        "bind_ip": "",             // Obj Bind IP
        "port": "",                // Port
		"port_type": "tcp",        // Port Type
		"protocol": "tars",        // Protocol
        "thread_num": 0,           // Thread Num
        "max_connections": 0,      // Max Connections
        "queuecap": 0,             // Max length
        "queuetimeout": 0          // Timeout in Queue
    }]                             
}

Return Value

{
	"server_conf": {          //Server Info
		"id": 0,                   // Server ID
		"application": "",         // Application
		"server_name": "",         // Server Name
		"node_name": "",           // Node Name
		"server_type": "",         // Server Type
		"enable_set": true,        // Open Set
		"set_name": "",            // Set Name
		"set_area": "",            // Set Region
		"set_group": "",           // Set Group
		"setting_state": "",       // Set State
		"present_state": "",       // Current State
		"bak_flag": true,          // Is Backup Machine
		"template_name": "",       // Template Name
		"profile": "",             // Private Template
		"async_thread_num": 0,     // Async Thread Num
		"base_path": "",           // Default Path
		"exe_path": "",            // EXE Path
		"start_script_path": "",   // Start Script
		"stop_script_path": "",    // Stop Script
		"monitor_script_path": "", // Monitor Script
		"patch_time": "",          // Publish Time
		"patch_version", "",       // Publish Version
		"process_id": "",          // ProcessID
		"posttime": ""             // Update Time
	},
	"tars_node_rst":[   //tarsnode install result
		{
			"ip":"1.1.1.3",  //Machine IP
			"rst":false,//install tarsnode
			"msg":""
		}
	]
}

About

Only Support POST method,in Header set Content-Type:application/json

Modify Server

/api/update_server

Parameter

{
	"id": 0,                  // Server ID
	"isBak": true,            // Is Backup Machine
	"template_name": "",      // Template Name
	"server_type": "",        // Server Type
	"enable_set": "",         // Open Set
	"set_name": "",           // Set Name
	"ser_area": "",           // Set Region
	"set_group": "",          // Set Group
	"async_thread_num": 0,    // Async Thread Num
	"base_path": "",          // Default Path
	"exe_path": "",           // EXE Path
	"start_script_path": "",  // Start Script
	"stop_script_path": "",   // Stop Script
	"monitor_script_path": "",// Monitor Script
	"profile": ""             // Private Template
}

Return Value

{
    "id": 0,                   // Server ID
    "application": "",         // Application
    "server_name": "",         // Server Name
    "node_name": "",           // Node Name
    "server_type": "",         // Server Type
    "enable_set": true,        // Open Set
    "set_name": "",            // Set Name
    "set_area": "",            // Set Region
    "set_group": "",           // Set Group
    "setting_state": "",       // Set State
    "present_state": "",       // Current State
    "bak_flag": true,          // Is Backup Machine
    "template_name": "",       // Template Name
    "profile": "",             // Private Template
    "async_thread_num": 0,     // Async Thread Num
    "base_path": "",           // Default Path
    "exe_path": "",            // EXE Path
    "start_script_path": "",   // Start Script
    "stop_script_path": "",    // Stop Script
    "monitor_script_path": "", // Monitor Script
    "patch_time": "",          // Publish Time
    "patch_version", "",       // Publish Version
    "process_id": "",          // ProcessID
    "posttime": ""             // Update Time
}

About

Only Support POST method,in Header set Content-Type:application/json

Get Server

/api/server

Parameter

id // Server ID

Return Value

{
    "id": 0,                   // Server ID
    "application": "",         // Application
    "server_name": "",         // Server Name
    "node_name": "",           // Node Name
    "server_type": "",         // Server Type
    "enable_set": true,        // Open Set
    "set_name": "",            // Set Name
    "set_area": "",            // Set Region
    "set_group": "",           // Set Group
    "setting_state": "",       // Set State
    "present_state": "",       // Current State
    "bak_flag": true,          // Is Backup Machine
    "template_name": "",       // Template Name
    "profile": "",             // Private Template
    "async_thread_num": 0,     // Async Thread Num
    "base_path": "",           // Default Path
    "exe_path": "",            // EXE Path
    "start_script_path": "",   // Start Script
    "stop_script_path": "",    // Stop Script
    "monitor_script_path": "", // Monitor Script
    "patch_time": "",          // Publish Time
    "patch_version", "",       // Publish Version
    "process_id": "",          // ProcessID
    "posttime": ""             // Update Time
}

Get Server List

/api/server_list

Parameter

tree_node_id // tree ID

Return Value

[{
    "id": 0,                   // Server ID
    "application": "",         // Application
    "server_name": "",         // Server Name
    "node_name": "",           // Node Name
    "server_type": "",         // Server Type
    "enable_set": true,        // Open Set
    "set_name": "",            // Set Name
    "set_area": "",            // Set Region
    "set_group": "",           // Set Group
    "setting_state": "",       // Set State
    "present_state": "",       // Current State
    "bak_flag": true,          // Is Backup Machine
    "template_name": "",       // Template Name
    "profile": "",             // Private Template
    "async_thread_num": 0,     // Async Thread Num
    "base_path": "",           // Default Path
    "exe_path": "",            // EXE Path
    "start_script_path": "",   // Start Script
    "stop_script_path": "",    // Stop Script
    "monitor_script_path": "", // Monitor Script
    "patch_time": "",          // Publish Time
    "patch_version": "",       // Publish Version
    "process_id": "",          // ProcessID
    "posttime": ""             // Update Time
}]

Get Inactive Server List

/api/inactive_server_list

Parameter

application // Application
server_name // Server Name
node_name   // Node Name

Return Value

[{
    "id": 0,                   // Server ID
    "application": "",         // Application
    "server_name": "",         // Server Name
    "node_name": "",           // Node Name
    "server_type": "",         // Server Type
    "enable_set": true,        // Open Set
    "set_name": "",            // Set Name
    "set_area": "",            // Set Region
    "set_group": "",           // Set Group
    "setting_state": "",       // Set State
    "present_state": "",       // Current State
    "bak_flag": true,          // Is Backup Machine
    "template_name": "",       // Template Name
    "profile": "",             // Private Template
    "async_thread_num": 0,     // Async Thread Num
    "base_path": "",           // Default Path
    "exe_path": "",            // EXE Path
    "start_script_path": "",   // Start Script
    "stop_script_path": "",    // Stop Script
    "monitor_script_path": "", // Monitor Script
    "patch_time": "",          // Publish Time
    "patch_version": "",       // Publish Version
    "process_id": "",          // ProcessID
    "posttime": ""             // Update Time
}]

Get Server Notify Log List

/api/server_notify_list

Parameter

tree_node_id // Tree ID

Return Value

{
    "count": 0,
    "rows":[{
        "notifytime": "",          // Time
        "server_id": "",           // Server ID
        "thread_id": "",           // Thread ID
        "command": "",             // Command
        "result": ""               // 结果
    }]
}

Is Support Page

yes

Get server realtime state

/api/get_realtime_state

Parameter

id // Server ID

Return Value

{
    "realtime_state": ""       // realtime state
}

Load Server

/api/load_server

Parameter

application  // Application
server_name  // Server Name
node_name    // Node Name

Return Value

"" // Execute result

Pre Expend

/api/expand_server_preview

Parameter

{
    "application": "",        // Application
    "server_name": "",        // Server Name
    "set": "",                // Set
    "node_name": "",          // Node Name
    "expand_nodes": [""],     // Expand Node
    "enable_set": true,       // Open Set
    "set_name": "",           // Set Name
    "set_area": "",           // Set Region    
    "set_group": "",          // Set Group
    "copy_node_config": true  // If copy node config when node_name is not empty
}

Return Value

[{
    "application": "",        // Application
    "server_name": "",        // Server Name
    "set": "",                // Set
    "obj_name": "",           // OBJ Name
    "node_name": "",          // Node Name
    "bind_ip": "",            // Obj Bind IP
    "port": 0,                // Port
    "template_name": "",      // Template Name
    "status": "",             // 状态
}]

About

Only Support POST method,in Header set Content-Type:application/json

Expand

/api/expand_server

Parameter

{
    "application": "",            // Application
    "server_name": "",            // Server Name
    "set": "",                    // Set
    "node_name": "",              // Node Name
    "copy_node_config": true,    // If copy node config, when node_name is not empty
    "expand_preview_servers": [{
        "node_name": "",          // Node Name
        "set": "",                // Set
        "obj_name": "",           // OBJ Name
        "bind_ip": "",            // Obj Bind IP
        "port": 0                 // Port
    }]
}

Return Value

{
		"server_conf": {          //Server Info
			[{                                  
				"id": 0,                   // Server ID
				"application": "",         // Application
				"server_name": "",         // Server Name
				"node_name": "",           // Node Name
				"server_type": "",         // Server Type
				"enable_set": true,        // Open Set
				"set_name": "",            // Set Name
				"set_area": "",            // Set Region
				"set_group": "",           // Set Group
				"setting_state": "",       // Set State
				"present_state": "",       // Current State
				"bak_flag": true,          // Is Backup Machine
				"template_name": "",       // Template Name
				"profile": "",             // Private Template
				"async_thread_num": 0,     // Async Thread Num
				"base_path": "",           // Default Path
				"exe_path": "",            // EXE Path
				"start_script_path": "",   // Start Script
				"stop_script_path": "",    // Stop Script
				"monitor_script_path": "", // Monitor Script
				"patch_time": "",          // Publish Time
				"patch_version", "",       // Publish Version
				"process_id": "",          // ProcessID
				"posttime": ""             // Update Time
			}]
		},
		"tars_node_rst":[   //tarsnode install result
			{
				"ip":"1.1.1.3",  //Machine IP
				"rst":false,// install tarsnode result
				"msg":"" 
			}
		]
}

About

Only Support POST method,in Header set Content-Type:application/json

Add Adapter

/api/add_adapter_conf

Parameter

{
	"application": "",         // Application
	"server_name": "",         // Server Name
	"node_name": "",           // Node Name
	"thread_num": 1,           // Thread Num
	"endpoint": "",            // EndPoint
	"max_connections": 0,      // Max Connect'o'n's
	"allow_ip": "",            // Allow IP
	"servant": "",             // Servant
	"queuecap": 0,             // Queue Length
	"queuetimeout": 0,         // Timeout in Queue
	"protocol": "",            // Protocol
	"handlegroup": ""          // Handle Group(not use)
}

Return Value

{
	"id": 0,                   // Adapter ID
	"application": "",         // Application
	"server_name": "",         // Server Name
	"node_name": "",           // Node Name
	"adapter_name": "",        // Adapter Name
	"thread_num": 1,           // Thread Num
	"endpoint": "",            // EndPoint
	"max_connections": 0,      // Max Connections
	"allow_ip": "",            // Allow IP
	"servant": "",             // Servant
	"queuecap": 0,             // Queue Length
	"queuetimeout": 0,         // Timeout in Queue
	"posttime": "",            // Update Time
	"protocol": "",            // Protocol
	"handlegroup": ""          // Handle Group(not use)
}

About

Only Support POST method,in Header set Content-Type:application/json

Delete Adapter

/api/delete_adapter_conf

Parameter

id // Adapter ID

Return Value

[0] // Deleted Adapter ID

Modify Adapter

/api/update_adapter_conf

Parameter

{
	"id": 0,                   // Adapter ID
	"thread_num": 1,           // Thread Num
	"endpoint": "",            // EndPoint
	"max_connections": 0,      // Max Connections
	"allow_ip": "",            // Allow IP
	"servant": "",             // Servant
	"queuecap": 0,             // Queue Length
	"queuetimeout": 0,         // Timeout in Queue
	"protocol": "",            // Protocol
	"handlegroup": ""          // handle Group (not use)
}

Return Value

{
    "id": 0,                   // Adapter ID
    "application": "",         // Application
    "server_name": "",         // Server Name
    "node_name": "",           // Node Name
    "adapter_name": "",        // Adapter Name
    "thread_num": 1,           // Thread Num
    "endpoint": "",            // EndPoint
    "max_connections": 0,      // Max Connections
    "allow_ip": "",            // Allow IP
    "servant": "",             // Servant
    "queuecap": 0,             // Queue Length
    "queuetimeout": 0,         // Timeout in Queue
    "posttime": "",            // Update Time
    "protocol": "",            // Protocol
    "handlegroup": ""          // 处理组
}

About

Only Support POST method,in Header set Content-Type:application/json

Get Adapter

/api/adapter_conf

Parameter

id // Adapter ID

Return Value

{
    "id": 0,                   // Adapter ID
    "application": "",         // Application
    "server_name": "",         // Server Name
    "node_name": "",           // Node Name
    "adapter_name": "",        // Adapter Name
    "thread_num": 1,           // Thread Num
    "endpoint": "",            // EndPoint
    "max_connections": 0,      // Max Connections
    "allow_ip": "",            // Allow IP
    "servant": "",             // Servant
    "queuecap": 0,             // Queue Length
    "queuetimeout": 0,         // Timeout in Queue
    "posttime": "",            // Update Time
    "protocol": "",            // Protocol
    "handlegroup": ""          // handle group(not use)
}

Get Adapter List

/api/adapter_conf_list

Parameter

id // Server ID

Return Value

[{
    "id": 0,                   // Adapter ID
    "application": "",         // Application
    "server_name": "",         // Server Name
    "node_name": "",           // Node Name
    "adapter_name": "",        // Adapter Name
    "thread_num": 1,           // Thread Num
    "endpoint": "",            // EndPoint
    "max_connections": 0,      // Max Connections
    "allow_ip": "",            // Allow IP
    "servant": "",             // Servant
    "queuecap": 0,             // Queue Length
    "queuetimeout": 0,         // Timeout in Queue
    "posttime": "",            // Update Time
    "protocol": "",            // Protocol
    "handlegroup": ""          // 处理组
}]

Server Config

Add Config

/api/add_config_file

Parameter

{
    "level": 1,         // Level
    "application": "",  // Application
    "server_name": "",  // Server Name
    "node_name": "",    // Node Name
    "set_name": "",     // Set Name
    "set_area": "",     // Set取
    "set_group": "",    // Set Group
    "filename": "",     // File Name
    "config": ""        // Content
}

Return Value

{
    "id": 0,            // ConfigID
    "server_name": "",  // Server Name
    "node_name": "",    // Node Name
    "set_name": "",     // Set Name
    "set_area": "",     // Set取
    "set_group": "",    // Set Group
    "filename": "",     // File Name
    "config": "",       // Content
    "level": 1,         // Level,1:Application or Set,2:Server,3:节点
    "posttime": "",     // Update Time
}

Delete Config

/api/delete_config_file

Parameter

id // ConfigID

Return Value

[0] // Delete ConfigID

Modify Config

/api/update_config_file

Parameter

{
    "id": 0,            // ConfigID
    "config": "",       // Content
    "reason": ""        // About
}

Return Value

{
    "id": 0,            // ConfigID
    "server_name": "",  // Server Name
    "node_name": "",    // Node Name
    "set_name": "",     // Set Name
    "set_area": "",     // Set Region
    "set_group": "",    // Set Group
    "filename": "",     // File Name
    "config": "",       // Content
    "level": 1,         // Level,1:Application or Set,2:Server,3:Node
    "posttime": "",     // Update Time
}

About

Only Support POST method,in Header set Content-Type:application/json

Get Config

/api/config_file

Parameter

id // ConfigID

Return Value

{
    "id": 0,            // ConfigID
    "server_name": "",  // Server Name
    "node_name": "",    // Node Name
    "set_name": "",     // Set Name
    "set_area": "",     // Set Region
    "set_group": "",    // Set Group
    "filename": "",     // File Name
    "config": "",       // Content
    "level": 1,         // Level,1:Application or Set,2:Server,3:Node
    "posttime": "",     // Update Time
}

Get Config List

/api/config_file_list

Parameter

level       // Level,1:Application,2:Set Name,3:Set Region,4:Set Group,5:Server
application // Application
server_name // Server Name
set_name    // Set Name
set_area    // Set Region
set_group   // Set Group

Return Value

[{
    "id": 0,            // ConfigID
    "server_name": "",  // Server Name
    "node_name": "",    // Node Name
    "set_name": "",     // Set Name
    "set_area": "",     // Set取
    "set_group": "",    // Set Group
    "filename": "",     // File Name
    "config": "",       // Content
    "level": 1,         // Level,1:Application Or Set,2:Server,3:Node
    "posttime": "",     // Update Time
}]

Get Node Config List

/api/node_config_file_list

Parameter

application // Application
server_name // Server Name
set_name    // Set Name
set_area    // Set Region
set_group   // Set Group
config_id   // ConfigID

Return Value

[{
    "id": 0,            // ConfigID
    "server_name": "",  // Server Name
    "node_name": "",    // Node Name
    "set_name": "",     // Set Name
    "set_area": "",     // Set Region
    "set_group": "",    // Set Group
    "filename": "",     // File Name
    "config": "",       // Content
    "level": 1,         // Level,1:Application or Set,2:Server,3:Node
    "posttime": "",     // Update Time
}]

About

Only Support POST method,in Header set Content-Type:application/json

Get Config Modify List

/api/config_file_history

Parameter

id  // ID

Return Value

{
    "id": "",        // ID
    "config_id": "", // ConfigID
    "reason": "",    // About
    "content": "",   // content
    "posttime": "",  // Update Time
}

Get Config Modify content

/api/config_file_history_list

Parameter

config_id // ConfigID

Return Value

{
    "count":0,
    "rows":[{
        "id": "",        // ID
        "config_id": "", // ConfigID
        "reason": "",    // About
        "content": "",   // Content
        "posttime": "",  // Update Time
    }]
}

Is Support Page

yes

Add ref

/api/add_config_ref

Parameter

config_id    // ConfigID
reference_id // ref ConfigID

Return Value

{
    "id": "",           // ref ID
    "config_id": "",    // ConfigID
    "reference_id": ""  // ref ConfigID
}

Delete Ref

/api/delete_config_ref

Parameter

id // Ref ID

Return Value

[0] // Deleted Ref ID

Ref list

/api/config_ref_list

Parameter

config_id // ConfigID

Return Value

[{
    "id": 0,                // refID
    "config_id": 0,         // ConfigID
    "reference": {
        "id": 0,            // ConfigID
        "server_name": "",  // Server Name
        "node_name": "",    // Node Name
        "set_name": "",     // Set Name
        "set_area": "",     // Set取
        "set_group": "",    // Set Group
        "filename": "",     // File Name
        "config": "",       // Content
        "level": 1,         // Level,1:Application or Set,2:Server,3:Node
        "posttime": "",     // Update Time
    }
}]

Merge Node Config

/api/merged_node_config

Parameter

id // Config ID

Return Value

"" // Config content

Push Config

/api/push_config_file

Parameter

ids // config ID, sep by ;

Return Value

[{
    "application": "",    // Application
    "server_name": "",    // Server Name
    "node_name": "",      // Node Name
    "ret_code": 0,        // Execute Result,0: Succ
    "err_msg": ""         // Error Message
}]

Task Manage

Include Start, Stop, Publish, Offline

Add Task

/api/add_task

Parameter

{
    "serial": true, // Is Serial
    "items": [{
        "server_id": "",    // Server Name
        "command": "",     // Command
        "parameters": {     // Parameter
        }
    }]
}

Command Include: restart,stop,undeploy_tars,patch_tars
when command!=patch_tars时,parameter is empty
when command=patch_tars时,parameter:
{
    patch_id: "0",    // Version
    update_text: "",  // About
    bak_flag: true    // backup flag, true:backup,false:master
}

Return Value

""  // Task ID

About

Only support POST,http Header set: Content-Type:application/json

Get Task and Sub Task Info

/api/task

Parameter

task_no // Task ID

Return Value

{
    "task_no": "",               // Task ID
    "serial": true,              // Is Serial
    "status": 0,                 // Job State
    "items":[{
        "task_no": "",
        "item_no": "",           // Sub Job ID
        "application": "",       // Application
        "server_name": "",       // Server Name
        "node_name": "",         // Node Name
        "command": "",           // Command
        "parameters": {},        // Parameter
        "start_time": "",        // Start Time
        "end_time": "",          // End Time
        "status": "",            // Sub Job State
        "status_info": "",       // State
        "execute_info": ""       // Execute Info
    }]
}

Get Task List

/api/task_list

Parameter

application // Application
server_name // Server Name
command     // Command
from        // Start Time
to          // End Time

Return Value

[{
    "task_no": "",               // Task ID
    "serial": true,              // Is Serial
    "status": 0,                 // Job State
    "items":[{
        "task_no": "",
        "item_no": "",           // Sub Job ID
        "application": "",       // Application
        "server_name": "",       // Server Name
        "node_name": "",         // Node Name
        "command": "",           // Command
        "parameters": {},        // Parameter
        "start_time": "",        // Start Time
        "end_time": "",          // End Time
        "status": "",            // Sub Job State
        "status_info": "",       // State
        "execute_info": ""       // Execute Info
    }]
}]

Publish Package

Upload Package

/api/upload_patch_package

Parameter

application // Application
module_name // Module Name
comment     // About
suse        // Packge OS name(not use)
task_id     // task ID
md5         // package md5(empty not check)

Return Value

{
    "id": 0,        // package ID
    "server": "",   // Server,Application+Module Name
    "tgz": "",      // Package name
    "comment": "",  // About
    "posttime": ""  // Update Time
}

Upload And Publish

/api/upload_and_publish

Parameter

application // app
module_name // name
comment     // comment
suse        // file

Reture Value

msg

Demo(use curl)

curl http://${TARS_WEB_HOST}/api/upload_and_publish?ticket=${TARS_TOKEN} -Fsuse=@${TARGET}.tgz -Fapplication=${APP} -Fmodule_name=${ServerName} -Fcomment=developer-auto-upload

Get Publish Version list

/api/server_patch_list

Parameter

application // Application
module_name // Module Name

Return Value

{
    "count":0,
    "rows":[{
        "id": 0,        // PackageID
        "server": "",   // Server,Application+Module Name
        "tgz": "",      // Package name
        "comment": "",  // About
        "posttime": ""  // Update Time
    }]
}

Support Page

Yes

Template

Add Template

/api/add_profile_template

Parameter

{
	"template_name": "",      // Not Empty,Template Name
	"parents_name": "",       // Not Empty,Parent Template
	"profile": ""             // Not Empty,Template Content
}

Return Value

{
	"id": 0,                  // Template ID
	"template_name": "",      // Template Name
	"parents_name": "",       // Parent Template
	"profile": "",            // Template Content
	"posttime": ""            // Update Time
}

Delete Template

/api/delete_profile_template

Parameter

id  // Template ID

Return Value

[0] // Delete Template

Modify Template

/api/update_profile_template

Parameter

{
	"id": "",                 //  Not Empty,Template ID
	"template_name": "",      //  Not Empty,Template Name
	"parents_name": "",       //  Not Empty,Parent Template
	"profile": ""             //  Not Empty,Template Content
}

Return Value

{
	"id": 0,                  // Template ID
	"template_name": "",      // Template Name
	"parents_name": "",       // Parent Template
	"profile": "",            // Template Content
	"posttime": ""            // Update Time
}

Get Template

/api/profile_template

Parameter

template_name // Template Name

Return Value

{
	"id": 0,                  // Template ID
	"template_name": "",      // Template Name
	"parents_name": "",       // Parent Template
	"profile": "",            // Template Content
	"posttime": ""            // Update Time
}

Query Template

/api/query_profile_template

Parameter

template_name  // Template Name
parents_name   // Parent Template Name

Return Value

[{
	"id": 0,                  // Template ID
	"template_name": "",      // Template Name
	"parents_name": "",       // Parent Template
	"profile": "",            // Template Content
	"posttime": ""            // Update Time
}]

Monitor

Get tarsstat Monitor Data

/api/tarsstat_monitor_data

Parameter

thedate         // Show Time
predate         // Compare Time
startshowtime   // Start Time
endshowtime     // End Time
master_name     // Server
slave_name      // Client
interface_name  // Interface
master_ip       // ServerIP
slave_ip        // ClientIP
group_by        // Group

Return Value

[{
    "show_date": "",          // Date
    "show_time": "",          // Time
    "master_name": "",        // Server
    "slave_name": "",         // Client
    "interface_name": "",     // Interface
    "master_ip": "",          // ServerIP
    "slave_ip": "",           // ClientIP
    "the_total_count": "",    // Current Date count
    "pre_total_count": "",    // Compare Date count
    "total_count_wave": "",   // wave rate
    "the_avg_time": "",       // Curent Date cost
    "pre_avg_time": "",       // Compare date cost
    "the_fail_rate": "",      // Current Date fail rate
    "pre_fail_rate": "",      // Compare Date fail rate
    "the_timeout_rate": "",   // Current Date timeout rate
    "pre_timeout_rate": ""    // Compare Date timeout rate
}]

Get tarsproperty monitor data

/api/tarsproperty_monitor_data

Parameter

thedate         // Show Time
predate         // Compare Time
startshowtime   // Start Time
endshowtime     // End Time
master_name     // Server Name
master_ip       // IP
property_name   // property
policy          // policy

Return Value

[{
    "show_date": "",          // Date
    "show_time": "",          // Time
    "master_name": "",        // Server Name
    "master_ip": "",          // IP
    "property_name": "",      // property
    "policy": "",             // policy
    "the_value": "",          // Current Date Value
    "pre_value": ""           // Compare Date Value
}]

Dict

Get Server Type List

/api/server_type_list

Parameter

None

Return Value

["tars_cpp"]

Get Template List

/api/template_name_list

Parameter

None

Return Value

["tars.default"]

Select Server

/api/cascade_select_server

Parameter

level        // Level,1:Application,2:Server Name,3:Set,4:Node
application  // Application,level>1 Not Empty
server_name  // Server Name,level>2 Not Empty
set          // Set,level>3,:Set Name.Set Region.Set Group

Return Value

[""] server list

Resource

Install Tars Node

/server/api/install_tars_node

Parameter

ips	//tarsnode machine ip

Return Value

[
	{
        "ip": "",  
        "rst": true, 
		"msg":"" 
    }
]

Uninstall Tars Node

/api/uninstall_tars_node

Parameter

ips	//tarsnode machine ip

Return Value

[
	{
        "ip": "",  //机器IP
        "rst": true, //卸载结果
		"msg":"" //卸载结果信息
    }
]

Other

Send Custom Command to Server

/api/send_command

Parameter

server_ids // Server ID
command    // Command

Return Value

[{
	"application": "", // Application
	"server_name": "", // Server Name
	"node_name": "",   // Node Name
	"ret_code": "",    // Return Value
	"err_msg": ""      // err message
}]

Get Unused Port

/api/auto_port

Parameter

node_name // Machine IP,sep by ;

Return Value

[{
	"node_name": "", //Machine IP
	"port": "", // Port
}]
Chapter