Operations Hub REST APIs for App, Group, and Page Permissions

Operations Hub provides REST APIs for App, Group, and Page Permissions. The following sections outline what these APIs are and how they work.

Authentication

For proper authentication, obtain a valid UAA token with a valid scope that includes iqp.developer.

Import App

The Import App API takes a zip or xml file (same as from the UI) and returns the application id of the imported App.

  • If the App is not already present, the type parameter is not required.
  • If the App is already present and the type parameter is not provided, then the default is to duplicate.
  • The type parameter can be explicitly provided as replace or duplicate.

Sample request for HTTP POST is as follows:

https://<hostname>/site/api/apps/import
https://<hostname>/site/api/apps/import?type=replace
https://<hostname>/site/api/apps/import?type=duplicate

The zip or xml file is part of the Request body with the key as file.

Sample response:
Http 200 Ok
{
     "uuid": <app id>
}                     

Get Apps

The Get Apps API returns all Apps from within Operations Hub .

Sample request for HTTP GET is as follows:
https://<hostname>/site/api/apps
The Get Apps API returns all of the Apps that are present.

Sample response:

Http 200 Ok
[
    {
        "name": "app name",
        "uuid": "app id"    
    },
    {
        "name": "app name",
        "uuid": "app id"    
    }
]

To filter a single App by name, the name parameter is used.

Sample request for HTTP GET is as follows:

https://<hostname>/site/api/apps?name={appname}

Sample response:

Http 200 ok
[
    {
        "name": "appname",
        "uuid": "app id"
    }
]

Get App Details for App Id

This API takes the App Id and returns the details of the App, including the UAA permitted groups.

Sample request for HTTP GET is as follows:

https://<hostname>/site/api/apps/{app id}

Sample response:

{
    "name": "app name",
    "id": "appid",
    "permittedUaaGroups": [],
    "pages": [
        {
            "id": "pageid",
            "name": "page name",
            "permittedUaaGroups": [],
            "queries": [
                {
                    "id": "query id",
                    "name": "query name",
                    "permittedUaaGroups": [
                        {
                            "id": "id",
                            "displayName": "group name"
                        }
                    ]
                }
            ]
        }
    ]
}          
  • Empty permission groups for App denotes NONE of the groups have permission to access the App.
  • Empty permission groups for Page denotes ALL the groups have permission to access the Page.
  • Empty permission groups for query denoted ALL the groups have permission to access the query.

Update App UAA Group Permissions

This API takes the application's universally unique identifier (UUID) and the list of UAA permissions to be updated. The permissions provided will overwrite the permission list already existing in Operations Hub.

Group id and name should match UAA group id and group name.

Sample request for HTTP POST is as follows:
https://<hostname>/site/api/apps/{app id}/permittedUaaGroups
Request body
[
  {
    "id": "group id",
    "displayName": "group name"
  },
  {
    "id": "group id",
    "displayName": "group name"
  }
]
Sample response:
Http 204 No content. 

Update Page UAA Group Permissions

This API takes page's universally unique identifier (UUID) and the list of UAA permissions to be updated. The permissions provided will overwrite the permission list already existing in Operations Hub.

Group id and name should match UAA group id and group name.

Sample request for HTTP POST is as follows:
https://<hostname>/site/api/pages/{page id}/permittedUaaGroups
Request body
[
  {
    "id": "group id",
    "displayName": "group name"
  },
  {
    "id": "group id",
    "displayName": "group name"
  }
]

Sample response:

Http 204 No content.

Update Query UAA Group Permissions

This API takes the query's universally unique identifier (UUID) and the list of UAA permissions to be updated. The permissions provided will overwrite the permission list already existing in Operations Hub.

Group id and name should match UAA group id and group name.

Sample request for HTTP POST is as follows:
https://<hostname>/site/api/queries/{query id}/permittedUaaGroups
Request body
[
  {
    "id": "group id",
    "displayName": "group name"
  },
  {
    "id": "group id",
    "displayName": "group name"
  }
]

Sample response:

Http 204 No content.

Get Query Id from Query Name

This API takes the query name and returns the query id.

Sample request for HTTP GET is as follows:
https://<hostname>/site/api/queries?name={query name}
Sample response:
Http 200 OK
{
    "uuid": <query id>
}

Get Query UAA Permissions for Query Id

This API takes the query id and returns the UAA permission group list present in Operations Hub.

Sample request for HTTP GET is as follows:

https://<hostname>/site/api/queries/{query id}/permittedUaaGroups

Sample response:

Http 200 Ok
 
[
  {
    "id": "group id",
    "displayName": "group name"
  },
  {
    "id": "group id",
    "displayName": "group name"
  }
]

Delete App

The Delete App API removes the application from Operations Hub.

Sample request is as follows:

https://<hostname>/site/api/apps/{app id}
Sample response:
Http 204 no content.