Skip to content
NSLCMOperationKeywords.robot 64.9 KiB
Newer Older
aureliano sinatra's avatar
aureliano sinatra committed
*** Settings ***
Giacomo Bernini's avatar
Giacomo Bernini committed
Resource   environment/variables.txt
Library    REST     ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}    ssl_verify=false
aureliano sinatra's avatar
aureliano sinatra committed
Library    JSONLibrary
Library    Process
Library    JSONSchemaLibrary    schemas/
Library    OperatingSystem
Library    MockServerLibrary
root's avatar
root committed
Library    Collections
Giacomo Bernini's avatar
Giacomo Bernini committed
Library    String
aureliano sinatra's avatar
aureliano sinatra committed

*** Keywords ***
Initialize System
    Start Process  java  -jar  ../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar  -serverPort  ${callback_port}  alias=mockInstance
    Wait For Process  handle=mockInstance  timeout=5s  on_timeout=continue
    Create Mock Session  ${callback_uri}:${callback_port} 
    
Check Operation Occurrence Id
Elian Kraja's avatar
Elian Kraja committed
    ${occid}=    Get Value From Json    ${response['headers']['Location']}  ${response}
aureliano sinatra's avatar
aureliano sinatra committed
    Set Global Variable    @{nsLcmOpOccId}    ${occid}
    Should Not Be Empty    ${nsLcmOpOccId}
    
Create Sessions
    Start Process  java  -jar  ../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar  -serverPort  ${callback_port}  alias=mockInstance
    Wait For Process  handle=mockInstance  timeout=5s  on_timeout=continue
    Create Mock Session  ${callback_uri}:${callback_port}   
    
Check subscription existence
aureliano sinatra's avatar
aureliano sinatra committed
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Get    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} 
    Integer    response status    200
    
root's avatar
root committed
Check Instance Deleted
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
root's avatar
root committed
    Delete    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}
root's avatar
root committed
    Integer    response status    404
root's avatar
root committed
    
aureliano sinatra's avatar
aureliano sinatra committed
Check Fail not supported
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Get    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs/${nsLcmOpOccId}
    # how to check if Fail is not supported? Also In Sol002
    
Check Cancel not supported
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Get    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs/${nsLcmOpOccId}
    # how to check if Cancel is not supported? Also In Sol002
    
Check Continue not supported
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Get    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs/${nsLcmOpOccId}
    # how to check if Continue is not supported? Also In Sol002
    
Check retry not supported
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Get    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs/${nsLcmOpOccId}
    # how to check if retry is not supported? Also In Sol002
    
Check Rollback not supported
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Get    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs/${nsLcmOpOccId}
    # how to check if rollback is not supported? Also In Sol002
    
Check resource FAILED_TEMP
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Get    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs/${nsLcmOpOccId} 
    String    response body operationState    FAILED_TEMP

Check resource not 
    [Arguments]   ${status}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs/${nsLcmOpOccId} 
    Should Not Be Equal As Strings  response body operationState    ${status}

aureliano sinatra's avatar
aureliano sinatra committed
Check Operation Notification Status is
    [Arguments]    ${status}
    Check Operation Notification    NsLcmOperationOccurrenceNotification   ${status}

Check Operation Notification
    [Arguments]    ${element}    ${status}
aureliano sinatra's avatar
aureliano sinatra committed
    ${json}=	Get File	schemas/${element}.schema.json
    Configure Notification Forward    ${element}    ${callback_endpoint}    ${callback_endpoint_fwd}
    Configure Notification Status Handler    ${callback_endpoint_fwd}    ${status}
    Wait Until Keyword Succeeds    ${notification_timeout}   ${poll_interval}   Verify Mock Expectation    ${notification_request}
aureliano sinatra's avatar
aureliano sinatra committed
    Clear Requests    ${callback_endpoint}
    Clear Requests    ${callback_endpoint_fwd}
    
Configure Notification Forward
    [Arguments]    ${element}    ${endpoint}    ${endpoint_fwd}    
   # ${BODY}=	evaluate	json.loads('''${json}''')	json
aureliano sinatra's avatar
aureliano sinatra committed
    Log  Creating mock HTTP forward to handle ${element}
    &{notification_tmp}=  Create Mock Request Matcher	POST  ${endpoint}  body_type="JSON_SCHEMA"    body=${element}
