跳转到内容

配置项

它是 CMDB 的基础组成部分。CI 是组织的重要资源。CI 可以分类到不同的 CI 类型,也可以定义 CI 与 CI 之间的关系。

属性

id (长整型)
表示用于标识 CI 的唯一标识符

id (长整型)
被认为具有较大值的数字位数。

示例

234759602834500

名称 (字符串)
表示用于标识 CI 的唯一名称

名称 (字符串)
纯文本格式。不允许富文本或换行符。

示例

Sample Content

描述 (字符串)
CI 的描述

描述 (字符串)
纯文本格式。不允许富文本或换行符。

示例

Sample Content

创建者 (用户)read only
表示创建 CI 的用户

创建者 (用户)

创建时间 (日期时间)read only
表示 CI 创建的时间

创建时间 (日期时间)
以 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :时间的长整型格式(自 1970年1月1日起的毫秒数)。

display_value :时间的可读格式,按照用户个性化设置显示。如果没有个性化设置,将使用默认格式。

最后更新者 (用户)read only
表示最后编辑 CI 的用户

最后更新者 (用户)

更多属性 全部展开

最后更新时间 (日期时间)read only

表示最后编辑 CI 的时间

最后更新时间 (日期时间)
以 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :时间的长整型格式(自 1970年1月1日起的毫秒数)。

display_value :时间的可读格式,按照用户个性化设置显示。如果没有个性化设置,将使用默认格式。

添加配置项

此操作允许您创建新的 CI。

必填字段:- 名称

URL

<service domain|custom domain>/app/<portal>/api/v3/cmdb/{ci_type_api_name}

属性

id (长整型)
表示用于标识 CI 的唯一标识符

id (长整型)
被认为具有较大值的数字位数。

示例

234759602834500

名称 (字符串)
表示用于标识 CI 的唯一名称

名称 (字符串)
纯文本格式。不允许富文本或换行符。

示例

Sample Content

描述 (字符串)
CI 的描述

描述 (字符串)
纯文本格式。不允许富文本或换行符。

示例

Sample Content

创建者 (用户)read only
表示创建 CI 的用户

创建者 (用户)

创建时间 (日期时间)read only
表示 CI 创建的时间

创建时间 (日期时间)
以 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :时间的长整型格式(自 1970年1月1日起的毫秒数)。

display_value :时间的可读格式,按照用户个性化设置显示。如果没有个性化设置,将使用默认格式。

最后更新者 (用户)read only
表示最后编辑 CI 的用户

最后更新者 (用户)

更多属性 全部展开

最后更新时间 (日期时间)read only

表示最后编辑 CI 的时间

最后更新时间 (日期时间)
以 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :时间的长整型格式(自 1970年1月1日起的毫秒数)。

display_value :时间的可读格式,按照用户个性化设置显示。如果没有个性化设置,将使用默认格式。

