From: tierno Date: Fri, 16 Nov 2018 15:34:49 +0000 (+0100) Subject: Merge branch 'netslice' X-Git-Tag: v5.0.0~15 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F04%2F6904%2F1;p=osm%2FNBI.git Merge branch 'netslice' Change-Id: Ic9e13d09ca7aeb77afdae6e5ccfb25952acd993f Signed-off-by: tierno --- cd65be33d44114e73936813eaf790e6a12b0df63 diff --cc osm_nbi/html_public/version index e84b96c,23fb4a2..fbec8cf --- a/osm_nbi/html_public/version +++ b/osm_nbi/html_public/version @@@ -1,2 -1,2 +1,2 @@@ - 0.1.27 -0.1.24 -2018-11-02 ++0.1.28 +2018-11-16 diff --cc osm_nbi/nbi.py index c5262a8,1354f2c..b7a6990 --- a/osm_nbi/nbi.py +++ b/osm_nbi/nbi.py @@@ -91,12 -92,32 +93,36 @@@ URL: /os /sdns O O / O O O + /nst/v1 O O + /netslice_templates_content O O + / O O O O + /netslice_templates O O + / O O O + /nst_content O O + /nst O + /artifacts[/] O + /subscriptions X X + / X X + + /nsilcm/v1 + /netslice_instances_content O O + / O O + /netslice_instances O O + / O O + instantiate O + terminate O + action O + /nsi_lcm_op_occs O O + / O O O + /subscriptions X X + / X X + query string: Follows SOL005 section 4.3.2 It contains extra METHOD to override http method, FORCE to force. + simpleFilterExpr := ["."]*["."]"="[","]* + filterExpr := ["&"]* + op := "eq" | "neq" (or "ne") | "gt" | "lt" | "gte" | "lte" | "cont" | "ncont" + attrName := string For filtering inside array, it must select the element of the array, or add ANYINDEX to apply the filtering over any item of the array, that is, pass if any item of the array pass the filter. It allows both ne and neq for not equal @@@ -606,7 -661,7 +666,7 @@@ class Server(object) if not main_topic or not version or not topic: raise NbiException("URL must contain at least 'main_topic/version/topic'", HTTPStatus.METHOD_NOT_ALLOWED) - if main_topic not in ("admin", "vnfpkgm", "nsd", "nslcm", "pdu"): - if main_topic not in ("admin", "vnfpkgm", "nsd", "nslcm", "nst", "nsilcm"): ++ if main_topic not in ("admin", "vnfpkgm", "nsd", "nslcm", "pdu", "nst", "nsilcm"): raise NbiException("URL main_topic '{}' not supported".format(main_topic), HTTPStatus.METHOD_NOT_ALLOWED) if version != 'v1': diff --cc osm_nbi/tests/clear-all.sh index 9ea6f36,c670106..dd95417 --- a/osm_nbi/tests/clear-all.sh +++ b/osm_nbi/tests/clear-all.sh @@@ -66,7 -66,7 +66,7 @@@ the done fi - for item in vim_accounts sdns nsrs vnfrs nslcmops nsds vnfds projects pdus # vims -for item in vim_accounts sdns nsrs vnfrs nslcmops nsds vnfds projects nsts nsis nsilcmops # vims ++for item in vim_accounts sdns nsrs vnfrs nslcmops nsds vnfds projects pdus nsts nsis nsilcmops # vims do curl --insecure ${OSMNBI_URL}/test/db-clear/${item} echo " ${item}" diff --cc osm_nbi/tests/test.py index dc7072c,2fbc217..51e1494 --- a/osm_nbi/tests/test.py +++ b/osm_nbi/tests/test.py @@@ -1620,8 -1395,7 +1647,9 @@@ if __name__ == "__main__" "TestDescriptors": TestDescriptors, "TestDeployHackfest1": TestDeployHackfest1, # "Deploy-MultiVIM": TestDeployMultiVIM, + "DeploySingleVdu": TestDeploySingleVdu, + "DeployHnfd": TestDeployHnfd, + "Upload-Slice-Template": TestNstTemplates, } test_to_do = [] test_params = {} diff --cc osm_nbi/validation.py index f81f45c,62d9d22..b8953b5 --- a/osm_nbi/validation.py +++ b/osm_nbi/validation.py @@@ -560,11 -560,41 +561,43 @@@ nbi_edit_input_schemas = "pdus": pdu_edit_schema, } + # NETSLICE SCHEMAS + nsi_instantiate = { + "title": "netslice action instantiate input schema", + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "lcmOperationType": string_schema, + "nsiInstanceId": id_schema, + "nsiName": name_schema, + "nsiDescription": {"oneOf": [description_schema, {"type": "null"}]}, + "nstdId": string_schema, + "vimAccountId": id_schema, + "ssh_keys": {"type": "string"}, + "nsi_id": id_schema, + "ns": { + "type": "array", + "minItems": 1, + "items": ns_instantiate + }, + }, + "required": ["nsiName", "nstdId", "vimAccountId"], + "additionalProperties": False + } + + nsi_action = { + + } + + nsi_terminate = { + + } + class ValidationError(Exception): - pass + def __init__(self, message, http_code=HTTPStatus.UNPROCESSABLE_ENTITY): + self.http_code = http_code + Exception.__init__(self, message) def validate_input(indata, schema_to_use):