# Application Release

# Release Status

# URI

GET /admin-api/status/application/http/{app_id}

# Request example

# Shell

curl \
  -H "API-Token: 1df87165-3593-4eca-a910-9ac20005e6ec" \
  http://admin-site/admin-api/status/application/http/107

# Response example

Status: 200 OK
{
    "time":1625728566,
    "status":0,
    "data":{
        "catch_uped":1,          // Number of synchronized nodes
        "total":2,               // Number of total nodes
        "unsynced_nodes":[       // unsynchronized nodes
            {
                "status":1,
                "id":1,
                "_modified_unix":1625637997.5736,
                "_created_unix":1625637514.0227,
                "config":{
                    "enable_qat":false
                },
                "online_status":true,
                "version":110,
                "sync_status_utime":0,
                "serial":"1677293471",
                "hardware_id":"b4230482bd8154eea67094dd80475762",
                "external_ip":"127.0.0.1"
            }
        ]
    }
}

# Get Unreleased Changes

# URI

GET /admin-api/txlogs/pending/http/{app_id}

# Request example

# Shell

curl \
  -H "API-Token: 1df87165-3593-4eca-a910-9ac20005e6ec" \
  http://admin-site/admin-api/txlogs/pending/http/107

# Response example

Status: 200 OK
{
    "status":0,
    "data":{
        "meta":{
            "count":4
        },
        "data":[
            {
                "created_unix":1629795184.363,
                "comment":"",
                "origin":"",                            // old snapshot
                "new":{                                 // new snapshot
                    "_modified_unix":1629795182.2211,
                    "comment":"",
                    "_created_unix":1629795182.2211,
                    "conditions":[                      // Request cookie ('foo') is "test"
                        {
                            "values":[
                                {
                                    "id":836,
                                    "val":"test",
                                    "type":"str"
                                }
                            ],
                            "id":699,
                            "operator":{
                                "name":"eq"
                            },
                            "variable":{
                                "args":"foo",
                                "name":"req-cookie"
                            }
                        }
                    ],
                    "top":0,
                    "enable_rule":true,
                    "id":1035,
                    "order":8,
                    "actions":[
                        {
                            "set-req-header":{
                                "value":"foo-test",
                                "header":"Host"
                            },
                            "id":823,
                            "type":"set-req-header"
                        }
                    ],
                    "last":false
                },
                "uid":454,
                "path":"applications.107.phases.rewrite.rules",
                "op":"add",
                "id":11287,
                "new_desc":"ID: 1035\n[% Conditions %]:\n    [% Variable %]: req-cookie(foo)\n    [% Operator %]: eq\n    [% value %]:\n        test\n[% Action %]:\n    [% Set request header %]:\n        value: foo-test\n        header: Host\n\n",
                "opid":"31d45e93-a54c-4bf0-9822-bcaaa7fd6cb2",
                "username":"openresty"
            }
        ]
    },
    "time":1629862774
}

# Get The Number of Unreleased Changes

# URI

GET /admin-api/txlogs/pending-count/http/{app_id}

# Request example

# Shell

curl \
  -H "API-Token: 1df87165-3593-4eca-a910-9ac20005e6ec" \
  http://admin-site/admin-api/txlogs/pending-count/http/107

# Response example

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

# Get Released Changes

# URI

GET /admin-api/txlogs/list/http/{app_id}

# Request example

# Shell

curl \
  -H "API-Token: 1df87165-3593-4eca-a910-9ac20005e6ec" \
  http://admin-site/admin-api/txlogs/list/http/107

# Response example

Status: 200 OK
{
    "time":1625731327,
    "status":0,
    "data":{
        "meta":{
            "count":12
        },
        "data":[
            {
                "created_unix":1572240470.344,
                "snapshot":{
                	//
                },
                "snapshot_desc":"",
                "old_snapshot":{
                    //
                },
                "old_snapshot_desc":"",
                "txlog_id":4434,
                "prev_id":1726,
                "latest":1,
                "comment":"",
                "app_type":1,
                "latest_editor":"edge-admin",
                "type":"release",
                "_created_unix":"2019-10-28 13:27:50.344039",
                "id":1727,
                "username":"edge-admin",
                "is_gray":false,
                "uid":2,
                "app_id":107,
            }
        ]
    }
}

# Release Global Conf

# URI

POST /admin-api/txlogs/release/http/{app_id}

# Request example

# Shell

curl 'http://admin-site/admin-api/txlogs/release/http/107' \
  -X 'POST' \
  -H "API-Token: 1df87165-3593-4eca-a910-9ac20005e6ec"

# Response example

Status: 200 OK
{
    "time":1625732509,
    "status":0
}

# RollBack

# URI

POST /admin-api/txlogs/rollback/http/{app_id}

# JSON body

  • id

    type: integer

    required: yes

    description: release id

# Request example

# Shell

curl 'http://admin-site/admin-api/txlogs/rollback/http/107' \
  -X 'POST' \
  -H "API-Token: 1df87165-3593-4eca-a910-9ac20005e6ec" \
  -d '{
      "id":1047
  }'

# Response example

Status: 200 OK
{
    "time":1625733110,
    "status":0
}

# Clear Pending Changes

# URI

GET /admin-api/txlogs/revert/http/1

# Request example

# Shell

curl 'http://admin-site/admin-api/txlogs/revert/http/107' \
  -H "API-Token: 1df87165-3593-4eca-a910-9ac20005e6ec"

# Response example

Status: 200 OK
{
    "time":1625732509,
    "status":0
}

# Add Comment

# URI

POST /admin-api/txlogs/comment/http/107/{release_id}

# JSON body

  • comment

    type: string

    required: yes

    description: release

# Request example

# Shell

curl 'http://admin-site/admin-api/txlogs/comment/http/107/1015' \
  -X 'POST' \
  -H "API-Token: 1df87165-3593-4eca-a910-9ac20005e6ec" \
  -d '{
      "comment":"test"
  }'

# Response example

Status: 200 OK
{
    "time":1625733110,
    "status":0
}