Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Lu Xu
slapos.core
Commits
e734c863
Commit
e734c863
authored
May 15, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify API.
Return object of access points.
parent
b8bc61a5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
41 deletions
+39
-41
documentation/source/rest.rst
documentation/source/rest.rst
+37
-39
master/product/Vifib/Tool/VifibRestApiV1Tool.py
master/product/Vifib/Tool/VifibRestApiV1Tool.py
+2
-2
No files found.
documentation/source/rest.rst
View file @
e734c863
...
...
@@ -105,7 +105,7 @@ Introsepcation Methods
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.
...
...
@@ -146,47 +146,45 @@ Extract of possible response::
Content-Type: application/json; charset=utf-8
{
"access_point": [
"instance_bang": {
"authentication": true,
"url": "{instance_url}/bang",
"method": "POST",
"required": {
"log": "unicode"
},
"optional": {}
"instance_bang": {
"authentication": true,
"url": "{instance_url}/bang",
"method": "POST",
"required": {
"log": "unicode"
},
"instance_list": {
"authentication": true,
"url": "http://three.example.com/instance",
"method": "GET",
"required": {},
"optional": {}
"optional": {}
},
"instance_list": {
"authentication": true,
"url": "http://three.example.com/instance",
"method": "GET",
"required": {},
"optional": {}
},
"register_computer": {
"authentication": true,
"url": "http://two.example.com/computer",
"method": "POST",
"required": {
"title": "unicode"
},
"register_computer": {
"authentication": true,
"url": "http://two.example.com/computer",
"method": "POST",
"required": {
"title": "unicode"
},
},
"request_instance": {
"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"
},
"request_instance": {
"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": {}
}
]
"optional": {}
}
}
All documentation here will refer to named access points except otherwise
...
...
master/product/Vifib/Tool/VifibRestApiV1Tool.py
View file @
e734c863
...
...
@@ -464,7 +464,7 @@ class VifibRestApiV1Tool(BaseTool):
rfc1123_date
(
self
.
api_modification_date
))
self
.
REQUEST
.
response
.
setHeader
(
'Cache-Control'
,
'public'
)
self
.
REQUEST
.
response
.
setStatus
(
200
)
d
=
{
'access_point'
:
[{
d
=
{
"discovery"
:
{
"authentication"
:
False
,
"url"
:
self
.
absolute_url
(),
...
...
@@ -527,7 +527,7 @@ class VifibRestApiV1Tool(BaseTool):
},
'optional'
:
{}
}
}
]}
}
self
.
REQUEST
.
response
.
setBody
(
jsonify
(
d
))
return
self
.
REQUEST
.
response
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment