From 54d00e5cb3a923e99cc0f0985358a9d515dcf3f6 Mon Sep 17 00:00:00 2001 From: wvandeun Date: Wed, 16 Apr 2025 14:59:11 +0200 Subject: [PATCH] docs: fix create update delete nodes guide --- docs/docs/python-sdk/guides/create_update_delete.mdx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/docs/python-sdk/guides/create_update_delete.mdx b/docs/docs/python-sdk/guides/create_update_delete.mdx index 8d90edf6..212b0e8e 100644 --- a/docs/docs/python-sdk/guides/create_update_delete.mdx +++ b/docs/docs/python-sdk/guides/create_update_delete.mdx @@ -67,7 +67,7 @@ nodes: A node can be created using the `create` method. The `create` method will first construct a `InfrahubNode` object in memory. This `InfrahubNode` object will then need to be saved into Infrahub using the `save` method. -The attributes and relationships of the `InfrahubNode` you want to create can be passed as arguments to the `create` method, or you can pass then using a dictionary. +The attributes and relationships of the `InfrahubNode` you want to create can be passed as arguments to the `create` method, or you can pass them using a dictionary. @@ -138,7 +138,7 @@ The attributes and relationships of the `InfrahubNode` you want to create can be ```python - interfaces = await client.get(kind="TestInterface", name__values=["Ethernet1", "Ethernet2"]) + interfaces = await client.filters(kind="TestInterface", name__values=["Ethernet1", "Ethernet2"]) device = await client.create(kind="TestDevice", name="atl1-edge1", interfaces=interfaces) await device.save() ``` @@ -147,7 +147,7 @@ The attributes and relationships of the `InfrahubNode` you want to create can be ```python - interfaces = client.get(kind="TestInterface", name__values=["Ethernet1", "Ethernet2"]) + interfaces = client.filters(kind="TestInterface", name__values=["Ethernet1", "Ethernet2"]) device = client.create(kind="TestDevice", name="atl1-edge1", interfaces=interfaces) device.save() ``` @@ -222,7 +222,7 @@ Adding a single relation: ```python - interface = client.get(kind="TestInterface", name__values="Ethernet1") + interface = client.get(kind="TestInterface", name__value="Ethernet1") device = client.get(kind="TestDevice", name__value="atl1-edge1") device.interfaces.add(interface) device.save() @@ -236,7 +236,7 @@ Adding multiple relations: ```python - interfaces = await client.filters(kind="TestInterface", name__value=["Ethernet1", "Ethernet2"]) + interfaces = await client.filters(kind="TestInterface", name__values=["Ethernet1", "Ethernet2"]) device = await client.get(kind="TestDevice", name__value="atl1-edge1") device.interfaces.extend(interfaces) await device.save() @@ -246,7 +246,7 @@ Adding multiple relations: ```python - interfaces = client.filters(kind="TestInterface", name__value=["Ethernet1", "Ethernet2"]) + interfaces = client.filters(kind="TestInterface", name__values=["Ethernet1", "Ethernet2"]) device = client.get(kind="TestDevice", name__value="atl1-edge1") device.interfaces.extend(interfaces) device.save()