aureliano sinatra's avatar
aureliano sinatra committed
    &{notification_fwd}=  Create Mock Http Forward	${endpoint_fwd}
    Create Mock Expectation With Http Forward  ${notification_tmp}  ${notification_fwd}
    
Configure Notification Status Handler
    [Arguments]    ${endpoint}    ${status}
    set to dictionary   ${json}    notificationStatus    ${status}   
aureliano sinatra's avatar
aureliano sinatra committed
    ${BODY}=    evaluate    json.dumps(${json})    json
    Log  Creating mock request and response to handle ${endpoint}
    &{req}=  Create Mock Request Matcher	POST  ${endpoint}  body_type="JSON"    body=${BODY}
    Set Global Variable    ${req}    ${notification_request}
    &{headers} =    Create Dictionary    Content-Type=application/json
    &{notification_response}=  Create Mock Response    headers=${headers}    status_code=204
aureliano sinatra's avatar
aureliano sinatra committed
    Create Mock Expectation  ${notification_request}  ${notification_response}    
        
Check resource operationState is
    [Arguments]    ${state} 
Elian Kraja's avatar
Elian Kraja committed
    String    ${response['body']['operationState']}   ${state}
Check resource INSTANTIATED
aureliano sinatra's avatar
aureliano sinatra committed
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${response['headers']['Location']}  
    ${opocc}=    Output    response
    Should Be Equal as Strings  ${opocc['status']}    200
    Get    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${opocc['body']['nsInstanceId']} 
Elian Kraja's avatar
Elian Kraja committed
    String    response body nsState    INSTANTIATED
aureliano sinatra's avatar
aureliano sinatra committed
    
Check resource not_instantiated
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${response['body']['id']}
    String    response body nsState     NOT_INSTANTIATED

Check NS resource not_instantiated
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${response['headers']['Location']}  
    ${opocc}=    Output    response
    Should Be Equal as Strings  ${opocc['status']}    200
    Get    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${opocc['body']['nsInstanceId']} 
Elian Kraja's avatar
Elian Kraja committed
    String    response body nsState     NOT_INSTANTIATED
Check operation resource state is FAILED_TEMP    
aureliano sinatra's avatar
aureliano sinatra committed
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${response['headers']['Location']}
    ${opocc}=    Output    response
    Should Be Equal as Strings  ${opocc['status']}    200
    Get    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${opocc['body']['nsInstanceId']}
aureliano sinatra's avatar
aureliano sinatra committed
    String    response body instantiationState    FAILED_TEMP 
Elian Kraja's avatar
Elian Kraja committed
    
Check operation resource state is not FAILED_TEMP
    Check operation resource state is FAILED_TEMP    
aureliano sinatra's avatar
aureliano sinatra committed
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${response['headers']['Location']}  
    ${opocc}=    Output    response
    Should Be Equal as Strings  ${opocc['status']}    200
    Get    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${opocc['body']['nsInstanceId']}
Giacomo Bernini's avatar
Giacomo Bernini committed
    String  response body instantiationState  not  FAILED_TEMP
aureliano sinatra's avatar
aureliano sinatra committed

Check resource is finally failed
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${response['headers']['Location']}  
    ${opocc}=    Output    response
    Should Be Equal as Strings  ${opocc['status']}    200
    Get    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${opocc['body']['nsInstanceId']}
aureliano sinatra's avatar
aureliano sinatra committed
    String    response body instantiationState    FINALLY_FAILED 

aureliano sinatra's avatar
aureliano sinatra committed
Launch another LCM operation
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    ${body}=    Get File    jsons/scaleNsToLevelRequest.json
    Post    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}/scale_to_level    ${body}
    Integer    response status    202

aureliano sinatra's avatar
aureliano sinatra committed
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Get    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId} 
    Integer    response status    200
    
root's avatar
root committed
Check Postcondition NS Instance is not created
root's avatar
root committed
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
root's avatar
root committed
    Get    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId} 
    Integer    response status    404
    
aureliano sinatra's avatar
aureliano sinatra committed
Check HTTP Response Status Code Is
    [Arguments]    ${expected_status}
    Log    Validate Status code    
