If not specified, default header is used.
Different header for POST request in GBP.
Change-Id: I8caa7152cc2076c97d573ebed9ca2290140c8e41
Signed-off-by: Tomas Cechvala <tcechval@cisco.com>
[Documentation] Unregister Endpoints L2Endpoints from ODL
: FOR ${endpoint} IN @{l2_eps}
\ ${l2_data} = Create L2 Endpoint JSON Data ${endpoint}
- \ Post Elements To URI ${ENDPOINT_UNREG_PATH} ${l2_data}
+ \ Post Elements To URI ${ENDPOINT_UNREG_PATH} ${l2_data} ${HEADERS_YANG_JSON}
Unregister L3Endpoints
[Arguments] ${l3_eps}
[Documentation] Unregister Endpoints L3Endpoints from ODL
: FOR ${endpoint} IN @{l3_eps}
\ ${l3_data} = Create L3 Endpoint JSON Data ${endpoint}
- \ Post Elements To URI ${ENDPOINT_UNREG_PATH} ${l3_data}
+ \ Post Elements To URI ${ENDPOINT_UNREG_PATH} ${l3_data} ${HEADERS_YANG_JSON}
Create L2 Endpoint JSON Data
[Arguments] ${endpoint}
[Return] ${output}
Post Elements To URI
- [Arguments] ${rest_uri} ${data}
+ [Arguments] ${rest_uri} ${data} ${headers}=${headers}
[Documentation] Perform a POST rest operation, using the URL and data provided
${resp} = RequestsLibrary.Post Request session ${rest_uri} data=${data} headers=${headers}
Should Be Equal As Strings ${resp.status_code} 200
Should Be Equal As Strings ${resp.status_code} 404
Add Elements To URI From File
- [Arguments] ${dest_uri} ${data_file}
+ [Arguments] ${dest_uri} ${data_file} ${headers}=${headers}
${body} OperatingSystem.Get File ${data_file}
${resp} RequestsLibrary.Put Request session ${dest_uri} data=${body} headers=${headers}
Should Be Equal As Strings ${resp.status_code} 200
Post Elements To URI From File
- [Arguments] ${dest_uri} ${data_file}
+ [Arguments] ${dest_uri} ${data_file} ${headers}=${headers}
${body} OperatingSystem.Get File ${data_file}
${resp} RequestsLibrary.Post Request session ${dest_uri} data=${body} headers=${headers}
Should Be Equal As Strings ${resp.status_code} 200
[Documentation] Endpoints registration
@{endpoint_files} = OperatingSystem.List Files In Directory ${ENDPOINTS_GBP1_DIR} vethl*.*json absolute
: FOR ${endpoint_file} IN @{endpoint_files}
- \ Post Elements To URI From File ${ENDPOINT_REG_PATH} ${endpoint_file}
+ \ Post Elements To URI From File ${ENDPOINT_REG_PATH} ${endpoint_file} ${HEADERS_YANG_JSON}
Put Tenant
[Documentation] Send GBP policy to ODL
[Documentation] Endpoints registration
@{endpoint_files} = OperatingSystem.List Files In Directory ${ENDPOINTS_GBP2_DIR} vethl*.*json absolute
: FOR ${endpoint_file} IN @{endpoint_files}
- \ Post Elements To URI From File ${ENDPOINT_REG_PATH} ${endpoint_file}
+ \ Post Elements To URI From File ${ENDPOINT_REG_PATH} ${endpoint_file} ${HEADERS_YANG_JSON}
Put Tenants
[Documentation] Send GBP policy to ODL
AUTH = [u'admin', u'admin']
SCOPE = 'sdn'
HEADERS = {'Content-Type': 'application/json'}
+HEADERS_YANG_JSON = {'Content-Type': 'application/yang.data+json'}
HEADERS_XML = {'Content-Type': 'application/xml'}
ACCEPT_XML = {'Accept': 'application/xml'}
ACCEPT_JSON = {'Accept': 'application/json'}