$ curl <service domain|custom domain>/app/<portal>/api/v3/cmdb/{ci_type_api_name}\
      -X POST\
      -H "Accept: application/vnd.manageengine.sdp.v3+json"\
      -H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
      -H "Content-Type: application/x-www-form-urlencoded"\
      -d input_data='{
    "ci_computer": {
        "name": "New Sample CI",
        "description": "API Test",
        "ci_attributes": {
        "txt_os": "Windows 10",
        "num_processor_count": 4,
        "dbl_purchase_cost": 54999.49,
        "date_purchase_date": {
            "value": "1628852400000"
        },
        "bool_rented": false,
        "ref_owned_by": {
            "id": "100000000000032679"
        }
    }
    }
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/cmdb/{ci_type_api_name}";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
           "Content-Type": "application/x-www-form-urlencoded",
           "Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
    "ci_computer": {
        "name": "New Sample CI",
        "description": "API Test",
        "ci_attributes": {
        "txt_os": "Windows 10",
        "num_processor_count": 4,
        "dbl_purchase_cost": 54999.49,
        "date_purchase_date": {
            "value": "1628852400000"
        },
        "bool_rented": false,
        "ref_owned_by": {
            "id": "100000000000032679"
        }
    }
    }
};
params = {"input_data": input_data};
response = invokeurl
[
    url: url
    type: POST
    parameters: params
    headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/cmdb/{ci_type_api_name}"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
    "Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
    "Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'
{
    "ci_computer": {
        "name": "New Sample CI",
        "description": "API Test",
        "ci_attributes": {
        "txt_os": "Windows 10",
        "num_processor_count": 4,
        "dbl_purchase_cost": 54999.49,
        "date_purchase_date": {
            "value": "1628852400000"
        },
        "bool_rented": false,
        "ref_owned_by": {
            "id": "100000000000032679"
        }
    }
    }
}
'@
$data = @{ 'input_data' = $input_data}
$response = Invoke-RestMethod -Uri $url -Method post -Body $data -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request

url = "<service domain|custom domain>/app/<portal>/api/v3/cmdb/{ci_type_api_name}"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json", 
          "Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx", 
          "Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
    "ci_computer": {
        "name": "New Sample CI",
        "description": "API Test",
        "ci_attributes": {
        "txt_os": "Windows 10",
        "num_processor_count": 4,
        "dbl_purchase_cost": 54999.49,
        "date_purchase_date": {
            "value": "1628852400000"
        },
        "bool_rented": false,
        "ref_owned_by": {
            "id": "100000000000032679"
        }
    }
    }
}'''
data = urlencode({"input_data":input_data}).encode()
httprequest = Request(url, headers=headers,data=data, method="POST")
try:
    with urlopen(httprequest) as response:
        print(response.read().decode())
except HTTPError as e:
    print(e.read().decode())
{
    "response_status": {
        "status_code": 2000,
        "status": "success"
    },
    "ci_computer": {
        "linked_instance": null,
        "created_time": {
            "display_value": "Aug 13, 2021 04:32 PM",
            "value": "1628852559740"
        },
        "attachments": "[]",
        "ci_attributes": {
            "ref_model": null,
            "txt_service_tag": null,
            "ref_owned_by": {
                "email_id": "lincoln@zmail.com",
                "is_technician": true,
                "sms_mail": "linc123@xys_sms.co",
                "contact_info_id": "100000000000032677",
                "mobile": "9876543210",
                "last_name": "",
                "user_scope": "0",
                "phone": "",
                "name": "Lincoln",
                "id": "100000000000032679",
                "photo_url": "test-photo-url",
                "is_vip_user": false,
                "department": null,
                "first_name": "Lincoln",
                "job_title": ""
            },
            "txt_processor_name": null,
            "bool_rented": false,
            "num_lease_number": null,
            "txt_location": null,
            "ref_managed_by": null,
            "txt_manufacturer": null,
            "txt_os": "Windows 10",
            "txt_serial_number": null,
            "txt_ip_address": null,
            "txt_mac_address": null,
            "num_processor_count": "4",
            "txt_service_pack": null,
            "dbl_purchase_cost": "54999.49",
            "date_purchase_date": {
                "display_value": "Aug 13, 2021 04:30 PM",
                "value": "1628852400000"
            },
            "ref_business_impact": null
        },
        "description": "API Test",
        "created_by": {
        "email_id": "lincoln@zmail.com",
        "is_technician": true,
        "sms_mail": "linc123@xys_sms.co",
        "contact_info_id": "100000000000032677",
        "mobile": "9876543210",
        "last_name": "",
        "user_scope": "0",
        "phone": "",
        "name": "Lincoln",
        "id": "100000000000032679",
        "photo_url": "test-photo-url",
        "is_vip_user": false,
        "department": null,
        "first_name": "Lincoln",
        "job_title": ""
        },
        "data_source": "[]",
        "last_updated_by": null,
        "ci_type": {
            "api_plural_name": "ci_computer",
            "name": "ci_computer",
            "display_name_plural": "Computer",
            "id": "100000000000030038",
            "display_name": "Computer",
            "icon_name": "exchange_server"
        },
        "linked_entity": null,
        "last_updated_time": null,
        "name": "New Sample CI",
        "id": "100000000000033079"
    }
}

编辑配置项

此操作允许您编辑 CI

URL

<service domain|custom domain>/app/<portal>/api/v3/cmdb/{ci_type_api_name}/{ci_id}

属性

id (长整型)
表示用于标识 CI 的唯一标识符

id (长整型)
被认为具有较大值的数字位数。

示例

234759602834500

名称 (字符串)
表示用于标识 CI 的唯一名称

名称 (字符串)
纯文本格式。不允许富文本或换行符。

示例

Sample Content

描述 (字符串)
CI 的描述

描述 (字符串)
纯文本格式。不允许富文本或换行符。

示例

Sample Content

创建者 (用户)read only
表示创建 CI 的用户

创建者 (用户)

创建时间 (日期时间)read only
表示 CI 创建的时间

创建时间 (日期时间)
以 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :时间的长整型格式(自 1970年1月1日起的毫秒数)。

display_value :时间的可读格式,按照用户个性化设置显示。如果没有个性化设置,将使用默认格式。

最后更新者 (用户)read only
表示最后编辑 CI 的用户

最后更新者 (用户)

更多属性 全部展开

最后更新时间 (日期时间)read only

表示最后编辑 CI 的时间

最后更新时间 (日期时间)
以 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :时间的长整型格式(自 1970年1月1日起的毫秒数)。

display_value :时间的可读格式,按照用户个性化设置显示。如果没有个性化设置,将使用默认格式。

$ curl <service domain|custom domain>/app/<portal>/api/v3/cmdb/{ci_type_api_name}/{ci_id}\
      -X PUT\ 
      -H "Accept: application/vnd.manageengine.sdp.v3+json"\
      -H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
      -H "Content-Type: application/x-www-form-urlencoded"\
      -d input_data='{
    "ci_computer": {
        "description": "API Test - Edited",
        "ci_attributes": {
        "txt_os": "Windows 11"
          }
        }
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/cmdb/{ci_type_api_name}/{ci_id}";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
           "Content-Type": "application/x-www-form-urlencoded",
           "Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
    "ci_computer": {
        "description": "API Test - Edited",
        "ci_attributes": {
        "txt_os": "Windows 11"
          }
        }
};
params = {"input_data": input_data};
response = invokeurl
[
    url: url
    type: PUT
    parameters: params
    headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/cmdb/{ci_type_api_name}/{ci_id}"
$headers = @{"Accept": "application/vnd.manageengine.sdp.v3+json", 
          "Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx", 
          "Content-Type" : "application/x-www-form-urlencoded"}
$input_data = @'
{
    "ci_computer": {
        "description": "API Test - Edited",
        "ci_attributes": {
        "txt_os": "Windows 11"
          }
        }
}
'@
$data = @{ 'input_data' = $input_data}
$response = Invoke-RestMethod -Uri $url -Method put -Body $data -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request

url = "<service domain|custom domain>/app/<portal>/api/v3/cmdb/{ci_type_api_name}/{ci_id}"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json", 
          "Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx", 
          "Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
    "ci_computer": {
        "description": "API Test - Edited",
        "ci_attributes": {
        "txt_os": "Windows 11"
          }
        }
}'''
data = urlencode({"input_data":input_data}).encode()
httprequest = Request(url, headers=headers,data=data, method="PUT")
try:
    with urlopen(httprequest) as response:
        print(response.read().decode())
