Chapter 5. Invoking the Data Grid REST API

download PDF

Data Grid services expose a REST endpoint at port 8443.

By default, Data Grid requires user authentication for data access and encryption for client connections.

Data Grid authorizes data access requests with credentials that you specify with the APPLICATION_USER and APPLICATION_PASSWORD parameters.
When Data Grid pods start they generate TLS certificate/key pairs and save them in the service-certs secret. The TLS certificates are signed by the OpenShift certificate authority (CA).

5.1. Creating External Routes to the REST API

REST clients running outside OpenShift access Data Grid pods through routes with reencrypt termination.


  1. Create a route with reencrypt termination.

    $ oc create route reencrypt ${ROUTE_NAME} \
      --port=https \
      --service ${APPLICATION_NAME}

    For example:

    $ oc create route reencrypt cache-service-https-route \
      --port=https \
      --service cache-service
  2. Run oc get routes to find the HTTPS route hostname, for example:

    $ oc get routes
    NAME                         HOST/PORT

5.2. Making REST Calls


  • Configure REST clients for authentication and encryption.

    On OpenShift
    Create truststores with the CA bundle mounted in the pod at:
    Outside OpenShift
    Create truststores with the CA for your OpenShift environment.


  • Invoke the Data Grid REST API as appropriate.

    For example, invoke a PUT call to add a key:value pair:

    curl -X PUT \
      -u ${USERNAME}:${PASSWORD} \
      -H 'Content-type: text/plain' \
      -d 'world' \

5.2.1. Using the OpenShift CA to Make REST Calls

In cases where the CA certificate is not valid, such as local OpenShift clusters or Red Hat OpenShift Container Platform development installations, you can use service-ca.crt to make REST calls.


  1. Get service-ca.crt from Data Grid pods.

    $ oc rsync ${pod_name}:/var/run/secrets/ .
  2. Pass service-ca.crt when you invoke REST calls.

    curl -X PUT \
      -u ${USERNAME}:${PASSWORD} \
      --cacert service-ca.crt \
      -H 'Content-type: text/plain' \
      -d 'world' \
Red Hat logoGithubRedditYoutubeTwitter


Try, buy, & sell


About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.