Elian Kraja's avatar
Elian Kraja committed
    Should Be Equal as Strings  ${response['status']}    ${expected_status}
aureliano sinatra's avatar
aureliano sinatra committed
    Log    Status code validated 
    
root's avatar
root committed
Check Postcondition NS Instance is deleted
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
root's avatar
root committed
    Get    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId} 
    Integer    response status    404
    
Check Postcondition NS Instance is not modified
    GET IndividualNSInstance
Elian Kraja's avatar
Elian Kraja committed
    ${resp_dict}=    evaluate    json.loads('''${response['body']}''')    json
root's avatar
root committed
    ${body}=    Get File    jsons/CreateNsRequest.json
    Dictionaries Should Be Equal    ${resp_dict}    ${body}    values=True
    
aureliano sinatra's avatar
aureliano sinatra committed
Check HTTP Response Header Contains
    [Arguments]    ${HEADER_TOCHECK}
Elian Kraja's avatar
Elian Kraja committed
    Should Contain     ${response['headers']}    ${HEADER_TOCHECK}
aureliano sinatra's avatar
aureliano sinatra committed
    Log    Header is present    
    
Check HTTP Response Body Json Schema Is
    [Arguments]    ${input}
    Run Keyword If    '${input}' == 'ProblemDetails'    Should Contain    ${response['headers']['Content-Type']}    application/problem+json
    ...    ELSE    Should Contain    ${response['headers']['Content-Type']}    application/json
    ${schema} =    Catenate    SEPARATOR=    ${input}    .schema.json
Elian Kraja's avatar
Elian Kraja committed
    Validate Json    ${schema}    ${response['body']}
aureliano sinatra's avatar
aureliano sinatra committed
    Log    Json Schema Validation OK
    
root's avatar
root committed
Check Postcondition NS Instance is not deleted
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
root's avatar
root committed
    Get    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId} 
    Integer    response status    200
    
aureliano sinatra's avatar
aureliano sinatra committed
Check HTTP Response Header ContentType is
    [Arguments]    ${expected_contentType}
    Log    Validate content type
Elian Kraja's avatar
Elian Kraja committed
    Should Be Equal as Strings   ${response['headers']['Content-Type']}    ${expected_contentType}
aureliano sinatra's avatar
aureliano sinatra committed
    Log    Content Type validated 

POST New nsInstance
    Log    Create NS instance by POST to ${apiRoot}/${apiName}/${apiVersion}/ns_instances
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    ${body}=    Get File    jsons/CreateNsRequest.json
    Post    ${apiRoot}/${apiName}/${apiVersion}/ns_instances    ${body}
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}     
POST New nsInstance resource workflow
    Log    Create NS instance by POST to ${apiRoot}/${apiName}/${apiVersion}/ns_instances
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    ${body}=    Get File    jsons/CreateNsRequest.json
    Post    ${apiRoot}/${apiName}/${apiVersion}/ns_instances    ${body}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}  

aureliano sinatra's avatar
aureliano sinatra committed
GET NsInstances
    Log    Query NS The GET method queries information about multiple NS instances.
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Get    ${apiRoot}/${apiName}/${apiVersion}/ns_instances
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
aureliano sinatra's avatar
aureliano sinatra committed
	

GET NsInstance Invalid Attribute-Based filtering parameter
    Log    Query NS The GET method queries information about multiple NS instances.
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Get   ${apiRoot}/${apiName}/${apiVersion}/ns_instances?attribute_not_exist=some_value
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
aureliano sinatra's avatar
aureliano sinatra committed
	
GET NsInstance Invalid Attribute Selector
    Log    Query NS The GET method queries information about multiple NS instances.
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} 
aureliano sinatra's avatar
aureliano sinatra committed
    Get    ${apiRoot}/${apiName}/${apiVersion}/ns_instances?fields=wrong_field	
