Loading SOL003/VNFFaultManagement-API/FaultManagement-APIKeyword.robot +46 −1 Original line number Diff line number Diff line Loading @@ -695,3 +695,48 @@ JWT Encode [Arguments] ${payload} ${key} ${algorithm} ${encoded}= Evaluate jwt.encode(${payload}, ${key}, ${algorithm}) [Return] ${encoded} Check resource existence and get CallbackUri Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Get ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId} Integer response status 200 Validate Json response body FmSubscriptions.schema.json Set Global Variable ${callbackResp} response body callbackUri Post Alarm Notification log Trying to perform a POST to get notification Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} ${template} = Get File jsons/AlarmNotification.json ${body}= Format String ${template} subscriptionId=${subscriptionId} Post ${callbackResp} ${body} ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} Post Alarm Cleared Notification log Trying to perform a POST to get notification Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} ${template} = Get File jsons/AlarmClearedNotification.json ${body}= Format String ${template} subscriptionId=${subscriptionId} alarmId=${alarmId} Post ${callbackResp} ${body} ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} Post Alarm List Rebuilt Notification log Trying to perform a POST to get notification Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} ${template} = Get File jsons/AlarmListRebuiltNotification.json ${body}= Format String ${template} subscriptionId=${subscriptionId} Post ${callbackResp} ${body} ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} No newline at end of file SOL003/VNFFaultManagement-API/NotificationEndpoint.robot +2 −54 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ Library String Library OperatingSystem Resource environment/variables.txt Resource FaultManagement-APIKeyword.robot Library JSONLibrary Library JSONSchemaLibrary schemas/ Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} ssl_verify=false Loading Loading @@ -43,56 +44,3 @@ VNF Fault Alarm List Reulit Notification ... Post-Conditions: none Post Alarm List Rebuilt Notification Check HTTP Response Status Code Is 204 No newline at end of file *** Keywords *** Check resource existence and get CallbackUri Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Get ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId} Integer response status 200 Validate Json response body FmSubscriptions.schema.json Set Global Variable ${callbackResp} response body callbackUri Check HTTP Response Status Code Is [Arguments] ${expected_status} Log Validate Status code Should Be Equal As Strings ${response['status']} ${expected_status} Log Status code validated Post Alarm Notification log Trying to perform a POST to get notification Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} ${template} = Get File jsons/AlarmNotification.json ${body}= Format String ${template} subscriptionId=${subscriptionId} Post ${callbackResp} ${body} ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} Post Alarm Cleared Notification log Trying to perform a POST to get notification Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} ${template} = Get File jsons/AlarmClearedNotification.json ${body}= Format String ${template} subscriptionId=${subscriptionId} alarmId=${alarmId} Post ${callbackResp} ${body} ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} Post Alarm List Rebuilt Notification log Trying to perform a POST to get notification Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} ${template} = Get File jsons/AlarmListRebuiltNotification.json ${body}= Format String ${template} subscriptionId=${subscriptionId} Post ${callbackResp} ${body} ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} No newline at end of file Loading
SOL003/VNFFaultManagement-API/FaultManagement-APIKeyword.robot +46 −1 Original line number Diff line number Diff line Loading @@ -695,3 +695,48 @@ JWT Encode [Arguments] ${payload} ${key} ${algorithm} ${encoded}= Evaluate jwt.encode(${payload}, ${key}, ${algorithm}) [Return] ${encoded} Check resource existence and get CallbackUri Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Get ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId} Integer response status 200 Validate Json response body FmSubscriptions.schema.json Set Global Variable ${callbackResp} response body callbackUri Post Alarm Notification log Trying to perform a POST to get notification Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} ${template} = Get File jsons/AlarmNotification.json ${body}= Format String ${template} subscriptionId=${subscriptionId} Post ${callbackResp} ${body} ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} Post Alarm Cleared Notification log Trying to perform a POST to get notification Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} ${template} = Get File jsons/AlarmClearedNotification.json ${body}= Format String ${template} subscriptionId=${subscriptionId} alarmId=${alarmId} Post ${callbackResp} ${body} ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} Post Alarm List Rebuilt Notification log Trying to perform a POST to get notification Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} ${template} = Get File jsons/AlarmListRebuiltNotification.json ${body}= Format String ${template} subscriptionId=${subscriptionId} Post ${callbackResp} ${body} ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} No newline at end of file
SOL003/VNFFaultManagement-API/NotificationEndpoint.robot +2 −54 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ Library String Library OperatingSystem Resource environment/variables.txt Resource FaultManagement-APIKeyword.robot Library JSONLibrary Library JSONSchemaLibrary schemas/ Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} ssl_verify=false Loading Loading @@ -43,56 +44,3 @@ VNF Fault Alarm List Reulit Notification ... Post-Conditions: none Post Alarm List Rebuilt Notification Check HTTP Response Status Code Is 204 No newline at end of file *** Keywords *** Check resource existence and get CallbackUri Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Get ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId} Integer response status 200 Validate Json response body FmSubscriptions.schema.json Set Global Variable ${callbackResp} response body callbackUri Check HTTP Response Status Code Is [Arguments] ${expected_status} Log Validate Status code Should Be Equal As Strings ${response['status']} ${expected_status} Log Status code validated Post Alarm Notification log Trying to perform a POST to get notification Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} ${template} = Get File jsons/AlarmNotification.json ${body}= Format String ${template} subscriptionId=${subscriptionId} Post ${callbackResp} ${body} ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} Post Alarm Cleared Notification log Trying to perform a POST to get notification Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} ${template} = Get File jsons/AlarmClearedNotification.json ${body}= Format String ${template} subscriptionId=${subscriptionId} alarmId=${alarmId} Post ${callbackResp} ${body} ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} Post Alarm List Rebuilt Notification log Trying to perform a POST to get notification Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} ${template} = Get File jsons/AlarmListRebuiltNotification.json ${body}= Format String ${template} subscriptionId=${subscriptionId} Post ${callbackResp} ${body} ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} No newline at end of file