2 Documentation Operations on relationship-list sub-object in AAI,
3 ... using specified base URL path including API version where it is implemented,
4 ... relies on system to choose default EdgeRule for the pair of object classes
6 Resource aai_interface.robot
8 Library ONAPLibrary.Templating
11 ${AAI_RELATIONSHIPLIST_PATH} relationship-list
12 ${AAI_RELATIONSHIP_PATH}= ${AAI_RELATIONSHIPLIST_PATH}/relationship
13 ${AAI_ADD_RELATIONSHIP_BODY} aai/add-relationship.jinja
14 ${AAI_RELATIONSHIP_DEPTH}= ?depth=1
18 [Documentation] Adds Relationship sub-object to existing object in AAI
19 [Arguments] ${api_version_base_object_url} ${related_class_name} ${related_object_url}
20 ${arguments}= Create Dictionary related_class_name=${related_class_name} related_object_url=${related_object_url}
21 Create Environment aai ${GLOBAL_TEMPLATE_FOLDER}
22 ${data}= Apply Template aai ${AAI_ADD_RELATIONSHIP_BODY} ${arguments}
23 ${put_resp}= Run A&AI Put Request ${api_version_base_object_url}/${AAI_RELATIONSHIP_PATH} ${data}
24 ${status_string}= Convert To String ${put_resp.status_code}
25 Should Match Regexp ${status_string} ^(201|200)$
28 [Documentation] Return RelationshipList of the object in AAI
29 [Arguments] ${api_version_base_object_url}
30 ${resp}= Get Object With Depth ${api_version_base_object_url}
31 Log Returning response ${resp['${AAI_RELATIONSHIPLIST_PATH}']}
32 [Return] ${resp['${AAI_RELATIONSHIPLIST_PATH}']}
35 [Documentation] Return Object with Depth parameter to show RelationshipList
36 [Arguments] ${api_version_base_object_url}
37 ${resp}= Run A&AI Get Request ${api_version_base_object_url}${AAI_RELATIONSHIP_DEPTH}
38 Should Be Equal As Strings ${resp.status_code} 200
39 Log Returning response ${resp.json()}
40 [Return] ${resp.json()}