지금 지원 담당자와 채팅
지원 담당자와 채팅

One Identity Safeguard for Privileged Sessions 6.14 - REST API Reference Guide

Introduction Using the SPS REST API Basic settings User management and access control Managing SPS General connection settings HTTP connections Citrix ICA connections MSSQL connections RDP connections SSH connections Telnet connections VNC connections Search, download, and index sessions Reporting Health and maintenance Advanced authentication and authorization Completing the Welcome Wizard using REST Enable and configure analytics using REST

Custom subchapters

List of the reporting subchapters created from custom queries to the SPS connection database. The list of tables and fields you can query are described in "Database tables available for custom queries" in the Administration Guide.

URL
GET https://<IP-address-of-SPS>/api/configuration/reporting/custom_subchapters
Cookies
Cookie name Description Required Values
session_id Contains the authentication token of the user Required

The value of the session ID cookie received from the REST server in the authentication response, for example, a1f71d030e657634730b9e887cb59a5e56162860. For details on authentication, see Authenticate to the SPS REST API.

NOTE: This session ID refers to the connection between the REST client and the SPS REST API. It is not related to the sessions that SPS records (and which also have a session ID, but in a different format)..

Sample request

The following command lists the available custom subchapters.

curl --cookie cookies https://<IP-address-of-SPS>/api/configuration/reporting/custom_subchapters

The following command retrieves the properties of a specific subchapter.

curl --cookie cookies https://<IP-address-of-SPS>/api/configuration/reporting/custom_subchapters/<object-id>
Response

The following is a sample response received when listing custom subchapters.

For details of the meta object, see Message format.

{
  "meta": {
    "first": "/api/configuration/reporting/content_subchapters",
    "href": "/api/configuration/reporting/custom_subchapters",
    "last": "/api/configuration/reporting/statistics_subchapters",
    "next": "/api/configuration/reporting/predefined_reports",
    "parent": "/api/configuration/reporting",
    "previous": "/api/configuration/reporting/content_subchapters",
    "transaction": "/api/transaction"
  },
  "items": [
    {
      "key": "5983143445707eb740fee3",
      "meta": {
        "href": "/api/configuration/reporting/custom_subchapters/5983143445707eb740fee3"
      }
    }
  ]
}

When retrieving the endpoint of a specific subchapter, the response is the following.

{
  "body": {
    "access": [
      "search"
    ],
    "chart": {
      "column_titles": [
        "col1",
        "col2"
      ],
      "type": "list"
    },
    "name": "API_test_adv_stats",
    "query": "select\n  to_timestamp(audit_trail_downloads.download_time),\n  audit_trail_downloads.username,\n  channels.channel_type,\n  channels.connection,\n  audit_trail_downloads.ip\nfrom audit_trail_downloads,\n     channels\nwhere channels._connection_channel_id = audit_trail_downloads.id\nand audit_trail_downloads.download_time <= :range_start\nand audit_trail_downloads.download_time > :range_end\nand audit_trail_downloads.username != 'admin'\norder by audit_trail_downloads.download_time;"
  },
  "key": "5983143445707eb740fee3",
  "meta": {
    "first": "/api/configuration/reporting/custom_subchapters/5983143445707eb740fee3",
    "href": "/api/configuration/reporting/custom_subchapters/5983143445707eb740fee3",
    "last": "/api/configuration/reporting/custom_subchapters/5983143445707eb740fee3",
    "next": null,
    "parent": "/api/configuration/reporting/custom_subchapters",
    "previous": null,
    "transaction": "/api/transaction"
  }
}
Element Type Description
key string Top level element, contains the ID of the custom subchapter.
body Top level element (string) The elements of the custom subchapter.
access list

Required. List of access control groups whose members can access the subchapter.

To deny access to the subchapter, use "admin" as the only value for the element.

chart Top level element Defines the properties of the chart generated from the database query.
type string

Defines the chart type.

  • Use bar to generate a bar chart.

    You have to provide the y_axis_title element for bar charts (its can be null).

  • Use pie to generate pie a chart.

  • Use list to generate a list.

    You have to provide the column_titles element for lists (it can be null).

y_axis_title string

Required if the type element is set to bar.