except HTTPError as e:
    print(e.read().decode())
{
    "response_status": {
        "status_code": 2000,
        "status": "success"
    },
    "ci_computer": {
        "linked_instance": null,
        "created_time": {
            "display_value": "Aug 13, 2021 04:32 PM",
            "value": "1628852559740"
        },
        "attachments": "[]",
        "ci_attributes": {
            "ref_model": null,
            "txt_service_tag": null,
            "ref_owned_by": {
                "email_id": "lincoln@zmail.com",
                "is_technician": true,
                "sms_mail": "linc123@xys_sms.co",
                "contact_info_id": "100000000000032677",
                "mobile": "9876543210",
                "last_name": "",
                "user_scope": "0",
                "phone": "",
                "name": "Lincoln",
                "id": "100000000000032679",
                "photo_url": "test-photo-url",
                "is_vip_user": false,
                "department": null,
                "first_name": "Lincoln",
                "job_title": ""
            },
            "txt_processor_name": null,
            "bool_rented": false,
            "num_lease_number": null,
            "txt_location": null,
            "ref_managed_by": null,
            "txt_manufacturer": null,
            "txt_os": "Windows 11",
            "txt_serial_number": null,
            "txt_ip_address": null,
            "txt_mac_address": null,
            "num_processor_count": "4",
            "txt_service_pack": null,
            "dbl_purchase_cost": "54999.49",
            "date_purchase_date": {
                "display_value": "Aug 13, 2021 04:30 PM",
                "value": "1628852400000"
            },
            "ref_business_impact": null
        },
        "description": "API Test - Edited",
        "created_by": {
        "email_id": "lincoln@zmail.com",
        "is_technician": true,
        "sms_mail": "linc123@xys_sms.co",
        "contact_info_id": "100000000000032677",
        "mobile": "9876543210",
        "last_name": "",
        "user_scope": "0",
        "phone": "",
        "name": "Lincoln",
        "id": "100000000000032679",
        "photo_url": "test-photo-url",
        "is_vip_user": false,
        "department": null,
        "first_name": "Lincoln",
        "job_title": ""
        },
        "data_source": "[]",
        "last_updated_by": {
        "email_id": "lincoln@zmail.com",
        "is_technician": true,
        "sms_mail": "linc123@xys_sms.co",
        "contact_info_id": "100000000000032677",
        "mobile": "9876543210",
        "last_name": "",
        "user_scope": "0",
        "phone": "",
        "name": "Lincoln",
        "id": "100000000000032679",
        "photo_url": "test-photo-url",
        "is_vip_user": false,
        "department": null,
        "first_name": "Lincoln",
        "job_title": ""
        },
        "ci_type": {
            "api_plural_name": "ci_computer",
            "name": "ci_computer",
            "display_name_plural": "Computer",
            "id": "100000000000030038",
            "display_name": "Computer",
            "icon_name": "exchange_server"
        },
        "linked_entity": null,
        "last_updated_time": {
            "display_value": "Aug 13, 2021 06:02 PM",
            "value": "1628857948859"
        },
        "name": "New Sample CI",
        "id": "100000000000033079"
    }
}

