[Version 8.6.1 and later]

Lesson 5: Running cache operations with the REST API

In this lesson, you will POST a cache entry into testgrid1 data grid that uses the REST API. For the purposes of this tutorial, you will run this task as a user.

Before you begin

  • Log off from the XSLD console as the administrator user and log back on as the general user, jsmith you created in Lesson 3. To log off the XSLD console, click the person icon from the XSLD console, and then click logout xsadmin to log off.
  • Log on to the XSLD console with the user name and password that you created in Lesson 3. Since this user, jsmith, belongs in the acmeGroup that is associated with the data grid testgrid1, this user can run caching operations against the testgrid1 data grid.

Procedure

  1. Open the IBM® API discovery tool and point the browser to the Operational REST server, which is located at https://<hostname.domain.com>:9444/ibm/api/explorer where <hostname.domain.com> is the fully qualified host name of the cache member group.
    Note: Depending on the role that is assigned to this user, different REST APIs are enabled or disabled based on the assigned role of the user logged in to the tool.
  2. Click grids: API for CRUD operations on a grid link from the API discovery tool.
  3. Click POST, and specify the following parameters:
    1. Specify testgrid1 in the gridname field.
    2. Specify testgrid1 in the mapname field.
    3. Specify key1 in the key field.
    4. Specify value1 in the body.
    5. Choose text/plain from the Parameter/content type list.
  4. Click Try it out! to submit the POST request.

Results

A "Response Code” of 200 indicates that a new cache entry was inserted into the testgrid1 cache successfully.