This documentation supports an earlier version of BMC Helix Operations Management.To view the documentation for the latest version, select 23.2 from the Product version picker.

Dynamic enrichment policy data table management endpoints in the REST API


The following section provides a list of supported endpoints and an overview about running these endpoints. Before you run an endpoint, you must authenticate yourself. For more information, see Access and authentication for the REST API 


Management of data tables from the external source file

You can create, update, delete, and retrieve details of data tables by running APIs.

POST /data_tables
Create a data table
Request URL
https://<tenant-url>/events-service/api/v1.0/data_tables
Example request URL
 https://HostA.bmc.com/events-service/api/v1.0/data_tables
Request Header
Content-Type: application/json
Authorization: Bearer <JWT_token>

For instructions on obtaining the JWT token, see Access and authentication for the REST API..

Parameter details



Request body

{
 "tag": "String",
 "content": "String"
}

Example request body

{
 "tag": "Import label",
 "content": "OPEN,CRITICAL,printer1,PRINTER_1_STATUS_REQUIRES_ACTION,HIGH\nASSIGNED,MAJOR,printer1,PRINTER_4_STATUS_REQUIRES_ACTION,LOWEST\nOPEN,MINOR,printer2,PRINTER_3_STATUS_REQUIRES_ACTION,LOW"
}


Successful response

{
 "message": "[Successfully created data table.]",
 "object": {
   "id": "[68f1c644-3594-11ec-9a65-3515b2f79aad]"
 }
}

Unsuccessful responses

Scenario 1: You specify an incorrect name for the request parameter.

[
 {
   "key": "validation.schema.additionalProperties",
   "level": "ERROR",
   "message": "Object instance has properties which are not allowed by the schema: [\"test\"]",
   "additionalInfo": []
 },
 {
   "key": "validation.schema.required",
   "level": "ERROR",
   "message": "Object has missing required properties ([\"content\"])",
   "additionalInfo": []
 }
]

Scenario 2: You specify an empty data table in the content parameter.

{
 "message": "Data table content cannot be empty.",
 "errorCode": "CONTENT_NOT_VALID"
}

Scenario 3: You do not specify comma-separated content for the data table.

{
 "message": "Content values should be comma separated.",
 "errorCode": "CONTENT_NOT_VALID"
}

Scenario 4: You specify different number of fields in each row of the data table.

{
 "message": "Number of fields at row number 2 are not equal to number of fields at row number 1.",
 "errorCode": "CONTENT_NOT_VALID"
}

Back to top

PUT /data_tables

Important

This API endpoint replaces the entire data table content. To append or remove rows from the data table, make the required changes on the entire data table content locally, and then use the updated content in the API request.

After you run this endpoint, make sure that you update the policy associated with the data table to bind the updated data table content.


Update a data table


Request URL
https://<tenant-url>/events-service/api/v1.0/data_tables
Example request URL
 https://HostA.bmc.com/events-service/api/v1.0/data_tables
Request Header
Content-Type: application/json
Authorization: Bearer <JWT_token>

For instructions on obtaining the JWT token, see Access and authentication for the REST API..

Parameter details

Request body

{
 "tag": "String",
 "content": "String",
 "id": "String"
}


Example request body

{
 "tag": "Import label",
 "content": "CLOSED,CRITICAL,printer1,PRINTER_1_STATUS_REQUIRES_ACTION,HIGH\nASSIGNED,MAJOR,printer1,PRINTER_4_STATUS_REQUIRES_ACTION,LOWEST\nOPEN,MINOR,printer2,PRINTER_3_STATUS_REQUIRES_ACTION,LOW",
 "id": "c8f7af05-3594-11ec-9a65-f335c7198f8c"
}

Successful response

{
 "message": "[Successfully updated data table.]",
 "object": {
   "id": "[c8f7af05-3594-11ec-9a65-f335c7198f8c]"
 }
}

Unsuccessful responses

Scenario 1: You attempt to update a data table entry that does not exist.

{
 "message": "[Failed to update data table entry for tenant 1220296999, entry with same id does not exist.]",
 "errorCode": "DATA_TABLE_ENTRY_DOES_NOT_EXIST"
}

Scenario 2: You specify a short and invalid data table ID.

{
 "message": "[Failed to update data table entry db64.]",
 "errorCode": "INVALID_ID"
}

Scenario 3: You specify a long and invalid data table ID.

{
 "message": "[Failed to update data table entry c8f7af05-3594-11ec-9a65-f335c7198f8cftabcdfe.]",
 "errorCode": "INVALID_ID"
}

Scenario 4: You do not specify the content for the data table.

{
 "message": "Data table content cannot be empty.",
 "errorCode": "CONTENT_NOT_VALID"
}

Scenario 5: You do not specify comma-separated content for the data table.

{
 "message": "Content values should be comma separated.",
 "errorCode": "CONTENT_NOT_VALID"
}

Scenario 6: You specify different number of fields in each row of the data table.

