Metadata Rule Suggestion
- Last UpdatedSep 20, 2022
- 4 minute read
Get Suggestion Results
Returns a SuggestionResult.
Request
GET /api/v1/tenants/{tenantId}/namespaces/{namespaceId}/suggestion/metadatarules
?token={token}
Parameters
string tenantId
Tenant identifier.string namespaceId
Namespace identifier.string token
A Guid which corresponds to a SuggestionResponse that has been created using the !:StartSuggestion method.
Response
| Status Code | Body Type | Description |
|---|---|---|
| 200 | SuggestionResult | A SuggestionResult object. |
| 400 | ResponseBody | Missing or invalid inputs. |
| 403 | ResponseBody | Forbidden. |
| 404 | ResponseBody | The specified suggestion was not found. |
| 500 | ResponseBody | Internal server error. |
Example response body
200 Response
{
"Status": "complete",
"Result": {
"key1": [
"value1",
"value2"
],
"key2": [
"value1",
"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"
}
}
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 Suggestion
Creates a SuggestionResponse for a RuleModel object.
Request
POST /api/v1/tenants/{tenantId}/namespaces/{namespaceId}/suggestion/metadatarules
?token={token}
Parameters
string tenantId
Tenant identifier.string namespaceId
Namespace identifier.boolean token
The !:Token toggles paging token
Request Body
The RuleModel object to create a suggestion for.
{
"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 | SuggestionResponse | A SuggestionResponse object. |
| 204 | ResponseBody | A SuggestionResponse 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
{
"SuggestionLink": "/api/v1/tenants/{tenantId}/namespaces/{namespaceId}/suggestion/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 Suggestion
Cancels a running suggestion query.
Request
DELETE /api/v1/tenants/{tenantId}/namespaces/{namespaceId}/suggestion/metadatarules
?token={token}
Parameters
string tenantId
Tenant identifier.string namespaceId
Namespace identifier.string token
A Guid which corresponds to a SuggestionResponse that has been created using the !:StartSuggestion 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
SuggestionResponse
Properties
| Property Name | Data Type | Required | Nullable | Description |
|---|---|---|---|---|
| SuggestionLink | string | false | true | None |
| Expires | int32 | false | false | None |
{
"SuggestionLink": "/api/v1/tenants/{tenantId}/namespaces/{namespaceId}/suggestion/metadatarules?Token=00000000-0000-0000-0000-000000000000",
"Expires": 7200
}
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
}
SuggestionResult
Properties
| Property Name | Data Type | Required | Nullable | Description |
|---|---|---|---|---|
| Status | string | false | true | None |
| Result | object | false | true | None |
{
"Status": "complete",
"Result": {
"key1": [
"value1",
"value2"
],
"key2": [
"value1",
"value2"
]
}
}