Talk: RO Northbound Interface: Difference between revisions

From OSM Public Wiki
Jump to: navigation, search
No edit summary
Line 8: Line 8:
     Params: Content-type: application/yaml
     Params: Content-type: application/yaml


'''In the code we cand read''' [https://github.com/nfvlabs/openmano/blob/master/openmano/httpserver.py#L1066 httpserver.py]
'''In the code we cand read''' [https://osm.etsi.org/gitweb/?p=osm/RO.git;a=blob;f=httpserver.py;h=789e0224c7c6354a49a04d1c56d59e524ee193d1;hb=aceb46455ba16b5cfddd8cde528251a57e8a3b56#l1224 httpserver.py]
     @bottle.route(url_base + '/<tenant_id>/instances/<instance_id>/action', method='POST')
     @bottle.route(url_base + '/<tenant_id>/instances/<instance_id>/action', method='POST')
     def http_post_instance_scenario_action(tenant_id, instance_id):
     def http_post_instance_scenario_action(tenant_id, instance_id):
Line 15: Line 15:
         http_content,_ = format_in( ''instance_scenario_action_schema'' )
         http_content,_ = format_in( ''instance_scenario_action_schema'' )


'''And then''' [https://github.com/nfvlabs/openmano/blob/master/openmano/openmano_schemas.py#L732 openmano_schemas.py]
'''And then''' [https://osm.etsi.org/gitweb/?p=osm/RO.git;a=blob;f=openmano_schemas.py;h=ffbacd3adb68428bf143d227f9e6f295b8bbbea2;hb=aceb46455ba16b5cfddd8cde528251a57e8a3b56#l1036 openmano_schemas.py]
     ''instance_scenario_action_schema'' = {
     ''instance_scenario_action_schema'' = {
     "title":"instance scenario action information schema",
     "title":"instance scenario action information schema",
Line 31: Line 31:


"json-schema" is a python library to validate input and, in spite of its name, has no connection at all with json or yaml.
"json-schema" is a python library to validate input and, in spite of its name, has no connection at all with json or yaml.
On the other hand, the references to github above are outdated. RO code is available at OSM's RO repo at: https://osm.etsi.org/gerrit/#/admin/projects/osm/RO


As a side note, for further comments in "talk" sections, please use the "Add topic" option (between "Edit" and "View history"), so that more than one topic can be included.
As a side note, for further comments in "talk" sections, please use the "Add topic" option (between "Edit" and "View history"), so that more than one topic can be included.

Revision as of 09:14, 31 January 2017

Several entries on this page are not correct according to what we find in the code.

For example :

On the wiki

   POST /openmano/{tenant_id}/instances/{instance_id}/action
   take an action over a scenario instance. Actions can be {start,pause,resume,shutoff,shutdown,forceOff,rebuild,reboot,console}
   Params: Content-type: application/yaml

In the code we cand read httpserver.py

   @bottle.route(url_base + '/<tenant_id>/instances/<instance_id>/action', method='POST')
   def http_post_instance_scenario_action(tenant_id, instance_id):
   [...]
       #parse input data
       http_content,_ = format_in( instance_scenario_action_schema )

And then openmano_schemas.py

   instance_scenario_action_schema = {
   "title":"instance scenario action information schema",
   "$schema": "http://json-schema.org/draft-04/schema#",

The documentation states that yaml is expected but the code seem to expect a json.


Same problem for openmano/{tenant_id}/instances


REPLY:

Code admits both yaml and json based on HTTP header "Content-type:" application/yaml or application/json

"json-schema" is a python library to validate input and, in spite of its name, has no connection at all with json or yaml.

As a side note, for further comments in "talk" sections, please use the "Add topic" option (between "Edit" and "View history"), so that more than one topic can be included.

Version of the RO ?

There is several versions of the RO :https://osm.etsi.org/gitweb/?p=osm/RO.git;a=tags

Should a table explicit the compatibility of this page with each tag ?