{
 "message": "Number of fields at row number 2 are not equal to number of fields at row number 1.",
 "errorCode": "CONTENT_NOT_VALID"
}

Back to top

GET  /data_tables/id
Get details of a data table by id
Request URL
https://<tenant-url>/events-service/api/v1.0/data_tables/id
Example URL
https://HostA.bmc.com/events-service/api/v1.0/data_tables/id
Request Header
Content-Type: application/json
Authorization: Bearer <JWT_token>

For instructions on obtaining the JWT token, see Access and authentication for the REST API..

Parameter details


Successful response

{
 "message": "Data Table entry found.",
 "object": {
   "id": "c8f7af05-3594-11ec-9a65-f335c7198f8c",
   "tag": "Import Lable",
   "tenantId": "1360806657",
   "content": "OPEN,CRITICAL,printer1,PRINTER_1_STATUS_REQUIRES_ACTION,HIGH\nASSIGNED,MAJOR,printer1,PRINTER_4_STATUS_REQUIRES_ACTION,LOWEST\nOPEN,MINOR,printer2,PRINTER_3_STATUS_REQUIRES_ACTION,LOW"
 }
}

Unsuccessful response

Scenario 1: You specify a short and invalid data table ID.

{
 "message": "[Failed to get data table entry abcd3.]",
 "errorCode": "INVALID_ID"
}

Scenario 2: You specify a long and invalid data table ID.

{
 "message": "[Failed to get data table entry c8f7af05-3594-11ec-9a65-f335c7198f8cftabcdfe.]",
 "errorCode": "INVALID_ID"
}

Scenario 3: You specify a data table ID that does not exist.

{
 "message": "[Failed to get data table entry for tenant 1220296999, entry with same id does not exist.]",
 "errorCode": "DATA_TABLE_ENTRY_DOES_NOT_EXIST"
}

Back to top

DELETE  /data_tables/<id>
Delete a data table by id
Request URL
 https://<tenant-url>/events-service/api/v1.0/data_tables/<id>
Example request URL
 https://HostA.bmc.com/events-service/api/v1.0/data_tables/c8f7af05-3594-11ec-9a65-f335c7198f8c
Request Header
Content-Type: application/json
Authorization: Bearer <JWT_token>

For instructions on obtaining the JWT token, see Access and authentication for the REST API..

Parameter details


Successful responses

{
 "message": "Deleted data table entry 68f1c644-3594-11ec-9a65-3515b2f79aad."
}

Unsuccessful response

Scenario 1: You specify a data table ID that does not exist.

{
 "message": "[Failed to delete data table entry for tenant 1220296999, entry with same id does not exist.]",
 "errorCode": "DATA_TABLE_ENTRY_DOES_NOT_EXIST"
}

Scenario 2: You specify a long and invalid data table ID.

{
 "message": "[Failed to get data table entry c8f7af05-3594-11ec-9a65-f335c7198f8cftabcdfe.]",
 "errorCode": "INVALID_ID"
}

Scenario 3: You specify a short and invalid data table ID.

{
 "message": "[Failed to get data table entry abcd.]",
 "errorCode": "INVALID_ID"
}

Back to top

POST /data_tables/search
Search data tables
Request URL
https://<tenant-url>/events-service/api/v1.0/data_tables/search
Example request URL
 https://HostA.bmc.com/events-service/api/v1.0/data_tables/search
Request Header
Content-Type: application/json
Authorization: Bearer <JWT_token>

For instructions on obtaining the JWT token, see Access and authentication for the REST API..

Parameter details



Request body

{
 "query": "string",
 "pageIndex": "integer",
 "recordsPerPage": "integer",
 "sortCriteria": "string"
}

Example request body

Example request 1
{
 "query": "tag = 'test' and modificationTime >= 1628736628709 ",
 "pageIndex": 1,
 "recordsPerPage": 10,
 "sortCriteria": "tag desc"
}
Example request 2
{
 "pageIndex": 1,
 "recordsPerPage": 10
}
Example request 3
{
 "query": "tag like 'abcd%'",
 "pageIndex": 1,
 "recordsPerPage":10
}

Successful response

{
 "dataTables": [
   {
     "id": "bb093bd4-6182-11ec-959b-759bf10b5454",
     "tag": "abcd"
   },
   {
     "id": "be7153c5-6187-11ec-959b-55e7fe592d72",
     "tag": "abcd"
   }
  ],
 "totalRecords": 2
}

Unsuccessful responses

Scenario 1: You specify an invalid column name in the query search criteria.

[
 {
   "key": "400",
   "level": "ERROR",
   "message": "Invalid columnName id in search criteria.",
   "additionalInfo": []
 }
]

Scenario 2: You specify an invalid column name in the sort criteria.

[
 {
   "key": "400",
   "level": "ERROR",
   "message": "Invalid columnName id in sort criteria.",
   "additionalInfo": []
 }
]

Back to top