A single training portal can hosted one or more workshops. The REST API endpoints for the workshops catalog provide a means to list the available workshops and get information on them.

Listing available workshops

The URL sub path for accessing the list of available workshop environments is /workshops/catalog/environments/. When making the request, the access token must be supplied in the HTTP Authorization header with type set as Bearer:

curl -v -H "Authorization: Bearer <access-token>" \
<training-portal-url>/workshops/catalog/environments/

The JSON response will be of the form:

{
  "portal": {
    "name": "educates-tutorials",
    "uid": "9b82a7b1-97db-4333-962c-97be6b5d7ee0",
    "generation": 451,
    "url": "<training_portal_url>",
    "sessions": {
      "maximum": 10,
      "registered": 0,
      "anonymous": 0,
      "allocated": 0
    }
  },
  "environments": [
    {
      "name": "educates-tutorials-w01",
      "state": "RUNNING",
      "workshop": {
        "name": "lab-et-self-guided-tour",
        "id": "15e5f1a569496f335049bb00c370ee20",
        "title": "Workshop Building Tutorial",
        "description": "A guided tour of how to build a workshop for your team's learning center.",
        "vendor": "",
        "authors": [],
        "difficulty": "",
        "duration": "",
        "tags": [],
        "logo": "",
        "url": "<workshop_repository_url"
      },
      "duration": 1800,
      "capacity": 10,
      "reserved": 0,
      "allocated": 0,
      "available": 0
    }
  ]
}

For each workshop listed under environments, where a field listed under workshop has the same name as it appears in the Workshop custom resource, it has the same meaning. The id field is an additional field which tries to uniquely identify a workshop based on the name of the workshop image, the Git repository for the workshop, or the web site hosting the workshop instructions. The value of the id field doesn't rely on the name of the Workshop resource and should be the same if same workshop details are used but the name of the Workshop resource is different.

The duration field provides the time in seconds after which the workshop environment will be expired. The value can be null if there is no expiration time for the workshop.

The capacity field is the maximum number of workshop sessions that can be created for the workshop.

The reserved field indicates how many instances of the workshop will be reserved as hot spares. These will be used to service requests for a workshop session. If no reserved instances are available and capacity has not been reached, a new workshop session will be created on demand.

The allocated field indicates how many workshop sessions are active and currently allocated to a user.

The available field indicates how many workshop sessions are available for immediate allocation. This will never be more than the number of reserved instances.

Under portal.sessions, the allocated field indicates the total number of allocated sessions across all workshops hosted by the portal.

Where maximum, registered and anonymous are non zero, they indicate caps on number of workshops that can be run.

The maximum indicates a maximum on the total number of workshop sessions that can be run by the portal across all workshops. Even where a specific workshop may not have reached capacity, if allocated for the whole portal has reached maximum, then no more workshop sessions will be able to be created.

The value of registered when non zero indicates a cap on the number of workshop sessions a single registered portal user can have running at the one time.

The value of anonymous when non zero indicates a cap on the number of workshop sessions an anonymous user can have running at the one time. Anonymous users are users created as a result of the REST API being used, or if anonymous access is enabled when accessing the portal via the web interface.

By default, only workshop environments which are currently marked with a state of RUNNING are returned. That is, those workshop environments which are taking new workshop session requests. If you also want to see the workshop environments which are currently in the process of being shutdown, you need to provide the state query string parameter to the REST API call and indicate which states workshop environments should be returned for.

curl -v -H "Authorization: Bearer <access-token>" \
https://lab-markdown-sample-ui.test/workshops/catalog/environments/?state=RUNNING&state=STOPPING

The state query string parameter can be included more than once to be able to see workshop environments in both RUNNING and STOPPING states.

Note that if anonymous access to the list of workshop environments is enabled and you are not authenticated when using the REST API endpoint, only workshop environments in a running state will be returned.

check-circle-line exclamation-circle-line close-line
Scroll to top icon