Skip to content

Latest commit

 

History

History
131 lines (92 loc) · 4.47 KB

data.md

File metadata and controls

131 lines (92 loc) · 4.47 KB

Data Actions

Details on the various actions that can be performed on the Data resource, including the expected parameters and the potential responses.

Contents

Export

Creates a csv file from a query of devices and attributes over a time range.

result = client.data.export(
    applicationId=my_application_id,
    query=my_query)

print(result)

Authentication

The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.Application, all.Application.read, all.Device, all.Device.read, all.Organization, all.Organization.read, all.User, all.User.read, data.*, or data.export.

Available Parameters

Name Type Required Description Default Example
applicationId string Y ID associated with the application 575ec8687ae143cd83dc4a97
query Data Export Y The query parameters Data Export Example
losantdomain string N Domain scope of request (rarely needed) example.com

Successful Responses

Code Type Description
202 Job Enqueued API Result If command was successfully sent

Error Responses

Code Type Description
400 Error Error if malformed request
404 Error Error if application was not found

Last Value Query

Returns the last known data for the given attribute

result = client.data.last_value_query(
    applicationId=my_application_id,
    query=my_query)

print(result)

Authentication

The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.Application, all.Application.read, all.Device, all.Device.read, all.Organization, all.Organization.read, all.User, all.User.read, data.*, or data.lastValueQuery.

Available Parameters

Name Type Required Description Default Example
applicationId string Y ID associated with the application 575ec8687ae143cd83dc4a97
query Last Value Query Y The query parameters Last Value Query Example
losantdomain string N Domain scope of request (rarely needed) example.com

Successful Responses

Code Type Description
200 Last Value Data Last known data for the requested attribute

Error Responses

Code Type Description
400 Error Error if malformed request
404 Error Error if application was not found

Time Series Query

Returns the data for the given query

result = client.data.time_series_query(
    applicationId=my_application_id,
    query=my_query)

print(result)

Authentication

The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.Application, all.Application.read, all.Device, all.Device.read, all.Organization, all.Organization.read, all.User, all.User.read, data.*, or data.timeSeriesQuery.

Available Parameters

Name Type Required Description Default Example
applicationId string Y ID associated with the application 575ec8687ae143cd83dc4a97
query Time Series Query Y The query parameters Time Series Query Example
losantdomain string N Domain scope of request (rarely needed) example.com

Successful Responses

Code Type Description
200 Time Series Data Data for requested time range

Error Responses

Code Type Description
400 Error Error if malformed request
404 Error Error if application was not found