{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":495,"path":"api-reference/rest-apis/cmdb-meta-api.md","title":"CMDB Meta API","bundle":null,"doc_type":null,"release":"australia","body":"\n# CMDB Meta API\n\nThe CMDB Meta API provides endpoints to obtain meta data on a Configuration Management Database \\(CMDB\\) class.\n\nThis API requires that the user have the ITIL role.\n\n**Parent Topic:**[REST API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/api-rest.md)\n\n## CMDB Meta - GET /now/cmdb/meta/\\{classname\\}\n\nReturns the meta data for the specified CMDB class.\n\n### URL format\n\nVersioned URL: `/api/now/{api_version}/cmdb/meta/{className}`\n\nDefault URL: `/api/now/cmdb/meta/{className}`\n\n**Note:** Available versions are specified in the [REST API Explorer](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_CustomWebServices.md).\n\n### Supported request parameters\n\n<table class=\"rest_api_path_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\napi\\_version\n\n</td><td id=\"version-entry-RESTAPI\">\n\nOptional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String\n\n</td></tr><tr><td>\n\nclassName\n\n</td><td>\n\nCMDB class name. This is the name of the table that contains the desired CI records, such as cmdb\\_ci\\_linux\\_server or cmdb\\_ci\\_apache\\_web\\_server.Data type: String\n\n</td></tr></tbody>\n</table>|Name|Description|\n|----|-----------|\n|None| |\n\n|Name|Description|\n|----|-----------|\n|None| |\n\n### Headers\n\nThe following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see [Supported REST API headers](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n<table class=\"rest_api_request_headers\"><thead><tr><th>\n\nHeader\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nAccept\n\n</td><td id=\"accept-entry-RESTAPI\">\n\nData format of the response body. Supported types: **application/json** or **application/xml**. Default: **application/json**\n\n</td></tr></tbody>\n</table>|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see [REST API HTTP response codes](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Status code|Description|\n|-----------|-----------|\n|200|Successful. The request was successfully processed.|\n|401|Unauthorized. The user credentials are incorrect or have not been passed.|\n|404|Not found. The requested item wasn't found.|\n|500|Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.|\n\n### Response body parameters \\(JSON or XML\\)\n\n<table><thead><tr><th>\n\nElement\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nattributes\n\n</td><td>\n\nAvailable fields in the specified class table. Data type: Array\n\n</td></tr><tr><td>\n\nchildren\n\n</td><td>\n\nList of classes extended from the specified class.Data type: Array\n\n</td></tr><tr><td>\n\nicon\n\n</td><td>\n\nClass icon sys\\_id.Data type: String\n\n</td></tr><tr><td>\n\nicon\\_url\n\n</td><td>\n\nClass icon URL. Data type: String\n\n</td></tr><tr><td>\n\nidentification\\_rules\n\n</td><td>\n\nAttributes associated with the configuration item identification rules for the specified class. Data type: Object\n\n</td></tr><tr><td>\n\nis\\_extendable\n\n</td><td>\n\nFlag that indicates whether the class can be extended to create other classes.Possible values:\n\n-   true: Class can be extended.\n-   false: Class cannot be extended.\n\n Data type: Boolean\n\n</td></tr><tr><td>\n\nlabel\n\n</td><td>\n\nSpecified class display name.Data type: String\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nTable/class name.Data type: String\n\n</td></tr><tr><td>\n\nparent\n\n</td><td>\n\nParent class.Data type: String\n\n</td></tr><tr><td>\n\nrelationship\\_rules\n\n</td><td>\n\nRelationships between the specifed class and other classes in the CMDB. Data type: Array\n\n</td></tr></tbody>\n</table>### Sample cURL request\n\n```\ncurl \"https://instance.servicenow/api/now/cmdb/meta/cmdb_ci_computer\" \\\n--request GET \\\n--header \"Accept:application/json\" \\\n--user 'username':'password'\n\n```\n\n```\n{\n  \"result\": {\n    \"icon_url\": \"images/app.ngbsm/computer.svg\",\n    \"is_extendable\": true,\n    \"parent\": \"cmdb_ci_hardware\",\n    \"children\": [\n      \"cmdb_ci_ucs_blade\",\n      \"cmdb_ci_pc_hardware\",\n      \"cmdb_ci_ucs_rack_unit\",\n      \"cmdb_ci_mainframe_hardware\",\n      \"cmdb_ci_server\",\n      \"cmdb_ci_storage_switch\"\n    ],\n    \"name\": \"cmdb_ci_computer\",\n    \"icon\": \"c6442dd69fb00200eb3919eb552e7012\",\n    \"attributes\": [\n      {\n        \"is_inherited\": \"false\",\n        \"is_mandatory\": \"false\",\n        \"is_read_only\": \"false\",\n        \"default_value\": null,\n        \"label\": \"OS Address Width (bits)\",\n        \"type\": \"integer\",\n        \"element\": \"os_address_width\",\n        \"max_length\": \"40\",\n        \"is_display\": \"false\"\n      },\n      {\n        \"is_inherited\": \"true\",\n        \"is_mandatory\": \"false\",\n        \"is_read_only\": \"true\",\n        \"default_value\": \"false\",\n        \"label\": \"Skip sync\",\n        \"type\": \"boolean\",\n        \"element\": \"skip_sync\",\n        \"max_length\": \"40\",\n        \"is_display\": \"false\"\n      },\n      {\n        \"is_inherited\": \"true\",\n        \"is_mandatory\": \"false\",\n        \"is_read_only\": \"false\",\n        \"default_value\": null,\n        \"label\": \"DNS Domain\",\n        \"type\": \"string\",\n        \"element\": \"dns_domain\",\n        \"max_length\": \"255\",\n        \"is_display\": \"false\"\n      },\n      {\n        \"is_inherited\": \"true\",\n        \"is_mandatory\": \"false\",\n        \"is_read_only\": \"false\",\n        \"default_value\": null,\n        \"label\": \"Purchased\",\n        \"type\": \"glide_date\",\n        \"element\": \"purchase_date\",\n        \"max_length\": \"40\",\n        \"is_display\": \"false\"\n      },\n      {\n        \"is_inherited\": \"true\",\n        \"is_mandatory\": \"false\",\n        \"is_read_only\": \"false\",\n        \"default_value\": null,\n        \"label\": \"Lease contract\",\n        \"type\": \"string\",\n        \"element\": \"lease_id\",\n        \"max_length\": \"40\",\n        \"is_display\": \"false\"\n      }\n    ],\n    \"relationship_rules\": [\n      {\n        \"parent\": \"cmdb_ci_computer\",\n        \"relation_type\": \"cb5592603751200032ff8c00dfbe5d17\",\n        \"child\": \"dscy_route_next_hop\"\n      },\n      {\n        \"parent\": \"cmdb_ci_computer\",\n        \"relation_type\": \"cb5592603751200032ff8c00dfbe5d17\",\n        \"child\": \"dscy_router_interface\"\n      },\n      {\n        \"parent\": \"cmdb_ci_computer\",\n        \"relation_type\": \"cb5592603751200032ff8c00dfbe5d17\",\n        \"child\": \"dscy_route_interface\"\n      },\n      {\n        \"parent\": \"cmdb_ci_computer\",\n        \"relation_type\": \"55c95bf6c0a8010e0118ec7056ebc54d\",\n        \"child\": \"cmdb_ci_storage_pool\"\n      },\n      {\n        \"parent\": \"cmdb_ci_computer\",\n        \"relation_type\": \"55c95bf6c0a8010e0118ec7056ebc54d\",\n        \"child\": \"cmdb_ci_disk_partition\"\n      },\n      {\n        \"parent\": \"cmdb_ci_computer\",\n        \"relation_type\": \"55c95bf6c0a8010e0118ec7056ebc54d\",\n        \"child\": \"cmdb_ci_storage_volume\"\n      },\n      {\n        \"parent\": \"cmdb_ci_computer\",\n        \"relation_type\": \"55c95bf6c0a8010e0118ec7056ebc54d\",\n        \"child\": \"cmdb_ci_storage_device\"\n      }\n    ],\n    \"label\": \"Computer\",\n    \"identification_rules\": {\n      \"related_rules\": [\n        {\n          \"condition\": \"\",\n          \"exact_count_match\": false,\n          \"referenced_field\": \"installed_on\",\n          \"active\": true,\n          \"attributes\": \"name\",\n          \"allow_fallback\": false,\n          \"table\": \"cmdb_print_queue_instance\",\n          \"order\": 100,\n          \"allow_null_attribute\": false\n        }\n      ],\n      \"applies_to\": \"cmdb_ci_hardware\",\n      \"identifiers\": [\n        {\n          \"condition\": \"valid=true^absent=false^EQ\",\n          \"exact_count_match\": true,\n          \"referenced_field\": \"cmdb_ci\",\n          \"active\": true,\n          \"attributes\": \"serial_number,serial_number_type\",\n          \"allow_fallback\": false,\n          \"table\": \"cmdb_serial_number\",\n          \"order\": 100,\n          \"allow_null_attribute\": false\n        },\n        {\n          \"condition\": null,\n          \"exact_count_match\": false,\n          \"referenced_field\": null,\n          \"active\": true,\n          \"attributes\": \"serial_number\",\n          \"allow_fallback\": false,\n          \"table\": null,\n          \"order\": 200,\n          \"allow_null_attribute\": false\n        },\n        {\n          \"condition\": null,\n          \"exact_count_match\": false,\n          \"referenced_field\": null,\n          \"active\": true,\n          \"attributes\": \"name\",\n          \"allow_fallback\": false,\n          \"table\": null,\n          \"order\": 300,\n          \"allow_null_attribute\": false\n        },\n        {\n          \"condition\": \"install_status!=100^EQ\",\n          \"exact_count_match\": true,\n          \"referenced_field\": \"cmdb_ci\",\n          \"active\": true,\n          \"attributes\": \"ip_address,mac_address\",\n          \"allow_fallback\": false,\n          \"table\": \"cmdb_ci_network_adapter\",\n          \"order\": 400,\n          \"allow_null_attribute\": false\n        }\n      ],\n      \"name\": \"Hardware Rule\",\n      \"description\": \"Identifier for hardware.\",\n      \"active\": true,\n      \"is_independent\": true\n    }\n  }\n}\n\n```\n\n"}}