28.2 Accessing and Using the Resources Service

The Resources Service exposes resources to retrieve resources information. The service allows you to retrieve lists of resources or access specific resources by filter expression or resource ID.

IMPORTANT:To view resource detail and resource assignments by using the resource/{resource id} and resource/{resource id}/assignments end points, you need to be a Resource Administrator and a Provisioning Administrator. The Resource Administrator must have appropriate permissions on the Provisioning domain. To provide these permissions:

  1. Log into the User Application as the Provisioning Administrator.

  2. Give all domain rights to the Resource Administrator including rights on the Provisioning domain.

  3. Login to iManager.

  4. Add Resource Administrator as a trustee of Resource-Config in iManager.

28.2.1 Available Resources

Resources Service

The service provides a resource URI for every object exposed. The Roles resource supports the following URI patterns:

  • Resource for returning a collection of resources

  • Resource for returning a specific resource instance

  • Resource for returning all assignments for a specific resource instance

  • Resource for returning a particular resource assignment

Services for Filtering, Debugging, and Displaying Schema Information

The service supports the following parameters to allow you to perform operations on the primary resources data set:

  • A filter parameter to enable the filtering of result sets

  • A debug matrix parameter to enable you to return the JSON structures in a human readable format

  • A schema matrix parameter to enable you to return the schema for the data set

28.2.2 Complete URI Syntax

The following table shows the complete URI syntax for all resource end points associated with the Resources Service, along with a description for each URI and a list of supported HTTP methods:

Table 28-1 Resource URIs

URI

Description

/resources

GET - Will return a list of resources with minimal information and a list of role URI links that include the role GUID

POST – Not supported

PUT – Not supported

DELETE – Not Supported

/resources/{ResourceId}

GET - The Resource ID parameter is a GUID used to identify a specific resource within the LDAP realm

POST – Not supported

PUT – Not supported

DELETE – Not Supported

/resources/{ResourceId}/assignments

GET - Will return a list of assignments for a specific resource. This will be a list of assignments to users.

POST – Not supported

PUT – Not supported

DELETE – Not Supported

/resources/{ResourceId}/assignments/{assignment id}

GET - Displays information on a specific resource assignment.

POST – Not supported

PUT – Not supported

DELETE – Not Supported

/resources/refreshCodeMap

GET - Not supported

POST – Triggers a code map refresh for an entitlement. The request to trigger the refresh takes in an entitlement DN and the response includes a detailed status containing information about the codemap refresh, such as the last refresh time and refresh status.

PUT – Not supported

DELETE – Not Supported

/resources/refreshStatus/{GUID}

GET - Fetches the status of a code map refresh (RUNNING, COMPLETED, FAILED). The request to fetch the refresh status takes in an entitlement DN and returns details outlining the status of the code map refresh that was triggered previously.

POST – Not supported

PUT – Not supported

DELETE – Not Supported

/resources/checkCodeMapValueStatus

GET - Not supported

POST – Checks for the existence of an entitlement value in the RBPM code map.

PUT – Not supported

DELETE – Not Supported

/resources/checkMultiCodeMapValueStatus

GET - Not supported

POST – Checks for the existence of multiple entitlement values in the RBPM code map.

PUT – Not supported

DELETE – Not Supported

The following table lists the parameters for debugging and displaying the schema:

Table 28-2 Matrix Parameters for Debugging and Displaying the Schema

URI

Description

resources;debug

This debug matrix parameter displays the resources JSON structure in human readable format, as opposed to compressed format. This matrix parameter can be put anywhere in the URI.

resources;schema

The schema matrix parameter can be put anywhere in the URI and in combination with the “Accept” header type will return the appropriate schema document for the content type. In this case a JSON schema document is returned for the resources.

28.2.3 JSON Representations

This section provides the JSON representation for the resources endpoint.

Resources Endpoint

JSON Response The resources end point (/resources) returns a collection (JSON Array) of resources.

{
      "Link": "\/RIS\/resources\/9ca222fa9f942e4a7f879ca222fa9f94",
      "DN":
"cn=BuildingAccessWest,cn=ResourceDefs,cn=RoleConfig,cn=AppConfig,cn=DoradoDriver,cn=TestDrivers,o=novell",
      "GUID": "9ca222fa9f942e4a7f879ca222fa9f94"
      "Name": "West Building Access",
      "description" : "West Building Access",
      "CategoryKey": ["default"],
}