获取配置项

此操作帮助您获取特定 CI 类型下的单个 CI。

URL

<service domain|custom domain>/app/<portal>/api/v3/cmdb/{ci_type_api_name}/{ci_id}

属性

id (长整型)
表示用于标识 CI 的唯一标识符

id (长整型)
被认为具有较大值的数字位数。

示例

234759602834500

名称 (字符串)
表示用于标识 CI 的唯一名称

名称 (字符串)
纯文本格式。不允许富文本或换行符。

示例

Sample Content

描述 (字符串)
CI 的描述

描述 (字符串)
纯文本格式。不允许富文本或换行符。

示例

Sample Content

创建者 (用户)read only
表示创建 CI 的用户

创建者 (用户)

创建时间 (日期时间)read only
表示 CI 创建的时间

创建时间 (日期时间)
以 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :时间的长整型格式(自 1970年1月1日起的毫秒数)。

display_value :时间的可读格式,按照用户个性化设置显示。如果没有个性化设置,将使用默认格式。

最后更新者 (用户)read only
表示最后编辑 CI 的用户

最后更新者 (用户)

更多属性 全部展开

最后更新时间 (日期时间)read only

表示最后编辑 CI 的时间

最后更新时间 (日期时间)
以 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :时间的长整型格式(自 1970年1月1日起的毫秒数)。

display_value :时间的可读格式,按照用户个性化设置显示。如果没有个性化设置,将使用默认格式。

$ curl -G <service domain|custom domain>/app/<portal>/api/v3/cmdb/{ci_type_api_name}/{ci_id}\
      -X GET\
      -H "Accept: application/vnd.manageengine.sdp.v3+json"\
      -H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
      -H "Content-Type: application/x-www-form-urlencoded"
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/cmdb/{ci_type_api_name}/{ci_id}";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
           "Content-Type": "application/x-www-form-urlencoded",
           "Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};          
response = invokeurl
[
    url: url
    type: GET
    headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/cmdb/{ci_type_api_name}/{ci_id}"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
    "Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
    "Content-Type" = "application/x-www-form-urlencoded"}  
$response = Invoke-RestMethod -Uri $url -Method get -Headers $headers 
$response
#Python version - 3.8
#This script requires requests module installed in python.
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request