aureliano sinatra's avatar
aureliano sinatra committed
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}  
aureliano sinatra's avatar
aureliano sinatra committed
Get NSInstances with all_fields attribute selector
    Log    Get the list of NSInstances, using fields
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    GET    ${apiRoot}/${apiName}/${apiVersion}/ns_instances?exclude_default
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
Get NSInstances with exclude_default attribute selector
    Log    Get the list of NSInstances, using fields
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    GET    ${apiRoot}/${apiName}/${apiVersion}/ns_instances?exclude_default
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
Get NSInstances with fields attribute selector
    Log    Get the list of NSInstances, using fields
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    GET    ${apiRoot}/${apiName}/${apiVersion}/ns_instances?fields=${fields}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}	
Get NSInstances with exclude_fields attribute selector
    Log    Get the list of NSInstances, using fields
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    GET    ${apiRoot}/${apiName}/${apiVersion}/ns_instances?exclude_fields=${fields}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output} 
    	
aureliano sinatra's avatar
aureliano sinatra committed
PUT NSInstances
    log    Trying to perform a PUT. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Put    ${apiRoot}/${apiName}/${apiVersion}/ns_instances
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}   
aureliano sinatra's avatar
aureliano sinatra committed
	
PATCH NSInstances
    log    Trying to perform a PATCH. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Patch    ${apiRoot}/${apiName}/${apiVersion}/ns_instances
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}  
aureliano sinatra's avatar
aureliano sinatra committed
	
DELETE NSInstances
    log    Trying to perform a DELETE. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Delete    ${apiRoot}/${apiName}/${apiVersion}/ns_instances
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse} 
aureliano sinatra's avatar
aureliano sinatra committed

POST IndividualNSInstance
    Log    Trying to perform a POST. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Post    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse} 
aureliano sinatra's avatar
aureliano sinatra committed
	
GET IndividualNSInstance
    Log    Trying to get information about an individual NS instance
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Get    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}
Elian Kraja's avatar
Elian Kraja committed
    ${Etag}=    Output    response headers ETag
aureliano sinatra's avatar
aureliano sinatra committed
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse} 
aureliano sinatra's avatar
aureliano sinatra committed
    
aureliano sinatra's avatar
aureliano sinatra committed
PUT IndividualNSInstance
    Log    Trying to perform a PUT. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Put    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse} 	
aureliano sinatra's avatar
aureliano sinatra committed
	
PATCH IndividualNSInstance
    Log    Trying to perform a PATCH. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Patch    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse} 	
aureliano sinatra's avatar
aureliano sinatra committed
	
DELETE IndividualNSInstance
    log    Trying to delete an individual VNF instance
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Delete    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse} 	
aureliano sinatra's avatar
aureliano sinatra committed
	

DELETE IndividualNSInstance Conflict
    log    Trying to delete an individual VNF instance
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Delete    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${ConflictNsInstanceId}
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse} 	
aureliano sinatra's avatar
aureliano sinatra committed


DELETE Instantiate NSInstance
    log    Trying to delete an instantiate NS instance. This method should not be implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Delete    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}/instantiate
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse} 
aureliano sinatra's avatar
aureliano sinatra committed
 
 PATCH Instantiate NSInstance
    log    Trying to patch an instantiate NS instance. This method should not be implemented 
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Patch    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}/instantiate
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse} 
aureliano sinatra's avatar
aureliano sinatra committed
 
PUT Instantiate NSInstance
    log    Trying to put an instantiate NS instance. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Put    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}/instantiate
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse} 
aureliano sinatra's avatar
aureliano sinatra committed
	
GET Instantiate NSInstance
    log    Trying to get an instantiate NS instance. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Get    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}/instantiate
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse} 
 POST Instantiate nsInstance
aureliano sinatra's avatar
aureliano sinatra committed
    Log    Trying to Instantiate a ns Instance
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    ${body}=    Get File    jsons/InstantiateNsRequest.json
    Post    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}/instantiate    ${body}
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
aureliano sinatra's avatar
aureliano sinatra committed
	
DELETE Scale NSInstance
    log    Trying to delete an Scale NS instance. This method should not be implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Delete    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}/scale
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse} 
aureliano sinatra's avatar
aureliano sinatra committed
 
 PATCH Scale NSInstance
    log    Trying to patch an Scale NS instance. This method should not be implemented 
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Patch    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}/scale
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse} 
aureliano sinatra's avatar
aureliano sinatra committed
 
PUT Scale NSInstance
    log    Trying to put an Scale NS instance. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Put    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}/scale
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse} 
aureliano sinatra's avatar
aureliano sinatra committed
	
