Access Requests
An application or software running on your customer’s site, or running in the cloud as a SaaS (Software as a Service) application provided to your customer, will use items (a product, or feature, or some other technology resource) for which tokens can be charged. Each time these resources are used, a call—termed an access request—is made to Elastic Access to request use of the item so that the number of tokens required can be calculated and charged to an available line item. In addition, an entry is sent to the Data Warehouse to register that usage for analytics purposes.
There are two ways an access request can be made:
• | As a one-off request, see One-Off Access Requests. |
• | As part of a session to achieve repeated scheduled charges, see Session-Based Access Requests. |
A one-off request for use of items is achieved using the elastic/api/v1.0/instances/{instanceId}/access-request endpoint of the Product Licensing REST API. One-off requests can be useful in the following scenarios:
• | You are experimenting with Elastic Access concepts. |
• | An application allows an item to be used once only, where activity is not time-based. |
For an example that demonstrates a call to /access-request, see Exercise 4a: Running a One-Off Access Request.
Requesting Multiple Items in One-Off Access Request
If multiple items are requested in this one-off way, Elastic Access attempts to fulfill the request in the order the items are specified. If it cannot fulfill all items requested, it will make a “best effort” fulfillment. This includes:
• | Charging for as many items as possible in the order in which they were requested. |
• | Sending a success response for items that could be fulfilled. |
• | Returning an error response for the items that could not be fulfilled. |
A client application can make access requests as part of a session. A session is a timeline where a customer is repeatedly charged for using one or more items. During this period, the client application does not need to repeat its access requests to Elastic Access (although it may change the combination of items it is using at any time or notify that it has finished using them).
The client application makes a session-based access request by sending a PUT to the /api/v1.0/sessions/{sessionID} endpoint. The endpoints used to initiate and manage sessions and the session workflow are discussed in more depth in the Sessions section.
For an example that demonstrates a call to /api/v1.0/sessions/{sessionID}, see Exercise 4b: Running a Session-Based Access Request.
See also