url = "<service domain|custom domain>/app/<portal>/api/v3/cmdb/{ci_type_api_name}/{ci_id}"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json", 
          "Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx", 
          "Content-Type" : "application/x-www-form-urlencoded"}
httprequest = Request(url, headers=headers)
try:
    with urlopen(httprequest) as response:
        print(response.read().decode())
except HTTPError as e:
    print(e.read().decode())
{
    "response_status": {
        "status_code": 2000,
        "status": "success"
    },
    "ci_computer": {
        "linked_instance": "100000000000005416",
        "created_time": {
            "display_value": "Jul 30, 2021 07:44 PM",
            "value": "1627654487657"
        },
        "attachments": [],
        "ci_attributes": {
            "ref_model": null,
            "txt_service_tag": null,
            "ref_owned_by": {
                "email_id": "lincoln@zmail.com",
                "is_technician": true,
                "sms_mail": "linc123@xys_sms.co",
                "contact_info_id": "100000000000034009",
                "mobile": "9876543210",
                "last_name": null,
                "user_scope": "0",
                "phone": null,
                "name": "Lincoln",
                "id": "100000000000034007",
                "photo_url": "test-photo-url",
                "is_vip_user": false,
                "department": {
                    "site": null,
                    "name": "Engineering",
                    "id": "100000000000005416"
                },
                "first_name": "Lincoln",
                "job_title": null
            },
            "txt_processor_name": null,
            "txt_location": null,
            "ref_managed_by": {
                "email_id": "lincoln@zmail.com",
                "is_technician": true,
                "sms_mail": "linc123@xys_sms.co",
                "contact_info_id": "100000000000034009",
                "mobile": "9876543210",
                "last_name": null,
                "user_scope": "0",
                "phone": null,
                "name": "Lincoln",
                "id": "100000000000034007",
                "photo_url": "test-photo-url",
                "is_vip_user": false,
                "department": {
                    "site": null,
                    "name": "Engineering",
                    "id": "100000000000005416"
                },
                "first_name": "Lincoln",
                "job_title": null
            },
            "txt_manufacturer": "Dell",
            "txt_os": "Windows",
            "txt_serial_number": null,
            "txt_ip_address": null,
            "txt_mac_address": null,
            "num_processor_count": null,
            "txt_service_pack": null,
            "ref_business_impact": {
                "name": "Affects Department",
                "id": "100000000000007152"
            }
        },
        "description": "Dell Server used for VMs",
        "created_by": {
            "email_id": "lincoln@zmail.com",
            "is_technician": true,
            "sms_mail": "linc123@xys_sms.co",
            "contact_info_id": "100000000000034009",
            "mobile": "9876543210",
            "last_name": null,
            "user_scope": "0",
            "phone": null,
            "name": "Lincoln",
            "id": "100000000000034007",
            "photo_url": "test-photo-url",
            "is_vip_user": false,
            "department": {
                "site": null,
                "name": "Engineering",
                "id": "100000000000005416"
            },
            "first_name": "Lincoln",
            "job_title": null
        },
        "data_source": [],
        "last_updated_by": {
            "email_id": "lincoln@zmail.com",
            "is_technician": true,
            "sms_mail": "linc123@xys_sms.co",
            "contact_info_id": "100000000000034009",
            "mobile": "9876543210",
            "last_name": null,
            "user_scope": "0",
            "phone": null,
            "name": "Lincoln",
            "id": "100000000000034007",
            "photo_url": "test-photo-url",
            "is_vip_user": false,
            "department": {
                "site": null,
                "name": "Engineering",
                "id": "100000000000005416"
            },
            "first_name": "Lincoln",
            "job_title": null
        },
        "ci_type": {
            "api_plural_name": "ci_computer",
            "name": "ci_computer",
            "display_name_plural": "Computer",
            "id": "100000000000030014",
            "display_name": "Computer",
            "icon_name": "exchange_server"
        },
        "linked_entity": {
            "api_plural_name": "departments",
            "name": "department",
            "display_name_plural": "sdp.module.pluralname.departments",
            "id": "100000000000004786",
            "display_name": "Department",
            "icon_name": null
        },
        "last_updated_time": {
            "display_value": "Jul 30, 2021 07:47 PM",
            "value": "1627654669667"
        },
        "linked_instance_data": {
            "site": null,
            "name": "Engineering",
            "id": "100000000000005416"
        },
        "name": "Dell Server",
        "id": "100000000000034020"
    }
}

