Metadata Rule Preview
- Last UpdatedJul 28, 2022
- 5 minute read
Get Preview Results
Returns a RulePreviewResult.
Request
GET /api/v1/tenants/{tenantId}/namespaces/{namespaceId}/preview/metadatarules
?token={token}&skip={skip}&count={count}
Parameters
string tenantId
Tenant identifier.string namespaceId
Namespace identifier.string token
A Guid which corresponds to a preview that has been created using the StartPreview method.integer skip
An Int32 to determine the number of preview results to skip.
[optional] integer count
An Int32 to determine the number of preview results to return.
Response
| Status Code | Body Type | Description |
|---|---|---|
| 200 | RulePreviewResult | A RulePreviewResult object. |
| 400 | ResponseBody | Missing or invalid inputs. |
| 403 | ResponseBody | Forbidden. |
| 404 | ResponseBody | The specified preview was not found. |
| 500 | ResponseBody | Internal server error. |
Example response body
200 Response
{
"Status": "complete",
"Results": [
{
"Name": "name",
"Id": "id",
"Description": "description",
"NewMetadata": {
"key": "value"
},
"UpdatedMetadata": {
"key": "value"
},
"RemovedMetadata": {
"key": "value"
}
}
],
"Statistics": {
"StreamsAffected": 1,
"NewMetadataKeys": 1,
"NewMetadataValues": 1,
"UpdatedMetadataValues": 1,
"RemovedMetadataKeys": 1,
"TotalResults": 1,
"PageCount": 1
}
}
400 Response
{
"OperationId": "00000000-0000-0000-0000-000000000000",
"Error": "Error message.",
"Reason": "Reason that caused the error.",
"Resolution": "Possible resolution for the error.",
"Parameters": {
"key1": "value1",
"key2": "value2"
}
}
403 Response
{
"OperationId": "00000000-0000-0000-0000-000000000000",
"Error": "Error message.",
"Reason": "Reason that caused the error.",
"Resolution": "Possible resolution for the error.",
"Parameters": {
"key1": "value1",
"key2": "value2"
}
}
404 Response
{
"OperationId": "00000000-0000-0000-0000-000000000000",
"Error": "Error message.",
"Reason": "Reason that caused the error.",
"Resolution": "Possible resolution for the error.",
"Parameters": {
"key1": "value1",
"key2": "value2"
}
}
500 Response
{
"OperationId": "00000000-0000-0000-0000-000000000000",
"Error": "Error message.",
"Reason": "Reason that caused the error.",
"Resolution": "Possible resolution for the error.",
"Parameters": {
"key1": "value1",
"key2": "value2"
}
}
Start Preview
Creates a RulePreviewResponse of a RuleModel object.
Request
POST /api/v1/tenants/{tenantId}/namespaces/{namespaceId}/preview/metadatarules
?KeepOldMetadata={KeepOldMetadata}&Skip={Skip}&Count={Count}&PageSize={PageSize}
Parameters
string tenantId
Tenant identifier.string namespaceId
Namespace identifier.
[optional] boolean KeepOldMetadata
A Boolean to determine whether or not existing metadata created by the rule should be preserved if the rule were deleted.
Defaults to false.[optional] integer Skip
An Int32 to determine how many results to skip.[optional] integer Count
An Int32 to determine how many results to return.[optional] integer PageSize
Request Body
The RuleModel object to preview.
{
"Id": "ruleId",
"Name": "name",
"Description": "description",
"ExampleStreamId": "exampleId",
"AutomationId": "00000000-0000-0000-0000-000000000000",
"State": "Started",
"Expressions": [
{
"Field": "Id",
"Specification": [
{
"Type": "Wildcard",
"Name": "id"
}
]
}
],
"Outputs": [
{
"Field": "Metadata",
"Value": {
"key": "{id}"
}
}
],
"CreationTime": "0001-01-01T00:00:00",
"ModifiedTime": "0001-01-01T00:00:00",
"ErrorInfo": {
"ErrorCount": 2
}
}
Response
| Status Code | Body Type | Description |
|---|---|---|
| 202 | RulePreviewResponse | A RulePreviewResponse object. |
| 204 | ResponseBody | A RulePreviewResponse object. |
| 400 | ResponseBody | Missing or invalid inputs. |
| 403 | ResponseBody | Forbidden. |
| 500 | ResponseBody | Internal server error. |
| 503 | ResponseBody | Dependent service error. |
Example response body
202 Response
{
"PreviewLink": "/api/v1/tenants/{tenantId}/namespaces/{namespaceId}/preview/metadatarules?Token=00000000-0000-0000-0000-000000000000",
"Expires": 7200
}
204 Response
{
"OperationId": "00000000-0000-0000-0000-000000000000",
"Error": "Error message.",
"Reason": "Reason that caused the error.",
"Resolution": "Possible resolution for the error.",
"Parameters": {
"key1": "value1",
"key2": "value2"
}
}
400 Response
{
"OperationId": "00000000-0000-0000-0000-000000000000",
"Error": "Error message.",
"Reason": "Reason that caused the error.",
"Resolution": "Possible resolution for the error.",
"Parameters": {
"key1": "value1",
"key2": "value2"
}
}
403 Response
{
"OperationId": "00000000-0000-0000-0000-000000000000",
"Error": "Error message.",
"Reason": "Reason that caused the error.",
"Resolution": "Possible resolution for the error.",
"Parameters": {
"key1": "value1",
"key2": "value2"
}
}
500 Response
{
"OperationId": "00000000-0000-0000-0000-000000000000",
"Error": "Error message.",
"Reason": "Reason that caused the error.",
"Resolution": "Possible resolution for the error.",
"Parameters": {
"key1": "value1",
"key2": "value2"
}
}
503 Response
{
"OperationId": "00000000-0000-0000-0000-000000000000",
"Error": "Error message.",
"Reason": "Reason that caused the error.",
"Resolution": "Possible resolution for the error.",
"Parameters": {
"key1": "value1",
"key2": "value2"
}
}
Cancel Preview
Cancels a running preview.
Request
DELETE /api/v1/tenants/{tenantId}/namespaces/{namespaceId}/preview/metadatarules
?token={token}
Parameters
string tenantId
Tenant identifier.string namespaceId
Namespace identifier.string token
A Guid which corresponds to a preview that has been created using the StartPreview method.
Response
| Status Code | Body Type | Description |
|---|---|---|
| 204 | None | No content. |
| 400 | ResponseBody | Missing or invalid inputs. |
| 403 | ResponseBody | Forbidden. |
| 404 | ResponseBody | The specified preview was not found. |
| 500 | ResponseBody | Internal server error. |
Definitions
RulePreviewResponse
Properties
| Property Name | Data Type | Required | Nullable | Description |
|---|---|---|---|---|
| PreviewLink | string | false | true | None |
| Expires | int32 | false | false | None |
{
"PreviewLink": "string",
"Expires": 0
}
ResponseBody
Properties
| Property Name | Data Type | Required | Nullable | Description |
|---|---|---|---|---|
| OperationId | string | false | true | None |
| Error | string | false | true | None |
| Reason | string | false | true | None |
| Resolution | string | false | true | None |
| Parameters | object | false | true | None |
{
"OperationId": "00000000-0000-0000-0000-000000000000",
"Error": "Error message.",
"Reason": "Reason that caused the error.",
"Resolution": "Possible resolution for the error.",
"Parameters": {
"key1": "value1",
"key2": "value2"
}
}
RuleModel
Properties
| Property Name | Data Type | Required | Nullable | Description |
|---|---|---|---|---|
| Id | string | false | true | None |
| Name | string | false | true | None |
| Description | string | false | true | None |
| ExampleStreamId | string | false | true | None |
| AutomationId | string | false | true | None |
| State | RuleStateEnum | false | false | None |
| Expressions | [RuleExpression] | false | true | None |
| Outputs | [RuleOutput] | false | true | None |
| CreationTime | date-time | false | false | None |
| ModifiedTime | date-time | false | false | None |
{
"Id": "ruleId",
"Name": "name",
"Description": "description",
"ExampleStreamId": "exampleId",
"AutomationId": "00000000-0000-0000-0000-000000000000",
"State": "Started",
"Expressions": [
{
"Field": "Id",
"Specification": [
{
"Type": "Wildcard",
"Name": "id"
}
]
}
],
"Outputs": [
{
"Field": "Metadata",
"Value": {
"key": "{id}"
}
}
],
"CreationTime": "0001-01-01T00:00:00",
"ModifiedTime": "0001-01-01T00:00:00",
"ErrorInfo": {
"ErrorCount": 2
}
}
RuleStateEnum
Enumerated Values
| Property | Value | Description |
|---|---|---|
| Started | 0 | |
| Stopped | 1 |
RuleExpression
Properties
| Property Name | Data Type | Required | Nullable | Description |
|---|---|---|---|---|
| Field | string | false | true | None |
| Specifications | [Specification] | false | true | None |
{
"Field": "string",
"Specifications": [
{
"Type": 0,
"Value": "string",
"Name": "string",
"CharacterType": 0,
"CharacterLength": 0,
"StrictValueMappings": true,
"RequiredDelimiters": [
"string"
],
"ValueMappings": {
"property1": "string",
"property2": "string"
}
}
]
}
Specification
Properties
| Property Name | Data Type | Required | Nullable | Description |
|---|---|---|---|---|
| Type | SpecificationType | false | false | None |
| Value | string | false | true | None |
| Name | string | false | true | None |
| CharacterType | CharacterType | false | false | None |
| CharacterLength | int32 | false | true | Null represents the longest string length within the group. |
| StrictValueMappings | boolean | false | false | None |
| RequiredDelimiters | string[] | false | true | None |
| ValueMappings | object | false | true | None |
{
"Type": 0,
"Value": "string",
"Name": "string",
"CharacterType": 0,
"CharacterLength": 0,
"StrictValueMappings": true,
"RequiredDelimiters": [
"string"
],
"ValueMappings": {
"property1": "string",
"property2": "string"
}
}
SpecificationType
Enumerated Values
| Property | Value |
|---|---|
| Unspecified | 0 |
| Group | 1 |
| Wildcard | 2 |
| Literal | 3 |
| Delimiter | 4 |
CharacterType
Enumerated Values
| Property | Value |
|---|---|
| Any | 0 |
| Letter | 1 |
| Digit | 2 |
| Alphanumeric | 3 |
RuleOutput
Properties
| Property Name | Data Type | Required | Nullable | Description |
|---|---|---|---|---|
| Field | string | false | true | None |
| Value | any | false | true | None |
{
"Field": "string",
"Value": null
}
RulePreviewResult
Properties
| Property Name | Data Type | Required | Nullable | Description |
|---|---|---|---|---|
| Status | string | false | true | None |
| Results | [StreamPreviewData] | false | true | None |
| Statistics | RulePreviewStatistics | false | true | None |
{
"Status": "complete",
"Results": [
{
"Name": "name",
"Id": "id",
"Description": "description",
"NewMetadata": {
"key": "value"
},
"UpdatedMetadata": {
"key": "value"
},
"RemovedMetadata": {
"key": "value"
}
}
],
"Statistics": {
"StreamsAffected": 1,
"NewMetadataKeys": 1,
"NewMetadataValues": 1,
"UpdatedMetadataValues": 1,
"RemovedMetadataKeys": 1,
"TotalResults": 1,
"PageCount": 1
}
}
StreamPreviewData
Properties
| Property Name | Data Type | Required | Nullable | Description |
|---|---|---|---|---|
| Name | string | false | true | None |
| Id | string | false | true | None |
| Description | string | false | true | None |
| NewMetadata | object | false | true | None |
| UpdatedMetadata | object | false | true | None |
| UnchangedMetadata | object | false | true | None |
| RemovedMetadata | object | false | true | None |
{
"Name": "string",
"Id": "string",
"Description": "string",
"NewMetadata": {
"property1": "string",
"property2": "string"
},
"UpdatedMetadata": {
"property1": "string",
"property2": "string"
},
"UnchangedMetadata": {
"property1": "string",
"property2": "string"
},
"RemovedMetadata": {
"property1": "string",
"property2": "string"
}
}
RulePreviewStatistics
Properties
| Property Name | Data Type | Required | Nullable | Description |
|---|---|---|---|---|
| StreamsAffected | int32 | false | false | None |
| NewMetadataKeys | int32 | false | false | None |
| NewMetadataValues | int32 | false | false | None |
| UpdatedMetadataValues | int32 | false | false | None |
| UnchangedMetadataValues | int32 | false | false | None |
| RemovedMetadataKeys | int32 | false | false | None |
| TotalResults | int32 | false | false | None |
| PageCount | int32 | false | false | None |
{
"StreamsAffected": 0,
"NewMetadataKeys": 0,
"NewMetadataValues": 0,
"UpdatedMetadataValues": 0,
"UnchangedMetadataValues": 0,
"RemovedMetadataKeys": 0,
"TotalResults": 0,
"PageCount": 0
}