Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

CONNECT data services developer documentation

Stream Views

  • Last UpdatedJan 10, 2025
  • 6 minute read

The API in this section interacts with stream views.

List Stream Views

Returns a list of SdsStreamView.

Request

GET /api/v1/Tenants/{tenantId}/Namespaces/{namespaceId}/StreamViews
?query={query}&filter={filter}&skip={skip}&count={count}&orderby={orderby}

Parameters

string tenantId
Tenant identifier.

string namespaceId
Namespace identifier.

[optional] string query
Parameter representing a string search. See the Search in SDS topic for information about specifying the query parameter.

[optional] string filter
Filter expression.

[optional] integer skip
Parameter representing the zero-based offset of the first object to retrieve. If unspecified, a default value of 0 is used.

[optional] integer count
Parameter representing the maximum number of objects to retrieve. If unspecified, a default value of 100 is used.

[optional] string orderby
Parameter representing sorted order of returned objects. A field name is required. The sorting is based on the stored values for the given field.
For example, orderby=name would sort the returned results by the name values (ascending by default).
Additionally, a value can be provided along with the field name to identify whether to sort ascending or descending,
by using values asc or desc, respectively.
For example, orderby=name desc would sort the returned results by the name values, descending.
If no value is specified, there is no sorting of results.

Response

Status Code Body Type Description
200 SdsStreamView[] Returns a list of SdsStreamView objects
400 ErrorResponseBody Missing or invalid inputs
401 ErrorResponseBody Unauthorized
403 ErrorResponseBody Forbidden
404 ErrorResponseBody One of the resources specified was not found
500 ErrorResponseBody An error occurred while processing the request
503 ErrorResponseBody Service Unavailable

Example response body

200 Response

HTTP/1.1 200
Content-Type: application/json
[
{
    "Id":"StreamView",
    "Name":"StreamView",
    "SourceTypeId":"Simple",
    "TargetTypeId":"Simple3"
},
{
    "Id":"StreamViewWithProperties",
    "Name":"StreamViewWithProperties",
    "SourceTypeId":"Simple",
    "TargetTypeId":"Simple3",
    "Properties":[
        {
            "SourceId":"Time",
            "TargetId":"Time"
        },
        {
            "SourceId":"State",
            "TargetId":"State"
        },
        {
            "SourceId":"Measurement",
            "TargetId":"Value"
        }
    ]
}
]

400 Response (ErrorResponseBody)

{
  "OperationId": "string",
  "Error": "string",
  "Reason": "string",
  "Resolution": "string",
  "Parameters": {
    "property1": "string",
    "property2": "string"
  }
}

Get Stream View

Returns the SdsStreamView.

Request

GET /api/v1/Tenants/{tenantId}/Namespaces/{namespaceId}/StreamViews/{streamViewId}

Parameters

string tenantId
Tenant identifier.

string namespaceId
Namespace identifier.

string streamViewId
Stream view identifier.

Response

Status Code Body Type Description
200 SdsStreamView Returns the SdsStreamView
400 ErrorResponseBody Missing or invalid inputs
401 ErrorResponseBody Unauthorized
403 ErrorResponseBody Forbidden
404 ErrorResponseBody One of the resources specified was not found
500 ErrorResponseBody An error occurred while processing the request
503 ErrorResponseBody Service Unavailable

Example response body

200 Response

HTTP/1.1 200
Content-Type: application/json
{
    "Id":"StreamView",
    "Name":"StreamView",
    "SourceTypeId":"Simple",
    "TargetTypeId":"Simple3",
    "Properties":[
        {
            "SourceId":"Time",
            "TargetId":"Time"
        },
    {
        "SourceId":"State",
        "TargetId":"State"
    },
    {
        "SourceId":"Measurement",
        "TargetId":"Value"
    }
    ]
}

400 Response (ErrorResponseBody)

{
  "OperationId": "string",
  "Error": "string",
  "Reason": "string",
  "Resolution": "string",
  "Parameters": {
    "property1": "string",
    "property2": "string"
  }
}

Get Or Create Stream View

If an SdsStreamView with a matching identifier already exists, the stream view passed in is compared with the existing stream view. If the stream views are identical, a Found (302) status is returned and the stream view. If the stream views are different, the Conflict (409) error is returned. If no matching identifier is found, the specified stream view is created.

Request

POST /api/v1/Tenants/{tenantId}/Namespaces/{namespaceId}/StreamViews/{streamViewId}

Parameters

string tenantId
Tenant identifier.

string namespaceId
Namespace identifier.

