Lesson 3 Creating a metric record
Create a metric data record and upload it to HCL™ Accelerate.
Before you begin
About this task
In the last lesson, you uploaded a metric definition for the data type "Tutorial Definition" to HCL™ Accelerate. In this lesson, you create a data record for that type and upload it.
To create a metric data record, complete the following steps:
Procedure
-
Create a curl POST request for the data record.
Most of these fields are familiar to you from the first lesson.
curl -X POST "https://my_velocity:port/api/v1/metrics" \ -H "accept: application/json" \ -H "Authorization: UserAccessKey my_user_access_token" \ -H "Content-Type: application/json" \ -k \ -v \ -d '{ "tenantId": "my_tenant_id", "dataSet": "Tutorial data set", "record": { "metricDefinitionName": "Tutorial Definition", "recordName": "My tutorial record", "pluginType": "plugin", "dataFormat": "custom", "executionDate": 1570028414997, "value": { "north": 199, "south": 322, "east": 485, "west": 234 }, "description": "Tutorial data record" }, "application": { "name": "Metric Tutorial" } }'
The
record
object defines the record. You can associate a record to its metric definition by using themetricDefinitionId
, ormetricDefinitionName
property, as we do here. ThepluginType
property is set to the generic value of "plugin". TheexecutionDate
value must be in milliseconds.The
value
object can have an arbitrary number of name-value pairs. The values defined in this property are displayed on the chart. Create enough values to make the chart interesting.The
application
property defines the application to which this record belongs. "Application" can refer to an integrated application, such as an HCL™ Launch application, or a set of metric records, among other things. In this tutorial, "Metric Tutorial" refers simply to the record that you upload. -
Run the curl command
The record is uploaded to HCL™ Accelerate. To confirm this, expand the dashboard's Applications list, as shown in the following graphic.
Figure 1. Tutorial application listed
Results
In this lesson, you created a metric data record of the "Tutorial Definition" type and uploaded it to HCL™ Accelerate.