Skip to content

Latest commit

 

History

History
234 lines (178 loc) · 9.48 KB

File metadata and controls

234 lines (178 loc) · 9.48 KB

TimeSeriesPropertyV2

Method HTTP request Release Stage
get_first_point GET /v2/ontologies/{ontology}/objects/{objectType}/{primaryKey}/timeseries/{property}/firstPoint Stable
get_last_point GET /v2/ontologies/{ontology}/objects/{objectType}/{primaryKey}/timeseries/{property}/lastPoint Stable
stream_points POST /v2/ontologies/{ontology}/objects/{objectType}/{primaryKey}/timeseries/{property}/streamPoints Stable

get_first_point

Get the first point of a time series property.

Parameters

Name Type Description Notes
ontology OntologyIdentifier
object_type ObjectTypeApiName The API name of the object type. To find the API name, use the List object types endpoint or check the Ontology Manager.
primary_key PropertyValueEscapedString The primary key of the object with the time series property.
property PropertyApiName The API name of the time series property. To find the API name for your time series property, check the Ontology Manager or use the Get object type endpoint.
sdk_package_rid Optional[SdkPackageRid] The package rid of the generated SDK. [optional]
sdk_version Optional[SdkVersion] The version of the generated SDK. [optional]

Return type

Optional[TimeSeriesPoint]

Example

from foundry_sdk import FoundryClient
import foundry_sdk
from pprint import pprint

client = FoundryClient(auth=foundry_sdk.UserTokenAuth(...), hostname="example.palantirfoundry.com")

# OntologyIdentifier
ontology = "palantir"
# ObjectTypeApiName | The API name of the object type. To find the API name, use the **List object types** endpoint or check the **Ontology Manager**.
object_type = "employee"
# PropertyValueEscapedString | The primary key of the object with the time series property.
primary_key = 50030
# PropertyApiName | The API name of the time series property. To find the API name for your time series property, check the **Ontology Manager** or use the **Get object type** endpoint.
property = "performance"
# Optional[SdkPackageRid] | The package rid of the generated SDK.
sdk_package_rid = None
# Optional[SdkVersion] | The version of the generated SDK.
sdk_version = None


try:
    api_response = client.ontologies.TimeSeriesPropertyV2.get_first_point(
        ontology,
        object_type,
        primary_key,
        property,
        sdk_package_rid=sdk_package_rid,
        sdk_version=sdk_version,
    )
    print("The get_first_point response:\n")
    pprint(api_response)
except foundry_sdk.PalantirRPCException as e:
    print("HTTP error when calling TimeSeriesPropertyV2.get_first_point: %s\n" % e)

Authorization

See README

HTTP response details

Status Code Type Description Content Type
200 Optional[TimeSeriesPoint] Success response. application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_last_point

Get the last point of a time series property.

Parameters

Name Type Description Notes
ontology OntologyIdentifier
object_type ObjectTypeApiName The API name of the object type. To find the API name, use the List object types endpoint or check the Ontology Manager.
primary_key PropertyValueEscapedString The primary key of the object with the time series property.
property PropertyApiName The API name of the time series property. To find the API name for your time series property, check the Ontology Manager or use the Get object type endpoint.
sdk_package_rid Optional[SdkPackageRid] The package rid of the generated SDK. [optional]
sdk_version Optional[SdkVersion] The version of the generated SDK. [optional]

Return type

Optional[TimeSeriesPoint]

Example

from foundry_sdk import FoundryClient
import foundry_sdk
from pprint import pprint

client = FoundryClient(auth=foundry_sdk.UserTokenAuth(...), hostname="example.palantirfoundry.com")

# OntologyIdentifier
ontology = "palantir"
# ObjectTypeApiName | The API name of the object type. To find the API name, use the **List object types** endpoint or check the **Ontology Manager**.
object_type = "employee"
# PropertyValueEscapedString | The primary key of the object with the time series property.
primary_key = 50030
# PropertyApiName | The API name of the time series property. To find the API name for your time series property, check the **Ontology Manager** or use the **Get object type** endpoint.
property = "performance"
# Optional[SdkPackageRid] | The package rid of the generated SDK.
sdk_package_rid = None
# Optional[SdkVersion] | The version of the generated SDK.
sdk_version = None


try:
    api_response = client.ontologies.TimeSeriesPropertyV2.get_last_point(
        ontology,
        object_type,
        primary_key,
        property,
        sdk_package_rid=sdk_package_rid,
        sdk_version=sdk_version,
    )
    print("The get_last_point response:\n")
    pprint(api_response)
except foundry_sdk.PalantirRPCException as e:
    print("HTTP error when calling TimeSeriesPropertyV2.get_last_point: %s\n" % e)

Authorization

See README

HTTP response details

Status Code Type Description Content Type
200 Optional[TimeSeriesPoint] Success response. application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

stream_points

Stream all of the points of a time series property.

Parameters

Name Type Description Notes
ontology OntologyIdentifier
object_type ObjectTypeApiName The API name of the object type. To find the API name, use the List object types endpoint or check the Ontology Manager.
primary_key PropertyValueEscapedString The primary key of the object with the time series property.
property PropertyApiName The API name of the time series property. To find the API name for your time series property, check the Ontology Manager or use the Get object type endpoint.
aggregate Optional[AggregateTimeSeries] [optional]
format Optional[StreamingOutputFormat] The output format to serialize the output binary stream in. Default is JSON. ARROW is more efficient than JSON at streaming a large sized response. [optional]
range Optional[TimeRange] [optional]
sdk_package_rid Optional[SdkPackageRid] The package rid of the generated SDK. [optional]
sdk_version Optional[SdkVersion] The version of the generated SDK. [optional]

Return type

bytes

Example

from foundry_sdk import FoundryClient
import foundry_sdk
from pprint import pprint

client = FoundryClient(auth=foundry_sdk.UserTokenAuth(...), hostname="example.palantirfoundry.com")

# OntologyIdentifier
ontology = "palantir"
# ObjectTypeApiName | The API name of the object type. To find the API name, use the **List object types** endpoint or check the **Ontology Manager**.
object_type = "employee"
# PropertyValueEscapedString | The primary key of the object with the time series property.
primary_key = 50030
# PropertyApiName | The API name of the time series property. To find the API name for your time series property, check the **Ontology Manager** or use the **Get object type** endpoint.
property = None
# Optional[AggregateTimeSeries]
aggregate = None
# Optional[StreamingOutputFormat] | The output format to serialize the output binary stream in. Default is JSON. ARROW is more efficient than JSON at streaming a large sized response.
format = None
# Optional[TimeRange]
range = {
    "type": "relative",
    "startTime": {"when": "BEFORE", "value": 5, "unit": "MONTHS"},
    "endTime": {"when": "BEFORE", "value": 1, "unit": "MONTHS"},
}
# Optional[SdkPackageRid] | The package rid of the generated SDK.
sdk_package_rid = None
# Optional[SdkVersion] | The version of the generated SDK.
sdk_version = None


try:
    api_response = client.ontologies.TimeSeriesPropertyV2.stream_points(
        ontology,
        object_type,
        primary_key,
        property,
        aggregate=aggregate,
        format=format,
        range=range,
        sdk_package_rid=sdk_package_rid,
        sdk_version=sdk_version,
    )
    print("The stream_points response:\n")
    pprint(api_response)
except foundry_sdk.PalantirRPCException as e:
    print("HTTP error when calling TimeSeriesPropertyV2.stream_points: %s\n" % e)

Authorization

See README

HTTP response details

Status Code Type Description Content Type
200 bytes Success response. /

[Back to top] [Back to API list] [Back to Model list] [Back to README]