string streamViewId
Stream view identifier.

Response

Status Code Body Type Description
200 SdsStreamView Returns the SdsStreamView
302 SdsStreamView Found a Stream View
400 ErrorResponseBody Missing or invalid inputs
401 ErrorResponseBody Unauthorized
403 ErrorResponseBody Forbidden
404 ErrorResponseBody One of the resources specified was not found
409 ErrorResponseBody Conflict
500 ErrorResponseBody An error occurred while processing the request
503 ErrorResponseBody Service Unavailable

Example response body

200 Response (SdsStreamView)

{
  "Id": "string",
  "Name": "string",
  "Description": "string",
  "SourceTypeId": "string",
  "TargetTypeId": "string",
  "Properties": [
    {
      "SourceId": "string",
      "TargetId": "string",
      "SdsStreamView": "<SdsStreamView>"
    }
  ],
  "CreatedDate": "2019-08-24T14:15:22Z",
  "ModifiedDate": "2019-08-24T14:15:22Z"
}

Create Or Update Stream View

Creates or updates the definition of a SdsStreamView.

Request

PUT /api/v1/Tenants/{tenantId}/Namespaces/{namespaceId}/StreamViews/{streamViewId}

Parameters

string tenantId
Tenant identifier.

string namespaceId
Namespace identifier.

string streamViewId
Stream view identifier.

Response

Status Code Body Type Description
200 SdsStreamView Returns the SdsStreamView
400 ErrorResponseBody Missing or invalid inputs
401 ErrorResponseBody Unauthorized
403 ErrorResponseBody Forbidden
404 ErrorResponseBody One of the resources specified was not found
409 ErrorResponseBody Conflict
500 ErrorResponseBody An error occurred while processing the request
503 ErrorResponseBody Service Unavailable

Example response body

200 Response (SdsStreamView)

{
  "Id": "string",
  "Name": "string",
  "Description": "string",
  "SourceTypeId": "string",
  "TargetTypeId": "string",
  "Properties": [
    {
      "SourceId": "string",
      "TargetId": "string",
      "SdsStreamView": "<SdsStreamView>"
    }
  ],
  "CreatedDate": "2019-08-24T14:15:22Z",
  "ModifiedDate": "2019-08-24T14:15:22Z"
}

Delete Stream View

Deletes a stream view from the specified tenant and namespace.

Request

DELETE /api/v1/Tenants/{tenantId}/Namespaces/{namespaceId}/StreamViews/{streamViewId}

Parameters

string tenantId
Tenant identifier.

string namespaceId
Namespace identifier.

string streamViewId
Stream view identifier.

Response

Status Code Body Type Description
204 None SdsStreamView was successfully deleted.
400 ErrorResponseBody Missing or invalid inputs
401 ErrorResponseBody Unauthorized
403 ErrorResponseBody Forbidden
404 ErrorResponseBody One of the resources specified was not found
500 ErrorResponseBody An error occurred while processing the request
503 ErrorResponseBody Service Unavailable

Get Stream View Map

Returns the SdsStreamViewMap corresponding to the specified streamViewId.

Request

GET /api/v1/Tenants/{tenantId}/Namespaces/{namespaceId}/StreamViews/{streamViewId}/Map

Parameters

string tenantId
Tenant identifier.

string namespaceId
Namespace identifier.

string streamViewId
Stream view identifier.

Response

Status Code Body Type Description
200 SdsStreamViewMap Returns the SdsStreamViewMap
400 ErrorResponseBody Missing or invalid inputs
401 ErrorResponseBody Unauthorized
403 ErrorResponseBody Forbidden
404 ErrorResponseBody One of the resources specified was not found
500 ErrorResponseBody An error occurred while processing the request
503 ErrorResponseBody Service Unavailable

Example response body

200 Response

HTTP/1.1 200
Content-Type: application/json
{
    "SourceTypeId": "Simple",
    "TargetTypeId": "Simple3",
    "Properties": [
        {
            "SourceId": "Time",
            "TargetId": "Time"
        },
        {
            "SourceId": "Measurement",
            "TargetId": "Value",
            "Mode": 20
        },
        {
            "SourceId": "State",
            "Mode": 2
        },
        {
            "TargetId": "State",
            "Mode": 1
        }
    ]
}

400 Response (ErrorResponseBody)

{
  "OperationId": "string",
  "Error": "string",
  "Reason": "string",
  "Resolution": "string",
  "Parameters": {
    "property1": "string",
    "property2": "string"
  }
}

Definitions

SdsStreamView

