40-api-net.rst 2.35 KB

网络配置接口

本地网络配置

配置本地网络

Verb: POST
Path: /api/v1/tx1/local_net
Header: (authorization, {$auth_atoken}) (Content-Type, json)

Request Body:

{
  "ip":   "127.0.0.1",
  "sub_mask":   "255.255.255.0",  #子网掩码
  "gateway":   "8.8.8.8",
  "mac_addr":   "f0:1f:af:d7:13:c0"
}

Response Body:

{
  "ip":   "127.0.0.1",
  "sub_mask":   "255.255.255.0",  #子网掩码
  "gateway":   "8.8.8.8",
  "mac_addr":   "f0:1f:af:d7:13:c0"
}

获取本地网络

Verb: GET
Path: /api/v1/tx1/local_net
Header: (authorization, {$auth_atoken}) (Content-Type, json)

Response Body:

{
  "ip":   "127.0.0.1",
  "sub_mask":   "255.255.255.0",  #子网掩码
  "gateway":   "8.8.8.8",
  "mac_addr":   "f0:1f:af:d7:13:c0"
}

中心网络配置

配置中心网络

Verb: POST
Path: /api/v1/tx1/center_net
Header: (authorization, {$auth_atoken}) (Content-Type, json)

Request Body:

{
  "ip":   "127.0.0.1",
  "port":   "8081"
}

Response Body:

{
  "ip":   "127.0.0.1",
  "port":   "8081"
}

获取中心网络

Verb: GET
Path: /api/v1/tx1/center_net
Header: (authorization, {$auth_atoken}) (Content-Type, json)

Response Body:

{
  "ip":   "127.0.0.1",
  "port":   "8081"
}

运维网络配置

配置运维网络

Verb: POST
Path: /api/v1/tx1/dev_net
Header: (authorization, {$auth_atoken}) (Content-Type, json)

Request Body:

{
  "ip":   "127.0.0.1",
  "port":   "8081"
}

Response Body:

{
  "ip":   "127.0.0.1",
  "port":   "8081"
}

获取运维网络

Verb: GET
Path: /api/v1/tx1/dev_net
Header: (authorization, {$auth_atoken}) (Content-Type, json)

Response Body:

{
  "ip":   "127.0.0.1",
  "port":   "8081"
}