获取配置项列表

此操作帮助您获取特定 CI 类型下所有 CI 的列表。

URL

<service domain|custom domain>/app/<portal>/api/v3/cmdb/{ci_type_api_name}

属性

id (长整型)
表示用于标识 CI 的唯一标识符

id (长整型)
被认为具有较大值的数字位数。

示例

234759602834500

名称 (字符串)
表示用于标识 CI 的唯一名称

名称 (字符串)
纯文本格式。不允许富文本或换行符。

示例

Sample Content

描述 (字符串)
CI 的描述

描述 (字符串)
纯文本格式。不允许富文本或换行符。

示例

Sample Content

创建者 (用户)read only
表示创建 CI 的用户

创建者 (用户)

创建时间 (日期时间)read only
表示 CI 创建的时间

创建时间 (日期时间)
以 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :时间的长整型格式(自 1970年1月1日起的毫秒数)。

display_value :时间的可读格式,按照用户个性化设置显示。如果没有个性化设置,将使用默认格式。

最后更新者 (用户)read only
表示最后编辑 CI 的用户

最后更新者 (用户)

更多属性 全部展开

最后更新时间 (日期时间)read only

表示最后编辑 CI 的时间

最后更新时间 (日期时间)
以 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :时间的长整型格式(自 1970年1月1日起的毫秒数)。

display_value :时间的可读格式,按照用户个性化设置显示。如果没有个性化设置,将使用默认格式。

$ curl -G <service domain|custom domain>/app/<portal>/api/v3/cmdb/{ci_type_api_name}\
      -X GET\ 
      -H "Accept: application/vnd.manageengine.sdp.v3+json"\
      -H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
      -H "Content-Type: application/x-www-form-urlencoded"\
      --data-urlencode input_data='{}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/cmdb/{ci_type_api_name}";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
           "Content-Type": "application/x-www-form-urlencoded",
           "Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {};
