Skip to content

Commit 6912b26

Browse files
committed
node-create: add property dict as param
1 parent 8220b2b commit 6912b26

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

linstor/linstorapi.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,8 @@ def node_create(
616616
ip,
617617
com_type=apiconsts.VAL_NETCOM_TYPE_PLAIN,
618618
port=None,
619-
netif_name='default'
619+
netif_name='default',
620+
property_dict=None
620621
):
621622
"""
622623
Creates a node on the controller.
@@ -627,6 +628,7 @@ def node_create(
627628
:param str com_type: Communication type of the node.
628629
:param int port: Port number of the node.
629630
:param str netif_name: Netinterface name that is created.
631+
:param dict[str, str] property_dict: Node properties.
630632
:return: A list containing ApiCallResponses from the controller.
631633
:rtype: list[ApiCallResponse]
632634
"""
@@ -660,6 +662,9 @@ def node_create(
660662
]
661663
}
662664

665+
if property_dict:
666+
body["props"] = property_dict
667+
663668
self._require_node_is_active(body["net_interfaces"][0])
664669

665670
return self._rest_request(apiconsts.API_CRT_NODE, "POST", "/v1/nodes", body)

0 commit comments

Comments
 (0)