GET Scale NSInstance
    log    Trying to get an Scale NS instance. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Get    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}/scale
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse} 
aureliano sinatra's avatar
aureliano sinatra committed
	
POST scale nsInstance
	Log    Trying to Instantiate a scale NS Instance
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    ${body}=    Get File    jsons/ScaleNsRequest.json
	Post    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}/scale    ${body}
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse} 
aureliano sinatra's avatar
aureliano sinatra committed
	
DELETE Update NSInstance
    log    Trying to delete an Update NS instance. This method should not be implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Delete    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}/update
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse} 
aureliano sinatra's avatar
aureliano sinatra committed
 
 PATCH Update NSInstance
    log    Trying to patch an Update NS instance. This method should not be implemented 
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Patch    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}/update
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse} 
aureliano sinatra's avatar
aureliano sinatra committed
 
PUT Update NSInstance
    log    Trying to put an Update NS instance. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Put    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}/update
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse} 
aureliano sinatra's avatar
aureliano sinatra committed
	
GET Update NSInstance
    log    Trying to get an Update NS instance. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Get    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}/update
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse} 
aureliano sinatra's avatar
aureliano sinatra committed
	
POST Update NSInstance
	Log    Trying to Instantiate a Update NS Instance
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    ${body}=    Get File    jsons/UpdateNsRequest.json
	Post    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}/update    ${body}
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse} 
aureliano sinatra's avatar
aureliano sinatra committed
	
DELETE Heal NSInstance
    log    Trying to Delete an Heal NS instance. This method should not be implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Delete    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}/heal
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse} 
aureliano sinatra's avatar
aureliano sinatra committed
 
 PATCH Heal NSInstance
    log    Trying to patch an Heal NS instance. This method should not be implemented 
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Patch    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}/heal
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse} 
aureliano sinatra's avatar
aureliano sinatra committed
 
PUT Heal NSInstance
    log    Trying to put an Heal NS instance. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Put    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}/heal
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse} 
aureliano sinatra's avatar
aureliano sinatra committed
	
GET Heal NSInstance
    log    Trying to get an Heal NS instance. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Get    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}/heal
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse} 
aureliano sinatra's avatar
aureliano sinatra committed
	
POST Heal NSInstance
	Log    Trying to Instantiate a Heal NS Instance
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    ${body}=    Get File    jsons/HealNsRequest.json
	Post    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}/heal    ${body}
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse} 
aureliano sinatra's avatar
aureliano sinatra committed
	
DELETE Terminate NSInstance
    log    Trying to Delete an Terminate NS instance. This method should not be implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Delete    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}/terminate
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse} 
aureliano sinatra's avatar
aureliano sinatra committed
 
PATCH Terminate NSInstance
    log    Trying to patch an Terminate NS instance. This method should not be implemented 
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Patch    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}/terminate
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse} 
aureliano sinatra's avatar
aureliano sinatra committed
 
PUT Terminate NSInstance
    log    Trying to put an Terminate NS instance. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Put    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}/terminate
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse} 
aureliano sinatra's avatar
aureliano sinatra committed
	
GET Terminate NSInstance
    log    Trying to Get an Terminate NS instance. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Get    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}/terminate
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse} 
aureliano sinatra's avatar
aureliano sinatra committed
	
POST Terminate NSInstance
	Log    Trying to Instantiate a Terminate NS Instance
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    ${body}=    Get File    jsons/TerminateNsRequest.json
	Post    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}/terminate    ${body}
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse} 
aureliano sinatra's avatar
aureliano sinatra committed
    log    Trying to perform a POST. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Post    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs 	
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
aureliano sinatra's avatar
aureliano sinatra committed
    log    Trying to perform a PUT. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Put    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs 	
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
aureliano sinatra's avatar
aureliano sinatra committed
    log    Trying to perform a PATCH. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Patch    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs 	
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
DELETE NS LCM OP Occurrences
aureliano sinatra's avatar
aureliano sinatra committed
    log    Trying to perform a DELETE. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Delete    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs 	
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
aureliano sinatra's avatar
aureliano sinatra committed
    Log    Query status information about multiple NS lifecycle management operation occurrences.
	Set Headers  {"Accept":"${ACCEPT}"}  
	Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
	Log    Execute Query and validate response
	Get    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs
	${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
GET NS LCM OP Occurrences Invalid attribute-based filtering parameters
aureliano sinatra's avatar
aureliano sinatra committed
    Log    Query status information about multiple NS lifecycle management operation occurrences.
	Set Headers  {"Accept":"${ACCEPT}"}  
	Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} 