The name of the y axis for the generated bar chart.

column_titles list

Required if the type element is set to list.

The column titles for the generated list.

name string The name of the subchapter.
query string

The SQL database query for creating the subchapter.

Caution:

Generating a report that includes an Advanced statistics chapter that returns several thousands of entries requires significant CPU and memory resources from One Identity Safeguard for Privileged Sessions (SPS). While generating such a partial report, the web interface of SPS can become slow or unresponsive.

Examples:

Create a bar chart with a custom title for the y-axis:

"chart": {
  "type": "bar",
  "y_axis_title": "Y_axis"
}

Create a pie chart:

"chart": {
  "type": "pie"
}

Create a list with custom column names:

"chart": {
  "column_titles": [
    "col1",
    "col2"
  ],
  "type": "list"
}
Status and error codes

The following table lists the typical status and error codes for this request. For a complete list of error codes, see Application level error codes.

Code Description Notes
201 Created The new resource was successfully created.
400 InvalidQuery The requested filter or its value is invalid.
401 Unauthenticated The requested resource cannot be retrieved because the client is not authenticated and the resource requires authorization to access it. The details section contains the path that was attempted to be accessed, but could not be retrieved.
403 Unauthorized The requested resource cannot be retrieved because the client is not authorized to access it. The details section contains the path that was attempted to be accessed, but could not be retrieved.
404 NotFound The requested object does not exist.
Add a custom subchapter

To add a custom subchapter, you have to:

  1. Open a transaction.

    For more information, see Open a transaction.

  2. Create the JSON object for the new subchapter.

    POST the JSON object to the https://<IP-address-of-SPS>/api/configuration/reporting/custom_subchapters endpoint. You can find a detailed description of the available parameters listed in Element .

    If the POST request is successful, the response includes the key of the new subchapter. For example:

    {
      "key": "9a8f7f19-edbf-4327-9d3a-9f527e7331ee",
      "meta": {
        "href": "/api/configuration/reporting/custom_subchapters/9a8f7f19-edbf-4327-9d3a-9f527e7331ee",
        "parent": "/api/configuration/reporting/custom_subchapters",
        "transaction": "/api/transaction"
      }
    }
  3. Commit your changes.

    For more information, see Commit a transaction.

Modify a custom subchapter

To modify a subchapter, you have to:

  1. Open a transaction.

    For more information, see Open a transaction.

  2. Modify the JSON object of the subchapter.

    PUT the modified JSON object to the https://<IP-address-of-SPS>/api/configuration/reporting/custom_subchapters/<key-of-the-object> endpoint. You can find a detailed description of the available parameters listed in Element .

  3. Commit your changes.

    For more information, see Commit a transaction.

Connection statistics subchapters

List of the reporting subchapters created from connection statistics.

URL
GET https://<IP-address-of-SPS>/api/configuration/reporting/statistics_subchapters
Cookies
Cookie name Description Required Values
session_id Contains the authentication token of the user Required

The value of the session ID cookie received from the REST server in the authentication response, for example, a1f71d030e657634730b9e887cb59a5e56162860. For details on authentication, see Authenticate to the SPS REST API.

NOTE: This session ID refers to the connection between the REST client and the SPS REST API. It is not related to the sessions that SPS records (and which also have a session ID, but in a different format)..

Sample request

The following command lists the available subchapters.

curl --cookie cookies https://<IP-address-of-SPS>/api/configuration/reporting/statistics_subchapters

The following command retrieves the properties of a specific subchapter.

curl --cookie cookies https://<IP-address-of-SPS>/api/configuration/reporting/statistics_subchapters/<subchapter-id>
Response

The following is a sample response received when listing connection statistics subchapters.

For details of the meta object, see Message format.

{
  "meta": {
    "first": "/api/configuration/reporting/content_subchapters",
    "href": "/api/configuration/reporting/statistics_subchapters",
    "last": "/api/configuration/reporting/statistics_subchapters",
    "next": null,
    "parent": "/api/configuration/reporting",
    "previous": "/api/configuration/reporting/reports",
    "transaction": "/api/transaction"
  },
  "items": [
    {
      "key": "21111736175707f1df8bea1",
      "meta": {
        "href": "/api/configuration/reporting/statistics_subchapters/21111736175707f1df8bea1"
      }
    }
  ]
}

