Skip to content

Commit 1e95c0e

Browse files
haakonvtvincent-cogniteandersfyllingvishal-cognitevikramlc
authored
chore: update all links to the official Cognite API reference (DM-3537) (#2486)
Co-authored-by: Vincent <vincent.gay@cognite.com> Co-authored-by: Anders Øen Fylling <7851860+andersfylling@users.noreply.github.com> Co-authored-by: vishal-cognite <vishal.doshi@cognite.com> Co-authored-by: vikramlc <vikram.chawan121@gmail.com>
1 parent 8afd420 commit 1e95c0e

66 files changed

Lines changed: 419 additions & 340 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

cognite/client/_api/ai/tools/documents.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def summarize(
1818
external_id: str | None = None,
1919
instance_id: NodeId | None = None,
2020
) -> Summary:
21-
"""`Summarize a document using a Large Language Model. <https://developer.cognite.com/api#tag/Document-AI/operation/document_questioning_api_v1_projects__projectName__ai_tools_documents_ask_post>`_
21+
"""`Summarize a document using a Large Language Model. <https://api-docs.cognite.com/20230101/tag/Document-AI/operation/document_questioning_ai_tools_documents_ask_post>`_
2222
2323
Note:
2424
Currently only supports summarizing a single document at a time, but
@@ -77,7 +77,7 @@ def ask_question(
7777
additional_context: str | None = None,
7878
ignore_unknown_ids: bool = False,
7979
) -> Answer:
80-
"""`Ask a question about one or more documents using a Large Language Model. <https://developer.cognite.com/api#tag/Document-AI/operation/documents_summary_api_v1_projects__projectName__ai_tools_documents_summarize_post>`_
80+
"""`Ask a question about one or more documents using a Large Language Model. <https://api-docs.cognite.com/20230101/tag/Document-AI/operation/documents_summary_ai_tools_documents_summarize_post>`_
8181
8282
Supports up to 100 documents at a time.
8383

cognite/client/_api/annotations.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def create(self, annotations: Sequence[Annotation | AnnotationWrite]) -> Annotat
3939
def create(
4040
self, annotations: Annotation | AnnotationWrite | Sequence[Annotation | AnnotationWrite]
4141
) -> Annotation | AnnotationList:
42-
"""`Create annotations <https://developer.cognite.com/api#tag/Annotations/operation/annotationsCreate>`_
42+
"""`Create annotations <https://api-docs.cognite.com/20230101/tag/Annotations/operation/annotationsCreate>`_
4343
4444
Args:
4545
annotations (Annotation | AnnotationWrite | Sequence[Annotation | AnnotationWrite]): Annotation(s) to create
@@ -64,7 +64,7 @@ def suggest(self, annotations: Annotation) -> Annotation: ...
6464
def suggest(self, annotations: Sequence[Annotation]) -> AnnotationList: ...
6565

6666
def suggest(self, annotations: Annotation | Sequence[Annotation]) -> Annotation | AnnotationList:
67-
"""`Suggest annotations <https://developer.cognite.com/api#tag/Annotations/operation/annotationsSuggest>`_
67+
"""`Suggest annotations <https://api-docs.cognite.com/20230101/tag/Annotations/operation/annotationsSuggest>`_
6868
6969
Args:
7070
annotations (Annotation | Sequence[Annotation]): annotation(s) to suggest. They must have status set to "suggested".
@@ -136,7 +136,7 @@ def update(
136136
| Sequence[Annotation | AnnotationWrite | AnnotationUpdate],
137137
mode: Literal["replace_ignore_null", "patch", "replace"] = "replace_ignore_null",
138138
) -> Annotation | AnnotationList:
139-
"""`Update annotations <https://developer.cognite.com/api#tag/Annotations/operation/annotationsUpdate>`_
139+
"""`Update annotations <https://api-docs.cognite.com/20230101/tag/Annotations/operation/annotationsUpdate>`_
140140
141141
Args:
142142
item (Annotation | AnnotationWrite | AnnotationUpdate | Sequence[Annotation | AnnotationWrite | AnnotationUpdate]): Annotation or list of annotations to update (or patch or list of patches to apply)
@@ -149,15 +149,15 @@ def update(
149149
)
150150

151151
def delete(self, id: int | Sequence[int]) -> None:
152-
"""`Delete annotations <https://developer.cognite.com/api#tag/Annotations/operation/annotationsDelete>`_
152+
"""`Delete annotations <https://api-docs.cognite.com/20230101/tag/Annotations/operation/annotationsDelete>`_
153153
154154
Args:
155155
id (int | Sequence[int]): ID or list of IDs to be deleted
156156
"""
157157
self._delete_multiple(identifiers=IdentifierSequence.load(ids=id), wrap_ids=True)
158158

159159
def retrieve_multiple(self, ids: Sequence[int]) -> AnnotationList:
160-
"""`Retrieve annotations by IDs <https://developer.cognite.com/api#tag/Annotations/operation/annotationsByids>`_`
160+
"""`Retrieve annotations by IDs <https://api-docs.cognite.com/20230101/tag/Annotations/operation/annotationsByids>`_`
161161
162162
Args:
163163
ids (Sequence[int]): list of IDs to be retrieved
@@ -169,7 +169,7 @@ def retrieve_multiple(self, ids: Sequence[int]) -> AnnotationList:
169169
return self._retrieve_multiple(list_cls=AnnotationList, resource_cls=Annotation, identifiers=identifiers)
170170

171171
def retrieve(self, id: int) -> Annotation | None:
172-
"""`Retrieve an annotation by id <https://developer.cognite.com/api#tag/Annotations/operation/annotationsGet>`_
172+
"""`Retrieve an annotation by id <https://api-docs.cognite.com/20230101/tag/Annotations/operation/annotationsGet>`_
173173
174174
Args:
175175
id (int): id of the annotation to be retrieved
@@ -214,7 +214,7 @@ def reverse_lookup(self, filter: AnnotationReverseLookupFilter, limit: int | Non
214214
)
215215

216216
def list(self, filter: AnnotationFilter | dict, limit: int | None = DEFAULT_LIMIT_READ) -> AnnotationList:
217-
"""`List annotations. <https://developer.cognite.com/api#tag/Annotations/operation/annotationsFilter>`_
217+
"""`List annotations. <https://api-docs.cognite.com/20230101/tag/Annotations/operation/annotationsFilter>`_
218218
219219
Note:
220220
Passing a filter with both 'annotated_resource_type' and 'annotated_resource_ids' is always required.

cognite/client/_api/assets.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ def __iter__(self) -> Iterator[Asset]:
231231
return self()
232232

233233
def retrieve(self, id: int | None = None, external_id: str | None = None) -> Asset | None:
234-
"""`Retrieve a single asset by id. <https://developer.cognite.com/api#tag/Assets/operation/getAsset>`_
234+
"""`Retrieve a single asset by id. <https://api-docs.cognite.com/20230101/tag/Assets/operation/getAsset>`_
235235
236236
Args:
237237
id (int | None): ID
@@ -261,7 +261,7 @@ def retrieve_multiple(
261261
external_ids: SequenceNotStr[str] | None = None,
262262
ignore_unknown_ids: bool = False,
263263
) -> AssetList:
264-
"""`Retrieve multiple assets by id. <https://developer.cognite.com/api#tag/Assets/operation/byIdsAssets>`_
264+
"""`Retrieve multiple assets by id. <https://api-docs.cognite.com/20230101/tag/Assets/operation/byIdsAssets>`_
265265
266266
Args:
267267
ids (Sequence[int] | None): IDs
@@ -289,7 +289,7 @@ def retrieve_multiple(
289289
)
290290

291291
def aggregate(self, filter: AssetFilter | dict[str, Any] | None = None) -> list[CountAggregate]:
292-
"""`Aggregate assets <https://developer.cognite.com/api#tag/Assets/operation/aggregateAssets>`_
292+
"""`Aggregate assets <https://api-docs.cognite.com/20230101/tag/Assets/operation/aggregateAssets>`_
293293
294294
Args:
295295
filter (AssetFilter | dict[str, Any] | None): Filter on assets with strict matching.
@@ -316,7 +316,7 @@ def aggregate_count(
316316
advanced_filter: Filter | dict[str, Any] | None = None,
317317
filter: AssetFilter | dict[str, Any] | None = None,
318318
) -> int:
319-
"""`Count of assets matching the specified filters. <https://developer.cognite.com/api#tag/Assets/operation/aggregateAssets>`_
319+
"""`Count of assets matching the specified filters. <https://api-docs.cognite.com/20230101/tag/Assets/operation/aggregateAssets>`_
320320
321321
Args:
322322
property (AssetPropertyLike | None): If specified, get an approximate number of asset with a specific property (property is not null) and matching the filters.
@@ -357,7 +357,7 @@ def aggregate_cardinality_values(
357357
aggregate_filter: AggregationFilter | dict[str, Any] | None = None,
358358
filter: AssetFilter | dict[str, Any] | None = None,
359359
) -> int:
360-
"""`Find approximate property count for assets. <https://developer.cognite.com/api#tag/Assets/operation/aggregateAssets>`_
360+
"""`Find approximate property count for assets. <https://api-docs.cognite.com/20230101/tag/Assets/operation/aggregateAssets>`_
361361
362362
Args:
363363
property (AssetPropertyLike): The property to count the cardinality of.
@@ -401,7 +401,7 @@ def aggregate_cardinality_properties(
401401
aggregate_filter: AggregationFilter | dict[str, Any] | None = None,
402402
filter: AssetFilter | dict[str, Any] | None = None,
403403
) -> int:
404-
"""`Find approximate paths count for assets. <https://developer.cognite.com/api#tag/Assets/operation/aggregateAssets>`_
404+
"""`Find approximate paths count for assets. <https://api-docs.cognite.com/20230101/tag/Assets/operation/aggregateAssets>`_
405405
406406
Args:
407407
path (AssetPropertyLike): The scope in every document to aggregate properties. The only value allowed now is ["metadata"].
@@ -437,7 +437,7 @@ def aggregate_unique_values(
437437
aggregate_filter: AggregationFilter | dict[str, Any] | None = None,
438438
filter: AssetFilter | dict[str, Any] | None = None,
439439
) -> UniqueResultList:
440-
"""`Get unique properties with counts for assets. <https://developer.cognite.com/api#tag/Assets/operation/aggregateAssets>`_
440+
"""`Get unique properties with counts for assets. <https://api-docs.cognite.com/20230101/tag/Assets/operation/aggregateAssets>`_
441441
442442
Note:
443443
In the case of text fields, the values are aggregated in a case-insensitive manner.
@@ -499,7 +499,7 @@ def aggregate_unique_properties(
499499
aggregate_filter: AggregationFilter | dict[str, Any] | None = None,
500500
filter: AssetFilter | dict[str, Any] | None = None,
501501
) -> UniqueResultList:
502-
"""`Get unique paths with counts for assets. <https://developer.cognite.com/api#tag/Assets/operation/aggregateAssets>`_
502+
"""`Get unique paths with counts for assets. <https://api-docs.cognite.com/20230101/tag/Assets/operation/aggregateAssets>`_
503503
504504
Note:
505505
In the case of text fields, the values are aggregated in a case-insensitive manner.
@@ -539,7 +539,7 @@ def create(self, asset: Sequence[Asset] | Sequence[AssetWrite]) -> AssetList: ..
539539
def create(self, asset: Asset | AssetWrite) -> Asset: ...
540540

541541
def create(self, asset: Asset | AssetWrite | Sequence[Asset] | Sequence[AssetWrite]) -> Asset | AssetList:
542-
"""`Create one or more assets. <https://developer.cognite.com/api#tag/Assets/operation/createAssets>`_
542+
"""`Create one or more assets. <https://api-docs.cognite.com/20230101/tag/Assets/operation/createAssets>`_
543543
544544
You can create an arbitrary number of assets, and the SDK will split the request into multiple requests.
545545
When specifying parent-child relation between assets using `parentExternalId` the link will be resvoled into an internal ID and stored as `parentId`.
@@ -709,7 +709,7 @@ def delete(
709709
recursive: bool = False,
710710
ignore_unknown_ids: bool = False,
711711
) -> None:
712-
"""`Delete one or more assets <https://developer.cognite.com/api#tag/Assets/operation/deleteAssets>`_
712+
"""`Delete one or more assets <https://api-docs.cognite.com/20230101/tag/Assets/operation/deleteAssets>`_
713713
714714
Args:
715715
id (int | Sequence[int] | None): Id or list of ids
@@ -750,7 +750,7 @@ def update(
750750
item: Asset | AssetWrite | AssetUpdate | Sequence[Asset | AssetWrite | AssetUpdate],
751751
mode: Literal["replace_ignore_null", "patch", "replace"] = "replace_ignore_null",
752752
) -> Asset | AssetList:
753-
"""`Update one or more assets <https://developer.cognite.com/api#tag/Assets/operation/updateAssets>`_
753+
"""`Update one or more assets <https://api-docs.cognite.com/20230101/tag/Assets/operation/updateAssets>`_
754754
Labels can be added, removed or replaced (set). Note that set operation deletes all the existing labels and adds the new specified labels.
755755
756756
Args:
@@ -853,7 +853,7 @@ def filter(
853853
aggregated_properties: Sequence[AggregateAssetProperty] | None = None,
854854
limit: int | None = DEFAULT_LIMIT_READ,
855855
) -> AssetList:
856-
"""`Advanced filter assets <https://developer.cognite.com/api#tag/Assets/operation/listAssets>`_
856+
"""`Advanced filter assets <https://api-docs.cognite.com/20230101/tag/Assets/operation/listAssets>`_
857857
858858
Advanced filter lets you create complex filtering expressions that combine simple operations,
859859
such as equals, prefix, exists, etc., using boolean operators and, or, and not.
@@ -920,7 +920,7 @@ def search(
920920
filter: AssetFilter | dict[str, Any] | None = None,
921921
limit: int = DEFAULT_LIMIT_READ,
922922
) -> AssetList:
923-
"""`Search for assets <https://developer.cognite.com/api#tag/Assets/operation/searchAssets>`_
923+
"""`Search for assets <https://api-docs.cognite.com/20230101/tag/Assets/operation/searchAssets>`_
924924
Primarily meant for human-centric use-cases and data exploration, not for programs, since matching and ordering may change over time. Use the `list` function if stable or exact matches are required.
925925
926926
Args:
@@ -1031,7 +1031,7 @@ def list(
10311031
advanced_filter: Filter | dict[str, Any] | None = None,
10321032
sort: SortSpec | list[SortSpec] | None = None,
10331033
) -> AssetList:
1034-
"""`List assets <https://developer.cognite.com/api#tag/Assets/operation/listAssets>`_
1034+
"""`List assets <https://api-docs.cognite.com/20230101/tag/Assets/operation/listAssets>`_
10351035
10361036
Args:
10371037
name (str | None): Name of asset. Often referred to as tag.

cognite/client/_api/data_modeling/containers.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def retrieve(self, ids: ContainerIdentifier) -> Container | None: ...
9999
def retrieve(self, ids: Sequence[ContainerIdentifier]) -> ContainerList: ...
100100

101101
def retrieve(self, ids: ContainerIdentifier | Sequence[ContainerIdentifier]) -> Container | ContainerList | None:
102-
"""`Retrieve one or more container by id(s). <https://developer.cognite.com/api#tag/Containers/operation/byExternalIdsContainers>`_
102+
"""`Retrieve one or more container by id(s). <https://api-docs.cognite.com/20230101/tag/Containers/operation/byExternalIdsContainers>`_
103103
104104
Args:
105105
ids (ContainerIdentifier | Sequence[ContainerIdentifier]): Identifier for container(s).
@@ -128,7 +128,7 @@ def retrieve(self, ids: ContainerIdentifier | Sequence[ContainerIdentifier]) ->
128128
)
129129

