Skip to content

Front page REST interface

Get metadata about front pages

Retrieve information about all the available front pages.

Definition

1
GET /api/front-page

Example request

1
curl -X GET "http://127.0.0.1:8080/api/front-page"

Example response

1
2
3
4
5
6
7
8
[
  {
    "user": "$default_user",
    "front_page_name": "Default front page"
  },
  {...},
  {...}
]

Arguments

None.

Returns

An array of front page objects.

Get metadata about front pages owned by a user

Retrieve information about all the available front pages owned by a specified user.

Definition

1
GET /api/front-page?user=USER_NAME

Example request

1
curl -X GET "http://127.0.0.1:8080/api/front-page?user=%24default_user"

Example response

1
2
3
4
5
6
7
8
[
  {
    "user": "$default_user",
    "front_page_name": "Default front page"
  },
  {...},
  {...}
]

Arguments

Argument Description
username Required. The string value of the username.

Returns

An array of front page objects owned by the specified user.

Get front page by name

Retrieve a front page.

Definition

1
GET /api/front-page/FRONTPAGE_NAME

Example request

1
curl -X GET "http://127.0.0.1:8080/api/front-page/Default%20front%20page"

Example response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
[
  {
    "items": [...],
    "name": "Memory usage",
    "type": "metric",
    "subType": "simple-numeric",
    "size": 4
  },
  {...},
  {...}
]

Arguments

None.

Returns

A front page object if a valid name was provided.

Create front page

Create a new front page entry in WombatOAM. For more details of the front_page value read the Front page JSON section.

Definition

1
PUT /api/front-page

Data

1
2
3
4
{
  "front_page_name": "My new front page name",
  "front_page": [...]
}

Example request

1
2
3
curl -X PUT "http://127.0.0.1:8080/api/front-page" \
     -H "Content-Type: application/json" \
     -d "{\"front_page_name\":\"My new front page name\", \"front_page\":[]}"

Example response

200 OK

Arguments

Argument Description
front_page_name Required. The name of the front page to be created.
front_page Required. The front page to be created.

Returns

In case of success, the HTTP response is 200 OK, and the new front page is stored.

Otherwise, HTTP 400 is sent with an error object:

1
{"error": "ERROR_REASON_STR"}

Update front page

Update an existing front page entry in WombatOAM. For more details of the front_page value read the Front page JSON section.

Definition

1
POST /api/front-page

Data

1
2
3
4
5
{
  "old_page_name": "Original page",
  "new_page_name": "My new front page name",
  "front_page": [...]
}

Example request

1
2
3
curl -X POST "http://127.0.0.1:8080/api/front-page" \
     -H "Content-Type: application/json" \
     -d "{\"old_page_name\":\"Original page\", \"new_page_name\":\"My new front page name\", \"front_page\":[]}"

Example response

200 OK

Arguments

Argument Description
old_page_name Required. The old name of the front page to be updated.
new_page_name Optional. The new name of the front page to be updated.
front_page Required. The front page to be updated.

Returns

In case of success, the HTTP response is 200 OK and the new front page is stored.

Otherwise, HTTP 400 is sent with an error object:

1
{"error": "ERROR_REASON_STR"}

Delete front page

Delete an existing front page entry in WombatOAM.

Definition

1
DELETE /api/front-page/FRONTPAGE_NAME

Example request

1
curl -X DELETE "http://127.0.0.1:8080/api/front-page/my%20page"

Example response

1
2
3
4
5
6
7
8
[
  {
    "user": "$default_user",
    "front_page_name": "Default front page"
  },
  {...},
  {...}
]

Arguments

Argument Description
front_page_name Required. The name of the front page to be deleted.

Returns

An array of front page objects.

Front page JSON

This section specifies a JSON structure called "front page JSON object". This structure is returned in the response of a get front page request. Also, when adding a new page or updating an existing one, a front page JSON object needs to be specified to describe how the page should look like.

The front page is a list of panels. An empty list represents a front page without any panel.

Each panel is a JSON object with the following mandatory fields:

  • items: Describes the contents of the panel.
  • name: The name of the panel.
  • type: The type of the panel can be list or metric.
  • subType: If type is list, then subType can be alarms or nodes. If type is metric, subType can be simple-numeric, live-numeric or histogram.
  • size: The width of the panel.

If the panel's subType is simple-numeric or histogram, then there should be an extra field: series. It defines the time interval of the metric data. The valid values are the following: 1, 2, 3, 5, 7.

Each item has 3 mandatory fields:

  • id: The identifier of the item.
  • type: The type of the item. Valid values are: node, nodeFamily, all.
  • name: The name of the item.

If an item is a metric, then it have to have a 4th field. The key is metric and the value is an object that describes the metric. It has 6 fields:

  • name: The name of the metric.
  • type: Valid types are counter and gauge.
  • display: This text will appear on the dashboard.
  • unit: Valid units are byte, numeric and percentage.
  • origin: The metric group's name.
  • active: Boolean value.