Skip to content

Latest commit

 

History

History
241 lines (182 loc) · 7.26 KB

TimeSeriesPropertyV2.md

File metadata and controls

241 lines (182 loc) · 7.26 KB

TimeSeriesPropertyV2

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

get_first_point

Get the first point of a time series property.

Third-party applications using this endpoint via OAuth2 must request the following operation scopes: api:ontologies-read.

Parameters

Name Type Description Notes
ontology OntologyIdentifier ontology
object_type ObjectTypeApiName objectType
primary_key PropertyValueEscapedString primaryKey
property PropertyApiName property
artifact_repository Optional[ArtifactRepositoryRid] artifactRepository [optional]
package_name Optional[SdkPackageName] packageName [optional]

Return type

TimeSeriesPoint

Example

from foundry.v2 import FoundryClient
import foundry
from pprint import pprint

foundry_client = FoundryClient(
    auth=foundry.UserTokenAuth(...), hostname="example.palantirfoundry.com"
)

# OntologyIdentifier | ontology
ontology = "palantir"
# ObjectTypeApiName | objectType
object_type = "employee"
# PropertyValueEscapedString | primaryKey
primary_key = 50030
# PropertyApiName | property
property = "performance"
# Optional[ArtifactRepositoryRid] | artifactRepository
artifact_repository = None
# Optional[SdkPackageName] | packageName
package_name = None


try:
    api_response = foundry_client.ontologies.TimeSeriesPropertyV2.get_first_point(
        ontology,
        object_type,
        primary_key,
        property,
        artifact_repository=artifact_repository,
        package_name=package_name,
    )
    print("The get_first_point response:\n")
    pprint(api_response)
except foundry.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 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.

Third-party applications using this endpoint via OAuth2 must request the following operation scopes: api:ontologies-read.

Parameters

Name Type Description Notes
ontology OntologyIdentifier ontology
object_type ObjectTypeApiName objectType
primary_key PropertyValueEscapedString primaryKey
property PropertyApiName property
artifact_repository Optional[ArtifactRepositoryRid] artifactRepository [optional]
package_name Optional[SdkPackageName] packageName [optional]

Return type

TimeSeriesPoint

Example

from foundry.v2 import FoundryClient
import foundry
from pprint import pprint

foundry_client = FoundryClient(
    auth=foundry.UserTokenAuth(...), hostname="example.palantirfoundry.com"
)

# OntologyIdentifier | ontology
ontology = "palantir"
# ObjectTypeApiName | objectType
object_type = "employee"
# PropertyValueEscapedString | primaryKey
primary_key = 50030
# PropertyApiName | property
property = "performance"
# Optional[ArtifactRepositoryRid] | artifactRepository
artifact_repository = None
# Optional[SdkPackageName] | packageName
package_name = None


try:
    api_response = foundry_client.ontologies.TimeSeriesPropertyV2.get_last_point(
        ontology,
        object_type,
        primary_key,
        property,
        artifact_repository=artifact_repository,
        package_name=package_name,
    )
    print("The get_last_point response:\n")
    pprint(api_response)
except foundry.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 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.

Third-party applications using this endpoint via OAuth2 must request the following operation scopes: api:ontologies-read.

Parameters

Name Type Description Notes
ontology OntologyIdentifier ontology
object_type ObjectTypeApiName objectType
primary_key PropertyValueEscapedString primaryKey
property PropertyApiName property
artifact_repository Optional[ArtifactRepositoryRid] artifactRepository [optional]
package_name Optional[SdkPackageName] packageName [optional]
range Optional[TimeRangeDict] [optional]

Return type

bytes

Example

from foundry.v2 import FoundryClient
import foundry
from pprint import pprint

foundry_client = FoundryClient(
    auth=foundry.UserTokenAuth(...), hostname="example.palantirfoundry.com"
)

# OntologyIdentifier | ontology
ontology = "palantir"
# ObjectTypeApiName | objectType
object_type = "employee"
# PropertyValueEscapedString | primaryKey
primary_key = 50030
# PropertyApiName | property
property = None
# Optional[ArtifactRepositoryRid] | artifactRepository
artifact_repository = None
# Optional[SdkPackageName] | packageName
package_name = None
# Optional[TimeRangeDict] |
range = {
    "type": "relative",
    "startTime": {"when": "BEFORE", "value": 5, "unit": "MONTHS"},
    "endTime": {"when": "BEFORE", "value": 1, "unit": "MONTHS"},
}


try:
    api_response = foundry_client.ontologies.TimeSeriesPropertyV2.stream_points(
        ontology,
        object_type,
        primary_key,
        property,
        artifact_repository=artifact_repository,
        package_name=package_name,
        range=range,
    )
    print("The stream_points response:\n")
    pprint(api_response)
except foundry.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]