Time Series Hierarchies - Execute Batch

Executes a batch get, create, update, delete operation on multiple time series hierarchy definitions.

POST https://{environmentFqdn}/timeseries/hierarchies/$batch?api-version=2020-07-31

URI Parameters

Name In Required Type Description
environmentFqdn
path True

string

Per environment FQDN, for example 10000000-0000-0000-0000-100000000109.env.timeseries.azure.com. You can obtain this domain name from the response of the Get Environments API, Azure portal, or Azure Resource Manager.

api-version
query True

string

Version of the API to be used with the client request. Currently supported version is "2020-07-31".

Request Header

Name Required Type Description
x-ms-client-request-id

string

Optional client request ID. Service records this value. Allows the service to trace operation across services, and allows the customer to contact support regarding a particular request.

x-ms-client-session-id

string

Optional client session ID. Service records this value. Allows the service to trace a group of related operations across services, and allows the customer to contact support regarding a particular group of requests.

Request Body

Name Type Description
delete

HierarchiesRequestBatchGetDelete

"delete" should be set while fetching specific hierarchies either by IDs or names.

get

HierarchiesRequestBatchGetDelete

"get" should be set while fetching specific hierarchies either by IDs or names.

put

TimeSeriesHierarchy[]

"put" should be set while creating or updating hierarchies.

Responses

Name Type Description
200 OK

HierarchiesBatchResponse

Successful operation.

Headers

x-ms-request-id: string

Other Status Codes

TsiError

Unexpected error.

Headers

x-ms-request-id: string

Security

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

HierarchiesBatchDeleteByIds
HierarchiesBatchDeleteByNames
HierarchiesBatchGetByIds
HierarchiesBatchGetByNames
HierarchiesBatchPut

HierarchiesBatchDeleteByIds

Sample Request

POST https://10000000-0000-0000-0000-100000000109.env.timeseries.azure.com/timeseries/hierarchies/$batch?api-version=2020-07-31

{
  "delete": {
    "hierarchyIds": [
      "a28fd14c-6b98-4ab5-9301-3840f142d30e"
    ]
  }
}

Sample Response

{
  "delete": [
    null
  ]
}

HierarchiesBatchDeleteByNames

Sample Request

POST https://10000000-0000-0000-0000-100000000109.env.timeseries.azure.com/timeseries/hierarchies/$batch?api-version=2020-07-31

{
  "delete": {
    "names": [
      "WindFarm"
    ]
  }
}

Sample Response

{
  "delete": [
    null
  ]
}

HierarchiesBatchGetByIds

Sample Request

POST https://10000000-0000-0000-0000-100000000109.env.timeseries.azure.com/timeseries/hierarchies/$batch?api-version=2020-07-31

{
  "get": {
    "hierarchyIds": [
      "6e292e54-9a26-4be1-9034-607d71492707",
      "a28fd14c-6b98-4ab5-9301-3840f142d30e"
    ]
  }
}

Sample Response

{
  "get": [
    {
      "hierarchy": {
        "id": "6e292e54-9a26-4be1-9034-607d71492707",
        "name": "Location",
        "source": {
          "instanceFieldNames": [
            "state",
            "city"
          ]
        }
      }
    },
    {
      "hierarchy": {
        "id": "a28fd14c-6b98-4ab5-9301-3840f142d30e",
        "name": "ManufactureDate",
        "source": {
          "instanceFieldNames": [
            "year",
            "month"
          ]
        }
      }
    }
  ]
}

HierarchiesBatchGetByNames

Sample Request

POST https://10000000-0000-0000-0000-100000000109.env.timeseries.azure.com/timeseries/hierarchies/$batch?api-version=2020-07-31

{
  "get": {
    "names": [
      "Location",
      "ManufactureDate"
    ]
  }
}

Sample Response

{
  "get": [
    {
      "hierarchy": {
        "id": "6e292e54-9a26-4be1-9034-607d71492707",
        "name": "Location",
        "source": {
          "instanceFieldNames": [
            "state",
            "city"
          ]
        }
      }
    },
    {
      "hierarchy": {
        "id": "a28fd14c-6b98-4ab5-9301-3840f142d30e",
        "name": "ManufactureDate",
        "source": {
          "instanceFieldNames": [
            "year",
            "month"
          ]
        }
      }
    }
  ]
}

HierarchiesBatchPut

Sample Request

POST https://10000000-0000-0000-0000-100000000109.env.timeseries.azure.com/timeseries/hierarchies/$batch?api-version=2020-07-31

{
  "put": [
    {
      "id": "6e292e54-9a26-4be1-9034-607d71492707",
      "name": "Location",
      "source": {
        "instanceFieldNames": [
          "state",
          "city"
        ]
      }
    },
    {
      "id": "a28fd14c-6b98-4ab5-9301-3840f142d30e",
      "name": "ManufactureDate",
      "source": {
        "instanceFieldNames": [
          "year",
          "month"
        ]
      }
    }
  ]
}