130130
def delete(self, ids: ContainerIdentifier | Sequence[ContainerIdentifier]) -> list[ContainerId]:
131-
"""`Delete one or more containers <https://developer.cognite.com/api#tag/Containers/operation/deleteContainers>`_
131+
"""`Delete one or more containers <https://api-docs.cognite.com/20230101/tag/Containers/operation/deleteContainers>`_
132132
133133
Args:
134134
ids (ContainerIdentifier | Sequence[ContainerIdentifier]): The container identifier(s).
@@ -154,7 +154,7 @@ def delete(self, ids: ContainerIdentifier | Sequence[ContainerIdentifier]) -> li
154154
return [ContainerId(space=item["space"], external_id=item["externalId"]) for item in deleted_containers]
155155

156156
def delete_constraints(self, ids: Sequence[ConstraintIdentifier]) -> list[ConstraintIdentifier]:
157-
"""`Delete one or more constraints <https://developer.cognite.com/api#tag/Containers/operation/deleteContainerConstraints>`_
157+
"""`Delete one or more constraints <https://api-docs.cognite.com/20230101/tag/Containers/operation/deleteContainerConstraints>`_
158158
159159
Args:
160160
ids (Sequence[ConstraintIdentifier]): The constraint identifier(s).
@@ -173,7 +173,7 @@ def delete_constraints(self, ids: Sequence[ConstraintIdentifier]) -> list[Constr
173173
return self._delete_constraints_or_indexes(ids, "constraints")
174174

175175
def delete_indexes(self, ids: Sequence[IndexIdentifier]) -> list[IndexIdentifier]:
176-
"""`Delete one or more indexes <https://developer.cognite.com/api#tag/Containers/operation/deleteContainerIndexes>`_
176+
"""`Delete one or more indexes <https://api-docs.cognite.com/20230101/tag/Containers/operation/deleteContainerIndexes>`_
177177
178178
Args:
179179
ids (Sequence[IndexIdentifier]): The index identifier(s).
@@ -223,7 +223,7 @@ def list(
223223
limit: int | None = DATA_MODELING_DEFAULT_LIMIT_READ,
224224
include_global: bool = False,
225225
) -> ContainerList:
226-
"""`List containers <https://developer.cognite.com/api#tag/Containers/operation/listContainers>`_
226+
"""`List containers <https://api-docs.cognite.com/20230101/tag/Containers/operation/listContainers>`_
227227
228228
Args:
229229
space (str | None): The space to query
@@ -267,7 +267,7 @@ def apply(self, container: Sequence[ContainerApply]) -> ContainerList: ...
267267
def apply(self, container: ContainerApply) -> Container: ...
268268

269269
def apply(self, container: ContainerApply | Sequence[ContainerApply]) -> Container | ContainerList:
270-
"""`Add or update (upsert) containers. <https://developer.cognite.com/api#tag/Containers/operation/ApplyContainers>`_
270+
"""`Add or update (upsert) containers. <https://api-docs.cognite.com/20230101/tag/Containers/operation/ApplyContainers>`_
271271
272272
Args:
273273
container (ContainerApply | Sequence[ContainerApply]): Container(s) to create or update.

cognite/client/_api/data_modeling/data_models.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def retrieve(
109109
def retrieve(
110110
self, ids: DataModelIdentifier | Sequence[DataModelIdentifier], inline_views: bool = False
111111
) -> DataModelList[ViewId] | DataModelList[View]:
112-
"""`Retrieve data_model(s) by id(s). <https://developer.cognite.com/api#tag/Data-models/operation/byExternalIdsDataModels>`_
112+
"""`Retrieve data_model(s) by id(s). <https://api-docs.cognite.com/20230101/tag/Data-models/operation/byExternalIdsDataModels>`_
113113
114114
Args:
115115
ids (DataModelIdentifier | Sequence[DataModelIdentifier]): Data Model identifier(s).
@@ -134,7 +134,7 @@ def retrieve(
134134
)
135135

136136
def delete(self, ids: DataModelIdentifier | Sequence[DataModelIdentifier]) -> list[DataModelId]:
137-
"""`Delete one or more data model <https://developer.cognite.com/api#tag/Data-models/operation/deleteDataModels>`_
137+
"""`Delete one or more data model <https://api-docs.cognite.com/20230101/tag/Data-models/operation/deleteDataModels>`_
138138
139139
Args:
140140
ids (DataModelIdentifier | Sequence[DataModelIdentifier]): Data Model identifier(s).
@@ -187,7 +187,7 @@ def list(
187187
all_versions: bool = False,
188188
include_global: bool = False,
189189
) -> DataModelList[View] | DataModelList[ViewId]:
190-
"""`List data models <https://developer.cognite.com/api#tag/Data-models/operation/listDataModels>`_
190+
"""`List data models <https://api-docs.cognite.com/20230101/tag/Data-models/operation/listDataModels>`_
191191
192192
Args:
193193
inline_views (bool): Whether to expand the referenced views inline in the returned result.
@@ -234,7 +234,7 @@ def apply(self, data_model: Sequence[DataModelApply]) -> DataModelList: ...
234234
def apply(self, data_model: DataModelApply) -> DataModel: ...
235235

236236
def apply(self, data_model: DataModelApply | Sequence[DataModelApply]) -> DataModel | DataModelList:
237-
"""`Create or update one or more data model. <https://developer.cognite.com/api#tag/Data-models/operation/createDataModels>`_
237+
"""`Create or update one or more data model. <https://api-docs.cognite.com/20230101/tag/Data-models/operation/createDataModels>`_
238238
239239
Args:
240240
data_model (DataModelApply | Sequence[DataModelApply]): Data model(s) to create or update (upsert).

0 commit comments

Comments
 (0)