頻寬規則

獲取頻寬規則列表

URI

GET /admin-api/socks5_proxy/{id}/bandwidth_rules

URI 引數

  • detail

    type: integer

    required: no

    description: 獲取詳細的 DNS 應用資訊

  • page

    type: integer

    required: no

    description: 第幾頁,從 1 開始

  • page_size

    type: integer

    required: no

    description: 每頁大小,預設 20

請求示例

Shell

curl http://{admin-site}/admin-api/socks5_proxy/3/bandwidth_rules?page=1&page_size=20&detail=1

響應示例

Status: 200 OK
{
    "data": [
        {
            "_modified_unix": 1621839010.1792,
            "connections": 30,
            "_created_unix": 1621839010.1792,
            "src_type": "user",
            "bandwidth": 30,
            "id": 2,
            "enabled": true,
            "src": [
                "abc"
            ],
            "order": 0
        }
    ],
    "status": 0
}

新增頻寬規則

URI

POST /admin-api/socks5_proxy/{id}/bandwidth_rules

JSON Body 引數

  • enabled

    type: boolean

    required: no

    description: 啟用/禁用

  • connections

    type: integer

    required: yes

    description: 連線數

  • src_type

    type: string

    required: yes

    description: 源型別, 取值:user、 group 、cidr

  • src

    type: string

    required: yes

    description: 源

  • bandwidth

    type: integer

    required: yes

    description: 頻寬

請求示例

Shell

curl -X POST http://{admin-site}/admin-api/socks5_proxy/{id}/bandwidth_rules -d
'{
    "enabled": true,
    "connections": 30,
    "bandwidth": 30,
    "src": [
        "abc"
    ],
    "src_type": "user"
}'

響應示例

Status: 200 OK
{
    "status": 0,
    "data": {
        "id": 1
    }
}

修改頻寬規則

URI

PUT /admin-api/socks5_proxy/{id}/bandwidth_rules/{id}

JSON Body 引數

  • enabled

    type: boolean

    required: no

    description: 啟用/禁用

  • connections

    type: integer

    required: yes

    description: 連線數

  • src_type

    type: string

    required: yes

    description: 源型別, 取值:user、 group 、cidr

  • src

    type: string

    required: yes

    description: 源

  • bandwidth

    type: integer

    required: yes

    description: 頻寬

請求示例

Shell

curl -X PUT http://{admin-site}/admin-api/socks5_proxy/{id}/bandwidth_rules/{id} -d
'{
    "_modified_unix": 1621839010.1792,
    "connections": 34,
    "_created_unix": 1621839010.1792,
    "bandwidth": 30,
    "id": 2,
    "enabled": true,
    "order": 0,
    "src": [
        "abc"
    ],
    "src_type": "group"
}'

響應示例

Status: 200 OK
{
    "status": 0
}

刪除頻寬規則

URI

DELETE /admin-api/socks5_proxy/{id}/bandwidth_rules/{id}

請求示例

Shell

curl -X DELETE http://{admin-site}/admin-api/socks5_proxy/{id}/bandwidth_rules/{id}

響應示例

Status: 200 OK
{
    "status": 0
}