Sample Response

{
  "put": [
    {
      "hierarchy": {
        "id": "6e292e54-9a26-4be1-9034-607d71492707",
        "name": "Location",
        "source": {
          "instanceFieldNames": [
            "state",
            "city"
          ]
        }
      },
      "error": null
    },
    {
      "hierarchy": {
        "id": "a28fd14c-6b98-4ab5-9301-3840f142d30e",
        "name": "ManufactureDate",
        "source": {
          "instanceFieldNames": [
            "year",
            "month"
          ]
        }
      },
      "error": null
    }
  ]
}

Definitions

Name Description
HierarchiesBatchRequest

Request to perform a single operation on a batch of hierarchies. Exactly one of "get", "put" or "delete" must be set.

HierarchiesBatchResponse

Response of a single operation on a batch of time series hierarchies. Only one of "get", "put" or "delete" will be set.

HierarchiesRequestBatchGetDelete

Request to get or delete multiple time series hierarchies. Exactly one of "hierarchyIds" or "names" must be set.

Source

Definition of how time series hierarchy tree levels are created.

TimeSeriesHierarchy

Time series hierarchy organizes time series instances into a tree.

TimeSeriesHierarchyOrError

Result of a batch operation on a particular time series hierarchy. Hierarchy is set when operation is successful and error object is set when operation is unsuccessful.

TsiError

Information about an API error.

TsiErrorBody

A particular API error with an error code and a message.

TsiErrorDetails

Additional error information.

HierarchiesBatchRequest

Request to perform a single operation on a batch of hierarchies. Exactly one of "get", "put" or "delete" must be set.

Name Type Description
delete

HierarchiesRequestBatchGetDelete

"delete" should be set while fetching specific hierarchies either by IDs or names.

get

HierarchiesRequestBatchGetDelete

"get" should be set while fetching specific hierarchies either by IDs or names.

put

TimeSeriesHierarchy[]

"put" should be set while creating or updating hierarchies.

HierarchiesBatchResponse

Response of a single operation on a batch of time series hierarchies. Only one of "get", "put" or "delete" will be set.

Name Type Description
delete

TsiErrorBody[]

List of error objects corresponding by position to the "delete" array in the request - null when the operation is successful.

get

TimeSeriesHierarchyOrError[]

List of hierarchy or error objects corresponding by position to the "get" array in the request. Hierarchy object is set when operation is successful and error object is set when operation is unsuccessful.

put

TimeSeriesHierarchyOrError[]

List of hierarchy or error object corresponding by position to the "put" array in the request. Hierarchy object is set when operation is successful and error object is set when operation is unsuccessful.

HierarchiesRequestBatchGetDelete

Request to get or delete multiple time series hierarchies. Exactly one of "hierarchyIds" or "names" must be set.

Name Type Description
hierarchyIds

string[]

List of hierarchy IDs.

names

string[]

List of hierarchy names.

Source

Definition of how time series hierarchy tree levels are created.

Name Type Description
instanceFieldNames

string[]

List of instance field names that must be set in all time series instances that belong to this hierarchy. The order of the instance fields defines the levels in the hierarchy.

TimeSeriesHierarchy

Time series hierarchy organizes time series instances into a tree.

Name Type Description
id

string

Case-sensitive unique hierarchy identifier. Can be null while creating hierarchy objects and then server generates the id, not null on get and delete operations.

name

string

User-given unique name for the type. It is mutable and not null.

source

Source

Definition of how time series hierarchy tree levels are created.

TimeSeriesHierarchyOrError

Result of a batch operation on a particular time series hierarchy. Hierarchy is set when operation is successful and error object is set when operation is unsuccessful.

Name Type Description
error

TsiErrorBody

Error object - set when the operation is unsuccessful.

hierarchy

TimeSeriesHierarchy

Time series hierarchy object - set when the operation is successful.

TsiError

Information about an API error.

Name Type Description
error

TsiErrorBody

A particular API error with an error code and a message.

TsiErrorBody

A particular API error with an error code and a message.

Name Type Description
code

string

Language-independent, human-readable string that defines a service-specific error code. This code serves as a more specific indicator for the HTTP error code specified in the response. Can be used to programmatically handle specific error cases.

details

TsiErrorDetails[]

Contains additional error information. May be null.

innerError

TsiErrorBody

Contains more specific error that narrows down the cause. May be null.

message

string

Human-readable, language-independent representation of the error. It is intended as an aid to developers and is not suitable for exposure to end users.

target

string

Target of the particular error (for example, the name of the property in error). May be null.

TsiErrorDetails

Additional error information.

Name Type Description
code

string

Language-independent, human-readable string that defines a service-specific error code. This code serves as a more specific indicator for the HTTP error code specified in the response. Can be used to programmatically handle specific error cases.

message

string

Human-readable, language-independent representation of the error. It is intended as an aid to developers and is not suitable for exposure to end users.