Merge branch 'netslice' 04/6904/1
authortierno <alfonso.tiernosepulveda@telefonica.com>
Fri, 16 Nov 2018 15:34:49 +0000 (16:34 +0100)
committertierno <alfonso.tiernosepulveda@telefonica.com>
Fri, 16 Nov 2018 15:34:49 +0000 (16:34 +0100)
Change-Id: Ic9e13d09ca7aeb77afdae6e5ccfb25952acd993f
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
1  2 
Dockerfile.local
osm_nbi/descriptor_topics.py
osm_nbi/html_out.py
osm_nbi/html_public/version
osm_nbi/instance_topics.py
osm_nbi/nbi.py
osm_nbi/tests/clear-all.sh
osm_nbi/tests/test.py
osm_nbi/validation.py

Simple merge
Simple merge
Simple merge
@@@ -1,2 -1,2 +1,2 @@@
- 0.1.27
 -0.1.24
 -2018-11-02
++0.1.28
 +2018-11-16
Simple merge
diff --cc osm_nbi/nbi.py
@@@ -91,12 -92,32 +93,36 @@@ URL: /os
              /sdns                                               O       O
                  /<id>                                           O                       O       O
  
+         /nst/v1                                                 O       O
+             /netslice_templates_content                         O       O
+                 /<nstInfoId>                                    O       O       O       O
+             /netslice_templates                                 O       O
+                 /<nstInfoId>                                    O                       O       O
+                     /nst_content                                O               O
+                     /nst                                        O
+                     /artifacts[/<artifactPath>]                 O
+             /subscriptions                                      X       X
+                 /<subscriptionId>                               X                       X
+         /nsilcm/v1
+             /netslice_instances_content                         O       O
+                 /<SliceInstanceId>                              O                       O
+             /netslice_instances                                 O       O
+                 /<SliceInstanceId>                              O                       O
+                     instantiate                                         O
+                     terminate                                           O
+                     action                                              O
+             /nsi_lcm_op_occs                                    O       O
+                 /<nsiLcmOpOccId>                                O                       O       O
+             /subscriptions                                      X       X
+                 /<subscriptionId>                               X                       X
  query string:
      Follows SOL005 section 4.3.2 It contains extra METHOD to override http method, FORCE to force.
 +        simpleFilterExpr := <attrName>["."<attrName>]*["."<op>]"="<value>[","<value>]*
 +        filterExpr := <simpleFilterExpr>["&"<simpleFilterExpr>]*
 +        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':
@@@ -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}"
@@@ -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 = {}
@@@ -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):