When retrieving the endpoint of a specific subchapter, the response is the following.

{
  "body": {
    "access": [
      "search",
      "reporting"
    ],
    "chart": {
      "type": "list"
    },
    "name": "stats_simple",
    "query": {
      "column": "username",
      "filter": [
        {
          "column": "protocol",
          "is_exact": false,
          "is_inverted": false,
          "value": "ssh"
        },
        {
          "column": "username",
          "is_exact": false,
          "is_inverted": false,
          "value": "admin"
        }
      ],
      "limit": 15,
      "order": "top"
    }
  },
  "key": "496444806570e9c7e32c30",
  "meta": {
    "first": "/api/configuration/reporting/statistics_subchapters/21111736175707f1df8bea1",
    "href": "/api/configuration/reporting/statistics_subchapters/496444806570e9c7e32c30",
    "last": "/api/configuration/reporting/statistics_subchapters/496444806570e9c7e32c30",
    "next": null,
    "parent": "/api/configuration/reporting/statistics_subchapters",
    "previous": "/api/configuration/reporting/statistics_subchapters/1539306268570e9442cab6c",
    "transaction": "/api/transaction"
  }
}
Element Type Description
key string Top level element, contains the ID of the subchapter.
body Top level element (string) The elements of the subchapter.
access list

Required. List of access control groups whose members can access the subchapter.

To deny access to the subchapter, use "admin" as the only value for the element.

chart Top level element Defines the properties of the chart generated from the database query.
type string

Defines the chart type.

  • Use bar to generate a bar chart.

  • Use pie to generate pie a chart.

  • Use list to generate a list.

name string The name of the subchapter.
query string The search query that defines the connections to use for creating statistics. For details on using the search, see Searching in the session database.
Examples:

Create statistics about the 15 most common usernames used in SSH connections.

  • Create a bar chart.

    {
      "access": [
        "reporting",
        "search"
      ],
      "chart": {
        "type": "bar"
      },
      "name": "stats_bar",
      "query": {
        "column": "username",
        "filter": [
          {
            "column": "protocol",
            "is_exact": false,
            "is_inverted": false,
            "value": "ssh"
          }
        ],
        "limit": 15,
        "order": "top"
      }
    }
  • Create a pie chart.

    {
      "access": [
        "reporting",
        "search"
      ],
      "chart": {
        "type": "pie"
      },
      "name": "stats_pie",
      "query": {
        "column": "username",
        "filter": [
          {
            "column": "protocol",
            "is_exact": false,
            "is_inverted": false,
            "value": "ssh"
          }
        ],
        "limit": 15,
        "order": "top"
      }
    }
  • Create a list.

    {
        "access": [
          "reporting",
          "search"
        ],
        "chart": {
          "type": "list"
        },
        "name": "stats_list",
        "query": {
          "column": "username",
          "filter": [
            {
              "column": "protocol",
              "is_exact": false,
              "is_inverted": false,
              "value": "ssh"
            }
          ],
          "limit": 15,
          "order": "top"
        }
      }
Status and error codes

The following table lists the typical status and error codes for this request. For a complete list of error codes, see Application level error codes.

Code Description Notes
201 Created The new resource was successfully created.
400 InvalidQuery The requested filter or its value is invalid.
401 Unauthenticated The requested resource cannot be retrieved because the client is not authenticated and the resource requires authorization to access it. The details section contains the path that was attempted to be accessed, but could not be retrieved.
403 Unauthorized The requested resource cannot be retrieved because the client is not authorized to access it. The details section contains the path that was attempted to be accessed, but could not be retrieved.
404 NotFound The requested object does not exist.
Add a connection statistics subchapter

To add a connection statistics subchapter, you have to:

  1. Open a transaction.

    For more information, see Open a transaction.

  2. Create the JSON object for the new subchapter.

    POST the JSON object to the https://<IP-address-of-SPS>/api/configuration/reporting/statistics_subchapters/ endpoint. You can find a detailed description of the available parameters listed in Element .

    If the POST request is successful, the response includes the key of the new subchapter. For example:

    {
      "key": "769e627d-515d-4d26-a03e-cb2ed0bbee04",
      "meta": {
        "href": "/api/configuration/reporting/statistics_subchapters/769e627d-515d-4d26-a03e-cb2ed0bbee04",
        "parent": "/api/configuration/reporting/statistics_subchapters",
        "transaction": "/api/transaction"
      }
    }
  3. Commit your changes.

    For more information, see Commit a transaction.

