list_ranger_configs

This command lists all Ranger configurations on the specified Guardium host(s). The result is shown as the administrator account, the host and port, and the cluster name.

This API is available in Guardium V10.1.4 and later.

REST API syntax

This API is available as a REST service with the GET method. Call this API as follows:
GET https://[Guardium hostname or IP address]:8443/restAPI/list_ranger_configs

GuardAPI syntax

list_ranger_configs parameter=value

Parameters

Parameter Value type Description
api_target_host String

Specifies the target hosts where the API executes. Valid values:
  • all_managed: execute on all managed units but not the central manager
  • all: execute on all managed units and the central manager
  • group:<group name>: execute on all managed units identified by <group name>
  • host name or IP address of a managed unit: specified from the central manager to execute on a managed unit.  For example, api_target_host=10.0.1.123.
  • host name or IP address of the central manager: specified from a managed unit to execute on the central manager. For example, api_target_host=10.0.1.123.

IP addresses must conform to the IP mode of your network. For dual IP mode, use the same IP protocol with which the managed unit is registered with the central manager. For example, if the registration uses IPv6, specify an IPv6 address. The hostname is independent of IP mode and can be used with any mode.

GrdAPI Example

List the current Ranger configuration (cluster) defined on this Guardium appliance:
grdapi list_ranger_configs
Sample output:
ID=0
admin@<server>:8080 Cluster4

REST API Example

List the current Ranger configuration (cluster) defined on this Guardium appliance.

curl -k -i --header "Authorization:Bearer <access token>" https://<Guardium host name>:8443/restAPI/list_ranger_configs
Sample output when there is no configuration:
HTTP/1.1 200 OK
X-FRAME-OPTIONS: SAMEORIGIN
Set-Cookie: JSESSIONID=8B9581F4DA85E980DBD4C152CB8AD975; Path=/; Secure; HttpOnly
Cache-Control: max-age=86400
Expires: Tue, 20 Sep 2016 21:32:09 GMT
Access-Control-Allow-Methods: POST, GET,  PUT, DELETE
Access-Control-Allow-Headers: authorization, origin, X-Requested-With, Content-Type, AcceptAccess-Control-Max-Age: 18000
Content-Type: application/json;charset=UTF-8Content-Length: 62Date: Mon, 19 Sep 2016 21:32:09 GMTServer: SQL Guard
Sample output with all services configured:
[
   {
   "id": 1,
   "clusterName": "Cluster4",
   "serverHost": "<server>",
   "serverPort":8080,
   "userName": "admin",
   "password": "nnnnnn",
   "lastRefresh": "2016-09-14 13:45:10",
   "status": [
      {
        "id": 1,
        "ambariConfigId": 1,
        "service": {
          "id": 1,
          "label": "HBase",
          "value": "HBASE"
       },
        "stapHost": {
          "id": 22,
          "name": "<server>",
          "value": "<server>",
          "port": "5555",
          "stapStatus": 2
          },
          "isMonitored": true,
          "port": "5555",
          "editMode": true
      },
      {
        "id": 2,
        "ambariConfigId": 1,
        "service": {
          "id": 2,
          "label": "HDFS",
          "value": "HDFS"
        },
        "stapHost": {
          "id": 22,
          "name": "<server>",
          "value": "<server>",
          "port": "5555",
          "stapStatus": 2
        },
        "isMonitored": false,
        "port": "5555",
        "editMode": true
      },
      {
        "id": 3,
        "ambariConfigId": 1,
        "service": {
          "id": 3,
          "label": "Hive",
          "value": "HIVE"
         },
         "stapHost": {
           "id": 28,
           "name": "<server>",
           "value": "<server>",
           "port": "5534",
           "stapStatus": 2
         },
         "isMonitored": true,
         "port": "5534",
         "editMode": true
      },
      {
         "id": 4,
         "ambariConfigId": 1,
         "service": {
           "id": 4,
           "label": "Kafka",
           "value": "KAFKA"
         },
         "stapHost": {
           "id": 22,
           "name": "<server>",
           "value": "<server>",
           "port": "5555",
           "stapStatus": 2
        },
        "isMonitored": true,
        "port": "5555",
        "editMode": true
      },
      {
         "id": 5,
         "ambariConfigId": 1,
         "service": {
           "id": 5,
           "label": "Storm",
           "value": "STORM"
         },
         "stapHost": {
           "id": 22,
           "name": "<server>",
           "value": "<server>",
           "port": "5555",
           "stapStatus": 2
         },
         "isMonitored": false,
         "port": "5555",
         "editMode": true
   }
]