Skip to content

Commit 561d81f

Browse files
kkerezsialexkerezsinispanglerco
authored
fix: Update python client example (#167)
Co-authored-by: NI\akerezsi <[email protected]> Co-authored-by: Paul Spangler <[email protected]>
1 parent 8a06264 commit 561d81f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

examples/assetmanagement/assets.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
)
1717
from nisystemlink.clients.core._http_configuration import HttpConfiguration
1818

19-
19+
# workspace where the asset will be created
20+
workspace_id = "yourWorkspaceId"
2021
server_configuration = HttpConfiguration(
2122
server_uri="https://yourserver.yourcompany.com",
2223
api_key="YourAPIKeyGeneratedFromSystemLink",
@@ -46,7 +47,7 @@
4647
date=datetime(2022, 6, 7, 18, 58, 5, tzinfo=timezone.utc),
4748
),
4849
is_NI_asset=True,
49-
workspace="your-workspace-id",
50+
workspace=workspace_id,
5051
location=AssetLocationForCreate(
5152
state=AssetPresence(asset_presence=AssetPresenceStatus.PRESENT)
5253
),
@@ -81,17 +82,16 @@
8182

8283
# Query assets using id.
8384
query_asset_request = QueryAssetsRequest(
84-
ids=[created_asset_id],
85+
filter=f'AssetIdentifier = "{created_asset_id}"',
8586
skip=0,
8687
take=1,
8788
descending=False,
88-
calibratable_only=False,
8989
return_count=False,
90-
) # type: ignore
90+
)
9191
client.query_assets(query=query_asset_request)
9292

9393
# Link files to the created asset.
94-
file_ids = ["sameple-file-id"]
94+
file_ids = ["sample-file-id"]
9595
if created_asset_id:
9696
link_files_response = client.link_files(
9797
asset_id=created_asset_id, file_ids=file_ids

0 commit comments

Comments
 (0)