Commit e734c863 authored by Łukasz Nowak's avatar Łukasz Nowak

Simplify API.

Return object of access points.
parent b8bc61a5
...@@ -105,7 +105,7 @@ Introsepcation Methods ...@@ -105,7 +105,7 @@ Introsepcation Methods
Fetching list of access urls Fetching list of access urls
---------------------------- ----------------------------
Explain acccess points in ``access_point`` list. Explain acccess points in dictionary.
Client is expected to ask about connection points before doing any request. Client is expected to ask about connection points before doing any request.
...@@ -146,47 +146,45 @@ Extract of possible response:: ...@@ -146,47 +146,45 @@ Extract of possible response::
Content-Type: application/json; charset=utf-8 Content-Type: application/json; charset=utf-8
{ {
"access_point": [ "instance_bang": {
"instance_bang": { "authentication": true,
"authentication": true, "url": "{instance_url}/bang",
"url": "{instance_url}/bang", "method": "POST",
"method": "POST", "required": {
"required": { "log": "unicode"
"log": "unicode"
},
"optional": {}
}, },
"instance_list": { "optional": {}
"authentication": true, },
"url": "http://three.example.com/instance", "instance_list": {
"method": "GET", "authentication": true,
"required": {}, "url": "http://three.example.com/instance",
"optional": {} "method": "GET",
"required": {},
"optional": {}
},
"register_computer": {
"authentication": true,
"url": "http://two.example.com/computer",
"method": "POST",
"required": {
"title": "unicode"
}, },
"register_computer": { },
"authentication": true, "request_instance": {
"url": "http://two.example.com/computer", "authentication": true,
"method": "POST", "url": "http://one.example.com/instance",
"required": { "method": "POST",
"title": "unicode" "required": {
}, "status": "unicode",
"slave": "bool",
"title": "unicode",
"software_release": "unicode",
"software_type": "unicode",
"parameter": "object",
"sla": "object"
}, },
"request_instance": { "optional": {}
"authentication": true, }
"url": "http://one.example.com/instance",
"method": "POST",
"required": {
"status": "unicode",
"slave": "bool",
"title": "unicode",
"software_release": "unicode",
"software_type": "unicode",
"parameter": "object",
"sla": "object"
},
"optional": {}
}
]
} }
All documentation here will refer to named access points except otherwise All documentation here will refer to named access points except otherwise
......
...@@ -464,7 +464,7 @@ class VifibRestApiV1Tool(BaseTool): ...@@ -464,7 +464,7 @@ class VifibRestApiV1Tool(BaseTool):
rfc1123_date(self.api_modification_date)) rfc1123_date(self.api_modification_date))
self.REQUEST.response.setHeader('Cache-Control', 'public') self.REQUEST.response.setHeader('Cache-Control', 'public')
self.REQUEST.response.setStatus(200) self.REQUEST.response.setStatus(200)
d = {'access_point': [{ d = {
"discovery": { "discovery": {
"authentication": False, "authentication": False,
"url": self.absolute_url(), "url": self.absolute_url(),
...@@ -527,7 +527,7 @@ class VifibRestApiV1Tool(BaseTool): ...@@ -527,7 +527,7 @@ class VifibRestApiV1Tool(BaseTool):
}, },
'optional' : {} 'optional' : {}
} }
}]} }
self.REQUEST.response.setBody(jsonify(d)) self.REQUEST.response.setBody(jsonify(d))
return self.REQUEST.response return self.REQUEST.response
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment