Collection policy creation and management endpoints in the REST API
Create and manage collection policies that are used to collect the logs.
POST/policies
Create a collection policy
Authorization: Bearer <JWT_token>
Example request body
"name": "Collection Policy",
"description": "Dummy description",
"selection_criteria": "( name EQUALS 'host_name' )",
"tenant_id": "1111111111",
"configurations": [
{
"name": "Collection Config",
"type": "COLLECTION",
"display_order": 1,
"details": {
"integration_template_id": "8dec2e2c-ae1b-4272-81bc-3d07b0a9d4d6",
"hosted": false,
"collection_type": "FILE",
"connector_type": "tdc-connector-base",
"parsing_rules": [
{
"name": "Parsing rule name",
"id": "00d46564-9081-4e6c-8674-f2a884d28141"
}
],
"filtering_rules": [
{
"name": "Filtering rule name",
"id": "01b6678e-45f7-45c9-9ce8-c095cf3ca485"
}
],
"selected_entities": [
"Log"
],
"parameters": [
{
"name": "path",
"secret": false,
"dataType": "String",
"context": {},
"value": "/test/log"
},
{
"name": "exclude_path",
"secret": false,
"dataType": "string_array",
"context": {},
"array_value": [
""
]
},
{
"name": "tag",
"secret": false,
"dataType": "String",
"context": {},
"value": "apache_server_NY"
}
]
}
}
],
"enabled": true,
"execution_order": 1
}
Response codes
Code | Description |
|---|---|
201 | Collection policy is created successfully. Returns the collection policy ID in the payload. |
400 | Error for invalid data. Check if all input values are valid. |
401 | Authorization failure. Verify JWT. |
403 | Permission denied. Verify the roles assigned to you. |
415 | Incorrect request format. Ensure that the request format is JSON. |
500 | Unexpected condition encountered. Contact BMC Support. |
PUT/policies/{id}
Update a collection policy by ID
Authorization: Bearer <JWT_token>
Parameter details
Example request body
"name": "Collection Policy",
"description": "Dummy description",
"selection_criteria": "( name EQUALS 'host_name' )",
"tenant_id": "1111111111",
"configurations": [
{
"name": "Collection Config",
"type": "COLLECTION",
"display_order": 1,
"details": {
"integration_template_id": "8dec2e2c-ae1b-4272-81bc-3d07b0a9d4d6",
"hosted": false,
"collection_type": "FILE",
"connector_type": "tdc-connector-base",
"parsing_rules": [
{
"name": "Parsing rule name",
"id": "00d46564-9081-4e6c-8674-f2a884d28141"
}
],
"filtering_rules": [
{
"name": "Filtering rule name",
"id": "01b6678e-45f7-45c9-9ce8-c095cf3ca485"
}
],
"selected_entities": [
"Log"
],
"parameters": [
{
"name": "path",
"secret": false,
"dataType": "String",
"context": {},
"value": "/test/log"
},
{
"name": "exclude_path",
"secret": false,
"dataType": "string_array",
"context": {},
"array_value": [
""
]
},
{
"name": "tag",
"secret": false,
"dataType": "String",
"context": {},
"value": "apache_server_NY"
}
]
}
}
],
"enabled": true,
"execution_order": 1
}
Response codes
Code | Description |
|---|---|
200 | Collection policy is updated successfully. |
400 | Error for invalid data. Check if all input values are valid. |
401 | Authorization failure. Verify JWT. |
403 | Permission denied. Verify the roles assigned to you. |
404 | The collection policy ID is not found. |
415 | Incorrect request format. Ensure that the request format is JSON and collection policy ID is correct. |
500 | Unexpected condition encountered. Contact BMC Support. |
GET/policies/{id}
Get a collection policy by ID
Authorization: Bearer <JWT_token>
Parameter details
Response codes
Code | Description |
|---|---|
200 | Collection policy returned successfully. |
401 | Authorization failure. Verify JWT. |
403 | Permission denied. Verify the roles assigned to you. |
404 | The collection policy ID is not found. |
500 | Unexpected condition encountered. Contact BMC Support. |
POST/policies/search
Search collection policies
Authorization: Bearer <JWT_token>
Example request body
"page_index": 1,
"page_size": 100,
"search_string": "name = 'Collection_Policy' and enabled = true",
"sort_criteria": "name DESC, enabled ASC"
}
Response codes
Code | Description |
|---|---|
200 | Policies are found. Returns details of the policies in the payload. |
400 | Error for invalid data. Check if all input values are valid. |
401 | Authorization failure. Verify JWT. |
403 | Permission denied. Verify the roles assined to you. |
415 | Incorrect request format. Ensure that the request format is JSON and collection policy IDs are correct. |
500 | Unexpected condition encountered. Contact BMC Support. |
POST/policies/enable
Enable collection policies
Authorization: Bearer <JWT_token>
Example request body
"ids": [
"a00a0a00-a000-00a0-a000-0a000aa0a0a0"
]
}
Response codes
Code | Description |
|---|---|
200 | Collection policies are enabled successfully. |
207 | Some collection policies are enabled. IDs of the policies that are not enabled are returned. |
400 | Error for invalid data. Check if all input values are valid. |
401 | Authorization failure. Verify JWT. |
403 | Permission denied. Verify the roles assigned to you. |
415 | Incorrect request format. Ensure that the request format is JSON and collection policy IDs are correct. |
500 | Unexpected condition encountered. Contact BMC Support. |
POST/policies/disable
Disable collection policies
Authorization: Bearer <JWT_token>
Example request body
"ids": [
"a00a0a00-a000-00a0-a000-0a000aa0a0a0"
]
}
Response codes
Code | Description |
|---|---|
200 | Collection policies are disabled successfully. |
207 | Some collection policies are disabled. IDs of the policies that are not disabled are returned. |
400 | Error for invalid data. Check if all input values are valid. |
401 | Authorization failure. Verify JWT. |
403 | Permission denied. Verify the roles assigned to you. |
415 | Incorrect request format. Ensure that the request format is JSON and collection policy IDs are correct. |
500 | Unexpected condition encountered. Contact BMC Support. |
DELETE/policies
Delete collection policies
Authorization: Bearer <JWT_token>
For instructions on obtaining the JWT token, see Access and authentication for the REST API..
Example request body
"id": [
"a00a0a00-a000-00a0-a000-0a000aa0a0a0"
]
}
Response codes
Code | Description |
|---|---|
200 | Collection policies are deleted successfully. |
207 | Some collection policies are deleted. IDs of the policies that are not deleted are returned. |
400 | Error for invalid data. Check if all input values are valid. |
401 | Authorization failure. Verify JWT. |
403 | Permission denied. Verify the roles assigned to you. |
415 | Incorrect request format. Ensure that the request format is JSON and collection policies IDs are correct. |
500 | Unexpected condition encountered. Contact BMC Support. |