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
Labels
Merge Requests
17
Merge Requests
17
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos.core
Commits
f932e38f
Commit
f932e38f
authored
Aug 06, 2013
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the hypermedia API to fetch software installation on computer.
parent
9e96f6f1
Changes
7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
262 additions
and
117 deletions
+262
-117
master/bt5/slapos_hypermedia/SkinTemplateItem/portal_skins/slapos_hypermedia/Computer_getHateoas.xml
...em/portal_skins/slapos_hypermedia/Computer_getHateoas.xml
+1
-1
master/bt5/slapos_hypermedia/SkinTemplateItem/portal_skins/slapos_hypermedia/Computer_getHateoasSoftwareInstallationList.xml
...ypermedia/Computer_getHateoasSoftwareInstallationList.xml
+5
-4
master/bt5/slapos_hypermedia/SkinTemplateItem/portal_skins/slapos_hypermedia/Person_getHateoasComputerList.xml
...skins/slapos_hypermedia/Person_getHateoasComputerList.xml
+1
-1
master/bt5/slapos_hypermedia/SkinTemplateItem/portal_skins/slapos_hypermedia/SoftwareInstallation_getHateoas.xml
...ins/slapos_hypermedia/SoftwareInstallation_getHateoas.xml
+7
-5
master/bt5/slapos_hypermedia/TestTemplateItem/testSlapOSHypermediaScenario.py
...permedia/TestTemplateItem/testSlapOSHypermediaScenario.py
+1
-1
master/bt5/slapos_hypermedia/TestTemplateItem/testSlapOSHypermediaSkins.py
..._hypermedia/TestTemplateItem/testSlapOSHypermediaSkins.py
+246
-104
master/bt5/slapos_hypermedia/bt/revision
master/bt5/slapos_hypermedia/bt/revision
+1
-1
No files found.
master/bt5/slapos_hypermedia/SkinTemplateItem/portal_skins/slapos_hypermedia/Computer_getHateoas.xml
View file @
f932e38f
...
...
@@ -80,7 +80,7 @@ else:\n
"type": "application/vnd.slapos.org.hal+json; class=slapos.org.computer" },\n
\n
"http://slapos.org/reg/software": {\n
"href": "%s/Computer_getHateoasSoftwareList" % context.absolute_url(),\n
"href": "%s/Computer_getHateoasSoftware
Installation
List" % context.absolute_url(),\n
"type": "application/vnd.slapos.org.hal+json; class=slapos.org.collection",\n
},\n
\n
...
...
master/bt5/slapos_hypermedia/SkinTemplateItem/portal_skins/slapos_hypermedia/Computer_getHateoasSoftwareList.xml
→
master/bt5/slapos_hypermedia/SkinTemplateItem/portal_skins/slapos_hypermedia/Computer_getHateoasSoftware
Installation
List.xml
View file @
f932e38f
...
...
@@ -80,12 +80,13 @@ else:\n
\n
for sql_obj in context.getPortalObject().portal_catalog(\n
portal_type=\'Software Installation\',\n
aggregate_relative_url=context.getRelativeUrl(),\n
default_aggregate_uid=context.getUid(),\n
validation_state=\'validated\',\n
):\n
obj = sql_obj.getObject()\n
result_dict[\'_links\'][\'item\'].append({\n
\'href\': \'%s/Software_getHateoas\' % obj.absolute_url(),\n
\'type\': \'application/vnd.slapos.org.hal+json; class=slapos.org.software\',\n
\'href\': \'%s/Software
Installation
_getHateoas\' % obj.absolute_url(),\n
\'type\': \'application/vnd.slapos.org.hal+json; class=slapos.org.software
_installation
\',\n
})\n
\n
response.setHeader(\'Content-Type\', type)\n
...
...
@@ -98,7 +99,7 @@ else:\n
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Computer_getHateoasSoftwareList
</string>
</value>
<value>
<string>
Computer_getHateoasSoftware
Installation
List
</string>
</value>
</item>
</dictionary>
</pickle>
...
...
master/bt5/slapos_hypermedia/SkinTemplateItem/portal_skins/slapos_hypermedia/Person_getHateoasComputerList.xml
View file @
f932e38f
...
...
@@ -80,7 +80,7 @@ else:\n
\n
for sql_obj in context.getPortalObject().portal_catalog(\n
portal_type="Computer",\n
source_administration_uid=context.getUid(),\n
default_
source_administration_uid=context.getUid(),\n
):\n
obj = sql_obj.getObject()\n
result_dict[\'_links\'][\'item\'].append({\n
...
...
master/bt5/slapos_hypermedia/SkinTemplateItem/portal_skins/slapos_hypermedia/Software_getHateoas.xml
→
master/bt5/slapos_hypermedia/SkinTemplateItem/portal_skins/slapos_hypermedia/Software
Installation
_getHateoas.xml
View file @
f932e38f
...
...
@@ -56,7 +56,7 @@ if REQUEST is None:\n
raise Unauthorized\n
\n
response = REQUEST.RESPONSE\n
type = \'application/vnd.slapos.org.hal+json; class=slapos.org.software\'\n
type = \'application/vnd.slapos.org.hal+json; class=slapos.org.software
_installation
\'\n
\n
if REQUEST.other[\'method\'] != "GET":\n
response.setStatus(405)\n
...
...
@@ -78,15 +78,17 @@ else:\n
\n
import json\n
result_dict = {\n
\'_class\': \'slapos.org.software\',\n
\'_class\': \'slapos.org.software
_installation
\',\n
\'title\': context.getTitle(),\n
\'software_url\': context.getUrlString(),\n
\'status\': state,\n
\'_links\': {\n
"self": { "href": context.Base_getRequestUrl(),\n
"type": "application/vnd.slapos.org.hal+json; class=slapos.org.software" },\n
"type": "application/vnd.slapos.org.hal+json; class=slapos.org.software
_installation
" },\n
},\n
}\n
url_string = context.getUrlString(None)\n
if url_string is not None:\n
result_dict["_links"]["software_release"] = { "href": url_string }\n
\n
response.setHeader(\'Content-Type\', type)\n
return json.dumps(result_dict)\n
...
...
@@ -98,7 +100,7 @@ else:\n
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Software_getHateoas
</string>
</value>
<value>
<string>
Software
Installation
_getHateoas
</string>
</value>
</item>
</dictionary>
</pickle>
...
...
master/bt5/slapos_hypermedia/TestTemplateItem/testSlapOSHypermediaScenario.py
View file @
f932e38f
...
...
@@ -322,7 +322,7 @@ class TestSlapOSHypermediaPersonScenario(testSlapOSMixin):
# Get user's software
#####################################################
content_type
=
"application/vnd.slapos.org.hal+json; "
\
"class=slapos.org.software"
"class=slapos.org.software
_installation
"
software_link_dict
=
software_collection_hal
[
'_links'
]
\
[
'item'
][
0
]
...
...
master/bt5/slapos_hypermedia/TestTemplateItem/testSlapOSHypermediaSkins.py
View file @
f932e38f
This diff is collapsed.
Click to expand it.
master/bt5/slapos_hypermedia/bt/revision
View file @
f932e38f
3
\ No newline at end of file
4
\ No newline at end of file
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