13.0 Entity Type APIs

WAS THIS PAGE HELPFUL? Leave Feedback

13.0 Entity Type APIs

13.1 Query Entity Types

Retrieve entity types by query. There are two kinds of queries supported:

  1. Retrieve a single entityType. Retrieves exactly one entityType wrapped XML <entityType> element
  2. Retrieve one or more entity types . Retrieves 1..n entity type objects wrapped by an XML <entityTypes> collection
13.2 Method: GET Entity Types

GET /api/entitytypes?query=(query criteria see below)

13.3 Method: GET a single Entity Type by unique entity type name

GET /api/entitytypes/{entityTypeName}

13.4 HTTP Query and Path Parameters
Field Type Description Required
query Query An encoded query string (where clause) no **
first Query Paging. First record to start from no
count Query Paging. Number of records to include when paging no
entityTypeName Path the unique name of the entity type no **

Note: **If neither a entityType path parameter or query query parameter is not provided, all entityTypes will be retrieved.

13.5 HTTP Headers
Header Valid Values Required
Content-Type application/xml or application/json True
GWOS-API-TOKEN a valid token returned from login True
GWOS-APP-NAME your application name True
13.6 Query Fields
Field Description Alias
id Entity Type integer id entityTypeId
name The entity type primary unique name  
description The description of this property type  
isLogicalEntity Boolean flag set if a logical entity  
applicationTypeSupported Boolean flag for application type support  

Note: Query fields are case-insensitive, thus camelCase, or all lower case will both work fine.
***The fields entity

13.7 Example Queries

These examples are not HTTP encoded for readability. In practice queries must be encoded.

  1. query for all entity types
    GET /api/entitytypes
  2. query for all entity types, order by name descending
    GET /api/entitytypes?query=order by name desc
  3. query for a single entityType named ‘DEVICE’
    GET /api/entitytypes/DEVICE
  4. a like query to find all entity types in list
    GET /api/entitytypes?query=name in (‘DEVICE','HOST,'CATEGORY)

Example Query Results in XML

The normal results of a query will result in either HTTP 200 OK status or a HTTP 404 NOT FOUND status.

Results of requesting a single entity with a entity type name in the path parameter is always wrapped with a single <entityType> element. Here is an XML example of the result of a query finding one entity type. All fields are displayed as attributes.

<entityType id="15" name="STATE_TYPE"
       description="com.groundwork.collage.model.impl.StateType"
       isLogicalEntity="false" applicationTypeSupported="false" />

Result of queries are always wrapped in a <propertyTypes> collection element, with one or more <propertyType> subelements.

<entityTypes>
  <entityType id="7" name="APPLICATION_TYPE"
       description="com.groundwork.collage.model.impl.ApplicationType"
       isLogicalEntity="false" applicationTypeSupported="false" />
  <entityType id="8" name="CATEGORY"
       description="com.groundwork.collage.model.impl.Category"
       isLogicalEntity="false" applicationTypeSupported="false" />
  <entityType id="9" name="CHECK_TYPE"
       description="com.groundwork.collage.model.impl.CheckType"
       isLogicalEntity="false" applicationTypeSupported="false" />
  <entityType id="10" name="COMPONENT"
       description="com.groundwork.collage.model.impl.Component"
       isLogicalEntity="false" applicationTypeSupported="false" />
</entityTypes>

See Appendix A for examples of usage with Curl
See Appendix B and Appendix C for example query data in both XML and JSON:
  Response Data - XML - JSON