Counting Item Statuses
Earlier, you received a comprehensive introduction to item statuses (see Related Links). With the functionality described here, you can access the Item counts by status from outside of the application.
Publication Action Counts
The feature exposes the types of errors that can occur during publication, so it’s possible to know what types of errors or failures there are. There are three attributes exposed through the API (https://url:8443/datahub-webapp/v1/pools/GLOBAL/publications):
- internalErrorCount - returns the number of errors generated during the Target Item creation process. For example, failure to resolve a transformation expression.
- externalErrorCount - returns the number of errors generated during the publication to the target system.
- ignoredCount - returns the number of items that were ignored in the publication grouping handlers.
Data Items
There are three kinds of items: Raw, Canonical, and Target. These items have the following statuses:
Raw Items:
- PENDING
- PROCESSED
- IGNORED
Canonical Items:
- SUCCESS
- ERROR
- ARCHIVED
- DELETED
Canonical Items for Publication:
- SUCCESS
- FAILURE (Internal Error/External Error)
- IGNORED
Regarding Canonical Items for Publication There are three qualifications:
- If a publication fails due to Target System Unavailability (for example the ping fails), then we mark the target system publication as FAILURE. The counts are not updated.
- If a publication detects an error in a canonical item for publication, then the canonical item for publication is marked as a FAILURE. The internal error count is updated.
- The publication result can be marked as FAILURE by the Target System (for example it contains a CrashReport). Then the external error count updates with the canonical item count.
As you can see, the standard status FAILURE appears. However, the API shows the additional details of whether it is an Internal or External error.
There are two different ways to access them:
- Through the REST API (Results provided in both XML and JSON.)
- Through the JMX API
REST
- https://{{url}}:8443/datahub-webapp/v1/status-counts - This endpoint returns the addition of the status counts for all of the pools. It returns an object that contains the different count objects separated by the item type. The following XML object is returned:
<itemStatusCounts> <rawItemStatusCount> <ignoredCount>0</ignoredCount> <pendingCount>0</pendingCount> <processedCount>0</processedCount> </rawItemStatusCount> <canonicalItemStatusCounts> <successCount>12</successCount> <archivedCount>0</archivedCount> <errorCount>1</errorCount> <deletedCount>0</deletedCount> </canonicalItemStatusCounts> <canonicalPublicationStatusCounts> <successCount>0</successCount> <internalErrorCount>0</internalErrorCount> <externalErrorCount>0</externalErrorCount> <ignoredCount>0</ignoredCount> </canonicalPublicationStatusCounts> </itemStatusCounts> - https://{{url}}:8443/datahub-webapp/v1/pools/GLOBAL/status-counts - This endpoint returns the counts of the statuses only for the pool specified in the request path. The XML object (for the GLOBAL pool) returned is:
<itemStatusCounts> <rawItemStatusCount> <poolName>GLOBAL</poolName> <ignoredCount>0</ignoredCount> <pendingCount>0</pendingCount> <processedCount>0</processedCount> </rawItemStatusCount> <canonicalItemStatusCounts> <poolName>GLOBAL</poolName> <successCount>12</successCount> <archivedCount>0</archivedCount> <errorCount>1</errorCount> <deletedCount>0</deletedCount> </canonicalItemStatusCounts> <canonicalPublicationStatusCounts> <poolName>GLOBAL</poolName> <successCount>0</successCount> <internalErrorCount>0</internalErrorCount> <externalErrorCount>0</externalErrorCount> <ignoredCount>0</ignoredCount> </canonicalPublicationStatusCounts> </itemStatusCounts> - https://{{url}}:8443/datahub-webapp/v1/status-counts/raw - This endpoint returns the addition of the status counts for all of the pools. It returns an object that contains only the raw type counts. The returned XML object is:
<rawItemStatusCount> <ignoredCount>0</ignoredCount> <pendingCount>0</pendingCount> <processedCount>0</processedCount> </rawItemStatusCount>
- https://{{url}}:8443/datahub-webapp/v1/pools/GLOBAL/status-counts/raw - This endpoint returns the counts of the statuses only for the pool specified in the request path and returns only the raw type counts. The XML object (for the GLOBAL pool) returned is:
<rawItemStatusCount> <poolName>GLOBAL</poolName> <ignoredCount>0</ignoredCount> <pendingCount>0</pendingCount> <processedCount>0</processedCount> </rawItemStatusCount>
- There is a new api for getting canonical item counts only (no pool). https://url:8443/datahub-webapp/v1/status-counts/canonical.xml
<canonicalItemStatusCounts> <successCount>12</successCount> <archivedCount>0</archivedCount> <errorCount>1</errorCount> <deletedCount>0</deletedCount> </canonicalItemStatusCounts>
- There is also a call for getting canonical item counts with the pool provided. https://url:8443/datahub-webapp/v1/pools/GLOBAL/status-counts/canonical.xml
<canonicalItemStatusCounts> <poolName>GLOBAL</poolName> <successCount>12</successCount> <archivedCount>0</archivedCount> <errorCount>1</errorCount> <deletedCount>0</deletedCount> </canonicalItemStatusCounts>
- There is a new call for getting canonical item publication counts only (no pool). https://url:8443/datahub-webapp/v1/status-counts/canonical-publication.xml
<canonicalPublicationStatusCounts> <successCount>0</successCount> <internalErrorCount>0</internalErrorCount> <externalErrorCount>0</externalErrorCount> <ignoredCount>0</ignoredCount> </canonicalPublicationStatusCounts> - There is also a call for getting canonical item publication counts with the pool provided. https://url:8443/datahub-webapp/v1/pools/GLOBAL/status-counts/canonical-publication.xml
<canonicalPublicationStatusCounts> <poolName>GLOBAL</poolName> <successCount>0</successCount> <internalErrorCount>0</internalErrorCount> <externalErrorCount>0</externalErrorCount> <ignoredCount>0</ignoredCount> </canonicalPublicationStatusCounts>
JMX
To use JMX, navigate to the MBeans, select statusCountsEmitter, and then expand Operations. You find the following operations:
- getRawItemStatusCounts() - returns all status counts for raw item type for all pools combined
- getRawItemStatusCounts(poolName) - returns all status counts for raw item type for the pool specified as a parameter
- getCanonicalItemStatusCounts() - returns all status counts for canonical item type for all pools combined
- getCanonicalItemStatusCounts(poolName) - returns all status counts for canonical item type for the pool specified as a parameter
- getCanonicalPublicationStatusCounts() - returns all status counts for canonical item publication type for all pools combined
- getCanonicalPublicationStatusCounts(poolName) - returns all status counts for canonical item publication type for the pool specified as a parameter
- getStatusCounts() - returns all status counts by item type for all pools combined
- getStatusCounts(poolName) - returns all status counts by item type for the pool specified as a parameter