Modify a connection statistics subchapter

To modify a subchapter, you have to:

  1. Open a transaction.

    For more information, see Open a transaction.

  2. Modify the JSON object of the subchapter.

    PUT the modified JSON object to the https://<IP-address-of-SPS>/api/configuration/reporting/statistics_subchapters//<key-of-the-subchapter> endpoint. You can find a detailed description of the available parameters listed in Element .

  3. Commit your changes.

    For more information, see Commit a transaction.

Health and maintenance

Topics:

Monitor appliance health status

To monitor the health status of an appliance, query the /api/health-status endpoint.

curl --cookie cookies https://<IP-address-of-SPS>/api/health-status

The following is a sample response received.

For details of the meta object, see Message format.

For details of the other objects, see tables Cluster status details and "issues" object details.

{
  "health_status": {
    "cpu": 5.4,
    "disk": 10.3,
    "load1": 1.93,
    "load15": 1.98,
    "load5": 2.01,
    "memory": 46.3,
    "sessions": {
    "http": 0,
    "ica": 0,
    "mssql": 0,
    "rdp": 0,
    "ssh": 0,
    "telnet": 0,
    "vnc": 0
   },
    "sessions_total": 0,
    "swap": 0,
    "system_details": {
      "cpu": {
        "guest": 0.0,
        "guest_nice": 0.0,
        "idle": 94.6,
        "iowait": 0.0,
        "irq": 0.0,
        "nice": 0.5,
        "softirq": 0.0,
        "steal": 1.0,
        "system": 1.0,
        "user": 3.0
       },
	"disk": {
	  "free": 26850131968,
	  "percent": 10.3,
	  "total": 31571550208,
	  "used": 3094085632
       },
	"memory": {
	  "active": 4459466752,
	  "available": 4492849152,
	  "buffers": 456245248,
	  "cached": 3229765632,
	  "free": 1336004608,
	  "inactive": 1984532480,
	  "percent": 46.3,
	  "shared": 249368576,
	  "total": 8364044288,
	  "used": 3342028800
       },
	"swap": {
	  "free": 0,
	  "percent": 0,
	  "sin": 0,
	  "sout": 0,
	  "total": 0,
	  "used": 0
       },
	"pipeline-queues": {
	  "session-events": 64.3,
	  "indexer-events": 40.0
	}
      }
    },
    "meta": {
    "href": "/api/health-status",
    "parent": "/api",
    "remaining_seconds": 600
    }
}
Elements Type Description

health_status

 

null or object

The health status of a node. When queried, it lists data related to the given node's health (in the case of HA, this means the current master node).

memory floating point number

Memory usage (percent)

disk floating point number Hard disk usage (percent)
swap floating point number Swap usage (percent)
cpu floating point number Overall CPU usage (percent)
load1 floating point number

The average system load during the last one minute.

load5 floating point number

The average system load during the last five-minute period.

load15 floating point number

The average system load during the last fifteen-minute period.

sessions string

The protocol type and the number of ongoing sessions. For example:

"sessions": {
  "ssh": 3,
  "rdp": 4
},
total_sessions integer (number of) The total number of ongoing sessions.
system_details JSON object Various details about the CPU, disk, memory and swap usage of the appliance. Note that the exact set of metrics is determined by the underlying kernel and system libraries, therefore it might change between different versions of Safeguard for Privileged Sessions without notice.

 

pipeline-queues

JSON object

Represents the fullness of the processing pipelines in percentages.

The number of CPUs determine the load a system can handle without causing the processes having to wait. As a generic rule of thumb, if the load is less than the number of processor cores of the appliance, the overall system load can be considered normal, otherwise it might be an indication of performance issues.

관련 문서

The document was helpful.

평가 결과 선택

I easily found the information I needed.

평가 결과 선택