A contract defining the stream view.

Properties

Property Name Data Type Required Nullable Description
Id string false true A unique identifier for the SdsStreamView.
Name string false true An optional user-friendly name for the SdsStreamView.
Description string false true A brief description of the SdsStreamView.
SourceTypeId string false true Identifier of the SdsType of the SdsStream.
TargetTypeId string false true Identifier of the SdsType to convert events to.
Properties [SdsStreamViewProperty] false true List of SdsStreamViewProperty.
CreatedDate date-time false false The DateTime in ISO 8601 extended format and UTC time standard when the SdsStreamView was created. This value is set upon object creation and is immutable. The default value of the CreatedDate property of existing objects is DateTime.MinValue. This property cannot be modified by users.
ModifiedDate date-time false false The DateTime in ISO 8601 extended format and UTC time standard when the SdsStreamView was last modified. This value is initialized upon object creation and is updated each time an object's properties are successfully modified. The ModifiedDate property of an object will also update if the object's ACL or owner is modified. The default value of the ModifiedDate property of existing objects is DateTime.MinValue. This property cannot be modified by users.
{
  "Id": "string",
  "Name": "string",
  "Description": "string",
  "SourceTypeId": "string",
  "TargetTypeId": "string",
  "Properties": [
    {
      "SourceId": "string",
      "TargetId": "string",
      "SdsStreamView": "<SdsStreamView>"
    }
  ],
  "CreatedDate": "2019-08-24T14:15:22Z",
  "ModifiedDate": "2019-08-24T14:15:22Z"
}


SdsStreamViewProperty

A contract defining the stream view property.

Properties

Property Name Data Type Required Nullable Description
SourceId string false true Identifier of the SdsTypeProperty from the source SdsType Properties list.
TargetId string false true Identifier of the SdsTypeProperty from the target SdsType Properties list.
SdsStreamView SdsStreamView false true Additional mapping instructions for derived types.
{
  "SourceId": "string",
  "TargetId": "string",
  "SdsStreamView": {
    "Id": "string",
    "Name": "string",
    "Description": "string",
    "SourceTypeId": "string",
    "TargetTypeId": "string",
    "Properties": "[<SdsStreamViewProperty>]",
    "CreatedDate": "2019-08-24T14:15:22Z",
    "ModifiedDate": "2019-08-24T14:15:22Z"
  }
}


ErrorResponseBody

The error response contains standard details on the cause and resolution of the error.

Properties

Property Name Data Type Required Nullable Description
OperationId string false true Operation unique identifier of action that caused the error
Error string false true Error description
Reason string false true Reason for the error
Resolution string false true Resolution to resolve the error
Parameters object false true IDs or values that are creating or are affected by the error
{
  "OperationId": "string",
  "Error": "string",
  "Reason": "string",
  "Resolution": "string",
  "Parameters": {
    "property1": "string",
    "property2": "string"
  }
}


SdsStreamViewMap

A contract defining the stream view map.

Properties

Property Name Data Type Required Nullable Description
SourceTypeId string false true Identifier of the SdsType of the SdsStream.
TargetTypeId string false true Identifier of the SdsType to convert events to.
Properties [SdsStreamViewMapProperty] false true Identifier of the SdsStreamViewMapProperty from the target SdsType Properties list.
{
  "SourceTypeId": "string",
  "TargetTypeId": "string",
  "Properties": [
    {
      "SourceId": "string",
      "TargetId": "string",
      "Mode": 0,
      "StreamViewMap": "<SdsStreamViewMap>"
    }
  ]
}


SdsStreamViewMapProperty

A contract defining stream view map property.

Properties

Property Name Data Type Required Nullable Description
SourceId string false true Identifier of the SdsType of the SdsStream.
TargetId string false true Identifier of the SdsType to convert events to.
Mode SdsStreamViewMode false false Aggregate of actions applied to the properties. SdsStreamViewMode are combined via binary arithmetic.
StreamViewMap SdsStreamViewMap false true Mapping for derived types.
{
  "SourceId": "string",
  "TargetId": "string",
  "Mode": 0,
  "StreamViewMap": {
    "SourceTypeId": "string",
    "TargetTypeId": "string",
    "Properties": "[<SdsStreamViewMapProperty>]"
  }
}


SdsStreamViewMode

Enumerated Values

Property Value
None 0
FieldAdd 1
FieldRemove 2
FieldRename 4
FieldMove 8
FieldConversion 16
InvalidFieldConversion 32

In This Topic
TitleResults for “How to create a CRG?”Also Available in