Giacomo Bernini's avatar
Giacomo Bernini committed
	GET    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs?${NEG_FILTER}
aureliano sinatra's avatar
aureliano sinatra committed
	${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
GET NS LCM OP Occurrences Invalid attribute selector
aureliano sinatra's avatar
aureliano sinatra committed
    Log    Query status information about multiple NS lifecycle management operation occurrences.
aureliano sinatra's avatar
aureliano sinatra committed
    Set Headers  {"Accept":"${ACCEPT}"}  
	Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} 
Giacomo Bernini's avatar
Giacomo Bernini committed
	GET    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs?${NEG_SELECTOR}
aureliano sinatra's avatar
aureliano sinatra committed
	${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
Get NS LCM OP Occurrences with all_fields attribute selector
aureliano sinatra's avatar
aureliano sinatra committed
    Log    Query status information about multiple NS lifecycle management operation occurrences, using fields
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    GET    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs?exclude_default
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
Get NS LCM OP Occurrences with exclude_default attribute selector
aureliano sinatra's avatar
aureliano sinatra committed
    Log    Query status information about multiple NS lifecycle management operation occurrences using fields
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    GET    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs?exclude_default
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
Get NS LCM OP Occurrences with fields attribute selector
aureliano sinatra's avatar
aureliano sinatra committed
    Log    Query status information about multiple NS lifecycle management operation occurrences, using fields
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    GET    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs?fields=${fields}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}	
Get NS LCM OP Occurrences with exclude_fields attribute selector
aureliano sinatra's avatar
aureliano sinatra committed
    Log    Query status information about multiple NS lifecycle management operation occurrences, using fields
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    GET    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs?exclude_fields=${fields}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output} 
    
POST Individual NS LCM OP Occurrence
aureliano sinatra's avatar
aureliano sinatra committed
    log    Trying to perform a POST. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Post    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs/${nsLcmOpOccId} 	
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
PUT Individual NS LCM OP Occurrence
aureliano sinatra's avatar
aureliano sinatra committed
    log    Trying to perform a PUT. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Put    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs/${nsLcmOpOccId} 		
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
PATCH Individual NS LCM OP Occurrence
aureliano sinatra's avatar
aureliano sinatra committed
    log    Trying to perform a PATCH. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Patch    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs/${nsLcmOpOccId} 	 	
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
DELETE Individual NS LCM OP Occurrence
aureliano sinatra's avatar
aureliano sinatra committed
    log    Trying to perform a DELETE. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Delete    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs/${nsLcmOpOccId} 	 	
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
GET Individual NS LCM OP Occurrence
aureliano sinatra's avatar
aureliano sinatra committed
    Log    Query status information about individual NS lifecycle management operation occurrence.
	Set Headers  {"Accept":"${ACCEPT}"}  
	Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
	Log    Execute Query and validate response
	Get    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs/${nsLcmOpOccId} 	
	${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}	
aureliano sinatra's avatar
aureliano sinatra committed
	
GET Retry operation task
    log    Trying to perform a GET. This method should not be implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Get    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs/${nsLcmOpOccId}/retry 	
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
aureliano sinatra's avatar
aureliano sinatra committed
	
PUT Retry operation task
    log    Trying to perform a PUT. This method should not be implemented 
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Put    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs/${nsLcmOpOccId}/retry  		
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
aureliano sinatra's avatar
aureliano sinatra committed
	
PATCH Retry operation task
    log    Trying to perform a PATCH. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}  
    Patch    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs/${nsLcmOpOccId}/retry  	 	
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
aureliano sinatra's avatar
aureliano sinatra committed
	
DELETE Retry operation task
    log    Trying to perform a DELETE. This method should not be implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Delete    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs/${nsLcmOpOccId}/retry  	 	
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
aureliano sinatra's avatar
aureliano sinatra committed
	
POST Retry operation task
    Log    Retry a NS lifecycle operation if that operation has experienced a temporary failure
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Log    Execute Query and validate response
    Post    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs/${nsLcmOpOccId}/retry
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
aureliano sinatra's avatar
aureliano sinatra committed
	
