Skip to main content

Hi Experts,

 

Need your help on Cognite Python sdk.

My goal

Get all linked timeseries of an Asset

I am using Asset class object https://cognite-sdk-python.readthedocs-hosted.com/en/latest/assets.html#cognite.client.data_classes.assets.Asset 

time_series function


​​
 

 

Problem

It is only giving me  the ‘Directly linked timeseries’ , not all the ‘Linked timeseries. 

 

 

Means in this case I only getting 13 timeseries objects , compared to 64 linked timeseries of the Asset.

 

Appreciate your help on adopting the correct approach

 

Thanks and Regards

Sree

You would need to use this function to get the “Linked timeseries”.

https://cognite-sdk-python.readthedocs-hosted.com/en/latest/time_series.html#cognite.client._api.time_series.TimeSeriesAPI.list

pass in that Asset’s external_id to asset_subtree_external_ids

Your snippet would look something like:

linked_timeseries = client.time_series.list(asset_subtree_external_ids=l“external_id of the Asset”], limit=Non

And here is the snippet for directly linked timeseries. This is what the Asset class object helper function does under the hood for you:

directly_linked_timeseries = client.time_series.list(asset_external_ids=e“external_id of the Asset”], limit=None)


Reply