aboutsummaryrefslogtreecommitdiffstats
path: root/src/onapsdk
diff options
context:
space:
mode:
authorAlexey Aleynikov <alexey.aleynikov@telekom.com>2023-06-12 17:32:56 +0300
committerMicha? Jagie??o <michal.jagiello@t-mobile.pl>2023-06-14 13:34:09 +0000
commit97562cf882ad33813ce047038ada44eec9813f58 (patch)
tree77b4ad06c93a77c05edb528e182c88e4179aaa5b /src/onapsdk
parente05c376573b67f72a5b8df931ecce0b18841f540 (diff)
added CPS changes in anchor
Issue-ID: TEST-395 Signed-off-by: Alexey Aleynikov <alexey.aleynikov@telekom.com> Change-Id: I425550bcbfa0b7a3aaba32ecce9c11b9556148a1
Diffstat (limited to 'src/onapsdk')
-rw-r--r--src/onapsdk/cps/anchor.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/onapsdk/cps/anchor.py b/src/onapsdk/cps/anchor.py
index b1f9014..6e540ea 100644
--- a/src/onapsdk/cps/anchor.py
+++ b/src/onapsdk/cps/anchor.py
@@ -82,27 +82,30 @@ class Anchor(CpsElement):
auth=self.auth,
)
- def get_node(self, xpath: str, include_descendants: bool = False) -> Dict[Any, Any]:
- """Get anchor node data.
+ def get_node(self, xpath: str, descendants: int = 0) -> Dict[Any, Any]:
+ """
+ Get anchor node data.
Using XPATH get anchor's node data.
Args:
xpath (str): Anchor node xpath.
- include_descendants (bool, optional): Determies if descendants should be included in
- response. Defaults to False.
-
+ descendants (int, optional): Determines the number of descendant
+ levels that should be returned.
+ Can be -1 (all), 0 (none), or any positive number.
+ Defaults to 0.
Returns:
Dict[Any, Any]: Anchor node data.
-
"""
return self.send_message_json(
"GET",
f"Get {self.name} anchor node with {xpath} xpath",
- f"{self.url}/node?xpath={xpath}&include-descendants={include_descendants}",
+ f"{self.url}/node?xpath={xpath}"
+ f"?descendants={descendants}",
auth=self.auth
)
+
def update_node(self, xpath: str, node_data: str) -> None:
"""Update anchor node data.