GET Rollback operation task
    log    Trying to perform a GET. This method should not be implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Get    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs/${nsLcmOpOccId}/rollback 	
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
aureliano sinatra's avatar
aureliano sinatra committed
	
PUT Rollback operation task
    log    Trying to perform a PUT. This method should not be implemented 
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Put    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs/${nsLcmOpOccId}/rollback  		
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
aureliano sinatra's avatar
aureliano sinatra committed
	
PATCH Rollback operation task
    log    Trying to perform a PATCH. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}  
    Patch    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs/${nsLcmOpOccId}/rollback  	 	
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
aureliano sinatra's avatar
aureliano sinatra committed
	
DELETE Rollback operation task
    log    Trying to perform a DELETE. This method should not be implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Delete    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs/${nsLcmOpOccId}/rollback  	 	
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
aureliano sinatra's avatar
aureliano sinatra committed
	
POST Rollback operation task
    Log    Rollback a NS lifecycle operation task
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Log    Execute Query and validate response
    Post    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs/${nsLcmOpOccId}/rollback
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
aureliano sinatra's avatar
aureliano sinatra committed
	
GET Continue operation task
    log    Trying to perform a GET. This method should not be implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Get    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs/${nsLcmOpOccId}/continue 	
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
aureliano sinatra's avatar
aureliano sinatra committed
	
PUT Continue operation task
    log    Trying to perform a PUT. This method should not be implemented 
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Put    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs/${nsLcmOpOccId}/continue  		
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
aureliano sinatra's avatar
aureliano sinatra committed
	
PATCH Continue operation task
    log    Trying to perform a PATCH. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}  
    Patch    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs/${nsLcmOpOccId}/continue  	 	
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
aureliano sinatra's avatar
aureliano sinatra committed
	
DELETE Continue operation task
    log    Trying to perform a DELETE. This method should not be implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Delete    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs/${nsLcmOpOccId}/continue  	 	
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
aureliano sinatra's avatar
aureliano sinatra committed
	
POST Continue operation task
    Log    Continue a NS lifecycle operation task
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Log    Execute Query and validate response
    Post    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs/${nsLcmOpOccId}/continue
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
aureliano sinatra's avatar
aureliano sinatra committed

GET Fail operation task
    log    Trying to perform a GET. This method should not be implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Get    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs/${nsLcmOpOccId}/fail 	
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
aureliano sinatra's avatar
aureliano sinatra committed
	
PUT Fail operation task
    log    Trying to perform a PUT. This method should not be implemented 
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Put    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs/${nsLcmOpOccId}/fail  		
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
aureliano sinatra's avatar
aureliano sinatra committed
	
PATCH Fail operation task
    log    Trying to perform a PATCH. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}  
    Patch    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs/${nsLcmOpOccId}/fail  	 	
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
aureliano sinatra's avatar
aureliano sinatra committed
	
DELETE Fail operation task
    log    Trying to perform a DELETE. This method should not be implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Delete    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs/${nsLcmOpOccId}/fail  	 	
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
aureliano sinatra's avatar
aureliano sinatra committed
	
POST Fail operation task
    Log    Fail a NS lifecycle operation task
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Log    Execute Query and validate response
    Post    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs/${nsLcmOpOccId}/fail
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
aureliano sinatra's avatar
aureliano sinatra committed
	
GET Cancel operation task
    log    Trying to perform a GET. This method should not be implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Get    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs/${nsLcmOpOccId}/cancel 	
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
aureliano sinatra's avatar
aureliano sinatra committed
	
PUT Cancel operation task
    log    Trying to perform a PUT. This method should not be implemented 
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Put    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs/${nsLcmOpOccId}/cancel  		
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
aureliano sinatra's avatar
aureliano sinatra committed
	
PATCH Cancel operation task
    Log    Trying to perform a PATCH. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}  
    Patch    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs/${nsLcmOpOccId}/cancel  	 	
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
aureliano sinatra's avatar
aureliano sinatra committed
	
DELETE Cancel operation task
    Log    Trying to perform a DELETE. This method should not be implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Delete    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs/${nsLcmOpOccId}/cancel  	 	
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
aureliano sinatra's avatar
aureliano sinatra committed
	
