Talk: RO Northbound Interface: Difference between revisions

From OSM Public Wiki
Jump to: navigation, search
No edit summary
No edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Is RO supporting json or yaml or both ? ==
Several entries on this page are not correct according to what we find in the code.
Several entries on this page are not correct according to what we find in the code.


Line 8: Line 10:
     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 17:
         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 26: Line 28:




REPLY:
=== REPLY: ===


Code admits both yaml and json based on HTTP header "Content-type:" application/yaml or application/json
Code admits both yaml and json based on HTTP header "Content-type:" application/yaml or application/json
Line 32: Line 34:
"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.
 
== Version of the 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.
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 ?
 
=== REPLY: ===
 
Documentation is for an old version. Latest versions (both master and v1.1) contains some new features. However new versions are backward compatible with the old version so that this documentation match current versions.

Latest revision as of 13:41, 31 January 2017

Is RO supporting json or yaml or both ?

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 ?

REPLY:

Documentation is for an old version. Latest versions (both master and v1.1) contains some new features. However new versions are backward compatible with the old version so that this documentation match current versions.