Alert Templates Ingestion

About Alert Template Ingestion

Alert template ingestion requires that you add an alert template source to the tenant before you can ingest alert templates. For more information, refer to the Ingestion documentation.

Add an Alert Template Source

Before ingesting an alert template, you must add an alert template source to the tenant.

Before You Begin

You need the following:

  • Ingestion payload for creating an alert template source in JSON format.
  • Obtain the ingestion URL for creating an alert template source from your system administrator.
  • Oauth token to connect to the REST API endpoint.
    Important: Make sure you have a valid unexpired token. Tokens are client specific and usually expire within a set time.
  • From the Setup section get the following information:
    • Client ID
    • Username
  • Ingestion Password that was created during initial tenant setup.
  • Access to a REST client such as Postman or Advanced REST client.

About This Task

You must add an alert template source to your tenant before you can ingest alert templates.

Procedure

  1. Open your REST client.
  2. Enter the ingestion URL in the HOST value field.
  3. Select the POST method.
  4. In Headers, add the following key-value pairs.
    ParameterDescription
    AuthorizationEnter the token_type followed by a space, then the access_token from the response you previously obtained. For example, bearer eyJhbGciOiJSUzI1NiJ9.A... The following code sample includes a bearer token:
    {
      "access_token": "eyJhbGciOiJSUzI1NiJ9.A...",
      "token_type": "bearer",
      "refresh_token": "eyJhbGciOiJSUzI1NiJ9.e..",
      "expires_in": 86399,
      "scope": "openid",
      "jti": "5e2c90ea-9edd-4da1-80c8-4a0d67f77ef3"
    }
    TenantThe unique ID for the tenant (for example, 07F28C049E0F4F29B8E85E4A6C916D7F)
  5. Select application/json as Content-Type .
  6. Paste the JSON payload into the request body.
    A sample JSON payload is shown below:
    {
      "name" : "Source System 1",
      "description" : "Source System 1 description"
    }

Results

On successful acceptance, you receive a 201 Created in the JSON response.

Example

HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 274

{
  "uuid" : "0188015D6FB54937BC82452F3F21D7BF",
  "isActive" : true,
  "createdOn" : 1457478555853,
  "updatedOn" : 1457478555853,
  "id" : 46244,
  "name" : "Source System 1",
  "description" : "Source System 1 description",
  "tenantUuid" : "A5BE798652EE43F0BDE0CA20A7239BBB"
}

What To Do Next

You can ingest alert templates for the alert template source into your tenant.

Ingest Alert Templates

You must have created at least one alert source before you ingest alert templates into Predix Essentials.

Before You Begin

You will need the following:
  • At least one alert template source added to your tenant.
  • Ingestion payload for alert templates in JSON format.
  • Obtain the ingestion URL for creating an alert template source from your system administrator.
  • Oauth token to ingest alerts.
    Important: Make sure you have a valid unexpired token. Tokens are client specific and usually expire within a set time.
  • From the Setup section get the following information:
    • Client ID
    • Username
  • Ingestion Password that was created during initial tenant setup.
  • Access to a REST client such as Postman or Advanced REST client.

About This Task

You can use the alert profile REST service endpoint to perform bulk alert profile ingestion from your source system.

Procedure

  1. Open your REST client.
  2. Enter the ingestion URL in the HOST value field.
  3. Select the POST method.
  4. In Headers, add the following parameters (key-value pairs).
    ParameterDescription
    AuthorizationEnter the token_type followed by a space, then the access_token from the response you previously obtained. For example, bearer eyJhbGciOiJSUzI1NiJ9.A... The following code sample includes a bearer token:
    {
      "access_token": "eyJhbGciOiJSUzI1NiJ9.A...",
      "token_type": "bearer",
      "refresh_token": "eyJhbGciOiJSUzI1NiJ9.e..",
      "expires_in": 86399,
      "scope": "openid",
      "jti": "5e2c90ea-9edd-4da1-80c8-4a0d67f77ef3"
    }
    TenantThe unique ID for the tenant (for example, 07F28C049E0F4F29B8E85E4A6C916D7F)
  5. Select application/json as Content-Type.
  6. Paste the JSON payload into the request body.
    A sample JSON payload is shown below:
    {
      "isActive" : true,
      "createdOn" : 1457478557569,
      "tenantUuid" : "A5BE798652EE43F0BDE0CA20A7239BBB",
      "name" : "TemplateBuilderName2",
      "description" : "Template Builder Description2",
      "source" : "/v1/profileSources/46246",
      "severity" : 3,
      "type" : "/v1/profileType/46349",
      "isConsumable" : true,
      "isTrip" : false,
      "validateAsset" : true
    }

Results

On successful acceptance, you receive a 201 Created in the JSON response.

Example

HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 1028

{
  "uuid" : "7BBCF0460BCE4E769689F23C2B9D163C",
  "isActive" : true,
  "createdOn" : 1457478558737,
  "updatedOn" : 1457478558737,
  "id" : 32539,
  "tenantUuid" : "A5BE798652EE43F0BDE0CA20A7239BBB",
  "name" : "TemplateBuilderName2",
  "description" : "Template Builder Description2",
  "source" : {
    "uuid" : "A169DB7623674D2FB307B2212C749714",
    "isActive" : true,
    "createdOn" : 1457478557567,
    "updatedOn" : 1457478557567,
    "id" : 46246,
    "name" : "TemplateSourceBuilderName",
    "description" : "Template Source Builder Description",
    "tenantUuid" : "A5BE798652EE43F0BDE0CA20A7239BBB"
  },
  "severity" : 3,
  "type" : {
    "uuid" : "D1E6529F71AD49D99E6DF048F721CDF7",
    "isActive" : true,
    "createdOn" : 1457478557564,
    "updatedOn" : 1457478557564,
    "id" : 46349,
    "name" : "TemplateType Builder Name",
    "description" : "Template Type Builder Description",
    "tenantUuid" : "A5BE798652EE43F0BDE0CA20A7239BBB"
  },
  "isConsumable" : true,
  "isTrip" : false,
  "validateAsset" : true
}

What To Do Next

You can ingest alerts into your tenant.