params = {"input_data":input_data};           
response = invokeurl
[
    url: url
    type: GET
    parameters:params
    headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/cmdb/{ci_type_api_name}"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
    "Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
    "Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'{}'@
$data = @{ 'input_data' = $input_data}    
$response = Invoke-RestMethod -Uri $url -Method get -Body $data -Headers $headers 
$response
#Python version - 3.8
#This script requires requests module installed in python.
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request

url = "<service domain|custom domain>/app/<portal>/api/v3/cmdb/{ci_type_api_name}"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json", 
          "Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx", 
          "Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{}'''       
url += "?" + urlencode({"input_data":input_data})
httprequest = Request(url, headers=headers)
try:
    with urlopen(httprequest) as response:
        print(response.read().decode())
except HTTPError as e:
    print(e.read().decode())
{
    "response_status": [
        {
            "status_code": 2000,
            "status": "success"
        }
    ],
    "list_info": {
        "has_more_rows": false,
        "sort_field": "name",
        "row_count": 1
    },
    "ci_computer": [
        {
            "created_time": {
                "display_value": "Jul 30, 2021 07:44 PM",
                "value": "1627654487657"
            },
            "last_updated_by": {
                "email_id": "lincoln@zmail.com",
                "is_technician": true,
                "sms_mail": "linc123@xys_sms.co",
                "contact_info_id": "100000000000034009",
                "mobile": "9876543210",
                "last_name": null,
                "user_scope": "0",
                "phone": null,
                "name": "Lincoln",
                "id": "100000000000034007",
                "photo_url": "test-photo-url",
                "is_vip_user": false,
                "department": {
                    "site": null,
                    "name": "Engineering",
                    "id": "100000000000005416"
                },
                "first_name": "Lincoln",
                "job_title": null
            },
            "ci_type": {
                "api_plural_name": "ci_computer",
                "name": "ci_computer",
                "display_name_plural": "Computer",
                "id": "100000000000030014",
                "display_name": "Computer",
                "icon_name": "exchange_server"
            },
            "ci_attributes": {
                "ref_model": null,
                "txt_service_tag": null,
                "ref_owned_by": {
                    "email_id": "lincoln@zmail.com",
                    "is_technician": true,
                    "sms_mail": "linc123@xys_sms.co",
                    "contact_info_id": "100000000000034009",
                    "mobile": "9876543210",
                    "last_name": null,
                    "user_scope": "0",
                    "phone": null,
                    "name": "Lincoln",
                    "id": "100000000000034007",
                    "photo_url": "test-photo-url",
                    "is_vip_user": false,
                    "department": {
                        "site": null,
                        "name": "Engineering",
                        "id": "100000000000005416"
                    },
                    "first_name": "Lincoln",
                    "job_title": null
                },
                "txt_processor_name": null,
                "txt_location": null,
                "ref_managed_by": {
                    "email_id": "lincoln@zmail.com",
                    "is_technician": true,
                    "sms_mail": "linc123@xys_sms.co",
                    "contact_info_id": "100000000000034009",
                    "mobile": "9876543210",
                    "last_name": null,
                    "user_scope": "0",
                    "phone": null,
                    "name": "Lincoln",
                    "id": "100000000000034007",
                    "photo_url": "test-photo-url",
                    "is_vip_user": false,
                    "department": {
                        "site": null,
                        "name": "Engineering",
                        "id": "100000000000005416"
                    },
                    "first_name": "Lincoln",
                    "job_title": null
                },
                "txt_manufacturer": "Dell",
                "txt_os": "Windows",
                "txt_serial_number": null,
                "txt_ip_address": null,
                "txt_mac_address": null,
                "num_processor_count": null,
                "txt_service_pack": null,
                "ref_business_impact": {
                    "name": "Affects Department",
                    "id": "100000000000007152"
                }
            },
            "last_updated_time": {
                "display_value": "Jul 30, 2021 07:47 PM",
                "value": "1627654669667"
            },
            "name": "Dell Server",
            "description": "Dell Server used for VMs",
            "id": "100000000000034020",
            "created_by": {
                "email_id": "lincoln@zmail.com",
                "is_technician": true,
                "sms_mail": "linc123@xys_sms.co",
                "contact_info_id": "100000000000034009",
                "mobile": "9876543210",
                "last_name": null,
                "user_scope": "0",
                "phone": null,
                "name": "Lincoln",
                "id": "100000000000034007",
                "photo_url": "test-photo-url",
                "is_vip_user": false,
                "department": {
                    "site": null,
                    "name": "Engineering",
                    "id": "100000000000005416"
                },
                "first_name": "Lincoln",
                "job_title": null
            },
            "data_source": []
        }
    ]
}

删除配置项

此操作允许您同时删除一个或多个特定 CI 类型的 CI。CI ID 可以以逗号分隔的方式提供。

URL

<service domain|custom domain>/app/<portal>/api/v3/cmdb/{ci_type_api_name}?ids={ci_ids}

$ curl <service domain|custom domain>/app/<portal>/api/v3/cmdb/{ci_type_api_name}?ids={ci_ids}\
      -X DELETE\ 
      -H "Accept: application/vnd.manageengine.sdp.v3+json"\
      -H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
      -H "Content-Type: application/x-www-form-urlencoded"
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/cmdb/{ci_type_api_name}?ids={ci_ids}";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
           "Content-Type": "application/x-www-form-urlencoded",
           "Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
response = invokeurl
[
    url: url
    type: DELETE
    headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/cmdb/{ci_type_api_name}?ids={ci_ids}"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
    "Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
    "Content-Type" = "application/x-www-form-urlencoded"}
$response = Invoke-RestMethod -Uri $url -Method delete -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.request import urlopen,Request

url = "<service domain|custom domain>/app/<portal>/api/v3/cmdb/{ci_type_api_name}?ids={ci_ids}"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json", 
          "Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx", 
          "Content-Type" : "application/x-www-form-urlencoded"}
httprequest = Request(url, headers=headers,method="DELETE")
try:
    with urlopen(httprequest) as response:
        print(response.read().decode())
except HTTPError as e:
    print(e.read().decode())
{
  "response_status": {
    "status_code": 2000,
    "status": "success"
  }
}