查询一条变更

查询一条变更

API调用URL地址

http://<serverName>:<portNumber>/api/v3/changes/{change_id}

其中{change_id}为需要获取的变更ID。

示例:http://192.168.0.39:8080/api/v3/changes/9

请求参数

方法:GET

请求参数:

参数名

位置

authtoken

<API Key>

header

 

响应示例

{

    "response_status": {
        "status_code"2000,
        "status""success"
    },
    "change": {
        "template": {
            "name""General Template",
            "id""1"
        },
        "short_description""",
        "attachments": [],
        "roll_out_plan": {
            "updated_on"null,
            "attachments": [],
            "stage": {
                "internal_name""Planning",
                "stage_index""2",
                "name""Planning",
                "id""2"
            },
            "name""roll_out_plan",
            "updated_by"null,
            "description"null,
            "id""913"
        },
        "closure_code"null,
        "sla_violation"null,
        "roles": [],
        "description""",
        "emergency"false,
        "change_type"null,
        "title""test",
        "review_details": {
            "updated_on"null,
            "attachments": [],
            "stage": {
                "internal_name""Review",
                "stage_index""5",
                "name""Review",
                "id""5"
            },
            "name""review_details",
            "updated_by"null,
            "description"null,
            "id""917"
        },
        "change_owner"null,
        "next_review_on"null,
        "assets": [],
        "urgency"null,
        "close_details": {
            "updated_on"null,
            "attachments": [],
            "stage": {
                "internal_name""Close",
                "stage_index""6",
                "name""Close",
                "id""6"
            },
            "name""close_details",
            "updated_by"null,
            "description"null,
            "id""918"
        },
        "id""9",
        "change_requester"null,
        "group"null,
        "created_time": {
            "display_value""13/10/2021 05:24 PM",
            "value""1634117045885"
        },
        "item"null,
        "workflow": {
            "validated"true,
            "name""SDGeneral",
            "id""1"
        },
        "approval_status": {
            "name""Pending Approval",
            "id""1"
        },
        "change_manager"null,
        "impact"null,
        "retrospective"false,
        "sla"null,
        "checklist": {
            "updated_on"null,
            "attachments": [],
            "stage": {
                "internal_name""Planning",
                "stage_index""2",
                "name""Planning",
                "id""2"
            },
            "name""checklist",
            "updated_by"null,
            "description"null,
            "id""915"
        },
        "services": [],
        "priority"null,
        "scheduled_end_time"null,
        "back_out_plan": {
            "updated_on"null,
            "attachments": [],
            "stage": {
                "internal_name""Planning",
                "stage_index""2",
                "name""Planning",
                "id""2"
            },
            "name""back_out_plan",
            "updated_by"null,
            "description"null,
            "id""916"
        },
        "site"null,
        "stage": {
            "internal_name""Submission",
            "stage_index""1",
            "name""Submission",
            "id""1"
        },
        "reason_for_change"null,
        "completed_time"null,
        "risk"null,
        "impact_details": {
            "updated_on"null,
            "attachments": [],
            "stage": {
                "internal_name""Planning",
                "stage_index""2",
                "name""Planning",
                "id""2"
            },
            "name""impact_details",
            "updated_by"null,
            "description"null,
            "id""914"
        },
        "category"null,
        "subcategory"null,
        "notes_present"false,
        "status": {
            "internal_name""Requested",
            "prominent"false,
            "stage": {
                "id""1"
            },
            "action_name"null,
            "name""Requested",
            "id""3"
        },
        "scheduled_start_time"null
    }
}

 

Postman示例

 

Python脚本示例

#Python version - 3.9
#需要安装requests模块
import requests
 
url = "http://192.168.0.39:8080/api/v3/changes/9"
headers = {"authtoken":"DDC8A7B6-9889-498F-B82E-4DD52355CAC8"}
response = requests.get(url,headers=headers,verify=False)
print(response.text)