POST Cancel operation task
    Log    Cancel a NS lifecycle operation task
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Log    Execute Query and validate response
    Post    ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs/${nsLcmOpOccId}/cancel
    ${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
aureliano sinatra's avatar
aureliano sinatra committed
	
PUT subscriptions
    Log    Trying to perform a PUT. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Put    ${apiRoot}/${apiName}/${apiVersion}/subscriptions    
	${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
aureliano sinatra's avatar
aureliano sinatra committed
	
PATCH subscriptions
    Log    Trying to perform a PATCH. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Patch    ${apiRoot}/${apiName}/${apiVersion}/subscriptions    
	${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
aureliano sinatra's avatar
aureliano sinatra committed
	
DELETE subscriptions
    Log    Trying to perform a DELETE. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    Delete    ${apiRoot}/${apiName}/${apiVersion}/subscriptions    
	${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
aureliano sinatra's avatar
aureliano sinatra committed
	
POST subscriptions
    Log    Create subscription instance by POST to ${apiRoot}/${apiName}/${apiVersion}/subscriptions
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    ${body}=    Get File    jsons/LccnSubscriptionRequest.json
    ${body}=    Replace String    ${body}    \${callback_uri}    ${callback_uri}
    ${body}=    Replace String    ${body}    \${callback_port}    ${callback_port}
    ${body}=    Replace String    ${body}    \${callback_endpoint}    ${callback_endpoint}
    Log  Creating mock request and response to handle GET operation on notification endpoint
    &{notification_request}=  Create Mock Request Matcher	GET  ${callback_endpoint}
    &{notification_response}=  Create Mock Response	status_code=204
    Log    Issue the subscription request
    Create Mock Expectation  ${notification_request}  ${notification_response}
aureliano sinatra's avatar
aureliano sinatra committed
    Post    ${apiRoot}/${apiName}/${apiVersion}/subscriptions    ${body}    
	${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
	Clear Requests    ${callback_endpoint}
aureliano sinatra's avatar
aureliano sinatra committed
	
POST subscriptions DUPLICATION
    Log    Trying to create a subscription with an already created content
    Pass Execution If    ${NFVO_DUPLICATION} == 0    NFVO is not permitting duplication. Skipping the test
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    ${body}=    Get File    jsons/LccnSubscriptionRequest.json
    ${body}=    Replace String    ${body}    \${callback_uri}    ${callback_uri}
    ${body}=    Replace String    ${body}    \${callback_port}    ${callback_port}
    ${body}=    Replace String    ${body}    \${callback_endpoint}    ${callback_endpoint}
    Log  Creating mock request and response to handle GET operation on notification endpoint
    &{notification_request}=  Create Mock Request Matcher	GET  ${callback_endpoint}
    &{notification_response}=  Create Mock Response	status_code=204
    Log    Issue the subscription request
    Create Mock Expectation  ${notification_request}  ${notification_response}
Elian Kraja's avatar
Elian Kraja committed
    Post    ${apiRoot}/${apiName}/${apiVersion}/subscriptions    ${body}    allow_redirects=false
aureliano sinatra's avatar
aureliano sinatra committed
	${outputResponse}=    Output    response
Elian Kraja's avatar
Elian Kraja committed
	Set Global Variable    ${response}    ${outputResponse}
	Clear Requests    ${callback_endpoint}
aureliano sinatra's avatar
aureliano sinatra committed
	
POST subscriptions NO DUPLICATION
    Log    Trying to create a subscription with an already created content
    Pass Execution If    ${NFVO_DUPLICATION} == 1    NFVO is permitting duplication.
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
aureliano sinatra's avatar
aureliano sinatra committed
    ${body}=    Get File    jsons/LccnSubscriptionRequest.json
    ${body}=    Replace String    ${body}    \${callback_uri}    ${callback_uri}
    ${body}=    Replace String    ${body}    \${callback_port}    ${callback_port}
    ${body}=    Replace String    ${body}    \${callback_endpoint}    ${callback_endpoint}
    Log  Creating mock request and response to handle GET operation on notification endpoint
    &{notification_request}=  Create Mock Request Matcher	GET  ${callback_endpoint}