RefreshCodeMap Endpoint

JSON Request The refreshCodeMap endpoint (/resources/refreshCodeMap) sends a JSON request in this format.

{
"DN" : "cn=Building Pass,cn=GroupEntitlementLoopback,cn=TestDrivers,o=novell"
}

JSON Response The refreshCodeMap endpoint (/resources/refreshCodeMap) returns a detailed status containing information about the code map refresh.

{"GUID":"46d1b6b9aea3264b9ca946d1b6b9aea3","Status":"true","DN":"cn=Building Pass,cn=GroupEntitlementLoopback,cn=TestDrivers,o=novell","DetailedStatus":[[{"GUID":"46d1b6b9aea3264b9ca946d1b6b9aea3","Status":"SUCCESS","Entitlement-DN":"cn=Building Pass,cn=GroupEntitlementLoopback,cn=TestDrivers,o=novell","Last-Refresh":"1329373072390","Connection-Name":"1111"}]]}

RefreshStatus Endpoint

JSON Response The refreshStatus endpoint (/resources/refreshStatus/{GUID}) returns details outlining the status of a previously triggered code map refresh.

{"CodeMapRefreshStatus":[{"GUID":"46d1b6b9aea3264b9ca946d1b6b9aea3","Status":"1329373072390","Entitlement-DN":"cn=Building Pass,cn=GroupEntitlementLoopback,cn=TestDrivers,o=novell","Last-Refresh":"1329373072390","Connection-Name":"1111"}]}

CheckCodeMapValueStatus Endpoint

JSON Request The checkCodeMapValueStatus endpoint (/resources/checkCodeMapValueStatus) sends a JSON request in this format:

{
"entitlementDN" : "cn=Building Pass,cn=GroupEntitlementLoopback,cn=TestDrivers,o=novell",
"connectionName" : "test",
"codeMapValue" : "Waltham:Spring Street"
}

JSON Response The checkCodeMapValueStatus endpoint (/resources/checkCodeMapValueStatus) returns the status for an entitlement value in this format:

{"UpToDate":"false","Value":"Waltham:Spring Street","RefreshStatus":{"GUID":"46d1b6b9aea3264b9ca946d1b6b9aea3","Status":"SUCCESS","Entitlement-DN":"cn=Building Pass,cn=GroupEntitlementLoopback,cn=TestDrivers,o=novell","Last-Refresh":"1329712008390","Connection-Name":"test"}}

CheckMultiCodeMapValueStatus Endpoint

JSON Request The checkMultiCodeMapValueStatus endpoint (/resources/checkMultiCodeMapValueStatus) sends a JSON request in this format:

{ "entitlementParams" : [
  {
    "entitlementDN" : "cn=Building Pass,cn=GroupEntitlementLoopback,cn=TestDrivers,o=novell",
    "connectionName" : "test",
    "codeMapValue" : "Waltham:Spring Street"
  },
  {
    "entitlementDN" : "cn=Parking Permission,cn=GroupEntitlementLoopback,cn=TestDrivers,o=novell",
    "connectionName" : "test1",
    "codeMapValue" : "Cambridge:Main Street"
  }
]
}

JSON Response The checkCodeMapValueStatus endpoint (/resources/checkMultiCodeMapValueStatus) returns the status for the specified entitlement values in this format:

{"CodeMapValueStatus":[{"UpToDate":"false","Value":"Waltham:Spring Street","RefreshStatus":{"GUID":"46d1b6b9aea3264b9ca946d1b6b9aea3","Status":"SUCCESS","Entitlement-DN":"cn=Building Pass,cn=GroupEntitlementLoopback,cn=TestDrivers,o=novell","Last-Refresh":"1329712008390","Connection-Name":"test"}},{"UpToDate":"false","Value":"Cambridge:Main Street","RefreshStatus":{"GUID":"d33a80ae1cb82e4c80b9d33a80ae1cb8","Status":"SUCCESS","Entitlement-DN":"cn=Parking Permission,cn=GroupEntitlementLoopback,cn=TestDrivers,o=novell","Last-Refresh":"1329686444156","Connection-Name":"test1"}}]}