<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.sugarlabs.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Alsroot</id>
	<title>Sugar Labs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.sugarlabs.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Alsroot"/>
	<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/go/Special:Contributions/Alsroot"/>
	<updated>2026-04-16T15:03:27Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=User:Alsroot&amp;diff=96050</id>
		<title>User:Alsroot</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=User:Alsroot&amp;diff=96050"/>
		<updated>2015-09-13T06:19:50Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{TOCright}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contacts ==&lt;br /&gt;
&lt;br /&gt;
* Nick &#039;&#039;alsroot&#039;&#039;&lt;br /&gt;
* [[Special:Emailuser/alsroot|Email]] me&lt;br /&gt;
* Timezone UTC+3&lt;br /&gt;
&lt;br /&gt;
== Projects ==&lt;br /&gt;
&lt;br /&gt;
* [http://school-network.org School Network]&lt;br /&gt;
&lt;br /&gt;
== Background tasks ==&lt;br /&gt;
&lt;br /&gt;
* Maintain Sugar Labs servers:&lt;br /&gt;
** [[Machine/jita|jita]]&lt;br /&gt;
&amp;lt;div id=&amp;quot;services&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
* Maintain Sugar Labs services:&lt;br /&gt;
** [[Service/meeting|meeting]]&lt;br /&gt;
** [[Service/chat|chat]]&lt;br /&gt;
** [[Service/activities|activities]]&lt;br /&gt;
** [[Service/jabber|jabber]]&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=User:Alsroot&amp;diff=96049</id>
		<title>User:Alsroot</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=User:Alsroot&amp;diff=96049"/>
		<updated>2015-09-10T06:03:25Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{TOCright}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contacts ==&lt;br /&gt;
&lt;br /&gt;
* Nick &#039;&#039;alsroot&#039;&#039;&lt;br /&gt;
* [[Special:Emailuser/alsroot|Email]] me&lt;br /&gt;
* Timezone UTC+3&lt;br /&gt;
&lt;br /&gt;
== Background tasks ==&lt;br /&gt;
&lt;br /&gt;
* Maintain Sugar Labs servers:&lt;br /&gt;
** [[Machine/jita|jita]]&lt;br /&gt;
&amp;lt;div id=&amp;quot;services&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
* Maintain Sugar Labs services:&lt;br /&gt;
** [[Service/meeting|meeting]]&lt;br /&gt;
** [[Service/chat|chat]]&lt;br /&gt;
** [[Service/activities|activities]]&lt;br /&gt;
** [[Service/jabber|jabber]]&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Sweets_Distribution&amp;diff=96048</id>
		<title>Sweets Distribution</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Sweets_Distribution&amp;diff=96048"/>
		<updated>2015-09-10T05:58:39Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Obsolete | [[Special:Emailuser/alsroot|Contact]] to developers if you want to reuse Sweets Distribution infrastructure in your project}} &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;linkgroup&amp;quot;&amp;gt;[[File:Question.png|65px|link=Sweets_Distribution/Logo]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Template:Sweets Distribution Linkbar}}&lt;br /&gt;
&lt;br /&gt;
These are overview and usage pages regarding the [[Sweets Distribution]]. Read [[Platform_Team/Sweets_Distribution|technical pages]] for getting detailed information.&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
&lt;br /&gt;
This is a set of 3rd party repositories with Sugar Learning Platform packages for major GNU/Linux [[Sweets_Distribution/Supported_platforms|distributions]]. &lt;br /&gt;
&lt;br /&gt;
The major reasons to support all these repositories are:&lt;br /&gt;
&lt;br /&gt;
* Let people to try new functionality which is not available from the regular sources;&lt;br /&gt;
* Support GNU/Linux distributions that lack of Sugar Learning Platform from official repositories;&lt;br /&gt;
* Bring recent Sugar Learning Platform versions to systems initially released with older Sugar.&lt;br /&gt;
&lt;br /&gt;
== Repositories ==&lt;br /&gt;
&lt;br /&gt;
Sweets Distribution is formed as a [[Template:Sweets_Distribution_Linkbar|list of repositories]] that can be added to the system. Only one repository can be registered in the system at the same time. Repositories are identified by names and might be in stable or development stage. Different repositories might be available on different platforms from the [[Sweets_Distribution/Supported_platforms|supported platforms list]].&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
The installation occurs in two phases:&lt;br /&gt;
&lt;br /&gt;
* [[#Add_repository|add]] one of Sweets Distribution repositories to local system;&lt;br /&gt;
* [[#Install packages|install]] packages from added Sweets Distribution repository.&lt;br /&gt;
&lt;br /&gt;
=== Add repository ===&lt;br /&gt;
&lt;br /&gt;
Experienced users might follow [[Sweets_Distribution/Manual_Installation|manual instructions]] to add Sweets Distribution [http://download.sugarlabs.org/packages/ repositories] to the system.&lt;br /&gt;
&lt;br /&gt;
For easy attaching Sweets Distribution repositories, use {{Code|sweets-distribution}} command.&lt;br /&gt;
&lt;br /&gt;
If {{Code|sweets-distribution}} is not yet installed, download the [ftp://download.sugarlabs.org/packages/sweets-distribution.sh sweets-distribution.sh] install script and run it from the {{Code|root}} user, e.g., &lt;br /&gt;
type the following commands in a terminal:&lt;br /&gt;
&lt;br /&gt;
 wget http://download.sugarlabs.org/packages/sweets-distribution.sh&lt;br /&gt;
 sudo sh sweets-distribution.sh&lt;br /&gt;
&lt;br /&gt;
*To get the status information about currently selected and all available repositories:&lt;br /&gt;
&lt;br /&gt;
 sweets-distribution status&lt;br /&gt;
&lt;br /&gt;
*To add chosen, here {{Code|0.94}}, repository in the system&lt;br /&gt;
&lt;br /&gt;
 sudo sweets-distribution select 0.94&lt;br /&gt;
&lt;br /&gt;
=== Install packages ===&lt;br /&gt;
&lt;br /&gt;
When the {{Code|sweets-distribution select}} command finishes, the local system will be aware of the Sweets Distribution repository and it will be possible to install packages.&lt;br /&gt;
&lt;br /&gt;
In the regular way for your operating system (such as with &#039;&#039;&#039;apt-get install&#039;&#039;&#039; or &#039;&#039;&#039;yum install&#039;&#039;&#039;), from a local system terminal, console, or via SSH, install one of the following packages:&lt;br /&gt;
&lt;br /&gt;
* {{Code|sweets-desktop}}&amp;lt;br&amp;gt;The full set of packages from Sweets Desktop.&lt;br /&gt;
&lt;br /&gt;
Sometimes, it may be required to downgrade packages while switching to another repository. The easy way to do so is with the {{Code|sync}} command:&lt;br /&gt;
&lt;br /&gt;
 sudo sweets-distribution sync&lt;br /&gt;
&lt;br /&gt;
Most of the Sweets Distribution packages will be placed in the {{Code|/opt/sweets}} directory; thus, it will be possible to use Sugar from the Sweets Distribution and from official packages at the same time.&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
=== Sweets Distribution 0.88 ===&lt;br /&gt;
&lt;br /&gt;
Stable [[Dextrose/2|Dextrose 2]] based releases:&lt;br /&gt;
&lt;br /&gt;
* [http://download.sugarlabs.org/packages/SweetsDistribution:/0.88/Ubuntu-10.04/ Ubuntu-10.04]&lt;br /&gt;
* [http://download.sugarlabs.org/packages/SweetsDistribution:/0.88/Ubuntu-10.10/ Ubuntu-10.10]&lt;br /&gt;
&lt;br /&gt;
=== Sweets Distribution 0.94 ===&lt;br /&gt;
&lt;br /&gt;
Testing [[Dextrose/3|Dextrose 3]] based releases:&lt;br /&gt;
* [http://download.sugarlabs.org/packages/SweetsDistribution:/0.94/Ubuntu-11.10/ Ubuntu-11.10]&lt;br /&gt;
: Found issues:&lt;br /&gt;
:* Read doesn&#039;t start since it is impossible to start gtk-2 based version; gtk-3 based fails to start&lt;br /&gt;
* [http://download.sugarlabs.org/packages/SweetsDistribution:/0.94/Ubuntu-11.04/ Ubuntu-11.04]&lt;br /&gt;
* [http://download.sugarlabs.org/packages/SweetsDistribution:/0.94/Ubuntu-10.10/ Ubuntu-10.04]&lt;br /&gt;
* [http://download.sugarlabs.org/packages/SweetsDistribution:/0.94/Ubuntu-10.04/ Ubuntu-10.04]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
Below are instructions on how to use the Sweets Distribution after [[#Install_packages|installing]] packages.&lt;br /&gt;
&lt;br /&gt;
=== Sweets Desktop session ===&lt;br /&gt;
&lt;br /&gt;
If {{Code|sweets-desktop}} package was installed, it will be possible to log in to a Sweets Desktop session. Choose the &#039;&#039;Sweets Desktop&#039;&#039; session type in a login manager.&lt;br /&gt;
&lt;br /&gt;
=== Run Sugar in a window ===&lt;br /&gt;
&lt;br /&gt;
To run Sugar in a window without logging out from the current desktop environment, select the &#039;&#039;Education/Sugar&#039;&#039; application menu item or enter the following command in a terminal:&lt;br /&gt;
 sweets-sugar-emulator&lt;br /&gt;
=== [[The_Undiscoverable#sugar-emulator.2C_sugar-runner_and_sweets-sugar-emulator|Run Sugar full screen]] ===&lt;br /&gt;
Run this command in a terminal or edit the properties of the menu item for &#039;&#039;Sugar&#039;&#039;&lt;br /&gt;
 sweets-sugar-emulator -f, --fullscreen&lt;br /&gt;
&lt;br /&gt;
=== Sugar Activities ===&lt;br /&gt;
&lt;br /&gt;
For stable 0.94 and 0.88 repositories, the following points are assumed:&lt;br /&gt;
&lt;br /&gt;
* Fructose activities need to be used only from Sweets Distribution packages, at least for ones that have external dependencies, i.e., they should not be upgraded from the [[Activity Library]];&lt;br /&gt;
* The rest of activities need to be handled manually, e.g., manual installing missed dependencies.&lt;br /&gt;
&lt;br /&gt;
All other repositories should bring [[Sugar Network]] integration, a different design solution for handling Sugar Activities. [[Sugar Network]] is assumed to improve the process of launching Sugar Activities to make it more reliable and smooth. By default, Sugar Network integration might be switched off, [[Platform_Team/Sweets_Distribution/0.94:SugarNetwork#Sugar_Network_integration|enable]] it after installation.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
* Latest [[Community/Distributions/Sweets_Distribution/Testing|Test results for Sweets Distribution]] on various platforms, such as Ubuntu, Trisquel, and Fedora 14.&lt;br /&gt;
* Older [[Community/Distributions/Ubuntu/Tests|Test results for Sweets Distribution on Ubuntu]].&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [http://www.mail-archive.com/sugar-devel@lists.sugarlabs.org/msg23369.html Announcement post],&lt;br /&gt;
&lt;br /&gt;
== Feedback ==&lt;br /&gt;
&lt;br /&gt;
{{:Platform_Team/Sweets_Distribution/Feedback}}&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Sugar_Network&amp;diff=96047</id>
		<title>Sugar Network</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Sugar_Network&amp;diff=96047"/>
		<updated>2015-09-10T05:48:41Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Obsolete | [http://school-network.org School Network] is a successor}} &lt;br /&gt;
&lt;br /&gt;
{{Template:Sugar Network Cycle Linkbar}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;linkgroup&amp;quot;&amp;gt;[[Image:Question.png|65px|link=Sugar_Network/Logo|What would be a good logo for Sugar Network?]]&amp;lt;/span&amp;gt; [[Sugar_Network/Logo|(We&#039;re searching for a good logo.)]]&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
&lt;br /&gt;
Sugar Network is a content sharing and social activity, around this content, system for Sugar Learning Environment.&lt;br /&gt;
&lt;br /&gt;
The system is intended to be a share point for various kinds of content within the Sugar community, e.g., friends, a class, parents, teachers, content authors, supporters, or, Sugar Learners in general. Sugar Network participants might be regular Internet users, students connected to a school server, or, even be in regions without any network connectivity except the [[wikipedia:Sneakernet|Sneakernet]].&lt;br /&gt;
&lt;br /&gt;
The content itself might be Sugar Activities, artifacts created by Sugar Activities, books, articles, etc. Sugar Network provides a way for content creators how to share their work, and, a way for all other people how to use shared content as easy as possible. Sugar Network&#039;s social activity features should make this process smoother by providing functionality like getting feedback, issue reports, usage statistics, etc.&lt;br /&gt;
&lt;br /&gt;
This work was initially started as an international research project within the Sugar Labs Perú in order to attend the needs identified during field work on Perú from 2007 to date.&lt;br /&gt;
&lt;br /&gt;
== Further reading ==&lt;br /&gt;
&lt;br /&gt;
* Sugar Network [[Sugar_Network/Declaration_of_purpose|declaration of purpose]].&lt;br /&gt;
* [[Sugar_Network/Concept|Sugar Network Concept]] - A guide to basic Sugar Network concepts.&lt;br /&gt;
* [[Sugar Network/Tutorial|Sugar Network Tutorial]] - A series of screen-shots of the most recent Sugar Network implementation.&lt;br /&gt;
* Sugar Network [[Platform_Team/Sugar_Network|technical implementation]].&lt;br /&gt;
* [http://pe.sugarlabs.org/ir/Proyecto_Piloto_Hexoquinasa Proyecto Piloto Hexoquinasa] - The actual deployment scenario of the first iteration Sugar Network&lt;br /&gt;
* Sugar Network [[Sugar_Network/Policy|Terms of use]].&lt;br /&gt;
&lt;br /&gt;
== Try it ==&lt;br /&gt;
&lt;br /&gt;
Note that current development version is not assumed to be perfect in all cases.&lt;br /&gt;
&lt;br /&gt;
There are two types of Sugar Network access:&lt;br /&gt;
&lt;br /&gt;
* Sugar Network clients.&amp;lt;br&amp;gt;Regular access for most of users. There are several clients that might have different audience:&lt;br /&gt;
** [[Platform_Team/Sugar_Network/Web_UI|Web UI]],&amp;lt;br&amp;gt;client is mostly targeting to low age users;&lt;br /&gt;
** [[Sugar_Network/Contributor_Hub|Contributor Hub]],&amp;lt;br&amp;gt;full featured access for content creators and providers as well as experienced users.&lt;br /&gt;
* [[Platform_Team/Sugar_Network/API|Sugar Network API]].&amp;lt;br&amp;gt;Low level access for various programmable usage. See API home page for more details.&lt;br /&gt;
&lt;br /&gt;
=== From the Web ===&lt;br /&gt;
&lt;br /&gt;
Easy way to try Sugar Network clients is Sugar Network Web sites with data synchronized with the [[Activity Library]]:&lt;br /&gt;
&lt;br /&gt;
* [http://network.sugarlabs.org/ network.sugarlabs.org], for Web UI;&lt;br /&gt;
* [http://network.sugarlabs.org/hub/ network.sugarlabs.org/hub], for Contributor Hub.&lt;br /&gt;
&lt;br /&gt;
Write access is not yet implemented for Web access. To discover all implemented functionality, use developer server where anonymous users have administrative privileges:&lt;br /&gt;
&lt;br /&gt;
* [http://network-devel.sugarlabs.org/ network-devel.sugarlabs.org], for Web UI;&lt;br /&gt;
* [http://network-devel.sugarlabs.org/hub/ network-devel.sugarlabs.org/hub], for Contributor Hub.&lt;br /&gt;
&lt;br /&gt;
=== On desktop ===&lt;br /&gt;
&lt;br /&gt;
Sugar Network clients can be used from local applications. Local applications have extra features, such as launching software by one click, or, seamless Journal integration. There are several distribution options:&lt;br /&gt;
&lt;br /&gt;
* Install Sugar from the [[Platform_Team/Sweets_Distribution/0.94:SugarNetwork|0.94:SugarNetwork]] repository in [[Sweets Distribution]] and [[Platform_Team/Sweets_Distribution/0.94:SugarNetwork#Sugar_Network_integration|enable]] Sugar Network integration in the Sugar Shell;&lt;br /&gt;
* On XO laptops, use [[Deployment_Platform/XO_reference_distribution#Try_reference_implementation|one of the reference images]] (note that images might be outdated, to make them up-to-date, upgrade system packages right after flashing). Or, try deployment [http://pe.sugarlabs.org/go/Proyecto_Piloto_Hexoquinasa/Instalar XO images] from downstream [http://pe.sugarlabs.org/go/Proyecto_Piloto_Hexoquinasa Hexoquinasa] project;&lt;br /&gt;
* Or, on existing Sugar installation, install [[Activities/Sugar_Network|Sugar Network activity]].&lt;br /&gt;
&lt;br /&gt;
=== In deployment ===&lt;br /&gt;
&lt;br /&gt;
If you are looking for complex solutions that will be useful for deploymentin an educational environment, take a look at [[Deployment Platform]].&lt;br /&gt;
&lt;br /&gt;
== Donate ==&lt;br /&gt;
&lt;br /&gt;
[[Crowd_funding/Sugar_Network#The_product|Help those]] working on the Sugar Network deployment on a regular basis.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [http://semweb4u.wordpress.com/tag/semanticxo/ Semantic XO] project and its [[Features/Semantic_Web|Features]] page.&lt;br /&gt;
&lt;br /&gt;
== Getting involved ==&lt;br /&gt;
&lt;br /&gt;
{{:Sugar_Network/Feedback}}&lt;br /&gt;
&lt;br /&gt;
== Subpages ==&lt;br /&gt;
&lt;br /&gt;
{{Special:PrefixIndex/{{PAGENAMEE}}/}}&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Platform_Team/Open_Build_Service/Policy&amp;diff=94775</id>
		<title>Platform Team/Open Build Service/Policy</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Platform_Team/Open_Build_Service/Policy&amp;diff=94775"/>
		<updated>2015-03-23T08:13:54Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: Alsroot moved page Platform Team/Open Build Service/Policy to School Network/Open Build Service/Policy: Collect all SNet related stuff under the same root page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[School Network/Open Build Service/Policy]]&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=School_Network/Open_Build_Service/Policy&amp;diff=94774</id>
		<title>School Network/Open Build Service/Policy</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=School_Network/Open_Build_Service/Policy&amp;diff=94774"/>
		<updated>2015-03-23T08:13:54Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: Alsroot moved page Platform Team/Open Build Service/Policy to School Network/Open Build Service/Policy: Collect all SNet related stuff under the same root page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;[[Category:Policy]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The [[Platform_Team/Open_Build_Service|Open Build Service]] works underneath the [[Sugar Network]], processing software content uploaded to [[Sugar Network]], thus, the [[Sugar_Network/Policy|Sugar Network Policy]] is inherited.&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Platform_Team/Open_Build_Service&amp;diff=94773</id>
		<title>Platform Team/Open Build Service</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Platform_Team/Open_Build_Service&amp;diff=94773"/>
		<updated>2015-03-23T08:13:52Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: Alsroot moved page Platform Team/Open Build Service to School Network/Open Build Service: Collect all SNet related stuff under the same root page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[School Network/Open Build Service]]&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=School_Network/Open_Build_Service&amp;diff=94772</id>
		<title>School Network/Open Build Service</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=School_Network/Open_Build_Service&amp;diff=94772"/>
		<updated>2015-03-23T08:13:52Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: Alsroot moved page Platform Team/Open Build Service to School Network/Open Build Service: Collect all SNet related stuff under the same root page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
This [http://git.sugarlabs.org/0sugar/build-service patched] Sugar Labs instance of the [http://openbuildservice.org/ Open Build Service] (OBS) has the following intentions:&lt;br /&gt;
&lt;br /&gt;
* Unattended building of software hosted on [[Sugar Network]] for all [[Sweets_Distribution/Supported_platforms|supported]] platforms.&lt;br /&gt;
&lt;br /&gt;
* Be a convenient instrument to create 3rd party repositories with native packages for all [[Sweets_Distribution/Supported_platforms|supported]] GNU/Linux distributions.&lt;br /&gt;
&lt;br /&gt;
== Sites ==&lt;br /&gt;
&lt;br /&gt;
* [https://obs.sugarlabs.org obs.sugarlabs.org]&amp;lt;br&amp;gt;This is an [https://obs.sugarlabs.org/apidocs/ API] site, all OBS clients use it to get access to OBS. There is no need to work with the site directly, although that is [http://en.opensuse.org//openSUSE:Build_Service_Curl possible].&lt;br /&gt;
&lt;br /&gt;
* [https://packages.sugarlabs.org packages.sugarlabs.org]&amp;lt;br&amp;gt;This is an original OBS Web client. It is intended to be used only by people who need to create native packages, i.e., it is not needed for most Sugar developers assuming that [[Sugar Network]] will process building procedures in unattended mode.&lt;br /&gt;
&lt;br /&gt;
* [http://download.sugarlabs.org/packages/ download.sugarlabs.org]&amp;lt;br&amp;gt;After building, binary packages will be acceptable from the Sugar Labs download site.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
See original [http://openbuildservice.org/help/manuals/ manuals] and [http://openbuildservice.org/help/materials/ materials] to learn more about what functionality OBS provides.&lt;br /&gt;
&lt;br /&gt;
On top of original OBS behavior, the Sugar Labs instance brings the following new features and common practices.&lt;br /&gt;
&lt;br /&gt;
=== Special projects ===&lt;br /&gt;
&lt;br /&gt;
There is a special project, named [https://packages.sugarlabs.org/project/repositories?project=base base]; it contains all GNU/Linux distributions that are supported on OBS. All other projects, that are intended for building packages, need to inherit repositories from this project.&lt;br /&gt;
&lt;br /&gt;
=== GNU/Linux distribution agnostic packages ===&lt;br /&gt;
&lt;br /&gt;
Instead of using spec files of packages to be built against for every GNU/Linux distribution, it is possible to use a special spec file that will be used as-is in all platforms that Sugar Labs OBS supports.&lt;br /&gt;
&lt;br /&gt;
To create such distro-agnostic packages,&lt;br /&gt;
&lt;br /&gt;
* upload a {{Code|sweets.recipe}} file in [[Sweets_Distribution/Recipe_Specification|special notation]] to OBS package;&lt;br /&gt;
* upload {{Code|.tar.gz}} sources with filename composed using {{Code|sweets.recipe}} fields:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;context&amp;gt;-&amp;lt;version&amp;gt;.tar.gz&lt;br /&gt;
&lt;br /&gt;
After that, OBS will start building submitted package on all attached OBS repositories.&lt;br /&gt;
&lt;br /&gt;
=== Resolve packages ===&lt;br /&gt;
&lt;br /&gt;
There is new API command that might be used to resolve package names and package dependencies on a particular OBS platform.&lt;br /&gt;
&lt;br /&gt;
 GET &#039;&#039;&#039;/resolve&#039;&#039;&#039;?project=PROJECT&amp;amp;repository=REPOSITORY&amp;amp;arch=ARCH&amp;amp;package=PACKAGE[&amp;amp;withdeps][&amp;amp;exclude=PACKAGE]&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
&lt;br /&gt;
* {{Code|PROJECT}}, {{Code|REPOSITORY}}, {{Code|ARCH}} and {{Code|PACKAGE}}&amp;lt;br&amp;gt;identification of particular OBS package;&lt;br /&gt;
* {{Code|withdeps}}&amp;lt;br&amp;gt;include dependencies graph of the {{Code|PACKAGE}};&lt;br /&gt;
* {{Code|exclude}}&amp;lt;br&amp;gt;restrict dependency graph from bottom side.&lt;br /&gt;
&lt;br /&gt;
For example,&lt;br /&gt;
&lt;br /&gt;
 https://obs.sugarlabs.org/resolve?project=OLPC&amp;amp;repository=11.3.1&amp;amp;arch=i586&amp;amp;package=pygame&amp;amp;withdeps&amp;amp;exclude=sugar&lt;br /&gt;
&lt;br /&gt;
Will output:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;resolve&amp;gt;&lt;br /&gt;
   &amp;lt;binary name=&amp;quot;pygame&amp;quot; url=&amp;quot;http://mock.laptop.org/cgit/koji.dist-f14-i686/plain/RPMS/pygame-1.9.1-3.fc14.i686.rpm&amp;quot; /&amp;gt;&lt;br /&gt;
   &amp;lt;binary name=&amp;quot;SDL&amp;quot; url=&amp;quot;http://mock.laptop.org/cgit/koji.dist-f14-i686-updates-11.3.1/plain/RPMS/SDL-1.2.14-11.fc14.i686.rpm&amp;quot; /&amp;gt;&lt;br /&gt;
   &amp;lt;binary name=&amp;quot;SDL_mixer&amp;quot; url=&amp;quot;http://mock.laptop.org/cgit/koji.dist-f14-i686/plain/RPMS/SDL_mixer-1.2.11-4.fc14.i686.rpm&amp;quot; /&amp;gt;&lt;br /&gt;
   &amp;lt;binary name=&amp;quot;SDL_image&amp;quot; url=&amp;quot;http://mock.laptop.org/cgit/koji.dist-f14-i686/plain/RPMS/SDL_image-1.2.10-1.fc13.i686.rpm&amp;quot; /&amp;gt;&lt;br /&gt;
   &amp;lt;binary name=&amp;quot;numpy&amp;quot; url=&amp;quot;http://mock.laptop.org/cgit/koji.dist-f14-i686/plain/RPMS/numpy-1.4.1-6.fc14.i686.rpm&amp;quot; /&amp;gt;&lt;br /&gt;
   &amp;lt;binary name=&amp;quot;SDL_ttf&amp;quot; url=&amp;quot;http://mock.laptop.org/cgit/koji.dist-f14-i686/plain/RPMS/SDL_ttf-2.0.10-1.fc14.i686.rpm&amp;quot; /&amp;gt;&lt;br /&gt;
   &amp;lt;binary name=&amp;quot;portmidi&amp;quot; url=&amp;quot;http://mock.laptop.org/cgit/koji.dist-f14-i686-updates-11.3.1/plain/RPMS/portmidi-200-5.fc14.i686.rpm&amp;quot; /&amp;gt;&lt;br /&gt;
   &amp;lt;binary name=&amp;quot;libmikmod&amp;quot; url=&amp;quot;http://mock.laptop.org/cgit/koji.dist-f14-i686/plain/RPMS/libmikmod-3.2.0-11.beta2.fc14.i686.rpm&amp;quot; /&amp;gt;&lt;br /&gt;
   &amp;lt;binary name=&amp;quot;libgfortran&amp;quot; url=&amp;quot;http://mock.laptop.org/cgit/koji.dist-f14-i686/plain/RPMS/libgfortran-4.5.1-4.fc14.i686.rpm&amp;quot; /&amp;gt;&lt;br /&gt;
   &amp;lt;binary name=&amp;quot;python-nose&amp;quot; url=&amp;quot;http://mock.laptop.org/cgit/koji.dist-f14-i686/plain/RPMS/python-nose-0.11.3-5.fc14.noarch.rpm&amp;quot; /&amp;gt;&lt;br /&gt;
   &amp;lt;binary name=&amp;quot;python-setuptools&amp;quot; url=&amp;quot;http://mock.laptop.org/cgit/koji.dist-f14-i686/plain/RPMS/python-setuptools-0.6.14-3.fc14.noarch.rpm&amp;quot; /&amp;gt;&lt;br /&gt;
   &amp;lt;binary name=&amp;quot;atlas&amp;quot; url=&amp;quot;http://mock.laptop.org/cgit/koji.dist-f14-i686/plain/RPMS/atlas-3.8.3-18.fc14.i686.rpm&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/resolve&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Policy ==&lt;br /&gt;
&lt;br /&gt;
{{:Platform_Team/Open_Build_System/Policy}}&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
* Open Build Service [http://openbuildservice.org/ home page].&lt;br /&gt;
* Open Build Service API [https://obs.sugarlabs.org/apidocs/ specification].&lt;br /&gt;
* Downstream patch [https://git.sugarlabs.org/sl-tweaks/obs sources].&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Sugar_Network/API&amp;diff=93401</id>
		<title>Sugar Network/API</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Sugar_Network/API&amp;diff=93401"/>
		<updated>2014-09-27T12:56:08Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: /* Base API */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the API that Sugar Network clients use to interact with a Sugar Network server. See also a guide to basic Sugar Network [[Sugar_Network/Concept|concepts]] and [[Platform_Team/Sugar_Network/Architecture|its twin page]] for a technical point of view. In addition, visit the [[Sugar_Network|introduction page]].&lt;br /&gt;
&lt;br /&gt;
{{Note/warning|Note|Until announcing API freeze, this document describes the most recent development version of the API.&amp;lt;br&amp;gt;You can find its implementation on the [[#API servers|node-devel.sugarlabs.org]] server.}}&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
To better understand this API, see a technical explanation of its [[Platform_Team/Sugar_Network/Architecture#Conceptual_level|conceptual level]] and [[#Sugar_Network_resources|objects model]] in particular.&lt;br /&gt;
&lt;br /&gt;
The API operates with [[Sugar Network]] [[#Sugar_Network_resources|resources]], which are collections of objects. All objects are identified by globally unique identifiers, GUIDs, and available for operation via [[#Base_API|basic actions]]. The API is being provided from a [[#API_servers|node server]] or a [[#Client_API|client]]. While processing requests, API providers generate [[#Notifications|events]].&lt;br /&gt;
&lt;br /&gt;
The API is [[Wikipedia:Restful|RESTful]], and is served via HTTP(S) using [[Wikipedia:Json|JSON]] notation. The common request url format is:&lt;br /&gt;
&lt;br /&gt;
 http[s]://&#039;&#039;SERVER&#039;&#039;[/&#039;&#039;RESOURCE&#039;&#039;[/&#039;&#039;GUID&#039;&#039;[/&#039;&#039;PROPERTY&#039;&#039;]]][?[cmd=&#039;&#039;COMMAND&#039;&#039;][&amp;amp;&#039;&#039;ARGUMENT&#039;&#039;=&#039;&#039;VALUE&#039;&#039;..]]&lt;br /&gt;
&lt;br /&gt;
When:&lt;br /&gt;
&lt;br /&gt;
* {{Code|SERVER}}, [[#API_servers|particular]] Sugar Network API server;&lt;br /&gt;
* {{Code|RESOURCE}}, name one of the [[#Sugar_Network_resources|existing]] resources;&lt;br /&gt;
* {{Code|GUID}}, the {{Code|RESOURCE}}&#039;s particular object;&lt;br /&gt;
* {{Code|PROPERTY}}, particular property of {{Code|GUID}} object;&lt;br /&gt;
* {{Code|COMMAND}}, optional command name; combination of HTTP request method ({{Code|GET}}, {{Code|POST}}, {{Code|PUT}}, or, {{Code|DELETE}}) and [possibly empty] {{Code|COMMAND}} composes the requested [[#Actions|action]];&lt;br /&gt;
* {{Code|ARGUMENT}}s and {{Code|VALUE}}s depend on the particular [[#Actions|action]].&lt;br /&gt;
&lt;br /&gt;
In most cases, the server replies in JSON notation. If a request fails, the replied JSON object will contain a {{Code|request}} key, with the original request, and {{Code|error}} key, with an error message.&lt;br /&gt;
&lt;br /&gt;
== API version ==&lt;br /&gt;
&lt;br /&gt;
Sugar Network nodes might support multiple API versions at once but only one of them is default, i.e., the one which is in use if clients do not specify particular API version. To specify API versions in client request, setup the {{Code|X-API}} HTTP header with chosen version. If such header is omitted, default version will be used by the node;&lt;br /&gt;
&lt;br /&gt;
Currently available API versions:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;0.1&#039;&#039; initial API implementation, should not be used;&lt;br /&gt;
* &#039;&#039;0.2&#039;&#039; the most recent version, the rest of the document describes exactly this version.&lt;br /&gt;
&lt;br /&gt;
== Nodes ==&lt;br /&gt;
&lt;br /&gt;
These are standard Sugar Network API servers publicly available.&lt;br /&gt;
&lt;br /&gt;
* [http://node-devel.sugarlabs.org/ node-devel.sugarlabs.org]&amp;lt;br&amp;gt;Development server which does not contain important data and is free for any experiments (administrative privileges for anonymous users); default API version is &#039;&#039;0.2&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
* [http://node-testing.sugarlabs.org/ node-testing.sugarlabs.org]&amp;lt;br&amp;gt;Recent stable release with regular data import from the production server; is still free for any experiments; default API version is &#039;&#039;0.1&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
* [http://node.sugarlabs.org/ node.sugarlabs.org]&amp;lt;br&amp;gt;Production server;&lt;br /&gt;
&lt;br /&gt;
* [http://localhost:5001/ localhost:5001]&amp;lt;br&amp;gt;default url to get access to [[#Client_API|local proxy]] provided from user side application; ; default API version is &#039;&#039;0.1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
{{:Sugar_Network/Resources}}&lt;br /&gt;
&lt;br /&gt;
== Base API ==&lt;br /&gt;
&lt;br /&gt;
List of actions common of all API providers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;POST&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;POST&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create new resource object.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to send:&lt;br /&gt;
* {{Code|&#039;&#039;RESOURCE}}&#039;s properties.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to receive:&lt;br /&gt;
* {{Code|guid}}, with globally unique identifier that specifies the created object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Modify resource object. By default, might be called only by {{Code|GUID}} creator.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to send:&lt;br /&gt;
* {{Code|RESOURCE}}&#039;s properties to modify.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Delete resource object. Actual object destruction won&#039;t happen, the object will be hidden. Garbage collection of hidden objects will be processed by Network administrators. By default, this action may be called only by the {{Code|GUID}} creator.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;[?offset=&#039;&#039;INTEGER&#039;&#039;][&amp;amp;limit=&#039;&#039;INTEGER&#039;&#039;][&amp;amp;query=&#039;&#039;STRING&#039;&#039;][&amp;amp;reply=&#039;&#039;PROP&#039;&#039;][&amp;amp;order_by=&amp;lt;nowiki&amp;gt;[+|-]&amp;lt;/nowiki&amp;gt;&#039;&#039;PROP&#039;&#039;][&amp;amp;group_by=&#039;&#039;PROP&#039;&#039;][&amp;amp;&#039;&#039;PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;][&amp;amp;&#039;&#039;!PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
Find resource objects.&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
* {{Code|offset}}, &#039;&#039;int&#039;&#039;&amp;lt;br&amp;gt;start index to return entries from, the default value is {{Code|0}};&lt;br /&gt;
* {{Code|limit}}, &#039;&#039;int&#039;&#039;&amp;lt;br&amp;gt;do not return more then specified value, maximal and default values are being setup on server side;&lt;br /&gt;
* {{Code|query}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;search request in [http://xapian.org/docs/queryparser.html Xapian] notation; if property is boolean, integer or datetime, it supports searching by ranges, i.e., {{Code|&#039;&#039;PROP&#039;&#039;:[&#039;&#039;START&#039;&#039;]..[&#039;&#039;END&#039;&#039;]}};&lt;br /&gt;
* {{Code|PROP}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;supplements {{Code|query}} with filtering by exact value of the {{Code|PROP}} property; the resulting query string will be {{Code|&#039;&#039;PROP&#039;&#039;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&#039;&#039;VALUE&#039;&#039; AND (&#039;&#039;QUERY&#039;&#039;)}}; argument is multiple;&lt;br /&gt;
* {{Code|!PROP}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;supplements {{Code|query}} by excluding exact value of the {{Code|PROP}} property; the resulting query string will be {{Code|NOT &#039;&#039;PROP&#039;&#039;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&#039;&#039;VALUE&#039;&#039; AND (&#039;&#039;QUERY&#039;&#039;)}}; argument is multiple;&lt;br /&gt;
* {{Code|reply}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;RESOURCE&#039;&#039; properties to return; by default, return only {{Code|guid}} property; argument is multiple;&lt;br /&gt;
* {{Code|order_by}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;property to sort the resulting list by; if starts with the {{Code|-}}, the order is descending, otherwise it is ascending;&lt;br /&gt;
* {{Code|group_by}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;property name to group resulting list by.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to receive:&lt;br /&gt;
* {{Code|total}}, total number in requested query (the reply might contain only the portion restricted by {{Code|limit}} request argument);&lt;br /&gt;
* {{Code|result}}, an array of dictionaries with resource object properties, dictionaries contain at least {{Code|guid}} property.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-resource&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;[?reply=&#039;&#039;PROP&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
* {{Code|reply}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;RESOURCE&#039;&#039; properties to return; by default, return only {{Code|guid}} property; argument is multiple;&lt;br /&gt;
&lt;br /&gt;
Return properties for a particular resource object.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to receive:&lt;br /&gt;
* properties that were specified in {{Code|reply}} argument(s), at least {{Code|guid}}.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT-property&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Modify particular resource property. By default, might be called only by {{Code|GUID}} creator.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-property&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Return property value for particular resource object.&lt;br /&gt;
&lt;br /&gt;
Data to receive:&lt;br /&gt;
* property value in JSON notation for regular properties;&lt;br /&gt;
* raw data or redirection for BLOB properties.&lt;br /&gt;
&lt;br /&gt;
=== Aggregated properties ===&lt;br /&gt;
&lt;br /&gt;
[[#resource-types|Aggregated]] properties have special API to treat their content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;POST-aggproperty&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;POST&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Submit new item. The command returns an id for newly created aggregated item. Depending on particular property, new items might be created not only by object&#039;s authors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT-aggproperty&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;/&#039;&#039;ID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Update existing aggregated item. Depending on particular property, the command is allowed either to object&#039;s authors or to aggregated item submitter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE-aggproperty&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;/&#039;&#039;ID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Delete existing aggregated item. Depending on particular property, the command is allowed either to object&#039;s authors or to aggregated item submitter.&lt;br /&gt;
&lt;br /&gt;
=== Notifications ===&lt;br /&gt;
&lt;br /&gt;
It is possible to subscribe to server events. Notification will happen using HTML5 [[wikipedia:Server-sent_events|Server-sent events]] (SSE).&lt;br /&gt;
&lt;br /&gt;
To start subscription, send the following request:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /?cmd=&#039;&#039;&#039;subscribe&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Response will be served with &#039;&#039;text/event-stream&#039;&#039; MIME type for default SSE message type. SSE message will be a JSONified object with the following, at least, attributes:&lt;br /&gt;
&lt;br /&gt;
* {{Code|event}}&amp;lt;br&amp;gt;event type.&lt;br /&gt;
&lt;br /&gt;
== Node API ==&lt;br /&gt;
&lt;br /&gt;
This is an API provided by Sugar Network nodes on top of [[#Base_API|base one]].&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
&lt;br /&gt;
Right now, the only way to be authenticated on a Sugar Network server is by running a [[Platform_Team/Sugar_Network/Implementation#sugar-network-client|local application]] on the client side and using the API it [[#Client_API|provides]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;TODO&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Authorization ===&lt;br /&gt;
&lt;br /&gt;
Read-only access is available for anonymous requests, except special content like machine serial numbers. But to process any changes, clients need to be authenticated.&lt;br /&gt;
&lt;br /&gt;
Right after creating any Sugar Network object, its author becomes the only user who can process any object modifications afterwards. Authority information will be kept in the [[#Sugar_Network_resources|author]] property and can be modified using the following commands.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;useradd&#039;&#039;&#039;&amp;amp;user=&#039;&#039;USER&#039;&#039;&amp;amp;role=&#039;&#039;ROLE&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Add another user who can modify the corresponding object. &#039;&#039;USER&#039;&#039; argument should be either &#039;&#039;User&#039;&#039; guid (for authors registered in the Sugar Network), or, full author name.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;userdel&#039;&#039;&#039;&amp;amp;user=&#039;&#039;USER&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Remove user from the authority list. It is not possible to remove yourself. &#039;&#039;USER&#039;&#039; argument should be either &#039;&#039;User&#039;&#039; guid (for authors registered in the Sugar Network), or, full author name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;TODO&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Retrieving releases ===&lt;br /&gt;
&lt;br /&gt;
To easy download Context [[#context-releases|releases]] and avoid reading raw &#039;&#039;Context.releases&#039;&#039; property, there are special high-level API commands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-solve&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;solve&#039;&#039;&#039;[&amp;amp;lsb_id=&#039;&#039;LSB_ID&#039;&#039;][&amp;amp;lsb_release=&#039;&#039;LSB_RELEASE&#039;&#039;][&amp;amp;assume=&#039;&#039;DEPENDENCY&#039;&#039;-&#039;&#039;VERSION&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
The command returns information about what particular releases should be downloaded depending on provided requirements. This command might return not only one release, e.g., activities might have dependencies either system packages or another Sugar Network Contexts.&lt;br /&gt;
&lt;br /&gt;
Solving requirements might be:&lt;br /&gt;
&lt;br /&gt;
* {{Code|LSB_ID}}, if Context releases depend on system packages, specify the [[Wikipedia:Linux_Standard_Base|LSB]] distributor id to consider while choosing particular packages;&lt;br /&gt;
* {{Code|LSB_RELEASE}}, if Context releases depend on system packages, specify the [[Wikipedia:Linux_Standard_Base|LSB]] release number of the distribution to consider while choosing particular packages;&lt;br /&gt;
* {{Code|DEPENDENCY-VERSION}}, the {{Code|assume}} argument instructs server to assume that specified [[Sugar_Network/Recipe_Specification#Dependencies|dependency]] is already available on client side and should be taken into account while solving; this is especially important for package dependencies when server considers packages available only from official repositories but users might have more recent package versions installed in local system; e.g., the above example request will fail without {{Code|sugar-0.94}} because neither {{Code|lsb_id}} nor {{Code|lsb_release}} were specified (even if LSB information is passed, server might not have information about what package versions come from official repositories).&lt;br /&gt;
&lt;br /&gt;
The resulting info is a JSON object with keys equal to Context guids and value objects for chosen release with the following keys:&lt;br /&gt;
&lt;br /&gt;
* {{Code|blob}}, bundle [[#resource-types|digest]] to download;&lt;br /&gt;
* {{Code|version}}, chosen version number;&lt;br /&gt;
* {{Code|title}}, the &#039;&#039;Context.title&#039;&#039; value;&lt;br /&gt;
* {{Code|command}}, a command to launch the bundle, only for Sugar activities.&lt;br /&gt;
&lt;br /&gt;
For example, the {{Code|&#039;&#039;&#039;GET&#039;&#039;&#039; &amp;lt;nowiki&amp;gt;/context/org.laptop.TurtleArtActivity?cmd=solve&amp;amp;assume=sugar-0.94&amp;lt;/nowiki&amp;gt;}} request returns:&lt;br /&gt;
&lt;br /&gt;
 {&lt;br /&gt;
   &amp;quot;org.laptop.TurtleArtActivity&amp;quot;: {&lt;br /&gt;
     &amp;quot;title&amp;quot;: &amp;quot;Turtle Blocks&amp;quot;,&lt;br /&gt;
     &amp;quot;version&amp;quot;: &amp;quot;202&amp;quot;,&lt;br /&gt;
     &amp;quot;blob&amp;quot;: &amp;quot;http://download.sugarlabs.org/activities/4027/turtleblocks-202.xo&amp;quot;,&lt;br /&gt;
     &amp;quot;content-type&amp;quot;: &amp;quot;application/vnd.olpc-sugar&amp;quot;,&lt;br /&gt;
     &amp;quot;size&amp;quot;: 4715955,&lt;br /&gt;
     &amp;quot;unpack_size&amp;quot;: 12873871,&lt;br /&gt;
     &amp;quot;command&amp;quot;: &amp;quot;sugar-activity TurtleArtActivity.TurtleArtActivity&amp;quot;,&lt;br /&gt;
   },&lt;br /&gt;
   &amp;quot;sugar&amp;quot;: {&lt;br /&gt;
     &amp;quot;version&amp;quot;: &amp;quot;0.94&amp;quot;,&lt;br /&gt;
   },&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-clone&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Like the [[#GET-solve|solve]] command, &#039;&#039;clone&#039;&#039; makes a solution but returns bundle itself, so, there is no way to get information about possible dependencies.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;clone&#039;&#039;&#039;[&amp;amp;lsb_id=&#039;&#039;LSB_ID&#039;&#039;][&amp;amp;lsb_release=&#039;&#039;LSB_RELEASE&#039;&#039;][&amp;amp;assume=&#039;&#039;DEPENDENCY&#039;&#039;-&#039;&#039;VERSION&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
=== Upload releases ===&lt;br /&gt;
&lt;br /&gt;
To easy upload Context [[#context-releases|releases]] and avoid writing to raw &#039;&#039;Context.releases&#039;&#039; property, there is a special high-level API command.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;POST&#039;&#039;&#039; /context?cmd=&#039;&#039;&#039;submit&#039;&#039;&#039;[&amp;amp;&#039;&#039;PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;][&amp;amp;initial]&lt;br /&gt;
&lt;br /&gt;
Where the {{Code|PROP}} arguments are optional release properties. The {{Code|initial}} argument asks the system to create new Context resource new release will belong to.&lt;br /&gt;
&lt;br /&gt;
The posting data might be two types,&lt;br /&gt;
&lt;br /&gt;
* Sugar activities in .xo bundles,&amp;lt;br&amp;gt;there is no need in {{Code|PROP}} arguments, all properties will be populated basing on metadata from a .xo bundle; including release notes from the {{Code|CHANGELOG}} file in [[Wikipedia:Markdown|Markdown]] notation; besides, only in this case {{Code|initial}} makes sense because it is the only way to get Context properties;&lt;br /&gt;
&lt;br /&gt;
* Arbitrary data,&amp;lt;br&amp;gt;all required release properties should be specified in {{Code|PROP}} arguments, at least &#039;&#039;context&#039;&#039; and &#039;&#039;version&#039;&#039;; &#039;&#039;license&#039;&#039; should be specified only if there are no existing releases to pickup license from.&lt;br /&gt;
&lt;br /&gt;
=== Node statistics ===&lt;br /&gt;
&lt;br /&gt;
The node statistics are about the entire server and depersonalized. Statistics are being collected by analyzing regular requests to an API server and stored for each Sugar Network node. To read such info, call the command:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /?cmd=&#039;&#039;&#039;stats&#039;&#039;&#039;[&amp;amp;start=&#039;&#039;SECONDS&#039;&#039;][&amp;amp;end=&#039;&#039;SECONDS&#039;&#039;][&amp;amp;event=&#039;&#039;EVENT&#039;&#039;][&amp;amp;limit=&#039;&#039;NUMBER&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
&lt;br /&gt;
* {{Code|start}} and {{Code|end}} is a time interval to get statistics for; if omitted, the beginning and the end of entire life cycle will be used;&lt;br /&gt;
* {{Code|event}}, multiple argument to specify what stats should be returned; if omitted, return all sources;&lt;br /&gt;
* {{Code|limit}}, number of stat records to return for the {{Code|start}}-{{Code|end}} interval; note that this amount is not precise, the final resultset might be smaller or bigger depending on chosen resolution; stats resolution depends on node configuration, default values are 1 day, 10 days, 30 days, 365 days; if omitted, return {{Code|end}} record only.&lt;br /&gt;
&lt;br /&gt;
Possible events are:&lt;br /&gt;
&lt;br /&gt;
* {{Code|users}}, total number of existing &#039;&#039;User&#039;&#039; objects;&lt;br /&gt;
* {{Code|contexts}}, total number of existing &#039;&#039;Context&#039;&#039; objects;&lt;br /&gt;
* {{Code|released}}, average number of newly uploaded &#039;&#039;Context.releases&#039;&#039; for specified time frame;&lt;br /&gt;
* {{Code|solved}}, average number of requested &#039;&#039;Context&#039;&#039; [[#GET-solve|solutions]] for specified time frame; note that this value does not equal to the number of solution usages on client side since solutions might be cached;&lt;br /&gt;
* {{Code|reported}}, average number of newly uploaded failure &#039;&#039;Report&#039;&#039; objects for specified time frame;&lt;br /&gt;
* {{Code|topics}}, total number of top-level &#039;&#039;Post&#039;&#039; objects;&lt;br /&gt;
* {{Code|posts}}, total number of dependent &#039;&#039;Post&#039;&#039; objects.&lt;br /&gt;
&lt;br /&gt;
== Client API ==&lt;br /&gt;
&lt;br /&gt;
The reasons to proxy Sugar Network data on users side:&lt;br /&gt;
&lt;br /&gt;
* Seamless support [[#Offline mode|offline workflow]];&lt;br /&gt;
* [[#Launching|One-click launch]] Sugar activities hosted on Sugar Network.&lt;br /&gt;
&lt;br /&gt;
Proxying happens by providing the same Sugar Network API (with some extra functionality, see below) from&lt;br /&gt;
[[Platform_Team/Sugar_Network/Implementation#sugar-network-client|local process]] launched beforehand.&lt;br /&gt;
&lt;br /&gt;
=== Offline mode ===&lt;br /&gt;
&lt;br /&gt;
Being connected to a Sugar Network node, local proxy provides [[#Node_API|original API]] from the node. If the connection is lost, the proxy will switch to local Sugar Network storage and continue working providing only [[#Base_API|base API]]. Any content created in offline mode will be uploaded to the node after getting a connection back.&lt;br /&gt;
&lt;br /&gt;
Besides, local Sugar Network storage will be reused to keep users preferences, such as:&lt;br /&gt;
&lt;br /&gt;
* Favorited Contexts&amp;lt;br&amp;gt;to select preferred &#039;&#039;Context&#039;&#039; resources; these Contexts will be marked by {{Code|favorite}} value in the &#039;&#039;Context.layer&#039;&#039; property;&lt;br /&gt;
&lt;br /&gt;
* Checked-in Contexts&amp;lt;br&amp;gt;to keep most recent Context (for &#039;&#039;activity&#039;&#039; and &#039;&#039;book&#039;&#039; types) version in local storage to make it available in offline; note that there is no need in checking-in to speedup online lunch, versions are being [[#Launching|cached]] anyway; these Contexts will be marked by {{Code|checkin}} value in the &#039;&#039;Context.layer&#039;&#039; property.&lt;br /&gt;
&lt;br /&gt;
To control users preferences there are special API commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT_favorite&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;favorite&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Set favorite status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE_favorite&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;favorite&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Unset favorite status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT_checkin&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;checkin&#039;&#039;&#039;[&amp;amp;spawn]&lt;br /&gt;
&lt;br /&gt;
Check-in the specified Context. By default, the command will return streamed &#039;&#039;text/event-stream&#039;&#039; MIME type data to monitor the progress. If the {{Code|spawn}} argument is specified, the command will exit immediately with [[#Notifications|asynchronous sending]] progress events.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE_checkin&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;checkin&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Checkout the Context.&lt;br /&gt;
&lt;br /&gt;
=== Launching ===&lt;br /&gt;
&lt;br /&gt;
Sugar Network Contexts (for &#039;&#039;activity&#039;&#039; and &#039;&#039;book&#039;&#039; types) can be launched as-is. The launching process is implicit and includes selecting the most recent (and appropriate for software contexts) version, downloading bundles from the Sugar Network, installing missed [[Sugar_Network/Recipe_Specification#Dependencies|software dependencies]], execution itself. All downloaded bundles will be cached [with further garbage collecting] to speedup further launching.&lt;br /&gt;
&lt;br /&gt;
Sugar activities will be directly executed. Book Contexts will be opened in the proper application according to its MIME type.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;launch&#039;&#039;&#039;[&amp;amp;args=&#039;&#039;ARG&#039;&#039;][&amp;amp;activity_id=&#039;&#039;ACTIVITY_ID&#039;&#039;][&amp;amp;object_id=&#039;&#039;OBJECT_ID&#039;&#039;][&amp;amp;uri=&#039;&#039;URI&#039;&#039;][&amp;amp;app=&#039;&#039;APP&#039;&#039;][&amp;amp;spawn]&lt;br /&gt;
&lt;br /&gt;
Arguments that make sense only for Sugar activities:&lt;br /&gt;
&lt;br /&gt;
* {{Code|ARG}}, command line argument to pass to launched activities, repeat {{Code|ARG}} for each argument;&lt;br /&gt;
* {{Code|ACTIVITY_ID}}, internal activity id which will be auto set if omitted;&lt;br /&gt;
* {{Code|OBJECT_ID}}, Journal object id to resume;&lt;br /&gt;
* {{Code|URI}}, URL to resume if activity supports this functionality.&lt;br /&gt;
&lt;br /&gt;
Arguments that make sense only for books:&lt;br /&gt;
&lt;br /&gt;
* {{Code|APP}}, specify application Context to open the book by; if omitted, the system will try to find most appropriate option, among all existing software Contexts.&lt;br /&gt;
&lt;br /&gt;
Common arguments:&lt;br /&gt;
&lt;br /&gt;
* {{Code|spawn}}, by default, the command will return streamed &#039;&#039;text/event-stream&#039;&#039; MIME type data to monitor the whole launching process until exiting the application; if the {{Code|spawn}} argument is specified, the command will exit immediately with [[#Notifications|asynchronous sending]] launching events.&lt;br /&gt;
&lt;br /&gt;
== Experimental API ==&lt;br /&gt;
&lt;br /&gt;
There is no guaranty that the following API will be stated as stable or frozen sometime.&lt;br /&gt;
&lt;br /&gt;
=== Access to Sugar Journal ===&lt;br /&gt;
&lt;br /&gt;
It is possible to get access to local Sugar Journal using special, &#039;&#039;journal&#039;&#039;, resource provided from [[#Client_API|client API]]. This kind of access might be useful when local applications cannot use DBus sugar-datastore API, e.g., [[wikipedia:Javascript|Javascript]] applications. API to Journal is restricted only to read-only access:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /journal?offset=&#039;&#039;INTEGER&#039;&#039;&amp;amp;limit=&#039;&#039;INTEGER&#039;&#039;[&amp;amp;query=&#039;&#039;STRING&#039;&#039;][&amp;amp;order_by=&amp;lt;nowiki&amp;gt;[+|-]&amp;lt;/nowiki&amp;gt;&#039;&#039;PROP&#039;&#039;][&amp;amp;&#039;&#039;QUERY_PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;[&amp;amp;...]]&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /journal/&#039;&#039;JOURNAL_ID&#039;&#039;[?reply=&#039;&#039;PROP&#039;&#039;[,..]]&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /journal/&#039;&#039;JOURNAL_ID&#039;&#039;/&#039;&#039;PROPERTY&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
Being HTTP based, Sugar Network API can be used in any manner regular HTTP requests can be handled. But for command-line access, there is a handy tool, {{Code|sugar-network}}, which takes care about Sugar Network specific like launching local API (if it is not already available) to get access to [[#Client_API|local proxy]].&lt;br /&gt;
&lt;br /&gt;
The sugar-network command-line format is below. Call {{Code|sugar-network --help}} for more detailed info.&lt;br /&gt;
&lt;br /&gt;
 sugar-network GET|POST|PUT|DELETE &#039;&#039;PATH&#039;&#039; &#039;&#039;ARG=VALUE&#039;&#039; [..]&lt;br /&gt;
&lt;br /&gt;
* {{Code|PATH}}, is an url path;&lt;br /&gt;
* {{Code|ARG&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;VALUE}}, request arguments as they being passed to in url.&lt;br /&gt;
&lt;br /&gt;
{{Code|POST}} and {{Code|PUT}} commands require data to pass, use the following command-line arguments:&lt;br /&gt;
&lt;br /&gt;
* {{Code|-f FILE}} to specify the file to pass;&lt;br /&gt;
* {{Code|-d DATA}} to specify string to pass;&lt;br /&gt;
* {{Code|-j}} posted data should be encoded into JSON before posting.&lt;br /&gt;
&lt;br /&gt;
== Getting involved ==&lt;br /&gt;
&lt;br /&gt;
{{:Sugar_Network/Feedback}}&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Resources&amp;diff=93342</id>
		<title>Sugar Network/Resources</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Resources&amp;diff=93342"/>
		<updated>2014-09-04T06:59:14Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following diagram shows the full list of objects implemented by the Sugar Network [[Platform Team/Sugar Network/API|API]].&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot; align=&amp;quot;let&amp;quot;&lt;br /&gt;
| [[File:Sugar-Network-diagram.png|200px|thumb|Sugar Network objects]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-types&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Property types&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Generally, Sugar Network objects&#039; property types correspond to JSON types. The only exceptions mentioned in the following list:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;enum&#039;&#039;, is an enumerated type when a value is a string from the predefined list of constants;&lt;br /&gt;
* &#039;&#039;markdown&#039;&#039;, is a string formatted in the [[Wikipedia:Markdown|Markdown]] syntax;&lt;br /&gt;
* &#039;&#039;blob&#039;&#039;, is a file represented by string value which is a [[Wikipedia:Sha1|SHA-1]] digest of file&#039;s content; the file itself can be obtained from the {{Code|&#039;&#039;&#039;GET&#039;&#039;&#039; /blobs/&#039;&#039;DIGEST&#039;&#039;}} request;&lt;br /&gt;
* &#039;&#039;aggregated&#039;&#039;, is a list of JSON objects which has [[Sugar_Network/API#Aggregated_properties|special API]] to treat its items; each aggregated item has a unique identifier; items might be created not only by the object&#039;s authors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-author&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.author&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A dictionary of authors working on the corresponding resource. Keys are Sugar Network &#039;&#039;User&#039;&#039; guids, or, if particular author is not registered in the Sugar Network, full user names. Values are dictionaries with the following keys:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;name&#039;&#039;&amp;lt;br&amp;gt;Full author&#039;s name;&lt;br /&gt;
* &#039;&#039;role&#039;&#039;&amp;lt;br&amp;gt;An integer which is a bit-wise ORed value of the following constants:&lt;br /&gt;
** &#039;&#039;0x1&#039;&#039;, author is registered in the Sugar Network (and &#039;&#039;guid&#039;&#039; key is set);&lt;br /&gt;
** &#039;&#039;0x10000&#039;&#039;, author is the original author of the corresponding resource; if it is not set, user is only a maintainer, e.g., an uploader of a book which has its original authors;&lt;br /&gt;
* &#039;&#039;avatar&#039;&#039;&amp;lt;br&amp;gt;An url to author&#039;s avatar.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-status&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.status&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is a system level property which can be set only by node editors. It is a list of &amp;quot;badges&amp;quot; editors set depending on the object quality. Currently supported statuses are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;featured&#039;&#039;, the object is popped up by node editors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-pins&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.pins&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This property makes sense only for objects provided from a [[Sugar_Network/API#Client_proxy|local proxy]]. The property is intended to store local user&#039;s preferences or statuses remote object has in local environment. Currently supported values are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;favorite&#039;&#039;, set if a user has &#039;&#039;&amp;quot;stared&amp;quot;&#039;&#039; the object;&lt;br /&gt;
* &#039;&#039;checkin&#039;&#039;, applied to Context objects only, set if a user has &#039;&#039;&amp;quot;pinned&amp;quot;&#039;&#039; the context to keep its most recent version permanently in the local system;&lt;br /&gt;
* &#039;&#039;stale&#039;&#039;, applied to Context objects only, set if previously checked-in Context might have more fresh releases on the node; it is not possible to filter Contexts by this value;&lt;br /&gt;
* &#039;&#039;inprogress&#039;&#039;, applied to Context objects only, set if the Context is in the process of downloading content from the node; it is being temporally set before launching the Context or checking it in; it is not possible to filter Contexts by this value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;context-type&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Context.type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;activity&#039;&#039;, Sugar application;&lt;br /&gt;
* &#039;&#039;book&#039;&#039;, books in various forms;&lt;br /&gt;
* &#039;&#039;group&#039;&#039;, a social group of related activities;&lt;br /&gt;
* &#039;&#039;talks&#039;&#039;, sub-type to mix-in offline discussion forum;&lt;br /&gt;
* &#039;&#039;project&#039;&#039;, sub-type to mix-in issue tracker and polling functionality.&lt;br /&gt;
&lt;br /&gt;
Context type specifies how context, and all related resources, can be used. For example, &#039;&#039;activity&#039;&#039; type assumes activity bundles uploaded to the &#039;&#039;Context.releases&#039;&#039; property, or, [[#post-type|Post.type]] depends on Context type it was created for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;context-releases&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Context.releases&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Contexts with &#039;&#039;activity&#039;&#039; or &#039;&#039;book&#039;&#039; types might have releases, i.e., activity or book versions that users can download. The &#039;&#039;releases&#039;&#039; property is aggregated where each item describes one particular version. There is no need in working with the &#039;&#039;releases&#039;&#039; property directly, there are high-level API commands to [[Sugar_Network/API#Upload_releases|upload]] and [[Sugar_Network/API#Retrieving_releases|download]] releases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;post-type&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post.type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Choose Post types according to Context [[#context-type|types]] the Post belongs to.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;topic&#039;&#039;, general purpose discussion; &#039;&#039;talks&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;artefact&#039;&#039;, object generated by Context application; &#039;&#039;activity&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;issue&#039;&#039;, problem with the Context; &#039;&#039;project&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;poll&#039;&#039;, a poll within the Context; &#039;&#039;project&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;post&#039;&#039;, a comment for a parent Post object; Context type independent.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;post-topic&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post.topic&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Only &#039;&#039;post&#039;&#039; type Post objects belong to a parent Post which guid should be specified in the &#039;&#039;topic&#039;&#039; property. The system design assumes only a two-level Posts hierarchy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;post-topic&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post.resolution&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Post types &#039;&#039;issue&#039;&#039; and &#039;&#039;poll&#039;&#039; topics might have a resolution to expose the current status. The only way to change topic resolution is creating a dependent post with resolution property set.&lt;br /&gt;
&lt;br /&gt;
Resolutions for &#039;&#039;issue&#039;&#039; Post objects:&lt;br /&gt;
* &#039;&#039;unconfirmed&#039;&#039;, newly created issue;&lt;br /&gt;
* &#039;&#039;new&#039;&#039;, confirmed issue;&lt;br /&gt;
* &#039;&#039;needinfo&#039;&#039;, posted information about the issue is insufficient, more details needed;&lt;br /&gt;
* &#039;&#039;resolved&#039;&#039;, the issue is resolved, closed;&lt;br /&gt;
* &#039;&#039;unrelated&#039;&#039;, the issue does not related to the Context, closed;&lt;br /&gt;
* &#039;&#039;obsolete&#039;&#039;, the issue is already solved in recent Context releases, closed;&lt;br /&gt;
* &#039;&#039;duplicate&#039;&#039;, the issue is a duplicate, closed.&lt;br /&gt;
&lt;br /&gt;
Resolutions for &#039;&#039;poll&#039;&#039; Post objects:&lt;br /&gt;
* &#039;&#039;open&#039;&#039;, the poll is open for votes;&lt;br /&gt;
* &#039;&#039;closed&#039;&#039;, the poll is closed for votes.&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Resources&amp;diff=93158</id>
		<title>Sugar Network/Resources</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Resources&amp;diff=93158"/>
		<updated>2014-08-09T08:22:57Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following diagram shows the full list of objects implemented by the Sugar Network [[Platform Team/Sugar Network/API|API]].&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot; align=&amp;quot;let&amp;quot;&lt;br /&gt;
| [[File:Sugar-Network-diagram.png|200px|thumb|Sugar Network objects]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-types&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Property types&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Generally, Sugar Network objects&#039; property types correspond to JSON types. The only exceptions mentioned in the following list:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;enum&#039;&#039;, is an enumerated type when a value is a string from the predefined list of constants;&lt;br /&gt;
* &#039;&#039;markdown&#039;&#039;, is a string formatted in the [[Wikipedia:Markdown|Markdown]] syntax;&lt;br /&gt;
* &#039;&#039;blob&#039;&#039;, is a file represented by string value which is a [[Wikipedia:Sha1|SHA-1]] digest of file&#039;s content; the file itself can be obtained from the {{Code|&#039;&#039;&#039;GET&#039;&#039;&#039; /blobs/&#039;&#039;DIGEST&#039;&#039;}} request;&lt;br /&gt;
* &#039;&#039;aggregated&#039;&#039;, is a list of JSON objects which has [[Sugar_Network/API#Aggregated_properties|special API]] to treat its items; each aggregated item has a unique identifier; items might be created not only by the object&#039;s authors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-author&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.author&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A dictionary of authors working on the corresponding resource. Keys are Sugar Network &#039;&#039;User&#039;&#039; guids, or, if particular author is not registered in the Sugar Network, full user names. Values are dictionaries with the following keys:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;name&#039;&#039;&amp;lt;br&amp;gt;Full author&#039;s name;&lt;br /&gt;
* &#039;&#039;role&#039;&#039;&amp;lt;br&amp;gt;An integer which is a bit-wise ORed value of the following constants:&lt;br /&gt;
** &#039;&#039;0x1&#039;&#039;, author is registered in the Sugar Network (and &#039;&#039;guid&#039;&#039; key is set);&lt;br /&gt;
** &#039;&#039;0x10000&#039;&#039;, author is the original author of the corresponding resource; if it is not set, user is only a maintainer, e.g., an uploader of a book which has its original authors;&lt;br /&gt;
* &#039;&#039;avatar&#039;&#039;&amp;lt;br&amp;gt;An url to author&#039;s avatar.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-status&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.status&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is a system level property which can be set only by node editors. It is a list of &amp;quot;badges&amp;quot; editors set depending on the object quality. Currently supported statuses are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;featured&#039;&#039;, the object is popped up by node editors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-pins&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.pins&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This property makes sense only for objects provided from a [[Sugar_Network/API#Client_proxy|local proxy]]. The property is intended to store local user&#039;s preferences or statuses remote object has in local environment. Currently supported values are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;favorite&#039;&#039;, set if a user has &#039;&#039;&amp;quot;stared&amp;quot;&#039;&#039; the object;&lt;br /&gt;
* &#039;&#039;checkin&#039;&#039;, applied to Context objects only, set if a user has &#039;&#039;&amp;quot;pinned&amp;quot;&#039;&#039; the context to keep its most recent version permanently in the local system;&lt;br /&gt;
* &#039;&#039;stale&#039;&#039;, applied to Context objects only, set if previously checked-in Context might have more fresh releases on the node; it is not possible to filter Contexts by this value;&lt;br /&gt;
* &#039;&#039;inprogress&#039;&#039;, applied to Context objects only, set if the Context is in the process of downloading content from the node; it is being temporally set before launching the Context or checking it in; it is not possible to filter Contexts by this value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;context-type&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Context.type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;activity&#039;&#039;, Sugar application;&lt;br /&gt;
* &#039;&#039;book&#039;&#039;, books in various forms;&lt;br /&gt;
* &#039;&#039;group&#039;&#039;, a social group of related activities;&lt;br /&gt;
* &#039;&#039;package&#039;&#039;, GNU/Linux package metadata;&lt;br /&gt;
* &#039;&#039;talks&#039;&#039;, sub-type to mix-in offline discussion forum;&lt;br /&gt;
* &#039;&#039;project&#039;&#039;, sub-type to mix-in issue tracker and polling functionality.&lt;br /&gt;
&lt;br /&gt;
Context type specifies how context, and all related resources, can be used. For example, &#039;&#039;activity&#039;&#039; type assumes activity bundles uploaded to the &#039;&#039;Context.releases&#039;&#039; property, or, [[#post-type|Post.type]] depends on Context type it was created for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;context-releases&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Context.releases&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Contexts with &#039;&#039;activity&#039;&#039; or &#039;&#039;book&#039;&#039; types might have releases, i.e., activity or book versions that users can download. The &#039;&#039;releases&#039;&#039; property is aggregated where each item describes one particular version. There is no need in working with the &#039;&#039;releases&#039;&#039; property directly, there are high-level API commands to [[Sugar_Network/API#Upload_releases|upload]] and [[Sugar_Network/API#Retrieving_releases|download]] releases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;post-type&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post.type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Choose Post types according to Context [[#context-type|types]] the Post belongs to.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;topic&#039;&#039;, general purpose discussion; &#039;&#039;talks&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;artefact&#039;&#039;, object generated by Context application; &#039;&#039;activity&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;issue&#039;&#039;, problem with the Context; &#039;&#039;project&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;poll&#039;&#039;, a poll within the Context; &#039;&#039;project&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;post&#039;&#039;, a comment for a parent Post object; Context type independent.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;post-topic&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post.topic&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Only &#039;&#039;post&#039;&#039; type Post objects belong to a parent Post which guid should be specified in the &#039;&#039;topic&#039;&#039; property. The system design assumes only a two-level Posts hierarchy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;post-topic&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post.resolution&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Post types &#039;&#039;issue&#039;&#039; and &#039;&#039;poll&#039;&#039; topics might have a resolution to expose the current status. The only way to change topic resolution is creating a dependent post with resolution property set.&lt;br /&gt;
&lt;br /&gt;
Resolutions for &#039;&#039;issue&#039;&#039; Post objects:&lt;br /&gt;
* &#039;&#039;unconfirmed&#039;&#039;, newly created issue;&lt;br /&gt;
* &#039;&#039;new&#039;&#039;, confirmed issue;&lt;br /&gt;
* &#039;&#039;needinfo&#039;&#039;, posted information about the issue is insufficient, more details needed;&lt;br /&gt;
* &#039;&#039;resolved&#039;&#039;, the issue is resolved, closed;&lt;br /&gt;
* &#039;&#039;unrelated&#039;&#039;, the issue does not related to the Context, closed;&lt;br /&gt;
* &#039;&#039;obsolete&#039;&#039;, the issue is already solved in recent Context releases, closed;&lt;br /&gt;
* &#039;&#039;duplicate&#039;&#039;, the issue is a duplicate, closed.&lt;br /&gt;
&lt;br /&gt;
Resolutions for &#039;&#039;poll&#039;&#039; Post objects:&lt;br /&gt;
* &#039;&#039;open&#039;&#039;, the poll is open for votes;&lt;br /&gt;
* &#039;&#039;closed&#039;&#039;, the poll is closed for votes.&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=File:Sugar-network-hub.svg&amp;diff=93099</id>
		<title>File:Sugar-network-hub.svg</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=File:Sugar-network-hub.svg&amp;diff=93099"/>
		<updated>2014-07-31T01:02:20Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: Alsroot uploaded a new version of &amp;amp;quot;File:Sugar-network-hub.svg&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=File:Sugar-network-hub.svg&amp;diff=93098</id>
		<title>File:Sugar-network-hub.svg</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=File:Sugar-network-hub.svg&amp;diff=93098"/>
		<updated>2014-07-31T01:00:41Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: Alsroot uploaded a new version of &amp;amp;quot;File:Sugar-network-hub.svg&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=File:Sugar-network-hub.svg&amp;diff=93080</id>
		<title>File:Sugar-network-hub.svg</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=File:Sugar-network-hub.svg&amp;diff=93080"/>
		<updated>2014-07-30T03:43:44Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: Alsroot uploaded a new version of &amp;amp;quot;File:Sugar-network-hub.svg&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=File:Sugar-network-hub.svg&amp;diff=93077</id>
		<title>File:Sugar-network-hub.svg</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=File:Sugar-network-hub.svg&amp;diff=93077"/>
		<updated>2014-07-30T03:39:52Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: Alsroot uploaded a new version of &amp;amp;quot;File:Sugar-network-hub.svg&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Sugar_Network/API&amp;diff=92973</id>
		<title>Sugar Network/API</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Sugar_Network/API&amp;diff=92973"/>
		<updated>2014-07-24T04:12:33Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: /* Sugar Network resources */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the API that Sugar Network clients use to interact with a Sugar Network server. See also a guide to basic Sugar Network [[Sugar_Network/Concept|concepts]] and [[Platform_Team/Sugar_Network/Architecture|its twin page]] for a technical point of view. In addition, visit the [[Sugar_Network|introduction page]].&lt;br /&gt;
&lt;br /&gt;
{{Note/warning|Note|Until announcing API freeze, this document describes the most recent development version of the API.&amp;lt;br&amp;gt;You can find its implementation on the [[#API servers|node-devel.sugarlabs.org]] server.}}&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
To better understand this API, see a technical explanation of its [[Platform_Team/Sugar_Network/Architecture#Conceptual_level|conceptual level]] and [[#Sugar_Network_resources|objects model]] in particular.&lt;br /&gt;
&lt;br /&gt;
The API operates with [[Sugar Network]] [[#Sugar_Network_resources|resources]], which are collections of objects. All objects are identified by globally unique identifiers, GUIDs, and available for operation via [[#Base_API|basic actions]]. The API is being provided from a [[#API_servers|node server]] or a [[#Client_API|client]]. While processing requests, API providers generate [[#Notifications|events]].&lt;br /&gt;
&lt;br /&gt;
The API is [[Wikipedia:Restful|RESTful]], and is served via HTTP(S) using [[Wikipedia:Json|JSON]] notation. The common request url format is:&lt;br /&gt;
&lt;br /&gt;
 http[s]://&#039;&#039;SERVER&#039;&#039;[/&#039;&#039;RESOURCE&#039;&#039;[/&#039;&#039;GUID&#039;&#039;[/&#039;&#039;PROPERTY&#039;&#039;]]][?[cmd=&#039;&#039;COMMAND&#039;&#039;][&amp;amp;&#039;&#039;ARGUMENT&#039;&#039;=&#039;&#039;VALUE&#039;&#039;..]]&lt;br /&gt;
&lt;br /&gt;
When:&lt;br /&gt;
&lt;br /&gt;
* {{Code|SERVER}}, [[#API_servers|particular]] Sugar Network API server;&lt;br /&gt;
* {{Code|RESOURCE}}, name one of the [[#Sugar_Network_resources|existing]] resources;&lt;br /&gt;
* {{Code|GUID}}, the {{Code|RESOURCE}}&#039;s particular object;&lt;br /&gt;
* {{Code|PROPERTY}}, particular property of {{Code|GUID}} object;&lt;br /&gt;
* {{Code|COMMAND}}, optional command name; combination of HTTP request method ({{Code|GET}}, {{Code|POST}}, {{Code|PUT}}, or, {{Code|DELETE}}) and [possibly empty] {{Code|COMMAND}} composes the requested [[#Actions|action]];&lt;br /&gt;
* {{Code|ARGUMENT}}s and {{Code|VALUE}}s depend on the particular [[#Actions|action]].&lt;br /&gt;
&lt;br /&gt;
In most cases, the server replies in JSON notation. If a request fails, the replied JSON object will contain a {{Code|request}} key, with the original request, and {{Code|error}} key, with an error message.&lt;br /&gt;
&lt;br /&gt;
== API version ==&lt;br /&gt;
&lt;br /&gt;
Sugar Network nodes might support multiple API versions at once but only one of them is default, i.e., the one which is in use if clients do not specify particular API version. To specify API versions in client request, setup the {{Code|X-API}} HTTP header with chosen version. If such header is omitted, default version will be used by the node;&lt;br /&gt;
&lt;br /&gt;
Currently available API versions:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;0.1&#039;&#039; initial API implementation, should not be used;&lt;br /&gt;
* &#039;&#039;0.2&#039;&#039; the most recent version, the rest of the document describes exactly this version.&lt;br /&gt;
&lt;br /&gt;
== Nodes ==&lt;br /&gt;
&lt;br /&gt;
These are standard Sugar Network API servers publicly available.&lt;br /&gt;
&lt;br /&gt;
* [http://node-devel.sugarlabs.org/ node-devel.sugarlabs.org]&amp;lt;br&amp;gt;Development server which does not contain important data and is free for any experiments (administrative privileges for anonymous users); default API version is &#039;&#039;0.2&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
* [http://node-testing.sugarlabs.org/ node-testing.sugarlabs.org]&amp;lt;br&amp;gt;Recent stable release with regular data import from the production server; is still free for any experiments; default API version is &#039;&#039;0.1&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
* [http://node.sugarlabs.org/ node.sugarlabs.org]&amp;lt;br&amp;gt;Production server;&lt;br /&gt;
&lt;br /&gt;
* [http://localhost:5001/ localhost:5001]&amp;lt;br&amp;gt;default url to get access to [[#Client_API|local proxy]] provided from user side application; ; default API version is &#039;&#039;0.1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
{{:Sugar_Network/Resources}}&lt;br /&gt;
&lt;br /&gt;
== Base API ==&lt;br /&gt;
&lt;br /&gt;
List of actions common of all API providers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;POST&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;POST&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create new resource object.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to send:&lt;br /&gt;
* {{Code|&#039;&#039;RESOURCE}}&#039;s properties.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to receive:&lt;br /&gt;
* {{Code|guid}}, with globally unique identifier that specifies the created object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Modify resource object. By default, might be called only by {{Code|GUID}} creator.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to send:&lt;br /&gt;
* {{Code|RESOURCE}}&#039;s properties to modify.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Delete resource object. Actual object destruction won&#039;t happen, the object will be hidden. Garbage collection of hidden objects will be processed by Network administrators. By default, this action may be called only by the {{Code|GUID}} creator.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;[?offset=&#039;&#039;INTEGER&#039;&#039;][&amp;amp;limit=&#039;&#039;INTEGER&#039;&#039;][&amp;amp;query=&#039;&#039;STRING&#039;&#039;][&amp;amp;reply=&#039;&#039;PROP&#039;&#039;][&amp;amp;order_by=&amp;lt;nowiki&amp;gt;[+|-]&amp;lt;/nowiki&amp;gt;&#039;&#039;PROP&#039;&#039;][&amp;amp;group_by=&#039;&#039;PROP&#039;&#039;][&amp;amp;&#039;&#039;PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;][&amp;amp;&#039;&#039;!PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
Find resource objects.&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
* {{Code|offset}}, &#039;&#039;int&#039;&#039;&amp;lt;br&amp;gt;start index to return entries from, the default value is {{Code|0}};&lt;br /&gt;
* {{Code|limit}}, &#039;&#039;int&#039;&#039;&amp;lt;br&amp;gt;do not return more then specified value, maximal and default values are being setup on server side;&lt;br /&gt;
* {{Code|query}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;search request in [http://xapian.org/docs/queryparser.html Xapian] notation with the following additions:&lt;br /&gt;
** if property is boolean, integer or datetime, it supports searching by ranges: {{Code|&#039;&#039;PROP&#039;&#039;:[&#039;&#039;START&#039;&#039;]..[&#039;&#039;END&#039;&#039;]}};&lt;br /&gt;
** the statement {{Code|&#039;&#039;PROP&#039;&#039;&amp;lt;nowiki&amp;gt;:=&amp;lt;/nowiki&amp;gt;[&amp;quot;]&#039;&#039;VALUE&#039;&#039;[&amp;quot;]}} has the same effect as {{Code|QUERY_PROP}}; it is different to regular {{Code|&#039;&#039;PROP&#039;&#039;:&#039;&#039;VALUE&#039;&#039;}} where {{Code|VALUE}} might be a substring;&lt;br /&gt;
* {{Code|PROP}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;supplements {{Code|query}} with filtering by exact value of the {{Code|PROP}} property; the resulting query string will be {{Code|&#039;&#039;PROP&#039;&#039;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&#039;&#039;VALUE&#039;&#039; AND (&#039;&#039;QUERY&#039;&#039;)}}; argument is multiple;&lt;br /&gt;
* {{Code|!PROP}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;supplements {{Code|query}} by excluding exact value of the {{Code|PROP}} property; the resulting query string will be {{Code|NOT &#039;&#039;PROP&#039;&#039;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&#039;&#039;VALUE&#039;&#039; AND (&#039;&#039;QUERY&#039;&#039;)}}; argument is multiple;&lt;br /&gt;
* {{Code|reply}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;RESOURCE&#039;&#039; properties to return; by default, return only {{Code|guid}} property; argument is multiple;&lt;br /&gt;
* {{Code|order_by}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;property to sort the resulting list by; if starts with the {{Code|-}}, the order is descending, otherwise it is ascending;&lt;br /&gt;
* {{Code|group_by}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;property name to group resulting list by.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to receive:&lt;br /&gt;
* {{Code|total}}, total number in requested query (the reply might contain only the portion restricted by {{Code|limit}} request argument);&lt;br /&gt;
* {{Code|result}}, an array of dictionaries with resource object properties, dictionaries contain at least {{Code|guid}} property.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-resource&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;[?reply=&#039;&#039;PROP&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
* {{Code|reply}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;RESOURCE&#039;&#039; properties to return; by default, return only {{Code|guid}} property; argument is multiple;&lt;br /&gt;
&lt;br /&gt;
Return properties for a particular resource object.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to receive:&lt;br /&gt;
* properties that were specified in {{Code|reply}} argument(s), at least {{Code|guid}}.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT-property&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Modify particular resource property. By default, might be called only by {{Code|GUID}} creator.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-property&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Return property value for particular resource object.&lt;br /&gt;
&lt;br /&gt;
Data to receive:&lt;br /&gt;
* property value in JSON notation for regular properties;&lt;br /&gt;
* raw data or redirection for BLOB properties.&lt;br /&gt;
&lt;br /&gt;
=== Aggregated properties ===&lt;br /&gt;
&lt;br /&gt;
[[#resource-types|Aggregated]] properties have special API to treat their content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;POST-aggproperty&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;POST&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Submit new item. The command returns an id for newly created aggregated item. Depending on particular property, new items might be created not only by object&#039;s authors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT-aggproperty&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;/&#039;&#039;ID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Update existing aggregated item. Depending on particular property, the command is allowed either to object&#039;s authors or to aggregated item submitter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE-aggproperty&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;/&#039;&#039;ID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Delete existing aggregated item. Depending on particular property, the command is allowed either to object&#039;s authors or to aggregated item submitter.&lt;br /&gt;
&lt;br /&gt;
=== Notifications ===&lt;br /&gt;
&lt;br /&gt;
It is possible to subscribe to server events. Notification will happen using HTML5 [[wikipedia:Server-sent_events|Server-sent events]] (SSE).&lt;br /&gt;
&lt;br /&gt;
To start subscription, send the following request:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /?cmd=&#039;&#039;&#039;subscribe&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Response will be served with &#039;&#039;text/event-stream&#039;&#039; MIME type for default SSE message type. SSE message will be a JSONified object with the following, at least, attributes:&lt;br /&gt;
&lt;br /&gt;
* {{Code|event}}&amp;lt;br&amp;gt;event type.&lt;br /&gt;
&lt;br /&gt;
== Node API ==&lt;br /&gt;
&lt;br /&gt;
This is an API provided by Sugar Network nodes on top of [[#Base_API|base one]].&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
&lt;br /&gt;
Right now, the only way to be authenticated on a Sugar Network server is by running a [[Platform_Team/Sugar_Network/Implementation#sugar-network-client|local application]] on the client side and using the API it [[#Client_API|provides]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;TODO&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Authorization ===&lt;br /&gt;
&lt;br /&gt;
Read-only access is available for anonymous requests, except special content like machine serial numbers. But to process any changes, clients need to be authenticated.&lt;br /&gt;
&lt;br /&gt;
Right after creating any Sugar Network object, its author becomes the only user who can process any object modifications afterwards. Authority information will be kept in the [[#Sugar_Network_resources|author]] property and can be modified using the following commands.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;useradd&#039;&#039;&#039;&amp;amp;user=&#039;&#039;USER&#039;&#039;&amp;amp;role=&#039;&#039;ROLE&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Add another user who can modify the corresponding object. &#039;&#039;USER&#039;&#039; argument should be either &#039;&#039;User&#039;&#039; guid (for authors registered in the Sugar Network), or, full author name.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;userdel&#039;&#039;&#039;&amp;amp;user=&#039;&#039;USER&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Remove user from the authority list. It is not possible to remove yourself. &#039;&#039;USER&#039;&#039; argument should be either &#039;&#039;User&#039;&#039; guid (for authors registered in the Sugar Network), or, full author name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;TODO&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Retrieving releases ===&lt;br /&gt;
&lt;br /&gt;
To easy download Context [[#context-releases|releases]] and avoid reading raw &#039;&#039;Context.releases&#039;&#039; property, there are special high-level API commands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-solve&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;solve&#039;&#039;&#039;[&amp;amp;lsb_id=&#039;&#039;LSB_ID&#039;&#039;][&amp;amp;lsb_release=&#039;&#039;LSB_RELEASE&#039;&#039;][&amp;amp;assume=&#039;&#039;DEPENDENCY&#039;&#039;-&#039;&#039;VERSION&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
The command returns information about what particular releases should be downloaded depending on provided requirements. This command might return not only one release, e.g., activities might have dependencies either system packages or another Sugar Network Contexts.&lt;br /&gt;
&lt;br /&gt;
Solving requirements might be:&lt;br /&gt;
&lt;br /&gt;
* {{Code|LSB_ID}}, if Context releases depend on system packages, specify the [[Wikipedia:Linux_Standard_Base|LSB]] distributor id to consider while choosing particular packages;&lt;br /&gt;
* {{Code|LSB_RELEASE}}, if Context releases depend on system packages, specify the [[Wikipedia:Linux_Standard_Base|LSB]] release number of the distribution to consider while choosing particular packages;&lt;br /&gt;
* {{Code|DEPENDENCY-VERSION}}, the {{Code|assume}} argument instructs server to assume that specified [[Sugar_Network/Recipe_Specification#Dependencies|dependency]] is already available on client side and should be taken into account while solving; this is especially important for package dependencies when server considers packages available only from official repositories but users might have more recent package versions installed in local system; e.g., the above example request will fail without {{Code|sugar-0.94}} because neither {{Code|lsb_id}} nor {{Code|lsb_release}} were specified (even if LSB information is passed, server might not have information about what package versions come from official repositories).&lt;br /&gt;
&lt;br /&gt;
The resulting info is a JSON object with keys equal to Context guids and value objects for chosen release with the following keys:&lt;br /&gt;
&lt;br /&gt;
* {{Code|blob}}, bundle [[#resource-types|digest]] to download;&lt;br /&gt;
* {{Code|version}}, chosen version number;&lt;br /&gt;
* {{Code|title}}, the &#039;&#039;Context.title&#039;&#039; value;&lt;br /&gt;
* {{Code|command}}, a command to launch the bundle, only for Sugar activities.&lt;br /&gt;
&lt;br /&gt;
For example, the {{Code|&#039;&#039;&#039;GET&#039;&#039;&#039; &amp;lt;nowiki&amp;gt;/context/org.laptop.TurtleArtActivity?cmd=solve&amp;amp;assume=sugar-0.94&amp;lt;/nowiki&amp;gt;}} request returns:&lt;br /&gt;
&lt;br /&gt;
 {&lt;br /&gt;
   &amp;quot;org.laptop.TurtleArtActivity&amp;quot;: {&lt;br /&gt;
     &amp;quot;title&amp;quot;: &amp;quot;Turtle Blocks&amp;quot;,&lt;br /&gt;
     &amp;quot;version&amp;quot;: &amp;quot;202&amp;quot;,&lt;br /&gt;
     &amp;quot;blob&amp;quot;: &amp;quot;http://download.sugarlabs.org/activities/4027/turtleblocks-202.xo&amp;quot;,&lt;br /&gt;
     &amp;quot;content-type&amp;quot;: &amp;quot;application/vnd.olpc-sugar&amp;quot;,&lt;br /&gt;
     &amp;quot;size&amp;quot;: 4715955,&lt;br /&gt;
     &amp;quot;unpack_size&amp;quot;: 12873871,&lt;br /&gt;
     &amp;quot;command&amp;quot;: &amp;quot;sugar-activity TurtleArtActivity.TurtleArtActivity&amp;quot;,&lt;br /&gt;
   },&lt;br /&gt;
   &amp;quot;sugar&amp;quot;: {&lt;br /&gt;
     &amp;quot;version&amp;quot;: &amp;quot;0.94&amp;quot;,&lt;br /&gt;
   },&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-clone&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Like the [[#GET-solve|solve]] command, &#039;&#039;clone&#039;&#039; makes a solution but returns bundle itself, so, there is no way to get information about possible dependencies.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;clone&#039;&#039;&#039;[&amp;amp;lsb_id=&#039;&#039;LSB_ID&#039;&#039;][&amp;amp;lsb_release=&#039;&#039;LSB_RELEASE&#039;&#039;][&amp;amp;assume=&#039;&#039;DEPENDENCY&#039;&#039;-&#039;&#039;VERSION&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
=== Upload releases ===&lt;br /&gt;
&lt;br /&gt;
To easy upload Context [[#context-releases|releases]] and avoid writing to raw &#039;&#039;Context.releases&#039;&#039; property, there is a special high-level API command.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;POST&#039;&#039;&#039; /context?cmd=&#039;&#039;&#039;submit&#039;&#039;&#039;[&amp;amp;&#039;&#039;PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;][&amp;amp;initial]&lt;br /&gt;
&lt;br /&gt;
Where the {{Code|PROP}} arguments are optional release properties. The {{Code|initial}} argument asks the system to create new Context resource new release will belong to.&lt;br /&gt;
&lt;br /&gt;
The posting data might be two types,&lt;br /&gt;
&lt;br /&gt;
* Sugar activities in .xo bundles,&amp;lt;br&amp;gt;there is no need in {{Code|PROP}} arguments, all properties will be populated basing on metadata from a .xo bundle; including release notes from the {{Code|CHANGELOG}} file in [[Wikipedia:Markdown|Markdown]] notation; besides, only in this case {{Code|initial}} makes sense because it is the only way to get Context properties;&lt;br /&gt;
&lt;br /&gt;
* Arbitrary data,&amp;lt;br&amp;gt;all required release properties should be specified in {{Code|PROP}} arguments, at least &#039;&#039;context&#039;&#039; and &#039;&#039;version&#039;&#039;; &#039;&#039;license&#039;&#039; should be specified only if there are no existing releases to pickup license from.&lt;br /&gt;
&lt;br /&gt;
=== Node statistics ===&lt;br /&gt;
&lt;br /&gt;
The node statistics are about the entire server and depersonalized. Statistics are being collected by analyzing regular requests to an API server and stored for each Sugar Network node. To read such info, call the command:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /?cmd=&#039;&#039;&#039;stats&#039;&#039;&#039;[&amp;amp;start=&#039;&#039;SECONDS&#039;&#039;][&amp;amp;end=&#039;&#039;SECONDS&#039;&#039;][&amp;amp;event=&#039;&#039;EVENT&#039;&#039;][&amp;amp;limit=&#039;&#039;NUMBER&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
&lt;br /&gt;
* {{Code|start}} and {{Code|end}} is a time interval to get statistics for; if omitted, the beginning and the end of entire life cycle will be used;&lt;br /&gt;
* {{Code|event}}, multiple argument to specify what stats should be returned; if omitted, return all sources;&lt;br /&gt;
* {{Code|limit}}, number of stat records to return for the {{Code|start}}-{{Code|end}} interval; note that this amount is not precise, the final resultset might be smaller or bigger depending on chosen resolution; stats resolution depends on node configuration, default values are 1 day, 10 days, 30 days, 365 days; if omitted, return {{Code|end}} record only.&lt;br /&gt;
&lt;br /&gt;
Possible events are:&lt;br /&gt;
&lt;br /&gt;
* {{Code|users}}, total number of existing &#039;&#039;User&#039;&#039; objects;&lt;br /&gt;
* {{Code|contexts}}, total number of existing &#039;&#039;Context&#039;&#039; objects;&lt;br /&gt;
* {{Code|released}}, average number of newly uploaded &#039;&#039;Context.releases&#039;&#039; for specified time frame;&lt;br /&gt;
* {{Code|solved}}, average number of requested &#039;&#039;Context&#039;&#039; [[#GET-solve|solutions]] for specified time frame; note that this value does not equal to the number of solution usages on client side since solutions might be cached;&lt;br /&gt;
* {{Code|reported}}, average number of newly uploaded failure &#039;&#039;Report&#039;&#039; objects for specified time frame;&lt;br /&gt;
* {{Code|topics}}, total number of top-level &#039;&#039;Post&#039;&#039; objects;&lt;br /&gt;
* {{Code|posts}}, total number of dependent &#039;&#039;Post&#039;&#039; objects.&lt;br /&gt;
&lt;br /&gt;
== Client API ==&lt;br /&gt;
&lt;br /&gt;
The reasons to proxy Sugar Network data on users side:&lt;br /&gt;
&lt;br /&gt;
* Seamless support [[#Offline mode|offline workflow]];&lt;br /&gt;
* [[#Launching|One-click launch]] Sugar activities hosted on Sugar Network.&lt;br /&gt;
&lt;br /&gt;
Proxying happens by providing the same Sugar Network API (with some extra functionality, see below) from&lt;br /&gt;
[[Platform_Team/Sugar_Network/Implementation#sugar-network-client|local process]] launched beforehand.&lt;br /&gt;
&lt;br /&gt;
=== Offline mode ===&lt;br /&gt;
&lt;br /&gt;
Being connected to a Sugar Network node, local proxy provides [[#Node_API|original API]] from the node. If the connection is lost, the proxy will switch to local Sugar Network storage and continue working providing only [[#Base_API|base API]]. Any content created in offline mode will be uploaded to the node after getting a connection back.&lt;br /&gt;
&lt;br /&gt;
Besides, local Sugar Network storage will be reused to keep users preferences, such as:&lt;br /&gt;
&lt;br /&gt;
* Favorited Contexts&amp;lt;br&amp;gt;to select preferred &#039;&#039;Context&#039;&#039; resources; these Contexts will be marked by {{Code|favorite}} value in the &#039;&#039;Context.layer&#039;&#039; property;&lt;br /&gt;
&lt;br /&gt;
* Checked-in Contexts&amp;lt;br&amp;gt;to keep most recent Context (for &#039;&#039;activity&#039;&#039; and &#039;&#039;book&#039;&#039; types) version in local storage to make it available in offline; note that there is no need in checking-in to speedup online lunch, versions are being [[#Launching|cached]] anyway; these Contexts will be marked by {{Code|checkin}} value in the &#039;&#039;Context.layer&#039;&#039; property.&lt;br /&gt;
&lt;br /&gt;
To control users preferences there are special API commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT_favorite&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;favorite&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Set favorite status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE_favorite&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;favorite&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Unset favorite status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT_checkin&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;checkin&#039;&#039;&#039;[&amp;amp;spawn]&lt;br /&gt;
&lt;br /&gt;
Check-in the specified Context. By default, the command will return streamed &#039;&#039;text/event-stream&#039;&#039; MIME type data to monitor the progress. If the {{Code|spawn}} argument is specified, the command will exit immediately with [[#Notifications|asynchronous sending]] progress events.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE_checkin&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;checkin&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Checkout the Context.&lt;br /&gt;
&lt;br /&gt;
=== Launching ===&lt;br /&gt;
&lt;br /&gt;
Sugar Network Contexts (for &#039;&#039;activity&#039;&#039; and &#039;&#039;book&#039;&#039; types) can be launched as-is. The launching process is implicit and includes selecting the most recent (and appropriate for software contexts) version, downloading bundles from the Sugar Network, installing missed [[Sugar_Network/Recipe_Specification#Dependencies|software dependencies]], execution itself. All downloaded bundles will be cached [with further garbage collecting] to speedup further launching.&lt;br /&gt;
&lt;br /&gt;
Sugar activities will be directly executed. Book Contexts will be opened in the proper application according to its MIME type.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;launch&#039;&#039;&#039;[&amp;amp;args=&#039;&#039;ARG&#039;&#039;][&amp;amp;activity_id=&#039;&#039;ACTIVITY_ID&#039;&#039;][&amp;amp;object_id=&#039;&#039;OBJECT_ID&#039;&#039;][&amp;amp;uri=&#039;&#039;URI&#039;&#039;][&amp;amp;app=&#039;&#039;APP&#039;&#039;][&amp;amp;spawn]&lt;br /&gt;
&lt;br /&gt;
Arguments that make sense only for Sugar activities:&lt;br /&gt;
&lt;br /&gt;
* {{Code|ARG}}, command line argument to pass to launched activities, repeat {{Code|ARG}} for each argument;&lt;br /&gt;
* {{Code|ACTIVITY_ID}}, internal activity id which will be auto set if omitted;&lt;br /&gt;
* {{Code|OBJECT_ID}}, Journal object id to resume;&lt;br /&gt;
* {{Code|URI}}, URL to resume if activity supports this functionality.&lt;br /&gt;
&lt;br /&gt;
Arguments that make sense only for books:&lt;br /&gt;
&lt;br /&gt;
* {{Code|APP}}, specify application Context to open the book by; if omitted, the system will try to find most appropriate option, among all existing software Contexts.&lt;br /&gt;
&lt;br /&gt;
Common arguments:&lt;br /&gt;
&lt;br /&gt;
* {{Code|spawn}}, by default, the command will return streamed &#039;&#039;text/event-stream&#039;&#039; MIME type data to monitor the whole launching process until exiting the application; if the {{Code|spawn}} argument is specified, the command will exit immediately with [[#Notifications|asynchronous sending]] launching events.&lt;br /&gt;
&lt;br /&gt;
== Experimental API ==&lt;br /&gt;
&lt;br /&gt;
There is no guaranty that the following API will be stated as stable or frozen sometime.&lt;br /&gt;
&lt;br /&gt;
=== Access to Sugar Journal ===&lt;br /&gt;
&lt;br /&gt;
It is possible to get access to local Sugar Journal using special, &#039;&#039;journal&#039;&#039;, resource provided from [[#Client_API|client API]]. This kind of access might be useful when local applications cannot use DBus sugar-datastore API, e.g., [[wikipedia:Javascript|Javascript]] applications. API to Journal is restricted only to read-only access:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /journal?offset=&#039;&#039;INTEGER&#039;&#039;&amp;amp;limit=&#039;&#039;INTEGER&#039;&#039;[&amp;amp;query=&#039;&#039;STRING&#039;&#039;][&amp;amp;order_by=&amp;lt;nowiki&amp;gt;[+|-]&amp;lt;/nowiki&amp;gt;&#039;&#039;PROP&#039;&#039;][&amp;amp;&#039;&#039;QUERY_PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;[&amp;amp;...]]&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /journal/&#039;&#039;JOURNAL_ID&#039;&#039;[?reply=&#039;&#039;PROP&#039;&#039;[,..]]&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /journal/&#039;&#039;JOURNAL_ID&#039;&#039;/&#039;&#039;PROPERTY&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
Being HTTP based, Sugar Network API can be used in any manner regular HTTP requests can be handled. But for command-line access, there is a handy tool, {{Code|sugar-network}}, which takes care about Sugar Network specific like launching local API (if it is not already available) to get access to [[#Client_API|local proxy]].&lt;br /&gt;
&lt;br /&gt;
The sugar-network command-line format is below. Call {{Code|sugar-network --help}} for more detailed info.&lt;br /&gt;
&lt;br /&gt;
 sugar-network GET|POST|PUT|DELETE &#039;&#039;PATH&#039;&#039; &#039;&#039;ARG=VALUE&#039;&#039; [..]&lt;br /&gt;
&lt;br /&gt;
* {{Code|PATH}}, is an url path;&lt;br /&gt;
* {{Code|ARG&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;VALUE}}, request arguments as they being passed to in url.&lt;br /&gt;
&lt;br /&gt;
{{Code|POST}} and {{Code|PUT}} commands require data to pass, use the following command-line arguments:&lt;br /&gt;
&lt;br /&gt;
* {{Code|-f FILE}} to specify the file to pass;&lt;br /&gt;
* {{Code|-d DATA}} to specify string to pass;&lt;br /&gt;
* {{Code|-j}} posted data should be encoded into JSON before posting.&lt;br /&gt;
&lt;br /&gt;
== Getting involved ==&lt;br /&gt;
&lt;br /&gt;
{{:Sugar_Network/Feedback}}&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Sugar_Network/API&amp;diff=92972</id>
		<title>Sugar Network/API</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Sugar_Network/API&amp;diff=92972"/>
		<updated>2014-07-24T04:11:57Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: /* API servers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the API that Sugar Network clients use to interact with a Sugar Network server. See also a guide to basic Sugar Network [[Sugar_Network/Concept|concepts]] and [[Platform_Team/Sugar_Network/Architecture|its twin page]] for a technical point of view. In addition, visit the [[Sugar_Network|introduction page]].&lt;br /&gt;
&lt;br /&gt;
{{Note/warning|Note|Until announcing API freeze, this document describes the most recent development version of the API.&amp;lt;br&amp;gt;You can find its implementation on the [[#API servers|node-devel.sugarlabs.org]] server.}}&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
To better understand this API, see a technical explanation of its [[Platform_Team/Sugar_Network/Architecture#Conceptual_level|conceptual level]] and [[#Sugar_Network_resources|objects model]] in particular.&lt;br /&gt;
&lt;br /&gt;
The API operates with [[Sugar Network]] [[#Sugar_Network_resources|resources]], which are collections of objects. All objects are identified by globally unique identifiers, GUIDs, and available for operation via [[#Base_API|basic actions]]. The API is being provided from a [[#API_servers|node server]] or a [[#Client_API|client]]. While processing requests, API providers generate [[#Notifications|events]].&lt;br /&gt;
&lt;br /&gt;
The API is [[Wikipedia:Restful|RESTful]], and is served via HTTP(S) using [[Wikipedia:Json|JSON]] notation. The common request url format is:&lt;br /&gt;
&lt;br /&gt;
 http[s]://&#039;&#039;SERVER&#039;&#039;[/&#039;&#039;RESOURCE&#039;&#039;[/&#039;&#039;GUID&#039;&#039;[/&#039;&#039;PROPERTY&#039;&#039;]]][?[cmd=&#039;&#039;COMMAND&#039;&#039;][&amp;amp;&#039;&#039;ARGUMENT&#039;&#039;=&#039;&#039;VALUE&#039;&#039;..]]&lt;br /&gt;
&lt;br /&gt;
When:&lt;br /&gt;
&lt;br /&gt;
* {{Code|SERVER}}, [[#API_servers|particular]] Sugar Network API server;&lt;br /&gt;
* {{Code|RESOURCE}}, name one of the [[#Sugar_Network_resources|existing]] resources;&lt;br /&gt;
* {{Code|GUID}}, the {{Code|RESOURCE}}&#039;s particular object;&lt;br /&gt;
* {{Code|PROPERTY}}, particular property of {{Code|GUID}} object;&lt;br /&gt;
* {{Code|COMMAND}}, optional command name; combination of HTTP request method ({{Code|GET}}, {{Code|POST}}, {{Code|PUT}}, or, {{Code|DELETE}}) and [possibly empty] {{Code|COMMAND}} composes the requested [[#Actions|action]];&lt;br /&gt;
* {{Code|ARGUMENT}}s and {{Code|VALUE}}s depend on the particular [[#Actions|action]].&lt;br /&gt;
&lt;br /&gt;
In most cases, the server replies in JSON notation. If a request fails, the replied JSON object will contain a {{Code|request}} key, with the original request, and {{Code|error}} key, with an error message.&lt;br /&gt;
&lt;br /&gt;
== API version ==&lt;br /&gt;
&lt;br /&gt;
Sugar Network nodes might support multiple API versions at once but only one of them is default, i.e., the one which is in use if clients do not specify particular API version. To specify API versions in client request, setup the {{Code|X-API}} HTTP header with chosen version. If such header is omitted, default version will be used by the node;&lt;br /&gt;
&lt;br /&gt;
Currently available API versions:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;0.1&#039;&#039; initial API implementation, should not be used;&lt;br /&gt;
* &#039;&#039;0.2&#039;&#039; the most recent version, the rest of the document describes exactly this version.&lt;br /&gt;
&lt;br /&gt;
== Nodes ==&lt;br /&gt;
&lt;br /&gt;
These are standard Sugar Network API servers publicly available.&lt;br /&gt;
&lt;br /&gt;
* [http://node-devel.sugarlabs.org/ node-devel.sugarlabs.org]&amp;lt;br&amp;gt;Development server which does not contain important data and is free for any experiments (administrative privileges for anonymous users); default API version is &#039;&#039;0.2&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
* [http://node-testing.sugarlabs.org/ node-testing.sugarlabs.org]&amp;lt;br&amp;gt;Recent stable release with regular data import from the production server; is still free for any experiments; default API version is &#039;&#039;0.1&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
* [http://node.sugarlabs.org/ node.sugarlabs.org]&amp;lt;br&amp;gt;Production server;&lt;br /&gt;
&lt;br /&gt;
* [http://localhost:5001/ localhost:5001]&amp;lt;br&amp;gt;default url to get access to [[#Client_API|local proxy]] provided from user side application; ; default API version is &#039;&#039;0.1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Sugar Network resources ==&lt;br /&gt;
&lt;br /&gt;
{{:Sugar_Network/Resources}}&lt;br /&gt;
&lt;br /&gt;
== Base API ==&lt;br /&gt;
&lt;br /&gt;
List of actions common of all API providers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;POST&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;POST&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create new resource object.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to send:&lt;br /&gt;
* {{Code|&#039;&#039;RESOURCE}}&#039;s properties.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to receive:&lt;br /&gt;
* {{Code|guid}}, with globally unique identifier that specifies the created object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Modify resource object. By default, might be called only by {{Code|GUID}} creator.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to send:&lt;br /&gt;
* {{Code|RESOURCE}}&#039;s properties to modify.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Delete resource object. Actual object destruction won&#039;t happen, the object will be hidden. Garbage collection of hidden objects will be processed by Network administrators. By default, this action may be called only by the {{Code|GUID}} creator.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;[?offset=&#039;&#039;INTEGER&#039;&#039;][&amp;amp;limit=&#039;&#039;INTEGER&#039;&#039;][&amp;amp;query=&#039;&#039;STRING&#039;&#039;][&amp;amp;reply=&#039;&#039;PROP&#039;&#039;][&amp;amp;order_by=&amp;lt;nowiki&amp;gt;[+|-]&amp;lt;/nowiki&amp;gt;&#039;&#039;PROP&#039;&#039;][&amp;amp;group_by=&#039;&#039;PROP&#039;&#039;][&amp;amp;&#039;&#039;PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;][&amp;amp;&#039;&#039;!PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
Find resource objects.&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
* {{Code|offset}}, &#039;&#039;int&#039;&#039;&amp;lt;br&amp;gt;start index to return entries from, the default value is {{Code|0}};&lt;br /&gt;
* {{Code|limit}}, &#039;&#039;int&#039;&#039;&amp;lt;br&amp;gt;do not return more then specified value, maximal and default values are being setup on server side;&lt;br /&gt;
* {{Code|query}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;search request in [http://xapian.org/docs/queryparser.html Xapian] notation with the following additions:&lt;br /&gt;
** if property is boolean, integer or datetime, it supports searching by ranges: {{Code|&#039;&#039;PROP&#039;&#039;:[&#039;&#039;START&#039;&#039;]..[&#039;&#039;END&#039;&#039;]}};&lt;br /&gt;
** the statement {{Code|&#039;&#039;PROP&#039;&#039;&amp;lt;nowiki&amp;gt;:=&amp;lt;/nowiki&amp;gt;[&amp;quot;]&#039;&#039;VALUE&#039;&#039;[&amp;quot;]}} has the same effect as {{Code|QUERY_PROP}}; it is different to regular {{Code|&#039;&#039;PROP&#039;&#039;:&#039;&#039;VALUE&#039;&#039;}} where {{Code|VALUE}} might be a substring;&lt;br /&gt;
* {{Code|PROP}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;supplements {{Code|query}} with filtering by exact value of the {{Code|PROP}} property; the resulting query string will be {{Code|&#039;&#039;PROP&#039;&#039;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&#039;&#039;VALUE&#039;&#039; AND (&#039;&#039;QUERY&#039;&#039;)}}; argument is multiple;&lt;br /&gt;
* {{Code|!PROP}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;supplements {{Code|query}} by excluding exact value of the {{Code|PROP}} property; the resulting query string will be {{Code|NOT &#039;&#039;PROP&#039;&#039;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&#039;&#039;VALUE&#039;&#039; AND (&#039;&#039;QUERY&#039;&#039;)}}; argument is multiple;&lt;br /&gt;
* {{Code|reply}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;RESOURCE&#039;&#039; properties to return; by default, return only {{Code|guid}} property; argument is multiple;&lt;br /&gt;
* {{Code|order_by}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;property to sort the resulting list by; if starts with the {{Code|-}}, the order is descending, otherwise it is ascending;&lt;br /&gt;
* {{Code|group_by}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;property name to group resulting list by.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to receive:&lt;br /&gt;
* {{Code|total}}, total number in requested query (the reply might contain only the portion restricted by {{Code|limit}} request argument);&lt;br /&gt;
* {{Code|result}}, an array of dictionaries with resource object properties, dictionaries contain at least {{Code|guid}} property.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-resource&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;[?reply=&#039;&#039;PROP&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
* {{Code|reply}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;RESOURCE&#039;&#039; properties to return; by default, return only {{Code|guid}} property; argument is multiple;&lt;br /&gt;
&lt;br /&gt;
Return properties for a particular resource object.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to receive:&lt;br /&gt;
* properties that were specified in {{Code|reply}} argument(s), at least {{Code|guid}}.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT-property&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Modify particular resource property. By default, might be called only by {{Code|GUID}} creator.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-property&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Return property value for particular resource object.&lt;br /&gt;
&lt;br /&gt;
Data to receive:&lt;br /&gt;
* property value in JSON notation for regular properties;&lt;br /&gt;
* raw data or redirection for BLOB properties.&lt;br /&gt;
&lt;br /&gt;
=== Aggregated properties ===&lt;br /&gt;
&lt;br /&gt;
[[#resource-types|Aggregated]] properties have special API to treat their content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;POST-aggproperty&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;POST&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Submit new item. The command returns an id for newly created aggregated item. Depending on particular property, new items might be created not only by object&#039;s authors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT-aggproperty&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;/&#039;&#039;ID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Update existing aggregated item. Depending on particular property, the command is allowed either to object&#039;s authors or to aggregated item submitter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE-aggproperty&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;/&#039;&#039;ID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Delete existing aggregated item. Depending on particular property, the command is allowed either to object&#039;s authors or to aggregated item submitter.&lt;br /&gt;
&lt;br /&gt;
=== Notifications ===&lt;br /&gt;
&lt;br /&gt;
It is possible to subscribe to server events. Notification will happen using HTML5 [[wikipedia:Server-sent_events|Server-sent events]] (SSE).&lt;br /&gt;
&lt;br /&gt;
To start subscription, send the following request:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /?cmd=&#039;&#039;&#039;subscribe&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Response will be served with &#039;&#039;text/event-stream&#039;&#039; MIME type for default SSE message type. SSE message will be a JSONified object with the following, at least, attributes:&lt;br /&gt;
&lt;br /&gt;
* {{Code|event}}&amp;lt;br&amp;gt;event type.&lt;br /&gt;
&lt;br /&gt;
== Node API ==&lt;br /&gt;
&lt;br /&gt;
This is an API provided by Sugar Network nodes on top of [[#Base_API|base one]].&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
&lt;br /&gt;
Right now, the only way to be authenticated on a Sugar Network server is by running a [[Platform_Team/Sugar_Network/Implementation#sugar-network-client|local application]] on the client side and using the API it [[#Client_API|provides]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;TODO&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Authorization ===&lt;br /&gt;
&lt;br /&gt;
Read-only access is available for anonymous requests, except special content like machine serial numbers. But to process any changes, clients need to be authenticated.&lt;br /&gt;
&lt;br /&gt;
Right after creating any Sugar Network object, its author becomes the only user who can process any object modifications afterwards. Authority information will be kept in the [[#Sugar_Network_resources|author]] property and can be modified using the following commands.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;useradd&#039;&#039;&#039;&amp;amp;user=&#039;&#039;USER&#039;&#039;&amp;amp;role=&#039;&#039;ROLE&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Add another user who can modify the corresponding object. &#039;&#039;USER&#039;&#039; argument should be either &#039;&#039;User&#039;&#039; guid (for authors registered in the Sugar Network), or, full author name.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;userdel&#039;&#039;&#039;&amp;amp;user=&#039;&#039;USER&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Remove user from the authority list. It is not possible to remove yourself. &#039;&#039;USER&#039;&#039; argument should be either &#039;&#039;User&#039;&#039; guid (for authors registered in the Sugar Network), or, full author name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;TODO&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Retrieving releases ===&lt;br /&gt;
&lt;br /&gt;
To easy download Context [[#context-releases|releases]] and avoid reading raw &#039;&#039;Context.releases&#039;&#039; property, there are special high-level API commands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-solve&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;solve&#039;&#039;&#039;[&amp;amp;lsb_id=&#039;&#039;LSB_ID&#039;&#039;][&amp;amp;lsb_release=&#039;&#039;LSB_RELEASE&#039;&#039;][&amp;amp;assume=&#039;&#039;DEPENDENCY&#039;&#039;-&#039;&#039;VERSION&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
The command returns information about what particular releases should be downloaded depending on provided requirements. This command might return not only one release, e.g., activities might have dependencies either system packages or another Sugar Network Contexts.&lt;br /&gt;
&lt;br /&gt;
Solving requirements might be:&lt;br /&gt;
&lt;br /&gt;
* {{Code|LSB_ID}}, if Context releases depend on system packages, specify the [[Wikipedia:Linux_Standard_Base|LSB]] distributor id to consider while choosing particular packages;&lt;br /&gt;
* {{Code|LSB_RELEASE}}, if Context releases depend on system packages, specify the [[Wikipedia:Linux_Standard_Base|LSB]] release number of the distribution to consider while choosing particular packages;&lt;br /&gt;
* {{Code|DEPENDENCY-VERSION}}, the {{Code|assume}} argument instructs server to assume that specified [[Sugar_Network/Recipe_Specification#Dependencies|dependency]] is already available on client side and should be taken into account while solving; this is especially important for package dependencies when server considers packages available only from official repositories but users might have more recent package versions installed in local system; e.g., the above example request will fail without {{Code|sugar-0.94}} because neither {{Code|lsb_id}} nor {{Code|lsb_release}} were specified (even if LSB information is passed, server might not have information about what package versions come from official repositories).&lt;br /&gt;
&lt;br /&gt;
The resulting info is a JSON object with keys equal to Context guids and value objects for chosen release with the following keys:&lt;br /&gt;
&lt;br /&gt;
* {{Code|blob}}, bundle [[#resource-types|digest]] to download;&lt;br /&gt;
* {{Code|version}}, chosen version number;&lt;br /&gt;
* {{Code|title}}, the &#039;&#039;Context.title&#039;&#039; value;&lt;br /&gt;
* {{Code|command}}, a command to launch the bundle, only for Sugar activities.&lt;br /&gt;
&lt;br /&gt;
For example, the {{Code|&#039;&#039;&#039;GET&#039;&#039;&#039; &amp;lt;nowiki&amp;gt;/context/org.laptop.TurtleArtActivity?cmd=solve&amp;amp;assume=sugar-0.94&amp;lt;/nowiki&amp;gt;}} request returns:&lt;br /&gt;
&lt;br /&gt;
 {&lt;br /&gt;
   &amp;quot;org.laptop.TurtleArtActivity&amp;quot;: {&lt;br /&gt;
     &amp;quot;title&amp;quot;: &amp;quot;Turtle Blocks&amp;quot;,&lt;br /&gt;
     &amp;quot;version&amp;quot;: &amp;quot;202&amp;quot;,&lt;br /&gt;
     &amp;quot;blob&amp;quot;: &amp;quot;http://download.sugarlabs.org/activities/4027/turtleblocks-202.xo&amp;quot;,&lt;br /&gt;
     &amp;quot;content-type&amp;quot;: &amp;quot;application/vnd.olpc-sugar&amp;quot;,&lt;br /&gt;
     &amp;quot;size&amp;quot;: 4715955,&lt;br /&gt;
     &amp;quot;unpack_size&amp;quot;: 12873871,&lt;br /&gt;
     &amp;quot;command&amp;quot;: &amp;quot;sugar-activity TurtleArtActivity.TurtleArtActivity&amp;quot;,&lt;br /&gt;
   },&lt;br /&gt;
   &amp;quot;sugar&amp;quot;: {&lt;br /&gt;
     &amp;quot;version&amp;quot;: &amp;quot;0.94&amp;quot;,&lt;br /&gt;
   },&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-clone&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Like the [[#GET-solve|solve]] command, &#039;&#039;clone&#039;&#039; makes a solution but returns bundle itself, so, there is no way to get information about possible dependencies.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;clone&#039;&#039;&#039;[&amp;amp;lsb_id=&#039;&#039;LSB_ID&#039;&#039;][&amp;amp;lsb_release=&#039;&#039;LSB_RELEASE&#039;&#039;][&amp;amp;assume=&#039;&#039;DEPENDENCY&#039;&#039;-&#039;&#039;VERSION&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
=== Upload releases ===&lt;br /&gt;
&lt;br /&gt;
To easy upload Context [[#context-releases|releases]] and avoid writing to raw &#039;&#039;Context.releases&#039;&#039; property, there is a special high-level API command.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;POST&#039;&#039;&#039; /context?cmd=&#039;&#039;&#039;submit&#039;&#039;&#039;[&amp;amp;&#039;&#039;PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;][&amp;amp;initial]&lt;br /&gt;
&lt;br /&gt;
Where the {{Code|PROP}} arguments are optional release properties. The {{Code|initial}} argument asks the system to create new Context resource new release will belong to.&lt;br /&gt;
&lt;br /&gt;
The posting data might be two types,&lt;br /&gt;
&lt;br /&gt;
* Sugar activities in .xo bundles,&amp;lt;br&amp;gt;there is no need in {{Code|PROP}} arguments, all properties will be populated basing on metadata from a .xo bundle; including release notes from the {{Code|CHANGELOG}} file in [[Wikipedia:Markdown|Markdown]] notation; besides, only in this case {{Code|initial}} makes sense because it is the only way to get Context properties;&lt;br /&gt;
&lt;br /&gt;
* Arbitrary data,&amp;lt;br&amp;gt;all required release properties should be specified in {{Code|PROP}} arguments, at least &#039;&#039;context&#039;&#039; and &#039;&#039;version&#039;&#039;; &#039;&#039;license&#039;&#039; should be specified only if there are no existing releases to pickup license from.&lt;br /&gt;
&lt;br /&gt;
=== Node statistics ===&lt;br /&gt;
&lt;br /&gt;
The node statistics are about the entire server and depersonalized. Statistics are being collected by analyzing regular requests to an API server and stored for each Sugar Network node. To read such info, call the command:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /?cmd=&#039;&#039;&#039;stats&#039;&#039;&#039;[&amp;amp;start=&#039;&#039;SECONDS&#039;&#039;][&amp;amp;end=&#039;&#039;SECONDS&#039;&#039;][&amp;amp;event=&#039;&#039;EVENT&#039;&#039;][&amp;amp;limit=&#039;&#039;NUMBER&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
&lt;br /&gt;
* {{Code|start}} and {{Code|end}} is a time interval to get statistics for; if omitted, the beginning and the end of entire life cycle will be used;&lt;br /&gt;
* {{Code|event}}, multiple argument to specify what stats should be returned; if omitted, return all sources;&lt;br /&gt;
* {{Code|limit}}, number of stat records to return for the {{Code|start}}-{{Code|end}} interval; note that this amount is not precise, the final resultset might be smaller or bigger depending on chosen resolution; stats resolution depends on node configuration, default values are 1 day, 10 days, 30 days, 365 days; if omitted, return {{Code|end}} record only.&lt;br /&gt;
&lt;br /&gt;
Possible events are:&lt;br /&gt;
&lt;br /&gt;
* {{Code|users}}, total number of existing &#039;&#039;User&#039;&#039; objects;&lt;br /&gt;
* {{Code|contexts}}, total number of existing &#039;&#039;Context&#039;&#039; objects;&lt;br /&gt;
* {{Code|released}}, average number of newly uploaded &#039;&#039;Context.releases&#039;&#039; for specified time frame;&lt;br /&gt;
* {{Code|solved}}, average number of requested &#039;&#039;Context&#039;&#039; [[#GET-solve|solutions]] for specified time frame; note that this value does not equal to the number of solution usages on client side since solutions might be cached;&lt;br /&gt;
* {{Code|reported}}, average number of newly uploaded failure &#039;&#039;Report&#039;&#039; objects for specified time frame;&lt;br /&gt;
* {{Code|topics}}, total number of top-level &#039;&#039;Post&#039;&#039; objects;&lt;br /&gt;
* {{Code|posts}}, total number of dependent &#039;&#039;Post&#039;&#039; objects.&lt;br /&gt;
&lt;br /&gt;
== Client API ==&lt;br /&gt;
&lt;br /&gt;
The reasons to proxy Sugar Network data on users side:&lt;br /&gt;
&lt;br /&gt;
* Seamless support [[#Offline mode|offline workflow]];&lt;br /&gt;
* [[#Launching|One-click launch]] Sugar activities hosted on Sugar Network.&lt;br /&gt;
&lt;br /&gt;
Proxying happens by providing the same Sugar Network API (with some extra functionality, see below) from&lt;br /&gt;
[[Platform_Team/Sugar_Network/Implementation#sugar-network-client|local process]] launched beforehand.&lt;br /&gt;
&lt;br /&gt;
=== Offline mode ===&lt;br /&gt;
&lt;br /&gt;
Being connected to a Sugar Network node, local proxy provides [[#Node_API|original API]] from the node. If the connection is lost, the proxy will switch to local Sugar Network storage and continue working providing only [[#Base_API|base API]]. Any content created in offline mode will be uploaded to the node after getting a connection back.&lt;br /&gt;
&lt;br /&gt;
Besides, local Sugar Network storage will be reused to keep users preferences, such as:&lt;br /&gt;
&lt;br /&gt;
* Favorited Contexts&amp;lt;br&amp;gt;to select preferred &#039;&#039;Context&#039;&#039; resources; these Contexts will be marked by {{Code|favorite}} value in the &#039;&#039;Context.layer&#039;&#039; property;&lt;br /&gt;
&lt;br /&gt;
* Checked-in Contexts&amp;lt;br&amp;gt;to keep most recent Context (for &#039;&#039;activity&#039;&#039; and &#039;&#039;book&#039;&#039; types) version in local storage to make it available in offline; note that there is no need in checking-in to speedup online lunch, versions are being [[#Launching|cached]] anyway; these Contexts will be marked by {{Code|checkin}} value in the &#039;&#039;Context.layer&#039;&#039; property.&lt;br /&gt;
&lt;br /&gt;
To control users preferences there are special API commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT_favorite&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;favorite&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Set favorite status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE_favorite&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;favorite&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Unset favorite status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT_checkin&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;checkin&#039;&#039;&#039;[&amp;amp;spawn]&lt;br /&gt;
&lt;br /&gt;
Check-in the specified Context. By default, the command will return streamed &#039;&#039;text/event-stream&#039;&#039; MIME type data to monitor the progress. If the {{Code|spawn}} argument is specified, the command will exit immediately with [[#Notifications|asynchronous sending]] progress events.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE_checkin&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;checkin&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Checkout the Context.&lt;br /&gt;
&lt;br /&gt;
=== Launching ===&lt;br /&gt;
&lt;br /&gt;
Sugar Network Contexts (for &#039;&#039;activity&#039;&#039; and &#039;&#039;book&#039;&#039; types) can be launched as-is. The launching process is implicit and includes selecting the most recent (and appropriate for software contexts) version, downloading bundles from the Sugar Network, installing missed [[Sugar_Network/Recipe_Specification#Dependencies|software dependencies]], execution itself. All downloaded bundles will be cached [with further garbage collecting] to speedup further launching.&lt;br /&gt;
&lt;br /&gt;
Sugar activities will be directly executed. Book Contexts will be opened in the proper application according to its MIME type.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;launch&#039;&#039;&#039;[&amp;amp;args=&#039;&#039;ARG&#039;&#039;][&amp;amp;activity_id=&#039;&#039;ACTIVITY_ID&#039;&#039;][&amp;amp;object_id=&#039;&#039;OBJECT_ID&#039;&#039;][&amp;amp;uri=&#039;&#039;URI&#039;&#039;][&amp;amp;app=&#039;&#039;APP&#039;&#039;][&amp;amp;spawn]&lt;br /&gt;
&lt;br /&gt;
Arguments that make sense only for Sugar activities:&lt;br /&gt;
&lt;br /&gt;
* {{Code|ARG}}, command line argument to pass to launched activities, repeat {{Code|ARG}} for each argument;&lt;br /&gt;
* {{Code|ACTIVITY_ID}}, internal activity id which will be auto set if omitted;&lt;br /&gt;
* {{Code|OBJECT_ID}}, Journal object id to resume;&lt;br /&gt;
* {{Code|URI}}, URL to resume if activity supports this functionality.&lt;br /&gt;
&lt;br /&gt;
Arguments that make sense only for books:&lt;br /&gt;
&lt;br /&gt;
* {{Code|APP}}, specify application Context to open the book by; if omitted, the system will try to find most appropriate option, among all existing software Contexts.&lt;br /&gt;
&lt;br /&gt;
Common arguments:&lt;br /&gt;
&lt;br /&gt;
* {{Code|spawn}}, by default, the command will return streamed &#039;&#039;text/event-stream&#039;&#039; MIME type data to monitor the whole launching process until exiting the application; if the {{Code|spawn}} argument is specified, the command will exit immediately with [[#Notifications|asynchronous sending]] launching events.&lt;br /&gt;
&lt;br /&gt;
== Experimental API ==&lt;br /&gt;
&lt;br /&gt;
There is no guaranty that the following API will be stated as stable or frozen sometime.&lt;br /&gt;
&lt;br /&gt;
=== Access to Sugar Journal ===&lt;br /&gt;
&lt;br /&gt;
It is possible to get access to local Sugar Journal using special, &#039;&#039;journal&#039;&#039;, resource provided from [[#Client_API|client API]]. This kind of access might be useful when local applications cannot use DBus sugar-datastore API, e.g., [[wikipedia:Javascript|Javascript]] applications. API to Journal is restricted only to read-only access:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /journal?offset=&#039;&#039;INTEGER&#039;&#039;&amp;amp;limit=&#039;&#039;INTEGER&#039;&#039;[&amp;amp;query=&#039;&#039;STRING&#039;&#039;][&amp;amp;order_by=&amp;lt;nowiki&amp;gt;[+|-]&amp;lt;/nowiki&amp;gt;&#039;&#039;PROP&#039;&#039;][&amp;amp;&#039;&#039;QUERY_PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;[&amp;amp;...]]&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /journal/&#039;&#039;JOURNAL_ID&#039;&#039;[?reply=&#039;&#039;PROP&#039;&#039;[,..]]&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /journal/&#039;&#039;JOURNAL_ID&#039;&#039;/&#039;&#039;PROPERTY&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
Being HTTP based, Sugar Network API can be used in any manner regular HTTP requests can be handled. But for command-line access, there is a handy tool, {{Code|sugar-network}}, which takes care about Sugar Network specific like launching local API (if it is not already available) to get access to [[#Client_API|local proxy]].&lt;br /&gt;
&lt;br /&gt;
The sugar-network command-line format is below. Call {{Code|sugar-network --help}} for more detailed info.&lt;br /&gt;
&lt;br /&gt;
 sugar-network GET|POST|PUT|DELETE &#039;&#039;PATH&#039;&#039; &#039;&#039;ARG=VALUE&#039;&#039; [..]&lt;br /&gt;
&lt;br /&gt;
* {{Code|PATH}}, is an url path;&lt;br /&gt;
* {{Code|ARG&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;VALUE}}, request arguments as they being passed to in url.&lt;br /&gt;
&lt;br /&gt;
{{Code|POST}} and {{Code|PUT}} commands require data to pass, use the following command-line arguments:&lt;br /&gt;
&lt;br /&gt;
* {{Code|-f FILE}} to specify the file to pass;&lt;br /&gt;
* {{Code|-d DATA}} to specify string to pass;&lt;br /&gt;
* {{Code|-j}} posted data should be encoded into JSON before posting.&lt;br /&gt;
&lt;br /&gt;
== Getting involved ==&lt;br /&gt;
&lt;br /&gt;
{{:Sugar_Network/Feedback}}&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Sugar_Network/API&amp;diff=92971</id>
		<title>Sugar Network/API</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Sugar_Network/API&amp;diff=92971"/>
		<updated>2014-07-24T04:02:10Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: /* API version */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the API that Sugar Network clients use to interact with a Sugar Network server. See also a guide to basic Sugar Network [[Sugar_Network/Concept|concepts]] and [[Platform_Team/Sugar_Network/Architecture|its twin page]] for a technical point of view. In addition, visit the [[Sugar_Network|introduction page]].&lt;br /&gt;
&lt;br /&gt;
{{Note/warning|Note|Until announcing API freeze, this document describes the most recent development version of the API.&amp;lt;br&amp;gt;You can find its implementation on the [[#API servers|node-devel.sugarlabs.org]] server.}}&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
To better understand this API, see a technical explanation of its [[Platform_Team/Sugar_Network/Architecture#Conceptual_level|conceptual level]] and [[#Sugar_Network_resources|objects model]] in particular.&lt;br /&gt;
&lt;br /&gt;
The API operates with [[Sugar Network]] [[#Sugar_Network_resources|resources]], which are collections of objects. All objects are identified by globally unique identifiers, GUIDs, and available for operation via [[#Base_API|basic actions]]. The API is being provided from a [[#API_servers|node server]] or a [[#Client_API|client]]. While processing requests, API providers generate [[#Notifications|events]].&lt;br /&gt;
&lt;br /&gt;
The API is [[Wikipedia:Restful|RESTful]], and is served via HTTP(S) using [[Wikipedia:Json|JSON]] notation. The common request url format is:&lt;br /&gt;
&lt;br /&gt;
 http[s]://&#039;&#039;SERVER&#039;&#039;[/&#039;&#039;RESOURCE&#039;&#039;[/&#039;&#039;GUID&#039;&#039;[/&#039;&#039;PROPERTY&#039;&#039;]]][?[cmd=&#039;&#039;COMMAND&#039;&#039;][&amp;amp;&#039;&#039;ARGUMENT&#039;&#039;=&#039;&#039;VALUE&#039;&#039;..]]&lt;br /&gt;
&lt;br /&gt;
When:&lt;br /&gt;
&lt;br /&gt;
* {{Code|SERVER}}, [[#API_servers|particular]] Sugar Network API server;&lt;br /&gt;
* {{Code|RESOURCE}}, name one of the [[#Sugar_Network_resources|existing]] resources;&lt;br /&gt;
* {{Code|GUID}}, the {{Code|RESOURCE}}&#039;s particular object;&lt;br /&gt;
* {{Code|PROPERTY}}, particular property of {{Code|GUID}} object;&lt;br /&gt;
* {{Code|COMMAND}}, optional command name; combination of HTTP request method ({{Code|GET}}, {{Code|POST}}, {{Code|PUT}}, or, {{Code|DELETE}}) and [possibly empty] {{Code|COMMAND}} composes the requested [[#Actions|action]];&lt;br /&gt;
* {{Code|ARGUMENT}}s and {{Code|VALUE}}s depend on the particular [[#Actions|action]].&lt;br /&gt;
&lt;br /&gt;
In most cases, the server replies in JSON notation. If a request fails, the replied JSON object will contain a {{Code|request}} key, with the original request, and {{Code|error}} key, with an error message.&lt;br /&gt;
&lt;br /&gt;
== API version ==&lt;br /&gt;
&lt;br /&gt;
Sugar Network nodes might support multiple API versions at once but only one of them is default, i.e., the one which is in use if clients do not specify particular API version. To specify API versions in client request, setup the {{Code|X-API}} HTTP header with chosen version. If such header is omitted, default version will be used by the node;&lt;br /&gt;
&lt;br /&gt;
Currently available API versions:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;0.1&#039;&#039; initial API implementation, should not be used;&lt;br /&gt;
* &#039;&#039;0.2&#039;&#039; the most recent version, the rest of the document describes exactly this version.&lt;br /&gt;
&lt;br /&gt;
== API servers ==&lt;br /&gt;
&lt;br /&gt;
These are standard Sugar Network API servers publicly available.&lt;br /&gt;
&lt;br /&gt;
* [http://node-devel.sugarlabs.org/ node-devel.sugarlabs.org]&amp;lt;br&amp;gt;Development server which does not contain important data and is free for any experiments (administrative privileges for anonymous users); default API version is &#039;&#039;0.2&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
* [http://node-testing.sugarlabs.org/ node-testing.sugarlabs.org]&amp;lt;br&amp;gt;Recent stable release with regular data import from the production server; is still free for any experiments; default API version is &#039;&#039;0.1&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
* [http://node.sugarlabs.org/ node.sugarlabs.org]&amp;lt;br&amp;gt;Production server;&lt;br /&gt;
&lt;br /&gt;
* [http://localhost:5001/ localhost:5001]&amp;lt;br&amp;gt;default url to get access to [[#Client_API|local proxy]] provided from user side application; ; default API version is &#039;&#039;0.1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Sugar Network resources ==&lt;br /&gt;
&lt;br /&gt;
{{:Sugar_Network/Resources}}&lt;br /&gt;
&lt;br /&gt;
== Base API ==&lt;br /&gt;
&lt;br /&gt;
List of actions common of all API providers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;POST&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;POST&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create new resource object.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to send:&lt;br /&gt;
* {{Code|&#039;&#039;RESOURCE}}&#039;s properties.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to receive:&lt;br /&gt;
* {{Code|guid}}, with globally unique identifier that specifies the created object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Modify resource object. By default, might be called only by {{Code|GUID}} creator.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to send:&lt;br /&gt;
* {{Code|RESOURCE}}&#039;s properties to modify.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Delete resource object. Actual object destruction won&#039;t happen, the object will be hidden. Garbage collection of hidden objects will be processed by Network administrators. By default, this action may be called only by the {{Code|GUID}} creator.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;[?offset=&#039;&#039;INTEGER&#039;&#039;][&amp;amp;limit=&#039;&#039;INTEGER&#039;&#039;][&amp;amp;query=&#039;&#039;STRING&#039;&#039;][&amp;amp;reply=&#039;&#039;PROP&#039;&#039;][&amp;amp;order_by=&amp;lt;nowiki&amp;gt;[+|-]&amp;lt;/nowiki&amp;gt;&#039;&#039;PROP&#039;&#039;][&amp;amp;group_by=&#039;&#039;PROP&#039;&#039;][&amp;amp;&#039;&#039;PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;][&amp;amp;&#039;&#039;!PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
Find resource objects.&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
* {{Code|offset}}, &#039;&#039;int&#039;&#039;&amp;lt;br&amp;gt;start index to return entries from, the default value is {{Code|0}};&lt;br /&gt;
* {{Code|limit}}, &#039;&#039;int&#039;&#039;&amp;lt;br&amp;gt;do not return more then specified value, maximal and default values are being setup on server side;&lt;br /&gt;
* {{Code|query}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;search request in [http://xapian.org/docs/queryparser.html Xapian] notation with the following additions:&lt;br /&gt;
** if property is boolean, integer or datetime, it supports searching by ranges: {{Code|&#039;&#039;PROP&#039;&#039;:[&#039;&#039;START&#039;&#039;]..[&#039;&#039;END&#039;&#039;]}};&lt;br /&gt;
** the statement {{Code|&#039;&#039;PROP&#039;&#039;&amp;lt;nowiki&amp;gt;:=&amp;lt;/nowiki&amp;gt;[&amp;quot;]&#039;&#039;VALUE&#039;&#039;[&amp;quot;]}} has the same effect as {{Code|QUERY_PROP}}; it is different to regular {{Code|&#039;&#039;PROP&#039;&#039;:&#039;&#039;VALUE&#039;&#039;}} where {{Code|VALUE}} might be a substring;&lt;br /&gt;
* {{Code|PROP}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;supplements {{Code|query}} with filtering by exact value of the {{Code|PROP}} property; the resulting query string will be {{Code|&#039;&#039;PROP&#039;&#039;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&#039;&#039;VALUE&#039;&#039; AND (&#039;&#039;QUERY&#039;&#039;)}}; argument is multiple;&lt;br /&gt;
* {{Code|!PROP}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;supplements {{Code|query}} by excluding exact value of the {{Code|PROP}} property; the resulting query string will be {{Code|NOT &#039;&#039;PROP&#039;&#039;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&#039;&#039;VALUE&#039;&#039; AND (&#039;&#039;QUERY&#039;&#039;)}}; argument is multiple;&lt;br /&gt;
* {{Code|reply}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;RESOURCE&#039;&#039; properties to return; by default, return only {{Code|guid}} property; argument is multiple;&lt;br /&gt;
* {{Code|order_by}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;property to sort the resulting list by; if starts with the {{Code|-}}, the order is descending, otherwise it is ascending;&lt;br /&gt;
* {{Code|group_by}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;property name to group resulting list by.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to receive:&lt;br /&gt;
* {{Code|total}}, total number in requested query (the reply might contain only the portion restricted by {{Code|limit}} request argument);&lt;br /&gt;
* {{Code|result}}, an array of dictionaries with resource object properties, dictionaries contain at least {{Code|guid}} property.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-resource&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;[?reply=&#039;&#039;PROP&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
* {{Code|reply}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;RESOURCE&#039;&#039; properties to return; by default, return only {{Code|guid}} property; argument is multiple;&lt;br /&gt;
&lt;br /&gt;
Return properties for a particular resource object.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to receive:&lt;br /&gt;
* properties that were specified in {{Code|reply}} argument(s), at least {{Code|guid}}.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT-property&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Modify particular resource property. By default, might be called only by {{Code|GUID}} creator.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-property&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Return property value for particular resource object.&lt;br /&gt;
&lt;br /&gt;
Data to receive:&lt;br /&gt;
* property value in JSON notation for regular properties;&lt;br /&gt;
* raw data or redirection for BLOB properties.&lt;br /&gt;
&lt;br /&gt;
=== Aggregated properties ===&lt;br /&gt;
&lt;br /&gt;
[[#resource-types|Aggregated]] properties have special API to treat their content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;POST-aggproperty&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;POST&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Submit new item. The command returns an id for newly created aggregated item. Depending on particular property, new items might be created not only by object&#039;s authors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT-aggproperty&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;/&#039;&#039;ID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Update existing aggregated item. Depending on particular property, the command is allowed either to object&#039;s authors or to aggregated item submitter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE-aggproperty&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;/&#039;&#039;ID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Delete existing aggregated item. Depending on particular property, the command is allowed either to object&#039;s authors or to aggregated item submitter.&lt;br /&gt;
&lt;br /&gt;
=== Notifications ===&lt;br /&gt;
&lt;br /&gt;
It is possible to subscribe to server events. Notification will happen using HTML5 [[wikipedia:Server-sent_events|Server-sent events]] (SSE).&lt;br /&gt;
&lt;br /&gt;
To start subscription, send the following request:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /?cmd=&#039;&#039;&#039;subscribe&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Response will be served with &#039;&#039;text/event-stream&#039;&#039; MIME type for default SSE message type. SSE message will be a JSONified object with the following, at least, attributes:&lt;br /&gt;
&lt;br /&gt;
* {{Code|event}}&amp;lt;br&amp;gt;event type.&lt;br /&gt;
&lt;br /&gt;
== Node API ==&lt;br /&gt;
&lt;br /&gt;
This is an API provided by Sugar Network nodes on top of [[#Base_API|base one]].&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
&lt;br /&gt;
Right now, the only way to be authenticated on a Sugar Network server is by running a [[Platform_Team/Sugar_Network/Implementation#sugar-network-client|local application]] on the client side and using the API it [[#Client_API|provides]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;TODO&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Authorization ===&lt;br /&gt;
&lt;br /&gt;
Read-only access is available for anonymous requests, except special content like machine serial numbers. But to process any changes, clients need to be authenticated.&lt;br /&gt;
&lt;br /&gt;
Right after creating any Sugar Network object, its author becomes the only user who can process any object modifications afterwards. Authority information will be kept in the [[#Sugar_Network_resources|author]] property and can be modified using the following commands.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;useradd&#039;&#039;&#039;&amp;amp;user=&#039;&#039;USER&#039;&#039;&amp;amp;role=&#039;&#039;ROLE&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Add another user who can modify the corresponding object. &#039;&#039;USER&#039;&#039; argument should be either &#039;&#039;User&#039;&#039; guid (for authors registered in the Sugar Network), or, full author name.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;userdel&#039;&#039;&#039;&amp;amp;user=&#039;&#039;USER&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Remove user from the authority list. It is not possible to remove yourself. &#039;&#039;USER&#039;&#039; argument should be either &#039;&#039;User&#039;&#039; guid (for authors registered in the Sugar Network), or, full author name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;TODO&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Retrieving releases ===&lt;br /&gt;
&lt;br /&gt;
To easy download Context [[#context-releases|releases]] and avoid reading raw &#039;&#039;Context.releases&#039;&#039; property, there are special high-level API commands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-solve&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;solve&#039;&#039;&#039;[&amp;amp;lsb_id=&#039;&#039;LSB_ID&#039;&#039;][&amp;amp;lsb_release=&#039;&#039;LSB_RELEASE&#039;&#039;][&amp;amp;assume=&#039;&#039;DEPENDENCY&#039;&#039;-&#039;&#039;VERSION&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
The command returns information about what particular releases should be downloaded depending on provided requirements. This command might return not only one release, e.g., activities might have dependencies either system packages or another Sugar Network Contexts.&lt;br /&gt;
&lt;br /&gt;
Solving requirements might be:&lt;br /&gt;
&lt;br /&gt;
* {{Code|LSB_ID}}, if Context releases depend on system packages, specify the [[Wikipedia:Linux_Standard_Base|LSB]] distributor id to consider while choosing particular packages;&lt;br /&gt;
* {{Code|LSB_RELEASE}}, if Context releases depend on system packages, specify the [[Wikipedia:Linux_Standard_Base|LSB]] release number of the distribution to consider while choosing particular packages;&lt;br /&gt;
* {{Code|DEPENDENCY-VERSION}}, the {{Code|assume}} argument instructs server to assume that specified [[Sugar_Network/Recipe_Specification#Dependencies|dependency]] is already available on client side and should be taken into account while solving; this is especially important for package dependencies when server considers packages available only from official repositories but users might have more recent package versions installed in local system; e.g., the above example request will fail without {{Code|sugar-0.94}} because neither {{Code|lsb_id}} nor {{Code|lsb_release}} were specified (even if LSB information is passed, server might not have information about what package versions come from official repositories).&lt;br /&gt;
&lt;br /&gt;
The resulting info is a JSON object with keys equal to Context guids and value objects for chosen release with the following keys:&lt;br /&gt;
&lt;br /&gt;
* {{Code|blob}}, bundle [[#resource-types|digest]] to download;&lt;br /&gt;
* {{Code|version}}, chosen version number;&lt;br /&gt;
* {{Code|title}}, the &#039;&#039;Context.title&#039;&#039; value;&lt;br /&gt;
* {{Code|command}}, a command to launch the bundle, only for Sugar activities.&lt;br /&gt;
&lt;br /&gt;
For example, the {{Code|&#039;&#039;&#039;GET&#039;&#039;&#039; &amp;lt;nowiki&amp;gt;/context/org.laptop.TurtleArtActivity?cmd=solve&amp;amp;assume=sugar-0.94&amp;lt;/nowiki&amp;gt;}} request returns:&lt;br /&gt;
&lt;br /&gt;
 {&lt;br /&gt;
   &amp;quot;org.laptop.TurtleArtActivity&amp;quot;: {&lt;br /&gt;
     &amp;quot;title&amp;quot;: &amp;quot;Turtle Blocks&amp;quot;,&lt;br /&gt;
     &amp;quot;version&amp;quot;: &amp;quot;202&amp;quot;,&lt;br /&gt;
     &amp;quot;blob&amp;quot;: &amp;quot;http://download.sugarlabs.org/activities/4027/turtleblocks-202.xo&amp;quot;,&lt;br /&gt;
     &amp;quot;content-type&amp;quot;: &amp;quot;application/vnd.olpc-sugar&amp;quot;,&lt;br /&gt;
     &amp;quot;size&amp;quot;: 4715955,&lt;br /&gt;
     &amp;quot;unpack_size&amp;quot;: 12873871,&lt;br /&gt;
     &amp;quot;command&amp;quot;: &amp;quot;sugar-activity TurtleArtActivity.TurtleArtActivity&amp;quot;,&lt;br /&gt;
   },&lt;br /&gt;
   &amp;quot;sugar&amp;quot;: {&lt;br /&gt;
     &amp;quot;version&amp;quot;: &amp;quot;0.94&amp;quot;,&lt;br /&gt;
   },&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-clone&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Like the [[#GET-solve|solve]] command, &#039;&#039;clone&#039;&#039; makes a solution but returns bundle itself, so, there is no way to get information about possible dependencies.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;clone&#039;&#039;&#039;[&amp;amp;lsb_id=&#039;&#039;LSB_ID&#039;&#039;][&amp;amp;lsb_release=&#039;&#039;LSB_RELEASE&#039;&#039;][&amp;amp;assume=&#039;&#039;DEPENDENCY&#039;&#039;-&#039;&#039;VERSION&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
=== Upload releases ===&lt;br /&gt;
&lt;br /&gt;
To easy upload Context [[#context-releases|releases]] and avoid writing to raw &#039;&#039;Context.releases&#039;&#039; property, there is a special high-level API command.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;POST&#039;&#039;&#039; /context?cmd=&#039;&#039;&#039;submit&#039;&#039;&#039;[&amp;amp;&#039;&#039;PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;][&amp;amp;initial]&lt;br /&gt;
&lt;br /&gt;
Where the {{Code|PROP}} arguments are optional release properties. The {{Code|initial}} argument asks the system to create new Context resource new release will belong to.&lt;br /&gt;
&lt;br /&gt;
The posting data might be two types,&lt;br /&gt;
&lt;br /&gt;
* Sugar activities in .xo bundles,&amp;lt;br&amp;gt;there is no need in {{Code|PROP}} arguments, all properties will be populated basing on metadata from a .xo bundle; including release notes from the {{Code|CHANGELOG}} file in [[Wikipedia:Markdown|Markdown]] notation; besides, only in this case {{Code|initial}} makes sense because it is the only way to get Context properties;&lt;br /&gt;
&lt;br /&gt;
* Arbitrary data,&amp;lt;br&amp;gt;all required release properties should be specified in {{Code|PROP}} arguments, at least &#039;&#039;context&#039;&#039; and &#039;&#039;version&#039;&#039;; &#039;&#039;license&#039;&#039; should be specified only if there are no existing releases to pickup license from.&lt;br /&gt;
&lt;br /&gt;
=== Node statistics ===&lt;br /&gt;
&lt;br /&gt;
The node statistics are about the entire server and depersonalized. Statistics are being collected by analyzing regular requests to an API server and stored for each Sugar Network node. To read such info, call the command:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /?cmd=&#039;&#039;&#039;stats&#039;&#039;&#039;[&amp;amp;start=&#039;&#039;SECONDS&#039;&#039;][&amp;amp;end=&#039;&#039;SECONDS&#039;&#039;][&amp;amp;event=&#039;&#039;EVENT&#039;&#039;][&amp;amp;limit=&#039;&#039;NUMBER&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
&lt;br /&gt;
* {{Code|start}} and {{Code|end}} is a time interval to get statistics for; if omitted, the beginning and the end of entire life cycle will be used;&lt;br /&gt;
* {{Code|event}}, multiple argument to specify what stats should be returned; if omitted, return all sources;&lt;br /&gt;
* {{Code|limit}}, number of stat records to return for the {{Code|start}}-{{Code|end}} interval; note that this amount is not precise, the final resultset might be smaller or bigger depending on chosen resolution; stats resolution depends on node configuration, default values are 1 day, 10 days, 30 days, 365 days; if omitted, return {{Code|end}} record only.&lt;br /&gt;
&lt;br /&gt;
Possible events are:&lt;br /&gt;
&lt;br /&gt;
* {{Code|users}}, total number of existing &#039;&#039;User&#039;&#039; objects;&lt;br /&gt;
* {{Code|contexts}}, total number of existing &#039;&#039;Context&#039;&#039; objects;&lt;br /&gt;
* {{Code|released}}, average number of newly uploaded &#039;&#039;Context.releases&#039;&#039; for specified time frame;&lt;br /&gt;
* {{Code|solved}}, average number of requested &#039;&#039;Context&#039;&#039; [[#GET-solve|solutions]] for specified time frame; note that this value does not equal to the number of solution usages on client side since solutions might be cached;&lt;br /&gt;
* {{Code|reported}}, average number of newly uploaded failure &#039;&#039;Report&#039;&#039; objects for specified time frame;&lt;br /&gt;
* {{Code|topics}}, total number of top-level &#039;&#039;Post&#039;&#039; objects;&lt;br /&gt;
* {{Code|posts}}, total number of dependent &#039;&#039;Post&#039;&#039; objects.&lt;br /&gt;
&lt;br /&gt;
== Client API ==&lt;br /&gt;
&lt;br /&gt;
The reasons to proxy Sugar Network data on users side:&lt;br /&gt;
&lt;br /&gt;
* Seamless support [[#Offline mode|offline workflow]];&lt;br /&gt;
* [[#Launching|One-click launch]] Sugar activities hosted on Sugar Network.&lt;br /&gt;
&lt;br /&gt;
Proxying happens by providing the same Sugar Network API (with some extra functionality, see below) from&lt;br /&gt;
[[Platform_Team/Sugar_Network/Implementation#sugar-network-client|local process]] launched beforehand.&lt;br /&gt;
&lt;br /&gt;
=== Offline mode ===&lt;br /&gt;
&lt;br /&gt;
Being connected to a Sugar Network node, local proxy provides [[#Node_API|original API]] from the node. If the connection is lost, the proxy will switch to local Sugar Network storage and continue working providing only [[#Base_API|base API]]. Any content created in offline mode will be uploaded to the node after getting a connection back.&lt;br /&gt;
&lt;br /&gt;
Besides, local Sugar Network storage will be reused to keep users preferences, such as:&lt;br /&gt;
&lt;br /&gt;
* Favorited Contexts&amp;lt;br&amp;gt;to select preferred &#039;&#039;Context&#039;&#039; resources; these Contexts will be marked by {{Code|favorite}} value in the &#039;&#039;Context.layer&#039;&#039; property;&lt;br /&gt;
&lt;br /&gt;
* Checked-in Contexts&amp;lt;br&amp;gt;to keep most recent Context (for &#039;&#039;activity&#039;&#039; and &#039;&#039;book&#039;&#039; types) version in local storage to make it available in offline; note that there is no need in checking-in to speedup online lunch, versions are being [[#Launching|cached]] anyway; these Contexts will be marked by {{Code|checkin}} value in the &#039;&#039;Context.layer&#039;&#039; property.&lt;br /&gt;
&lt;br /&gt;
To control users preferences there are special API commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT_favorite&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;favorite&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Set favorite status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE_favorite&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;favorite&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Unset favorite status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT_checkin&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;checkin&#039;&#039;&#039;[&amp;amp;spawn]&lt;br /&gt;
&lt;br /&gt;
Check-in the specified Context. By default, the command will return streamed &#039;&#039;text/event-stream&#039;&#039; MIME type data to monitor the progress. If the {{Code|spawn}} argument is specified, the command will exit immediately with [[#Notifications|asynchronous sending]] progress events.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE_checkin&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;checkin&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Checkout the Context.&lt;br /&gt;
&lt;br /&gt;
=== Launching ===&lt;br /&gt;
&lt;br /&gt;
Sugar Network Contexts (for &#039;&#039;activity&#039;&#039; and &#039;&#039;book&#039;&#039; types) can be launched as-is. The launching process is implicit and includes selecting the most recent (and appropriate for software contexts) version, downloading bundles from the Sugar Network, installing missed [[Sugar_Network/Recipe_Specification#Dependencies|software dependencies]], execution itself. All downloaded bundles will be cached [with further garbage collecting] to speedup further launching.&lt;br /&gt;
&lt;br /&gt;
Sugar activities will be directly executed. Book Contexts will be opened in the proper application according to its MIME type.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;launch&#039;&#039;&#039;[&amp;amp;args=&#039;&#039;ARG&#039;&#039;][&amp;amp;activity_id=&#039;&#039;ACTIVITY_ID&#039;&#039;][&amp;amp;object_id=&#039;&#039;OBJECT_ID&#039;&#039;][&amp;amp;uri=&#039;&#039;URI&#039;&#039;][&amp;amp;app=&#039;&#039;APP&#039;&#039;][&amp;amp;spawn]&lt;br /&gt;
&lt;br /&gt;
Arguments that make sense only for Sugar activities:&lt;br /&gt;
&lt;br /&gt;
* {{Code|ARG}}, command line argument to pass to launched activities, repeat {{Code|ARG}} for each argument;&lt;br /&gt;
* {{Code|ACTIVITY_ID}}, internal activity id which will be auto set if omitted;&lt;br /&gt;
* {{Code|OBJECT_ID}}, Journal object id to resume;&lt;br /&gt;
* {{Code|URI}}, URL to resume if activity supports this functionality.&lt;br /&gt;
&lt;br /&gt;
Arguments that make sense only for books:&lt;br /&gt;
&lt;br /&gt;
* {{Code|APP}}, specify application Context to open the book by; if omitted, the system will try to find most appropriate option, among all existing software Contexts.&lt;br /&gt;
&lt;br /&gt;
Common arguments:&lt;br /&gt;
&lt;br /&gt;
* {{Code|spawn}}, by default, the command will return streamed &#039;&#039;text/event-stream&#039;&#039; MIME type data to monitor the whole launching process until exiting the application; if the {{Code|spawn}} argument is specified, the command will exit immediately with [[#Notifications|asynchronous sending]] launching events.&lt;br /&gt;
&lt;br /&gt;
== Experimental API ==&lt;br /&gt;
&lt;br /&gt;
There is no guaranty that the following API will be stated as stable or frozen sometime.&lt;br /&gt;
&lt;br /&gt;
=== Access to Sugar Journal ===&lt;br /&gt;
&lt;br /&gt;
It is possible to get access to local Sugar Journal using special, &#039;&#039;journal&#039;&#039;, resource provided from [[#Client_API|client API]]. This kind of access might be useful when local applications cannot use DBus sugar-datastore API, e.g., [[wikipedia:Javascript|Javascript]] applications. API to Journal is restricted only to read-only access:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /journal?offset=&#039;&#039;INTEGER&#039;&#039;&amp;amp;limit=&#039;&#039;INTEGER&#039;&#039;[&amp;amp;query=&#039;&#039;STRING&#039;&#039;][&amp;amp;order_by=&amp;lt;nowiki&amp;gt;[+|-]&amp;lt;/nowiki&amp;gt;&#039;&#039;PROP&#039;&#039;][&amp;amp;&#039;&#039;QUERY_PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;[&amp;amp;...]]&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /journal/&#039;&#039;JOURNAL_ID&#039;&#039;[?reply=&#039;&#039;PROP&#039;&#039;[,..]]&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /journal/&#039;&#039;JOURNAL_ID&#039;&#039;/&#039;&#039;PROPERTY&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
Being HTTP based, Sugar Network API can be used in any manner regular HTTP requests can be handled. But for command-line access, there is a handy tool, {{Code|sugar-network}}, which takes care about Sugar Network specific like launching local API (if it is not already available) to get access to [[#Client_API|local proxy]].&lt;br /&gt;
&lt;br /&gt;
The sugar-network command-line format is below. Call {{Code|sugar-network --help}} for more detailed info.&lt;br /&gt;
&lt;br /&gt;
 sugar-network GET|POST|PUT|DELETE &#039;&#039;PATH&#039;&#039; &#039;&#039;ARG=VALUE&#039;&#039; [..]&lt;br /&gt;
&lt;br /&gt;
* {{Code|PATH}}, is an url path;&lt;br /&gt;
* {{Code|ARG&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;VALUE}}, request arguments as they being passed to in url.&lt;br /&gt;
&lt;br /&gt;
{{Code|POST}} and {{Code|PUT}} commands require data to pass, use the following command-line arguments:&lt;br /&gt;
&lt;br /&gt;
* {{Code|-f FILE}} to specify the file to pass;&lt;br /&gt;
* {{Code|-d DATA}} to specify string to pass;&lt;br /&gt;
* {{Code|-j}} posted data should be encoded into JSON before posting.&lt;br /&gt;
&lt;br /&gt;
== Getting involved ==&lt;br /&gt;
&lt;br /&gt;
{{:Sugar_Network/Feedback}}&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Sugar_Network/API&amp;diff=92970</id>
		<title>Sugar Network/API</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Sugar_Network/API&amp;diff=92970"/>
		<updated>2014-07-24T04:01:21Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: /* API servers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the API that Sugar Network clients use to interact with a Sugar Network server. See also a guide to basic Sugar Network [[Sugar_Network/Concept|concepts]] and [[Platform_Team/Sugar_Network/Architecture|its twin page]] for a technical point of view. In addition, visit the [[Sugar_Network|introduction page]].&lt;br /&gt;
&lt;br /&gt;
{{Note/warning|Note|Until announcing API freeze, this document describes the most recent development version of the API.&amp;lt;br&amp;gt;You can find its implementation on the [[#API servers|node-devel.sugarlabs.org]] server.}}&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
To better understand this API, see a technical explanation of its [[Platform_Team/Sugar_Network/Architecture#Conceptual_level|conceptual level]] and [[#Sugar_Network_resources|objects model]] in particular.&lt;br /&gt;
&lt;br /&gt;
The API operates with [[Sugar Network]] [[#Sugar_Network_resources|resources]], which are collections of objects. All objects are identified by globally unique identifiers, GUIDs, and available for operation via [[#Base_API|basic actions]]. The API is being provided from a [[#API_servers|node server]] or a [[#Client_API|client]]. While processing requests, API providers generate [[#Notifications|events]].&lt;br /&gt;
&lt;br /&gt;
The API is [[Wikipedia:Restful|RESTful]], and is served via HTTP(S) using [[Wikipedia:Json|JSON]] notation. The common request url format is:&lt;br /&gt;
&lt;br /&gt;
 http[s]://&#039;&#039;SERVER&#039;&#039;[/&#039;&#039;RESOURCE&#039;&#039;[/&#039;&#039;GUID&#039;&#039;[/&#039;&#039;PROPERTY&#039;&#039;]]][?[cmd=&#039;&#039;COMMAND&#039;&#039;][&amp;amp;&#039;&#039;ARGUMENT&#039;&#039;=&#039;&#039;VALUE&#039;&#039;..]]&lt;br /&gt;
&lt;br /&gt;
When:&lt;br /&gt;
&lt;br /&gt;
* {{Code|SERVER}}, [[#API_servers|particular]] Sugar Network API server;&lt;br /&gt;
* {{Code|RESOURCE}}, name one of the [[#Sugar_Network_resources|existing]] resources;&lt;br /&gt;
* {{Code|GUID}}, the {{Code|RESOURCE}}&#039;s particular object;&lt;br /&gt;
* {{Code|PROPERTY}}, particular property of {{Code|GUID}} object;&lt;br /&gt;
* {{Code|COMMAND}}, optional command name; combination of HTTP request method ({{Code|GET}}, {{Code|POST}}, {{Code|PUT}}, or, {{Code|DELETE}}) and [possibly empty] {{Code|COMMAND}} composes the requested [[#Actions|action]];&lt;br /&gt;
* {{Code|ARGUMENT}}s and {{Code|VALUE}}s depend on the particular [[#Actions|action]].&lt;br /&gt;
&lt;br /&gt;
In most cases, the server replies in JSON notation. If a request fails, the replied JSON object will contain a {{Code|request}} key, with the original request, and {{Code|error}} key, with an error message.&lt;br /&gt;
&lt;br /&gt;
== API version ==&lt;br /&gt;
&lt;br /&gt;
Sugar Network nodes might support multiple API versions at once but only one of them is default, i.e., the one which is in use if clients do not specify particular API version. To specify API versions in client request, setup the {{Code|X-API}} HTTP header with chosen version. If such header is omitted, default version will be used by the node;&lt;br /&gt;
&lt;br /&gt;
Currently available API versions:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;0.1&#039;&#039; initial API implementation, should not be used;&lt;br /&gt;
* &#039;&#039;0.2.&#039;&#039; most recent version, the rest of the document describes exactly this one.&lt;br /&gt;
&lt;br /&gt;
== API servers ==&lt;br /&gt;
&lt;br /&gt;
These are standard Sugar Network API servers publicly available.&lt;br /&gt;
&lt;br /&gt;
* [http://node-devel.sugarlabs.org/ node-devel.sugarlabs.org]&amp;lt;br&amp;gt;Development server which does not contain important data and is free for any experiments (administrative privileges for anonymous users); default API version is &#039;&#039;0.2&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
* [http://node-testing.sugarlabs.org/ node-testing.sugarlabs.org]&amp;lt;br&amp;gt;Recent stable release with regular data import from the production server; is still free for any experiments; default API version is &#039;&#039;0.1&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
* [http://node.sugarlabs.org/ node.sugarlabs.org]&amp;lt;br&amp;gt;Production server;&lt;br /&gt;
&lt;br /&gt;
* [http://localhost:5001/ localhost:5001]&amp;lt;br&amp;gt;default url to get access to [[#Client_API|local proxy]] provided from user side application; ; default API version is &#039;&#039;0.1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Sugar Network resources ==&lt;br /&gt;
&lt;br /&gt;
{{:Sugar_Network/Resources}}&lt;br /&gt;
&lt;br /&gt;
== Base API ==&lt;br /&gt;
&lt;br /&gt;
List of actions common of all API providers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;POST&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;POST&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create new resource object.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to send:&lt;br /&gt;
* {{Code|&#039;&#039;RESOURCE}}&#039;s properties.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to receive:&lt;br /&gt;
* {{Code|guid}}, with globally unique identifier that specifies the created object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Modify resource object. By default, might be called only by {{Code|GUID}} creator.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to send:&lt;br /&gt;
* {{Code|RESOURCE}}&#039;s properties to modify.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Delete resource object. Actual object destruction won&#039;t happen, the object will be hidden. Garbage collection of hidden objects will be processed by Network administrators. By default, this action may be called only by the {{Code|GUID}} creator.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;[?offset=&#039;&#039;INTEGER&#039;&#039;][&amp;amp;limit=&#039;&#039;INTEGER&#039;&#039;][&amp;amp;query=&#039;&#039;STRING&#039;&#039;][&amp;amp;reply=&#039;&#039;PROP&#039;&#039;][&amp;amp;order_by=&amp;lt;nowiki&amp;gt;[+|-]&amp;lt;/nowiki&amp;gt;&#039;&#039;PROP&#039;&#039;][&amp;amp;group_by=&#039;&#039;PROP&#039;&#039;][&amp;amp;&#039;&#039;PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;][&amp;amp;&#039;&#039;!PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
Find resource objects.&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
* {{Code|offset}}, &#039;&#039;int&#039;&#039;&amp;lt;br&amp;gt;start index to return entries from, the default value is {{Code|0}};&lt;br /&gt;
* {{Code|limit}}, &#039;&#039;int&#039;&#039;&amp;lt;br&amp;gt;do not return more then specified value, maximal and default values are being setup on server side;&lt;br /&gt;
* {{Code|query}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;search request in [http://xapian.org/docs/queryparser.html Xapian] notation with the following additions:&lt;br /&gt;
** if property is boolean, integer or datetime, it supports searching by ranges: {{Code|&#039;&#039;PROP&#039;&#039;:[&#039;&#039;START&#039;&#039;]..[&#039;&#039;END&#039;&#039;]}};&lt;br /&gt;
** the statement {{Code|&#039;&#039;PROP&#039;&#039;&amp;lt;nowiki&amp;gt;:=&amp;lt;/nowiki&amp;gt;[&amp;quot;]&#039;&#039;VALUE&#039;&#039;[&amp;quot;]}} has the same effect as {{Code|QUERY_PROP}}; it is different to regular {{Code|&#039;&#039;PROP&#039;&#039;:&#039;&#039;VALUE&#039;&#039;}} where {{Code|VALUE}} might be a substring;&lt;br /&gt;
* {{Code|PROP}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;supplements {{Code|query}} with filtering by exact value of the {{Code|PROP}} property; the resulting query string will be {{Code|&#039;&#039;PROP&#039;&#039;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&#039;&#039;VALUE&#039;&#039; AND (&#039;&#039;QUERY&#039;&#039;)}}; argument is multiple;&lt;br /&gt;
* {{Code|!PROP}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;supplements {{Code|query}} by excluding exact value of the {{Code|PROP}} property; the resulting query string will be {{Code|NOT &#039;&#039;PROP&#039;&#039;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&#039;&#039;VALUE&#039;&#039; AND (&#039;&#039;QUERY&#039;&#039;)}}; argument is multiple;&lt;br /&gt;
* {{Code|reply}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;RESOURCE&#039;&#039; properties to return; by default, return only {{Code|guid}} property; argument is multiple;&lt;br /&gt;
* {{Code|order_by}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;property to sort the resulting list by; if starts with the {{Code|-}}, the order is descending, otherwise it is ascending;&lt;br /&gt;
* {{Code|group_by}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;property name to group resulting list by.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to receive:&lt;br /&gt;
* {{Code|total}}, total number in requested query (the reply might contain only the portion restricted by {{Code|limit}} request argument);&lt;br /&gt;
* {{Code|result}}, an array of dictionaries with resource object properties, dictionaries contain at least {{Code|guid}} property.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-resource&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;[?reply=&#039;&#039;PROP&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
* {{Code|reply}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;RESOURCE&#039;&#039; properties to return; by default, return only {{Code|guid}} property; argument is multiple;&lt;br /&gt;
&lt;br /&gt;
Return properties for a particular resource object.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to receive:&lt;br /&gt;
* properties that were specified in {{Code|reply}} argument(s), at least {{Code|guid}}.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT-property&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Modify particular resource property. By default, might be called only by {{Code|GUID}} creator.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-property&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Return property value for particular resource object.&lt;br /&gt;
&lt;br /&gt;
Data to receive:&lt;br /&gt;
* property value in JSON notation for regular properties;&lt;br /&gt;
* raw data or redirection for BLOB properties.&lt;br /&gt;
&lt;br /&gt;
=== Aggregated properties ===&lt;br /&gt;
&lt;br /&gt;
[[#resource-types|Aggregated]] properties have special API to treat their content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;POST-aggproperty&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;POST&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Submit new item. The command returns an id for newly created aggregated item. Depending on particular property, new items might be created not only by object&#039;s authors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT-aggproperty&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;/&#039;&#039;ID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Update existing aggregated item. Depending on particular property, the command is allowed either to object&#039;s authors or to aggregated item submitter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE-aggproperty&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;/&#039;&#039;ID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Delete existing aggregated item. Depending on particular property, the command is allowed either to object&#039;s authors or to aggregated item submitter.&lt;br /&gt;
&lt;br /&gt;
=== Notifications ===&lt;br /&gt;
&lt;br /&gt;
It is possible to subscribe to server events. Notification will happen using HTML5 [[wikipedia:Server-sent_events|Server-sent events]] (SSE).&lt;br /&gt;
&lt;br /&gt;
To start subscription, send the following request:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /?cmd=&#039;&#039;&#039;subscribe&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Response will be served with &#039;&#039;text/event-stream&#039;&#039; MIME type for default SSE message type. SSE message will be a JSONified object with the following, at least, attributes:&lt;br /&gt;
&lt;br /&gt;
* {{Code|event}}&amp;lt;br&amp;gt;event type.&lt;br /&gt;
&lt;br /&gt;
== Node API ==&lt;br /&gt;
&lt;br /&gt;
This is an API provided by Sugar Network nodes on top of [[#Base_API|base one]].&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
&lt;br /&gt;
Right now, the only way to be authenticated on a Sugar Network server is by running a [[Platform_Team/Sugar_Network/Implementation#sugar-network-client|local application]] on the client side and using the API it [[#Client_API|provides]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;TODO&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Authorization ===&lt;br /&gt;
&lt;br /&gt;
Read-only access is available for anonymous requests, except special content like machine serial numbers. But to process any changes, clients need to be authenticated.&lt;br /&gt;
&lt;br /&gt;
Right after creating any Sugar Network object, its author becomes the only user who can process any object modifications afterwards. Authority information will be kept in the [[#Sugar_Network_resources|author]] property and can be modified using the following commands.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;useradd&#039;&#039;&#039;&amp;amp;user=&#039;&#039;USER&#039;&#039;&amp;amp;role=&#039;&#039;ROLE&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Add another user who can modify the corresponding object. &#039;&#039;USER&#039;&#039; argument should be either &#039;&#039;User&#039;&#039; guid (for authors registered in the Sugar Network), or, full author name.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;userdel&#039;&#039;&#039;&amp;amp;user=&#039;&#039;USER&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Remove user from the authority list. It is not possible to remove yourself. &#039;&#039;USER&#039;&#039; argument should be either &#039;&#039;User&#039;&#039; guid (for authors registered in the Sugar Network), or, full author name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;TODO&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Retrieving releases ===&lt;br /&gt;
&lt;br /&gt;
To easy download Context [[#context-releases|releases]] and avoid reading raw &#039;&#039;Context.releases&#039;&#039; property, there are special high-level API commands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-solve&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;solve&#039;&#039;&#039;[&amp;amp;lsb_id=&#039;&#039;LSB_ID&#039;&#039;][&amp;amp;lsb_release=&#039;&#039;LSB_RELEASE&#039;&#039;][&amp;amp;assume=&#039;&#039;DEPENDENCY&#039;&#039;-&#039;&#039;VERSION&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
The command returns information about what particular releases should be downloaded depending on provided requirements. This command might return not only one release, e.g., activities might have dependencies either system packages or another Sugar Network Contexts.&lt;br /&gt;
&lt;br /&gt;
Solving requirements might be:&lt;br /&gt;
&lt;br /&gt;
* {{Code|LSB_ID}}, if Context releases depend on system packages, specify the [[Wikipedia:Linux_Standard_Base|LSB]] distributor id to consider while choosing particular packages;&lt;br /&gt;
* {{Code|LSB_RELEASE}}, if Context releases depend on system packages, specify the [[Wikipedia:Linux_Standard_Base|LSB]] release number of the distribution to consider while choosing particular packages;&lt;br /&gt;
* {{Code|DEPENDENCY-VERSION}}, the {{Code|assume}} argument instructs server to assume that specified [[Sugar_Network/Recipe_Specification#Dependencies|dependency]] is already available on client side and should be taken into account while solving; this is especially important for package dependencies when server considers packages available only from official repositories but users might have more recent package versions installed in local system; e.g., the above example request will fail without {{Code|sugar-0.94}} because neither {{Code|lsb_id}} nor {{Code|lsb_release}} were specified (even if LSB information is passed, server might not have information about what package versions come from official repositories).&lt;br /&gt;
&lt;br /&gt;
The resulting info is a JSON object with keys equal to Context guids and value objects for chosen release with the following keys:&lt;br /&gt;
&lt;br /&gt;
* {{Code|blob}}, bundle [[#resource-types|digest]] to download;&lt;br /&gt;
* {{Code|version}}, chosen version number;&lt;br /&gt;
* {{Code|title}}, the &#039;&#039;Context.title&#039;&#039; value;&lt;br /&gt;
* {{Code|command}}, a command to launch the bundle, only for Sugar activities.&lt;br /&gt;
&lt;br /&gt;
For example, the {{Code|&#039;&#039;&#039;GET&#039;&#039;&#039; &amp;lt;nowiki&amp;gt;/context/org.laptop.TurtleArtActivity?cmd=solve&amp;amp;assume=sugar-0.94&amp;lt;/nowiki&amp;gt;}} request returns:&lt;br /&gt;
&lt;br /&gt;
 {&lt;br /&gt;
   &amp;quot;org.laptop.TurtleArtActivity&amp;quot;: {&lt;br /&gt;
     &amp;quot;title&amp;quot;: &amp;quot;Turtle Blocks&amp;quot;,&lt;br /&gt;
     &amp;quot;version&amp;quot;: &amp;quot;202&amp;quot;,&lt;br /&gt;
     &amp;quot;blob&amp;quot;: &amp;quot;http://download.sugarlabs.org/activities/4027/turtleblocks-202.xo&amp;quot;,&lt;br /&gt;
     &amp;quot;content-type&amp;quot;: &amp;quot;application/vnd.olpc-sugar&amp;quot;,&lt;br /&gt;
     &amp;quot;size&amp;quot;: 4715955,&lt;br /&gt;
     &amp;quot;unpack_size&amp;quot;: 12873871,&lt;br /&gt;
     &amp;quot;command&amp;quot;: &amp;quot;sugar-activity TurtleArtActivity.TurtleArtActivity&amp;quot;,&lt;br /&gt;
   },&lt;br /&gt;
   &amp;quot;sugar&amp;quot;: {&lt;br /&gt;
     &amp;quot;version&amp;quot;: &amp;quot;0.94&amp;quot;,&lt;br /&gt;
   },&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-clone&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Like the [[#GET-solve|solve]] command, &#039;&#039;clone&#039;&#039; makes a solution but returns bundle itself, so, there is no way to get information about possible dependencies.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;clone&#039;&#039;&#039;[&amp;amp;lsb_id=&#039;&#039;LSB_ID&#039;&#039;][&amp;amp;lsb_release=&#039;&#039;LSB_RELEASE&#039;&#039;][&amp;amp;assume=&#039;&#039;DEPENDENCY&#039;&#039;-&#039;&#039;VERSION&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
=== Upload releases ===&lt;br /&gt;
&lt;br /&gt;
To easy upload Context [[#context-releases|releases]] and avoid writing to raw &#039;&#039;Context.releases&#039;&#039; property, there is a special high-level API command.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;POST&#039;&#039;&#039; /context?cmd=&#039;&#039;&#039;submit&#039;&#039;&#039;[&amp;amp;&#039;&#039;PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;][&amp;amp;initial]&lt;br /&gt;
&lt;br /&gt;
Where the {{Code|PROP}} arguments are optional release properties. The {{Code|initial}} argument asks the system to create new Context resource new release will belong to.&lt;br /&gt;
&lt;br /&gt;
The posting data might be two types,&lt;br /&gt;
&lt;br /&gt;
* Sugar activities in .xo bundles,&amp;lt;br&amp;gt;there is no need in {{Code|PROP}} arguments, all properties will be populated basing on metadata from a .xo bundle; including release notes from the {{Code|CHANGELOG}} file in [[Wikipedia:Markdown|Markdown]] notation; besides, only in this case {{Code|initial}} makes sense because it is the only way to get Context properties;&lt;br /&gt;
&lt;br /&gt;
* Arbitrary data,&amp;lt;br&amp;gt;all required release properties should be specified in {{Code|PROP}} arguments, at least &#039;&#039;context&#039;&#039; and &#039;&#039;version&#039;&#039;; &#039;&#039;license&#039;&#039; should be specified only if there are no existing releases to pickup license from.&lt;br /&gt;
&lt;br /&gt;
=== Node statistics ===&lt;br /&gt;
&lt;br /&gt;
The node statistics are about the entire server and depersonalized. Statistics are being collected by analyzing regular requests to an API server and stored for each Sugar Network node. To read such info, call the command:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /?cmd=&#039;&#039;&#039;stats&#039;&#039;&#039;[&amp;amp;start=&#039;&#039;SECONDS&#039;&#039;][&amp;amp;end=&#039;&#039;SECONDS&#039;&#039;][&amp;amp;event=&#039;&#039;EVENT&#039;&#039;][&amp;amp;limit=&#039;&#039;NUMBER&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
&lt;br /&gt;
* {{Code|start}} and {{Code|end}} is a time interval to get statistics for; if omitted, the beginning and the end of entire life cycle will be used;&lt;br /&gt;
* {{Code|event}}, multiple argument to specify what stats should be returned; if omitted, return all sources;&lt;br /&gt;
* {{Code|limit}}, number of stat records to return for the {{Code|start}}-{{Code|end}} interval; note that this amount is not precise, the final resultset might be smaller or bigger depending on chosen resolution; stats resolution depends on node configuration, default values are 1 day, 10 days, 30 days, 365 days; if omitted, return {{Code|end}} record only.&lt;br /&gt;
&lt;br /&gt;
Possible events are:&lt;br /&gt;
&lt;br /&gt;
* {{Code|users}}, total number of existing &#039;&#039;User&#039;&#039; objects;&lt;br /&gt;
* {{Code|contexts}}, total number of existing &#039;&#039;Context&#039;&#039; objects;&lt;br /&gt;
* {{Code|released}}, average number of newly uploaded &#039;&#039;Context.releases&#039;&#039; for specified time frame;&lt;br /&gt;
* {{Code|solved}}, average number of requested &#039;&#039;Context&#039;&#039; [[#GET-solve|solutions]] for specified time frame; note that this value does not equal to the number of solution usages on client side since solutions might be cached;&lt;br /&gt;
* {{Code|reported}}, average number of newly uploaded failure &#039;&#039;Report&#039;&#039; objects for specified time frame;&lt;br /&gt;
* {{Code|topics}}, total number of top-level &#039;&#039;Post&#039;&#039; objects;&lt;br /&gt;
* {{Code|posts}}, total number of dependent &#039;&#039;Post&#039;&#039; objects.&lt;br /&gt;
&lt;br /&gt;
== Client API ==&lt;br /&gt;
&lt;br /&gt;
The reasons to proxy Sugar Network data on users side:&lt;br /&gt;
&lt;br /&gt;
* Seamless support [[#Offline mode|offline workflow]];&lt;br /&gt;
* [[#Launching|One-click launch]] Sugar activities hosted on Sugar Network.&lt;br /&gt;
&lt;br /&gt;
Proxying happens by providing the same Sugar Network API (with some extra functionality, see below) from&lt;br /&gt;
[[Platform_Team/Sugar_Network/Implementation#sugar-network-client|local process]] launched beforehand.&lt;br /&gt;
&lt;br /&gt;
=== Offline mode ===&lt;br /&gt;
&lt;br /&gt;
Being connected to a Sugar Network node, local proxy provides [[#Node_API|original API]] from the node. If the connection is lost, the proxy will switch to local Sugar Network storage and continue working providing only [[#Base_API|base API]]. Any content created in offline mode will be uploaded to the node after getting a connection back.&lt;br /&gt;
&lt;br /&gt;
Besides, local Sugar Network storage will be reused to keep users preferences, such as:&lt;br /&gt;
&lt;br /&gt;
* Favorited Contexts&amp;lt;br&amp;gt;to select preferred &#039;&#039;Context&#039;&#039; resources; these Contexts will be marked by {{Code|favorite}} value in the &#039;&#039;Context.layer&#039;&#039; property;&lt;br /&gt;
&lt;br /&gt;
* Checked-in Contexts&amp;lt;br&amp;gt;to keep most recent Context (for &#039;&#039;activity&#039;&#039; and &#039;&#039;book&#039;&#039; types) version in local storage to make it available in offline; note that there is no need in checking-in to speedup online lunch, versions are being [[#Launching|cached]] anyway; these Contexts will be marked by {{Code|checkin}} value in the &#039;&#039;Context.layer&#039;&#039; property.&lt;br /&gt;
&lt;br /&gt;
To control users preferences there are special API commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT_favorite&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;favorite&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Set favorite status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE_favorite&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;favorite&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Unset favorite status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT_checkin&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;checkin&#039;&#039;&#039;[&amp;amp;spawn]&lt;br /&gt;
&lt;br /&gt;
Check-in the specified Context. By default, the command will return streamed &#039;&#039;text/event-stream&#039;&#039; MIME type data to monitor the progress. If the {{Code|spawn}} argument is specified, the command will exit immediately with [[#Notifications|asynchronous sending]] progress events.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE_checkin&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;checkin&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Checkout the Context.&lt;br /&gt;
&lt;br /&gt;
=== Launching ===&lt;br /&gt;
&lt;br /&gt;
Sugar Network Contexts (for &#039;&#039;activity&#039;&#039; and &#039;&#039;book&#039;&#039; types) can be launched as-is. The launching process is implicit and includes selecting the most recent (and appropriate for software contexts) version, downloading bundles from the Sugar Network, installing missed [[Sugar_Network/Recipe_Specification#Dependencies|software dependencies]], execution itself. All downloaded bundles will be cached [with further garbage collecting] to speedup further launching.&lt;br /&gt;
&lt;br /&gt;
Sugar activities will be directly executed. Book Contexts will be opened in the proper application according to its MIME type.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;launch&#039;&#039;&#039;[&amp;amp;args=&#039;&#039;ARG&#039;&#039;][&amp;amp;activity_id=&#039;&#039;ACTIVITY_ID&#039;&#039;][&amp;amp;object_id=&#039;&#039;OBJECT_ID&#039;&#039;][&amp;amp;uri=&#039;&#039;URI&#039;&#039;][&amp;amp;app=&#039;&#039;APP&#039;&#039;][&amp;amp;spawn]&lt;br /&gt;
&lt;br /&gt;
Arguments that make sense only for Sugar activities:&lt;br /&gt;
&lt;br /&gt;
* {{Code|ARG}}, command line argument to pass to launched activities, repeat {{Code|ARG}} for each argument;&lt;br /&gt;
* {{Code|ACTIVITY_ID}}, internal activity id which will be auto set if omitted;&lt;br /&gt;
* {{Code|OBJECT_ID}}, Journal object id to resume;&lt;br /&gt;
* {{Code|URI}}, URL to resume if activity supports this functionality.&lt;br /&gt;
&lt;br /&gt;
Arguments that make sense only for books:&lt;br /&gt;
&lt;br /&gt;
* {{Code|APP}}, specify application Context to open the book by; if omitted, the system will try to find most appropriate option, among all existing software Contexts.&lt;br /&gt;
&lt;br /&gt;
Common arguments:&lt;br /&gt;
&lt;br /&gt;
* {{Code|spawn}}, by default, the command will return streamed &#039;&#039;text/event-stream&#039;&#039; MIME type data to monitor the whole launching process until exiting the application; if the {{Code|spawn}} argument is specified, the command will exit immediately with [[#Notifications|asynchronous sending]] launching events.&lt;br /&gt;
&lt;br /&gt;
== Experimental API ==&lt;br /&gt;
&lt;br /&gt;
There is no guaranty that the following API will be stated as stable or frozen sometime.&lt;br /&gt;
&lt;br /&gt;
=== Access to Sugar Journal ===&lt;br /&gt;
&lt;br /&gt;
It is possible to get access to local Sugar Journal using special, &#039;&#039;journal&#039;&#039;, resource provided from [[#Client_API|client API]]. This kind of access might be useful when local applications cannot use DBus sugar-datastore API, e.g., [[wikipedia:Javascript|Javascript]] applications. API to Journal is restricted only to read-only access:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /journal?offset=&#039;&#039;INTEGER&#039;&#039;&amp;amp;limit=&#039;&#039;INTEGER&#039;&#039;[&amp;amp;query=&#039;&#039;STRING&#039;&#039;][&amp;amp;order_by=&amp;lt;nowiki&amp;gt;[+|-]&amp;lt;/nowiki&amp;gt;&#039;&#039;PROP&#039;&#039;][&amp;amp;&#039;&#039;QUERY_PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;[&amp;amp;...]]&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /journal/&#039;&#039;JOURNAL_ID&#039;&#039;[?reply=&#039;&#039;PROP&#039;&#039;[,..]]&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /journal/&#039;&#039;JOURNAL_ID&#039;&#039;/&#039;&#039;PROPERTY&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
Being HTTP based, Sugar Network API can be used in any manner regular HTTP requests can be handled. But for command-line access, there is a handy tool, {{Code|sugar-network}}, which takes care about Sugar Network specific like launching local API (if it is not already available) to get access to [[#Client_API|local proxy]].&lt;br /&gt;
&lt;br /&gt;
The sugar-network command-line format is below. Call {{Code|sugar-network --help}} for more detailed info.&lt;br /&gt;
&lt;br /&gt;
 sugar-network GET|POST|PUT|DELETE &#039;&#039;PATH&#039;&#039; &#039;&#039;ARG=VALUE&#039;&#039; [..]&lt;br /&gt;
&lt;br /&gt;
* {{Code|PATH}}, is an url path;&lt;br /&gt;
* {{Code|ARG&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;VALUE}}, request arguments as they being passed to in url.&lt;br /&gt;
&lt;br /&gt;
{{Code|POST}} and {{Code|PUT}} commands require data to pass, use the following command-line arguments:&lt;br /&gt;
&lt;br /&gt;
* {{Code|-f FILE}} to specify the file to pass;&lt;br /&gt;
* {{Code|-d DATA}} to specify string to pass;&lt;br /&gt;
* {{Code|-j}} posted data should be encoded into JSON before posting.&lt;br /&gt;
&lt;br /&gt;
== Getting involved ==&lt;br /&gt;
&lt;br /&gt;
{{:Sugar_Network/Feedback}}&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Resources&amp;diff=92905</id>
		<title>Sugar Network/Resources</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Resources&amp;diff=92905"/>
		<updated>2014-07-10T07:52:46Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following diagram shows the full list of objects implemented by the Sugar Network [[Platform Team/Sugar Network/API|API]].&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot; align=&amp;quot;let&amp;quot;&lt;br /&gt;
| [[File:Sugar-Network-diagram.png|200px|thumb|Sugar Network objects]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-types&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Property types&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Generally, Sugar Network objects&#039; property types correspond to JSON types. The only exceptions mentioned in the following list:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;enum&#039;&#039;, is an enumerated type when a value is a string from the predefined list of constants;&lt;br /&gt;
* &#039;&#039;markdown&#039;&#039;, is a string formatted in the [[Wikipedia:Markdown|Markdown]] syntax;&lt;br /&gt;
* &#039;&#039;blob&#039;&#039;, is a file represented by string value which is a [[Wikipedia:Sha1|SHA-1]] digest of file&#039;s content; the file itself can be obtained from the {{Code|&#039;&#039;&#039;GET&#039;&#039;&#039; /blobs/&#039;&#039;DIGEST&#039;&#039;}} request;&lt;br /&gt;
* &#039;&#039;aggregated&#039;&#039;, is a list of JSON objects which has [[Sugar_Network/API#Aggregated_properties|special API]] to treat its items; each aggregated item has a unique identifier; items might be created not only by the object&#039;s authors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-author&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.author&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A dictionary of authors working on the corresponding resource. Keys are Sugar Network &#039;&#039;User&#039;&#039; guids, or, if particular author is not registered in the Sugar Network, full user names. Values are dictionaries with the following keys:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;name&#039;&#039;&amp;lt;br&amp;gt;Full author&#039;s name;&lt;br /&gt;
* &#039;&#039;role&#039;&#039;&amp;lt;br&amp;gt;An integer which is a bit-wise ORed value of the following constants:&lt;br /&gt;
** &#039;&#039;0x1&#039;&#039;, author is registered in the Sugar Network (and &#039;&#039;guid&#039;&#039; key is set);&lt;br /&gt;
** &#039;&#039;0x10000&#039;&#039;, author is the original author of the corresponding resource; if it is not set, user is only a maintainer, e.g., an uploader of a book which has its original authors;&lt;br /&gt;
* &#039;&#039;avatar&#039;&#039;&amp;lt;br&amp;gt;An url to author&#039;s avatar.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-status&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.status&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is a system level property which can be set only by node editors. It is a list of &amp;quot;badges&amp;quot; editors set depending on the object quality. Currently supported statuses are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;featured&#039;&#039;, the object is popped up by node editors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-pins&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.pins&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This property makes sense only for objects provided from a [[Sugar_Network/API#Client_proxy|local proxy]]. The property is intended to store local user&#039;s preferences or statuses remote object has in local environment. Currently supported values are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;favorite&#039;&#039;, set if a user has &#039;&#039;&amp;quot;stared&amp;quot;&#039;&#039; the object;&lt;br /&gt;
* &#039;&#039;checkin&#039;&#039;, applied to Context objects only, set if a user has &#039;&#039;&amp;quot;pinned&amp;quot;&#039;&#039; the context to keep its most recent version permanently in the local system;&lt;br /&gt;
* &#039;&#039;stale&#039;&#039;, applied to Context objects only, set if previously checked-in Context might have more fresh releases on the node; it is not possible to filter Contexts by this value;&lt;br /&gt;
* &#039;&#039;inprogress&#039;&#039;, applied to Context objects only, set if the Context is in the process of downloading content from the node; it is being temporally set before launching the Context or checking it in; it is not possible to filter Contexts by this value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;context-type&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Context.type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;activity&#039;&#039;, Sugar activity;&lt;br /&gt;
* &#039;&#039;book&#039;&#039;, books in various forms;&lt;br /&gt;
* &#039;&#039;talks&#039;&#039;, offline discussion groups;&lt;br /&gt;
* &#039;&#039;project&#039;&#039;, general purpose context to group related Post objects;&lt;br /&gt;
* &#039;&#039;package&#039;&#039;, GNU/Linux package metadata.&lt;br /&gt;
&lt;br /&gt;
Context type specifies how context, and all related resources, can be used. For example, &#039;&#039;activity&#039;&#039; type assumes activity bundles uploaded to the &#039;&#039;Context.releases&#039;&#039; property, or, [[#post-type|Post.type]] depends on Context type it was created for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;context-releases&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Context.releases&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Contexts with &#039;&#039;activity&#039;&#039; or &#039;&#039;book&#039;&#039; types might have releases, i.e., activity or book versions that users can download. The &#039;&#039;releases&#039;&#039; property is aggregated where each item describes one particular version. There is no need in working with the &#039;&#039;releases&#039;&#039; property directly, there are high-level API commands to [[Sugar_Network/API#Upload_releases|upload]] and [[Sugar_Network/API#Retrieving_releases|download]] releases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;post-type&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post.type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Choose Post types according to Context [[#context-type|types]] the Post belongs to.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;topic&#039;&#039;, general purpose discussion; &#039;&#039;talks&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;artefact&#039;&#039;, object generated by Context application; &#039;&#039;activity&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;issue&#039;&#039;, problem with the Context; &#039;&#039;project&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;poll&#039;&#039;, a poll within the Context; &#039;&#039;project&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;post&#039;&#039;, a comment for a parent Post object; Context type independent.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;post-topic&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post.topic&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Only &#039;&#039;post&#039;&#039; type Post objects belong to a parent Post which guid should be specified in the &#039;&#039;topic&#039;&#039; property. The system design assumes only a two-level Posts hierarchy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;post-topic&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post.resolution&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Post types &#039;&#039;issue&#039;&#039; and &#039;&#039;poll&#039;&#039; topics might have a resolution to expose the current status. The only way to change topic resolution is creating a dependent post with resolution property set.&lt;br /&gt;
&lt;br /&gt;
Resolutions for &#039;&#039;issue&#039;&#039; Post objects:&lt;br /&gt;
* &#039;&#039;unconfirmed&#039;&#039;, newly created issue;&lt;br /&gt;
* &#039;&#039;new&#039;&#039;, confirmed issue;&lt;br /&gt;
* &#039;&#039;needinfo&#039;&#039;, posted information about the issue is insufficient, more details needed;&lt;br /&gt;
* &#039;&#039;resolved&#039;&#039;, the issue is resolved, closed;&lt;br /&gt;
* &#039;&#039;unrelated&#039;&#039;, the issue does not related to the Context, closed;&lt;br /&gt;
* &#039;&#039;obsolete&#039;&#039;, the issue is already solved in recent Context releases, closed;&lt;br /&gt;
* &#039;&#039;duplicate&#039;&#039;, the issue is a duplicate, closed.&lt;br /&gt;
&lt;br /&gt;
Resolutions for &#039;&#039;poll&#039;&#039; Post objects:&lt;br /&gt;
* &#039;&#039;open&#039;&#039;, the poll is open for votes;&lt;br /&gt;
* &#039;&#039;closed&#039;&#039;, the poll is closed for votes.&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Resources&amp;diff=92903</id>
		<title>Sugar Network/Resources</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Resources&amp;diff=92903"/>
		<updated>2014-07-08T22:20:19Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following diagram shows the full list of objects implemented by the Sugar Network [[Platform Team/Sugar Network/API|API]].&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot; align=&amp;quot;let&amp;quot;&lt;br /&gt;
| [[File:Sugar-Network-diagram.png|200px|thumb|Sugar Network objects]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-types&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Property types&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Generally, Sugar Network objects&#039; property types correspond to JSON types. The only exceptions mentioned in the following list:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;enum&#039;&#039;, is an enumerated type when a value is a string from the predefined list of constants;&lt;br /&gt;
* &#039;&#039;markdown&#039;&#039;, is a string formatted in the [[Wikipedia:Markdown|Markdown]] syntax;&lt;br /&gt;
* &#039;&#039;blob&#039;&#039;, is a file represented by string value which is a [[Wikipedia:Sha1|SHA-1]] digest of file&#039;s content; the file itself can be obtained from the {{Code|&#039;&#039;&#039;GET&#039;&#039;&#039; /blobs/&#039;&#039;DIGEST&#039;&#039;}} request;&lt;br /&gt;
* &#039;&#039;aggregated&#039;&#039;, is a list of JSON objects which has [[Sugar_Network/API#Aggregated_properties|special API]] to treat its items; each aggregated item has a unique identifier; items might be created not only by the object&#039;s authors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-author&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.author&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A dictionary of authors working on the corresponding resource. Keys are Sugar Network &#039;&#039;User&#039;&#039; guids, or, if particular author is not registered in the Sugar Network, full user names. Values are dictionaries with the following keys:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;name&#039;&#039;&amp;lt;br&amp;gt;Full author&#039;s name;&lt;br /&gt;
* &#039;&#039;role&#039;&#039;&amp;lt;br&amp;gt;An integer which is a bit-wise ORed value of the following constants:&lt;br /&gt;
** &#039;&#039;0x1&#039;&#039;, author is registered in the Sugar Network (and &#039;&#039;guid&#039;&#039; key is set);&lt;br /&gt;
** &#039;&#039;0x10000&#039;&#039;, author is the original author of the corresponding resource; if it is not set, user is only a maintainer, e.g., an uploader of a book which has its original authors;&lt;br /&gt;
* &#039;&#039;avatar&#039;&#039;&amp;lt;br&amp;gt;An url to author&#039;s avatar.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-status&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.status&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is a system level property which can be set only by node editors. It is a list of &amp;quot;badges&amp;quot; editors set depending on the object quality. Currently supported statuses are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;featured&#039;&#039;, the object is popped up by node editors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-pins&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.pins&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This property makes sense only for objects provided from a [[Sugar_Network/API#Client_proxy|local proxy]]. The property is intended to store local user&#039;s preferences or statuses remote object has in local environment. Currently supported values are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;favorite&#039;&#039;, set if a user has &#039;&#039;&amp;quot;stared&amp;quot;&#039;&#039; the object;&lt;br /&gt;
* &#039;&#039;checkin&#039;&#039;, applied to Context objects only, set if a user has &#039;&#039;&amp;quot;pinned&amp;quot;&#039;&#039; the context to keep its most recent version permanently in the local system;&lt;br /&gt;
* &#039;&#039;stale&#039;&#039;, applied to Context objects only, set if previously checked-in Context might have more fresh releases on the node; it is not possible to filter Contexts by this value;&lt;br /&gt;
* &#039;&#039;inprogress&#039;&#039;, applied to Context objects only, set if the Context is in the process of downloading content from the node; it is being temporally set before launching the Context or checking it in; it is not possible to filter Contexts by this value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;context-type&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Context.type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;activity&#039;&#039;, Sugar activity;&lt;br /&gt;
* &#039;&#039;book&#039;&#039;, books in various forms;&lt;br /&gt;
* &#039;&#039;talks&#039;&#039;, offline discussion groups;&lt;br /&gt;
* &#039;&#039;project&#039;&#039;, general purpose context to group related Post objects;&lt;br /&gt;
* &#039;&#039;package&#039;&#039;, GNU/Linux package metadata.&lt;br /&gt;
&lt;br /&gt;
Context type specifies how context, and all related resources, can be used. For example, &#039;&#039;activity&#039;&#039; type assumes activity bundles uploaded to the &#039;&#039;Context.releases&#039;&#039; property, or, [[#post-type|Post.type]] depends on Context type it was created for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;context-releases&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Context.releases&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Contexts with &#039;&#039;activity&#039;&#039; or &#039;&#039;book&#039;&#039; types might have releases, i.e., activity or book versions that users can download. The &#039;&#039;releases&#039;&#039; property is aggregated where each item describes one particular version. There is no need in working with the &#039;&#039;releases&#039;&#039; property directly, there are high-level API commands to [[Sugar_Network/API#Upload_releases|upload]] and [[Sugar_Network/API#Retrieving_releases|download]] releases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;post-type&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post.type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Choose Post types according to Context [[#context-type|types]] the Post belongs to.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;topic&#039;&#039;, general purpose discussion; &#039;&#039;talks&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;review&#039;&#039;, review the Context; &#039;&#039;activity&#039;&#039; or &#039;&#039;book&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;artefact&#039;&#039;, object generated by Context application; &#039;&#039;activity&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;issue&#039;&#039;, problem with the Context; &#039;&#039;project&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;poll&#039;&#039;, a poll within the Context; &#039;&#039;project&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;post&#039;&#039;, a comment for a parent Post object; Context type independent.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;post-topic&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post.topic&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Only &#039;&#039;post&#039;&#039; type Post objects belong to a parent Post which guid should be specified in the &#039;&#039;topic&#039;&#039; property. The system design assumes only a two-level Posts hierarchy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;post-topic&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post.resolution&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Post types &#039;&#039;issue&#039;&#039; and &#039;&#039;poll&#039;&#039; topics might have a resolution to expose the current status. The only way to change topic resolution is creating a dependent post with resolution property set.&lt;br /&gt;
&lt;br /&gt;
Resolutions for &#039;&#039;issue&#039;&#039; Post objects:&lt;br /&gt;
* &#039;&#039;unconfirmed&#039;&#039;, newly created issue;&lt;br /&gt;
* &#039;&#039;new&#039;&#039;, confirmed issue;&lt;br /&gt;
* &#039;&#039;needinfo&#039;&#039;, posted information about the issue is insufficient, more details needed;&lt;br /&gt;
* &#039;&#039;resolved&#039;&#039;, the issue is resolved, closed;&lt;br /&gt;
* &#039;&#039;unrelated&#039;&#039;, the issue does not related to the Context, closed;&lt;br /&gt;
* &#039;&#039;obsolete&#039;&#039;, the issue is already solved in recent Context releases, closed;&lt;br /&gt;
* &#039;&#039;duplicate&#039;&#039;, the issue is a duplicate, closed.&lt;br /&gt;
&lt;br /&gt;
Resolutions for &#039;&#039;poll&#039;&#039; Post objects:&lt;br /&gt;
* &#039;&#039;open&#039;&#039;, the poll is open for votes;&lt;br /&gt;
* &#039;&#039;closed&#039;&#039;, the poll is closed for votes.&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Resources&amp;diff=92901</id>
		<title>Sugar Network/Resources</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Resources&amp;diff=92901"/>
		<updated>2014-07-06T19:47:02Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following diagram shows the full list of objects implemented by the Sugar Network [[Platform Team/Sugar Network/API|API]].&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot; align=&amp;quot;let&amp;quot;&lt;br /&gt;
| [[File:Sugar-Network-diagram.png|200px|thumb|Sugar Network objects]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-types&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Property types&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Generally, Sugar Network objects&#039; property types correspond to JSON types. The only exceptions mentioned in the following list:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;enum&#039;&#039;, is an enumerated type when a value is a string from the predefined list of constants;&lt;br /&gt;
* &#039;&#039;markdown&#039;&#039;, is a string formatted in the [[Wikipedia:Markdown|Markdown]] syntax;&lt;br /&gt;
* &#039;&#039;blob&#039;&#039;, is a file represented by string value which is a [[Wikipedia:Sha1|SHA-1]] digest of file&#039;s content; the file itself can be obtained from the {{Code|&#039;&#039;&#039;GET&#039;&#039;&#039; /blobs/&#039;&#039;DIGEST&#039;&#039;}} request;&lt;br /&gt;
* &#039;&#039;aggregated&#039;&#039;, is a list of JSON objects which has [[Sugar_Network/API#Aggregated_properties|special API]] to treat its items; each aggregated item has a unique identifier; items might be created not only by the object&#039;s authors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-author&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.author&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A dictionary of authors working on the corresponding resource. Keys are Sugar Network &#039;&#039;User&#039;&#039; guids, or, if particular author is not registered in the Sugar Network, full user names. Values are dictionaries with the following keys:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;name&#039;&#039;&amp;lt;br&amp;gt;Full author&#039;s name;&lt;br /&gt;
* &#039;&#039;role&#039;&#039;&amp;lt;br&amp;gt;An integer which is a bit-wise ORed value of the following constants:&lt;br /&gt;
** &#039;&#039;0x1&#039;&#039;, author is registered in the Sugar Network (and &#039;&#039;guid&#039;&#039; key is set);&lt;br /&gt;
** &#039;&#039;0x10000&#039;&#039;, author is the original author of the corresponding resource; if it is not set, user is only a maintainer, e.g., an uploader of a book which has its original authors;&lt;br /&gt;
* &#039;&#039;avatar&#039;&#039;&amp;lt;br&amp;gt;An url to author&#039;s avatar.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-status&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.status&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is a system level property which can be set only by node editors. It is a list of &amp;quot;badges&amp;quot; editors set depending on the object quality. Currently supported statuses are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;featured&#039;&#039;, the object is popped up by node editors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-pins&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.pins&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This property makes sense only for objects provided from a [[Sugar_Network/API#Client_proxy|local proxy]]. The property is intended to store local user&#039;s preferences or statuses remote object has in local environment. Currently supported values are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;favorite&#039;&#039;, set if a user has &#039;&#039;&amp;quot;stared&amp;quot;&#039;&#039; the object;&lt;br /&gt;
* &#039;&#039;checkin&#039;&#039;, applied to Context objects only, set if a user has &#039;&#039;&amp;quot;pinned&amp;quot;&#039;&#039; the context to keep its most recent version permanently in the local system;&lt;br /&gt;
* &#039;&#039;stale&#039;&#039;, applied to Context objects only, set if previously checked-in Context might have more fresh releases on the node; it is not possible to filter Contexts by this value;&lt;br /&gt;
* &#039;&#039;inprogress&#039;&#039;, applied to Context objects only, set if the Context is in the process of downloading content from the node; it is being temporally set before launching the Context or checking it in; it is not possible to filter Contexts by this value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;context-type&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Context.type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;activity&#039;&#039;, Sugar activity;&lt;br /&gt;
* &#039;&#039;book&#039;&#039;, books in various forms;&lt;br /&gt;
* &#039;&#039;talks&#039;&#039;, offline discussion groups;&lt;br /&gt;
* &#039;&#039;project&#039;&#039;, general purpose context to group related Post objects;&lt;br /&gt;
* &#039;&#039;package&#039;&#039;, GNU/Linux package metadata.&lt;br /&gt;
&lt;br /&gt;
Context type specifies how context, and all related resources, can be used. For example, &#039;&#039;activity&#039;&#039; type assumes activity bundles uploaded to the &#039;&#039;Context.releases&#039;&#039; property, or, [[#post-type|Post.type]] depends on Context type it was created for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;context-releases&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Context.releases&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Contexts with &#039;&#039;activity&#039;&#039; or &#039;&#039;book&#039;&#039; types might have releases, i.e., activity or book versions that users can download. The &#039;&#039;releases&#039;&#039; property is aggregated where each item describes one particular version. There is no need in working with the &#039;&#039;releases&#039;&#039; property directly, there are high-level API commands to [[Sugar_Network/API#Upload_releases|upload]] and [[Sugar_Network/API#Retrieving_releases|download]] releases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;post-type&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post.type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Choose Post types according to Context [[#context-type|types]] the Post belongs to.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;topic&#039;&#039;, general purpose discussion; &#039;&#039;talks&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;review&#039;&#039;, review the Context; &#039;&#039;activity&#039;&#039; or &#039;&#039;book&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;artefact&#039;&#039;, object generated by Context application; &#039;&#039;activity&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;issue&#039;&#039;, problem with the Context; &#039;&#039;project&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;poll&#039;&#039;, a poll within the Context; &#039;&#039;project&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;notice&#039;&#039;, auto-generated Post for updates within the Context; Context type independent;&lt;br /&gt;
* &#039;&#039;post&#039;&#039;, a comment for a parent Post object; Context type independent.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;post-topic&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post.topic&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Only &#039;&#039;post&#039;&#039; type Post objects belong to a parent Post which guid should be specified in the &#039;&#039;topic&#039;&#039; property. The system design assumes only a two-level Posts hierarchy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;post-topic&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post.resolution&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Post types &#039;&#039;issue&#039;&#039; and &#039;&#039;poll&#039;&#039; topics might have a resolution to expose the current status. The only way to change topic resolution is creating a dependent post with resolution property set.&lt;br /&gt;
&lt;br /&gt;
Resolutions for &#039;&#039;issue&#039;&#039; Post objects:&lt;br /&gt;
* &#039;&#039;unconfirmed&#039;&#039;, newly created issue;&lt;br /&gt;
* &#039;&#039;new&#039;&#039;, confirmed issue;&lt;br /&gt;
* &#039;&#039;needinfo&#039;&#039;, posted information about the issue is insufficient, more details needed;&lt;br /&gt;
* &#039;&#039;resolved&#039;&#039;, the issue is resolved, closed;&lt;br /&gt;
* &#039;&#039;unrelated&#039;&#039;, the issue does not related to the Context, closed;&lt;br /&gt;
* &#039;&#039;obsolete&#039;&#039;, the issue is already solved in recent Context releases, closed;&lt;br /&gt;
* &#039;&#039;duplicate&#039;&#039;, the issue is a duplicate, closed.&lt;br /&gt;
&lt;br /&gt;
Resolutions for &#039;&#039;poll&#039;&#039; Post objects:&lt;br /&gt;
* &#039;&#039;open&#039;&#039;, the poll is open for votes;&lt;br /&gt;
* &#039;&#039;closed&#039;&#039;, the poll is closed for votes.&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=File:Sugar-Network-diagram.png&amp;diff=92900</id>
		<title>File:Sugar-Network-diagram.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=File:Sugar-Network-diagram.png&amp;diff=92900"/>
		<updated>2014-07-06T19:08:11Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: Alsroot uploaded a new version of &amp;amp;quot;File:Sugar-Network-diagram.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Resources&amp;diff=92840</id>
		<title>Sugar Network/Resources</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Resources&amp;diff=92840"/>
		<updated>2014-06-29T11:02:51Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following diagram shows the full list of objects implemented by the Sugar Network [[Platform Team/Sugar Network/API|API]].&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot; align=&amp;quot;let&amp;quot;&lt;br /&gt;
| [[File:Sugar-Network-diagram.png|200px|thumb|Sugar Network objects]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-types&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Property types&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Generally, Sugar Network objects&#039; property types correspond to JSON types. The only exceptions mentioned in the following list:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;enum&#039;&#039;, is an enumerated type when a value is a string from the predefined list of constants;&lt;br /&gt;
* &#039;&#039;markdown&#039;&#039;, is a string formatted in the [[Wikipedia:Markdown|Markdown]] syntax;&lt;br /&gt;
* &#039;&#039;blob&#039;&#039;, is a file represented by string value which is a [[Wikipedia:Sha1|SHA-1]] digest of file&#039;s content; the file itself can be obtained from the {{Code|&#039;&#039;&#039;GET&#039;&#039;&#039; /blobs/&#039;&#039;DIGEST&#039;&#039;}} request;&lt;br /&gt;
* &#039;&#039;aggregated&#039;&#039;, is a list of JSON objects which has [[Sugar_Network/API#Aggregated_properties|special API]] to treat its items; each aggregated item has a unique identifier; items might be created not only by the object&#039;s authors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-author&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.author&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A dictionary of authors working on the corresponding resource. Keys are Sugar Network &#039;&#039;User&#039;&#039; guids, or, if particular author is not registered in the Sugar Network, full user names. Values are dictionaries with the following keys:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;name&#039;&#039;&amp;lt;br&amp;gt;Full author&#039;s name;&lt;br /&gt;
* &#039;&#039;role&#039;&#039;&amp;lt;br&amp;gt;An integer which is a bit-wise ORed value of the following constants:&lt;br /&gt;
** &#039;&#039;0x1&#039;&#039;, author is registered in the Sugar Network (and &#039;&#039;guid&#039;&#039; key is set);&lt;br /&gt;
** &#039;&#039;0x10000&#039;&#039;, author is the original author of the corresponding resource; if it is not set, user is only a maintainer, e.g., an uploader of a book which has its original authors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-status&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.status&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is a system level property which can be set only by node editors. It is a list of &amp;quot;badges&amp;quot; editors set depending on the object quality. Currently supported statuses are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;featured&#039;&#039;, the object is popped up by node editors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-pins&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.pins&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This property makes sense only for objects provided from a [[Sugar_Network/API#Client_proxy|local proxy]]. The property is intended to store local user&#039;s preferences or statuses remote object has in local environment. Currently supported values are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;favorite&#039;&#039;, set if a user has &#039;&#039;&amp;quot;stared&amp;quot;&#039;&#039; the object;&lt;br /&gt;
* &#039;&#039;checkin&#039;&#039;, applied to Context objects only, set if a user has &#039;&#039;&amp;quot;pinned&amp;quot;&#039;&#039; the context to keep its most recent version permanently in the local system;&lt;br /&gt;
* &#039;&#039;stale&#039;&#039;, applied to Context objects only, set if previously checked-in Context might have more fresh releases on the node; it is not possible to filter Contexts by this value;&lt;br /&gt;
* &#039;&#039;inprogress&#039;&#039;, applied to Context objects only, set if the Context is in the process of downloading content from the node; it is being temporally set before launching the Context or checking it in; it is not possible to filter Contexts by this value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;context-type&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Context.type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;activity&#039;&#039;, Sugar activity;&lt;br /&gt;
* &#039;&#039;book&#039;&#039;, books in various forms;&lt;br /&gt;
* &#039;&#039;talks&#039;&#039;, offline discussion groups;&lt;br /&gt;
* &#039;&#039;project&#039;&#039;, general purpose context to group related Post objects;&lt;br /&gt;
* &#039;&#039;package&#039;&#039;, GNU/Linux package metadata.&lt;br /&gt;
&lt;br /&gt;
Context type specifies how context, and all related resources, can be used. For example, &#039;&#039;activity&#039;&#039; type assumes activity bundles uploaded to the &#039;&#039;Context.releases&#039;&#039; property, or, [[#post-type|Post.type]] depends on Context type it was created for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;context-releases&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Context.releases&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Contexts with &#039;&#039;activity&#039;&#039; or &#039;&#039;book&#039;&#039; types might have releases, i.e., activity or book versions that users can download. The &#039;&#039;releases&#039;&#039; property is aggregated where each item describes one particular version. There is no need in working with the &#039;&#039;releases&#039;&#039; property directly, there are high-level API commands to [[Sugar_Network/API#Upload_releases|upload]] and [[Sugar_Network/API#Retrieving_releases|download]] releases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;post-type&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post.type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Choose Post types according to Context [[#context-type|types]] the Post belongs to.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;topic&#039;&#039;, general purpose discussion; &#039;&#039;talks&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;review&#039;&#039;, review the Context; &#039;&#039;activity&#039;&#039; or &#039;&#039;book&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;artefact&#039;&#039;, object generated by Context application; &#039;&#039;activity&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;issue&#039;&#039;, problem with the Context; &#039;&#039;project&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;poll&#039;&#039;, a poll within the Context; &#039;&#039;project&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;notice&#039;&#039;, auto-generated Post for updates within the Context; Context type independent;&lt;br /&gt;
* &#039;&#039;post&#039;&#039;, a comment for a parent Post object; Context type independent.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;post-topic&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post.topic&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Only &#039;&#039;post&#039;&#039; type Post objects belong to a parent Post which guid should be specified in the &#039;&#039;topic&#039;&#039; property. The system design assumes only a two-level Posts hierarchy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;post-topic&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post.resolution&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Post types &#039;&#039;issue&#039;&#039; and &#039;&#039;poll&#039;&#039; topics might have a resolution to expose the current status. The only way to change topic resolution is creating a dependent post with resolution property set.&lt;br /&gt;
&lt;br /&gt;
Resolutions for &#039;&#039;issue&#039;&#039; Post objects:&lt;br /&gt;
* &#039;&#039;unconfirmed&#039;&#039;, newly created issue;&lt;br /&gt;
* &#039;&#039;new&#039;&#039;, confirmed issue;&lt;br /&gt;
* &#039;&#039;needinfo&#039;&#039;, posted information about the issue is insufficient, more details needed;&lt;br /&gt;
* &#039;&#039;resolved&#039;&#039;, the issue is resolved, closed;&lt;br /&gt;
* &#039;&#039;unrelated&#039;&#039;, the issue does not related to the Context, closed;&lt;br /&gt;
* &#039;&#039;obsolete&#039;&#039;, the issue is already solved in recent Context releases, closed;&lt;br /&gt;
* &#039;&#039;duplicate&#039;&#039;, the issue is a duplicate, closed.&lt;br /&gt;
&lt;br /&gt;
Resolutions for &#039;&#039;poll&#039;&#039; Post objects:&lt;br /&gt;
* &#039;&#039;open&#039;&#039;, the poll is open for votes;&lt;br /&gt;
* &#039;&#039;closed&#039;&#039;, the poll is closed for votes.&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Resources&amp;diff=92839</id>
		<title>Sugar Network/Resources</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Resources&amp;diff=92839"/>
		<updated>2014-06-27T09:41:05Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following diagram shows the full list of objects implemented by the Sugar Network [[Platform Team/Sugar Network/API|API]].&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot; align=&amp;quot;let&amp;quot;&lt;br /&gt;
| [[File:Sugar-Network-diagram.png|200px|thumb|Sugar Network objects]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-types&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Property types&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Generally, Sugar Network objects&#039; property types correspond to JSON types. The only exceptions mentioned in the following list:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;enum&#039;&#039;, is an enumerated type when a value is a string from the predefined list of constants;&lt;br /&gt;
* &#039;&#039;markdown&#039;&#039;, is a string formatted in the [[Wikipedia:Markdown|Markdown]] syntax;&lt;br /&gt;
* &#039;&#039;blob&#039;&#039;, is a file represented by string value which is a [[Wikipedia:Sha1|SHA-1]] digest of file&#039;s content; the file itself can be obtained from the {{Code|&#039;&#039;&#039;GET&#039;&#039;&#039; /blobs/&#039;&#039;DIGEST&#039;&#039;}} request;&lt;br /&gt;
* &#039;&#039;aggregated&#039;&#039;, is a list of JSON objects which has [[Sugar_Network/API#Aggregated_properties|special API]] to treat its items; each aggregated item has a unique identifier; items might be created not only by the object&#039;s authors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-author&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.author&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A dictionary of authors working on the corresponding resource. Keys are Sugar Network &#039;&#039;User&#039;&#039; guids, or, if particular author is not registered in the Sugar Network, full user names. Values are dictionaries with the following keys:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;name&#039;&#039;&amp;lt;br&amp;gt;Full author&#039;s name;&lt;br /&gt;
* &#039;&#039;role&#039;&#039;&amp;lt;br&amp;gt;An integer which is a bit-wise ORed value of the following constants:&lt;br /&gt;
** &#039;&#039;0x1&#039;&#039;, author is registered in the Sugar Network (and &#039;&#039;guid&#039;&#039; key is set);&lt;br /&gt;
** &#039;&#039;0x10000&#039;&#039;, author is the original author of the corresponding resource; if it is not set, user is only a maintainer, e.g., an uploader of a book which has its original authors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-status&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.status&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is a system level property which can be set only by node editors. It is a list of &amp;quot;badges&amp;quot; editors set depending on the object quality. Currently supported statuses are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;featured&#039;&#039;, the object is popped up by node editors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-pins&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.pins&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This property makes sense only for objects provided from a [[Sugar_Network/API#Client_proxy|local proxy]]. The property is intended to store local user&#039;s preferences or statuses remote object has in local environment. Currently supported values are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;favorite&#039;&#039;, set if a user has &#039;&#039;&amp;quot;stared&amp;quot;&#039;&#039; the object;&lt;br /&gt;
* &#039;&#039;checkin&#039;&#039;, applied to Context objects only, set if a user has &#039;&#039;&amp;quot;pinned&amp;quot;&#039;&#039; the context to keep its most recent version permanently in the local system;&lt;br /&gt;
* &#039;&#039;stale&#039;&#039;, applied to Context objects only, set if previously checked-in Context might have more fresh releases on the node; it is not possible to filter Contexts by this value;&lt;br /&gt;
* &#039;&#039;inprogress&#039;&#039;, applied to Context objects only, set if the Context is in the process of downloading content from the node; it is being temporally set before launching the Context or checking it in; it is not possible to filter Contexts by this value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;context-type&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Context.type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;activity&#039;&#039;, Sugar activity;&lt;br /&gt;
* &#039;&#039;book&#039;&#039;, books in various forms;&lt;br /&gt;
* &#039;&#039;talks&#039;&#039;, offline discussion groups;&lt;br /&gt;
* &#039;&#039;project&#039;&#039;, general purpose context to group related Post objects;&lt;br /&gt;
* &#039;&#039;package&#039;&#039;, GNU/Linux package metadata.&lt;br /&gt;
&lt;br /&gt;
Context type specifies how context, and all related resources, can be used. For example, &#039;&#039;activity&#039;&#039; type assumes activity bundles uploaded to the &#039;&#039;Context.releases&#039;&#039; property, or, [[#post-type|Post.type]] depends on Context type it was created for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;context-releases&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Context.releases&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Contexts with &#039;&#039;activity&#039;&#039; or &#039;&#039;book&#039;&#039; types might have releases, i.e., activity or book versions that users can download. The &#039;&#039;releases&#039;&#039; property is aggregated where each item describes one particular version. There is no need in working with the &#039;&#039;releases&#039;&#039; property directly, there are high-level API commands to [[Sugar_Network/API#Upload_releases|upload]] and [[Sugar_Network/API#Retrieving_releases|download]] releases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;post-type&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post.type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Choose Post types according to Context [[#context-type|types]] the Post belongs to.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;topic&#039;&#039;, general purpose discussion; &#039;&#039;talks&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;review&#039;&#039;, review the Context; &#039;&#039;activity&#039;&#039; or &#039;&#039;book&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;artefact&#039;&#039;, object generated by Context application; &#039;&#039;activity&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;issue&#039;&#039;, problem with the Context; &#039;&#039;project&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;poll&#039;&#039;, a poll within the Context; &#039;&#039;project&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;notice&#039;&#039;, auto-generated Post for updates within the Context; Context type independent;&lt;br /&gt;
* &#039;&#039;post&#039;&#039;, a comment for a parent Post object; Context type independent.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;post-topic&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post.topic&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Only &#039;&#039;post&#039;&#039; type Post objects belong to a parent Post which guid should be specified in the &#039;&#039;topic&#039;&#039; property. The system design assumes only a two-level Posts hierarchy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;post-topic&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post.resolution&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Post types &#039;&#039;issue&#039;&#039; and &#039;&#039;poll&#039;&#039; topics might have a resolution to expose the current status. The only way to change topic resolution is creating a dependent post with resolution property set.&lt;br /&gt;
&lt;br /&gt;
Resolutions for &#039;&#039;issue&#039;&#039; Post objects:&lt;br /&gt;
* &#039;&#039;new&#039;&#039;, newly created issue;&lt;br /&gt;
* &#039;&#039;needinfo&#039;&#039;, posted information about the issue is insufficient, more details needed;&lt;br /&gt;
* &#039;&#039;resolved&#039;&#039;, the issue is resolved, closed;&lt;br /&gt;
* &#039;&#039;unrelated&#039;&#039;, the issue does not related to the Context, closed;&lt;br /&gt;
* &#039;&#039;obsolete&#039;&#039;, the issue is already solved in recent Context releases, closed;&lt;br /&gt;
* &#039;&#039;duplicate&#039;&#039;, the issue is a duplicate, closed.&lt;br /&gt;
&lt;br /&gt;
Resolutions for &#039;&#039;poll&#039;&#039; Post objects:&lt;br /&gt;
* &#039;&#039;open&#039;&#039;, the poll is open for votes;&lt;br /&gt;
* &#039;&#039;closed&#039;&#039;, the poll is closed for votes.&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Resources&amp;diff=92742</id>
		<title>Sugar Network/Resources</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Resources&amp;diff=92742"/>
		<updated>2014-06-04T12:02:24Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following diagram shows the full list of objects implemented by the Sugar Network [[Platform Team/Sugar Network/API|API]].&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot; align=&amp;quot;let&amp;quot;&lt;br /&gt;
| [[File:Sugar-Network-diagram.png|200px|thumb|Sugar Network objects]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-types&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Property types&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Generally, Sugar Network objects&#039; property types correspond to JSON types. The only exceptions mentioned in the following list:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;enum&#039;&#039;, is an enumerated type when a value is a string from the predefined list of constants;&lt;br /&gt;
* &#039;&#039;markdown&#039;&#039;, is a string formatted in the [[Wikipedia:Markdown|Markdown]] syntax;&lt;br /&gt;
* &#039;&#039;blob&#039;&#039;, is a file represented by string value which is a [[Wikipedia:Sha1|SHA-1]] digest of file&#039;s content; the file itself can be obtained from the {{Code|&#039;&#039;&#039;GET&#039;&#039;&#039; /blobs/&#039;&#039;DIGEST&#039;&#039;}} request;&lt;br /&gt;
* &#039;&#039;aggregated&#039;&#039;, is a list of JSON objects which has [[Sugar_Network/API#Aggregated_properties|special API]] to treat its items; each aggregated item has a unique identifier; items might be created not only by the object&#039;s authors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-author&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.author&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A dictionary of authors working on the corresponding resource. Keys are Sugar Network &#039;&#039;User&#039;&#039; guids, or, if particular author is not registered in the Sugar Network, full user names. Values are dictionaries with the following keys:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;name&#039;&#039;&amp;lt;br&amp;gt;Full author&#039;s name;&lt;br /&gt;
* &#039;&#039;role&#039;&#039;&amp;lt;br&amp;gt;An integer which is a bit-wise ORed value of the following constants:&lt;br /&gt;
** &#039;&#039;0x1&#039;&#039;, author is registered in the Sugar Network (and &#039;&#039;guid&#039;&#039; key is set);&lt;br /&gt;
** &#039;&#039;0x10000&#039;&#039;, author is the original author of the corresponding resource; if it is not set, user is only a maintainer, e.g., an uploader of a book which has its original authors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-status&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.status&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is a system level property which can be set only by node editors. It is a list of &amp;quot;badges&amp;quot; editors set depending on the object quality. Currently supported statuses are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;featured&#039;&#039;, the object is popped up by node editors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-pins&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.pins&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This property makes sense only for objects provided from a [[Sugar_Network/API#Client_proxy|local proxy]]. The property is intended to store local user&#039;s preferences or statuses remote object has in local environment. Currently supported values are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;favorite&#039;&#039;, set if a user has &#039;&#039;&amp;quot;stared&amp;quot;&#039;&#039; the object;&lt;br /&gt;
* &#039;&#039;checkin&#039;&#039;, applied to Context objects only, set if a user has &#039;&#039;&amp;quot;pinned&amp;quot;&#039;&#039; the context to keep its most recent version permanently in the local system;&lt;br /&gt;
* &#039;&#039;stale&#039;&#039;, applied to Context objects only, set if previously checked-in Context might have more fresh releases on the node; it is not possible to filter Contexts by this value;&lt;br /&gt;
* &#039;&#039;inprogress&#039;&#039;, applied to Context objects only, set if the Context is in the process of downloading content from the node; it is being temporally set before launching the Context or checking it in; it is not possible to filter Contexts by this value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;context-type&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Context.type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;activity&#039;&#039;, Sugar activity;&lt;br /&gt;
* &#039;&#039;book&#039;&#039;, books in various forms;&lt;br /&gt;
* &#039;&#039;talks&#039;&#039;, offline discussion groups;&lt;br /&gt;
* &#039;&#039;project&#039;&#039;, general purpose context to group related Post objects;&lt;br /&gt;
* &#039;&#039;package&#039;&#039;, GNU/Linux package metadata.&lt;br /&gt;
&lt;br /&gt;
Context type specifies how context, and all related resources, can be used. For example, &#039;&#039;activity&#039;&#039; type assumes activity bundles uploaded to the &#039;&#039;Context.releases&#039;&#039; property, or, [[#post-type|Post.type]] depends on Context type it was created for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;context-releases&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Context.releases&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Contexts with &#039;&#039;activity&#039;&#039; or &#039;&#039;book&#039;&#039; types might have releases, i.e., activity or book versions that users can download. The &#039;&#039;releases&#039;&#039; property is aggregated where each item describes one particular version. There is no need in working with the &#039;&#039;releases&#039;&#039; property directly, there are high-level API commands to [[Sugar_Network/API#Upload_releases|upload]] and [[Sugar_Network/API#Retrieving_releases|download]] releases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;post-type&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post.type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Choose Post types according to Context [[#context-type|types]] the Post belongs to.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;topic&#039;&#039;, general purpose discussion; &#039;&#039;talks&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;review&#039;&#039;, review the Context; &#039;&#039;activity&#039;&#039; or &#039;&#039;book&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;artefact&#039;&#039;, object generated by Context application; &#039;&#039;activity&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;question&#039;&#039;, Q&amp;amp;A request; &#039;&#039;project&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;issue&#039;&#039;, problem with the Context; &#039;&#039;project&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;poll&#039;&#039;, a poll within the Context; &#039;&#039;project&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;notice&#039;&#039;, auto-generated Post for updates within the Context; Context type independent;&lt;br /&gt;
* &#039;&#039;post&#039;&#039;, a comment for a parent Post object; Context type independent.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;post-topic&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post.topic&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Only &#039;&#039;post&#039;&#039; type Post objects belong to a parent Post which guid should be specified in the &#039;&#039;topic&#039;&#039; property. The system design assumes only a two-level Posts hierarchy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;post-topic&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post.resolution&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Post types &#039;&#039;question&#039;&#039;, &#039;&#039;issue&#039;&#039;, or, &#039;&#039;poll&#039;&#039; might have a resolution to expose the current status.&lt;br /&gt;
&lt;br /&gt;
Resolutions for &#039;&#039;question&#039;&#039; Post objects:&lt;br /&gt;
* &#039;&#039;takeback&#039;&#039;, the question is taken back by the author;&lt;br /&gt;
* Post guid which is a solution for the question.&lt;br /&gt;
&lt;br /&gt;
Resolutions for &#039;&#039;issue&#039;&#039; Post objects:&lt;br /&gt;
* &#039;&#039;new&#039;&#039;, newly created issue;&lt;br /&gt;
* &#039;&#039;needinfo&#039;&#039;, posted information about the issue is insufficient, more details needed;&lt;br /&gt;
* &#039;&#039;resolved&#039;&#039;, the issue is resolved, closed;&lt;br /&gt;
* &#039;&#039;unrelated&#039;&#039;, the issue does not related to the Context, closed;&lt;br /&gt;
* &#039;&#039;obsolete&#039;&#039;, the issue is already solved in recent Context releases, closed;&lt;br /&gt;
* &#039;&#039;duplicate&#039;&#039;, the issue is a duplicate, closed.&lt;br /&gt;
&lt;br /&gt;
Resolutions for &#039;&#039;poll&#039;&#039; Post objects:&lt;br /&gt;
* &#039;&#039;open&#039;&#039;, the poll is open for votes;&lt;br /&gt;
* &#039;&#039;closed&#039;&#039;, the poll is closed for votes.&lt;br /&gt;
&lt;br /&gt;
Only &#039;&#039;question&#039;&#039; and &#039;&#039;poll&#039;&#039; Post types allow changing resolution by the Post authors. Assigning resolution for &#039;&#039;issue&#039;&#039; type Posts is available for Context authors. Due to complex authority validations, setting resolution value can happen only via direct [[Sugar_Network/API#PUT-property|PUT]] command.&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Resources&amp;diff=92741</id>
		<title>Sugar Network/Resources</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Resources&amp;diff=92741"/>
		<updated>2014-06-04T12:01:31Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following diagram shows the full list of objects implemented by the Sugar Network [[Platform Team/Sugar Network/API|API]].&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot; align=&amp;quot;let&amp;quot;&lt;br /&gt;
| [[File:Sugar-Network-diagram.png|200px|thumb|Sugar Network objects]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-types&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Property types&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Generally, Sugar Network objects&#039; property types correspond to JSON types. The only exceptions mentioned in the following list:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;enum&#039;&#039;, is an enumerated type when a value is a string from the predefined list of constants;&lt;br /&gt;
* &#039;&#039;markdown&#039;&#039;, is a string formatted in the [[Wikipedia:Markdown|Markdown]] syntax;&lt;br /&gt;
* &#039;&#039;blob&#039;&#039;, is a file represented by string value which is a [[Wikipedia:Sha1|SHA-1]] digest of file&#039;s content; the file itself can be obtained from the {{Code|&#039;&#039;&#039;GET&#039;&#039;&#039; /blobs/&#039;&#039;DIGEST&#039;&#039;}} request;&lt;br /&gt;
* &#039;&#039;aggregated&#039;&#039;, is a list of JSON objects which has [[Sugar_Network/API#Aggregated_properties|special API]] to treat its items; each aggregated item has a unique identifier; items might be created not only by the object&#039;s authors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-author&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.author&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A dictionary of authors working on the corresponding resource. Keys are Sugar Network &#039;&#039;User&#039;&#039; guids, or, if particular author is not registered in the Sugar Network, full user names. Values are dictionaries with the following keys:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;name&#039;&#039;&amp;lt;br&amp;gt;Full author&#039;s name;&lt;br /&gt;
* &#039;&#039;role&#039;&#039;&amp;lt;br&amp;gt;An integer which is a bit-wise ORed value of the following constants:&lt;br /&gt;
** &#039;&#039;0x1&#039;&#039;, author is registered in the Sugar Network (and &#039;&#039;guid&#039;&#039; key is set);&lt;br /&gt;
** &#039;&#039;0x10000&#039;&#039;, author is the original author of the corresponding resource; if it is not set, user is only a maintainer, e.g., an uploader of a book which has its original authors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-status&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.status&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is a system level property which can be set only by node editors. It is a list of &amp;quot;badges&amp;quot; editors set depending on the object quality. Currently supported statuses are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;featured&#039;&#039;, the object is popped up by node editors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-pins&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.pins&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This property makes sense only for objects provided from a [[Sugar_Network/API#Client_proxy|local proxy]]. The property is intended to store local user&#039;s preferences or statuses remote object has in local environment. Currently supported values are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;favorite&#039;&#039;, set if a user has &#039;&#039;&amp;quot;stared&amp;quot;&#039;&#039; the object;&lt;br /&gt;
* &#039;&#039;checkin&#039;&#039;, applied to Context objects only, set if a user has &#039;&#039;&amp;quot;pinned&amp;quot;&#039;&#039; the context to keep its most recent version permanently in the local system;&lt;br /&gt;
* &#039;&#039;stale&#039;&#039;, applied to Context objects only, set if previously checked-in Context might have more fresh releases on the node; it is not possible to filter Contexts by this value;&lt;br /&gt;
* &#039;&#039;inprogress&#039;&#039;, applied to Context objects only, set if the Context is in the process of downloading content from the node; it is being temporally set before launching the Context or checking it in; it is not possible to filter Contexts by this value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;context-type&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Context.type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;activity&#039;&#039;, Sugar activity;&lt;br /&gt;
* &#039;&#039;book&#039;&#039;, books in various forms;&lt;br /&gt;
* &#039;&#039;talks&#039;&#039;, offline discussion groups;&lt;br /&gt;
* &#039;&#039;project&#039;&#039;, general purpose context to group related Post objects;&lt;br /&gt;
* &#039;&#039;package&#039;&#039;, GNU/Linux package metadata.&lt;br /&gt;
&lt;br /&gt;
Context type specifies how context, and all related resources, can be used. For example, &#039;&#039;activity&#039;&#039; type assumes activity bundles uploaded to the &#039;&#039;Context.releases&#039;&#039; property, or, [[#post-type|Post.type]] depends on Context type it was created for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;context-releases&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Context.releases&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Contexts with &#039;&#039;activity&#039;&#039; or &#039;&#039;book&#039;&#039; types might have releases, i.e., activity or book versions that users can download. The &#039;&#039;releases&#039;&#039; property is aggregated where each item describes one particular version. There is no need in working with the &#039;&#039;releases&#039;&#039; property directly, there are high-level API commands to [[Sugar_Network/API#Upload_releases|upload]] and [[Sugar_Network/API#Retrieving_releases|download]] releases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;post-type&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post.type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Choose Post types according to Context [[#context-type|types]] the Post belongs to.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;topic&#039;&#039;, general purpose discussion; &#039;&#039;talks&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;review&#039;&#039;, review the Context; &#039;&#039;activity&#039;&#039; or &#039;&#039;book&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;artefact&#039;&#039;, object generated by Context application; &#039;&#039;activity&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;question&#039;&#039;, Q&amp;amp;A request; &#039;&#039;project&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;issue&#039;&#039;, problem with the Context; &#039;&#039;project&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;poll&#039;&#039;, a poll within the Context; &#039;&#039;project&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;notice&#039;&#039;, auto-generated Post for updates within the Context; Context type independent;&lt;br /&gt;
* &#039;&#039;post&#039;&#039;, a comment for a parent Post object; Context type independent.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;post-topic&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post.topic&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Only &#039;&#039;post&#039;&#039; type Post objects belong to a parent Post which guid should be specified in the &#039;&#039;topic&#039;&#039; property. The system design assumes only a two-level Posts hierarchy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;post-topic&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post.resolution&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Post types &#039;&#039;question&#039;&#039;, &#039;&#039;issue&#039;&#039;, or, &#039;&#039;poll&#039;&#039; might have a resolution to expose the current status.&lt;br /&gt;
&lt;br /&gt;
Resolutions for &#039;&#039;question&#039;&#039; Post objects:&lt;br /&gt;
* &#039;&#039;takeback&#039;&#039;, the question is taken back by the author;&lt;br /&gt;
* Post guid which is a solution for the question.&lt;br /&gt;
&lt;br /&gt;
Resolutions for &#039;&#039;issue&#039;&#039; Post objects:&lt;br /&gt;
* &#039;&#039;new&#039;&#039;, newly created issue;&lt;br /&gt;
* &#039;&#039;needinfo&#039;&#039;, posted information about the issue is insufficient, more details needed;&lt;br /&gt;
* &#039;&#039;resolved&#039;&#039;, the issue is resolved, closed;&lt;br /&gt;
* &#039;&#039;unrelated&#039;&#039;, the issue does not related to the Context, closed;&lt;br /&gt;
* &#039;&#039;obsolete&#039;&#039;, the issue is already solved in recent Context releases, closed;&lt;br /&gt;
* &#039;&#039;duplicate&#039;&#039;, the issue is a duplicate, closed.&lt;br /&gt;
&lt;br /&gt;
Resolutions for &#039;&#039;poll&#039;&#039; Post objects:&lt;br /&gt;
* &#039;&#039;open&#039;&#039;, the poll is open for votes;&lt;br /&gt;
* &#039;&#039;closed&#039;&#039;, the poll is closed for votes.&lt;br /&gt;
&lt;br /&gt;
Only &#039;&#039;question&#039;&#039; and &#039;&#039;poll&#039;&#039; Post types allow changing resolution by the Post authors. Assigning resolution for &#039;&#039;issue&#039;&#039; type Posts is available for Context authors. Due to complex authority validations, setting resolution value can happen only via direct [[Sugar_Network/API#PUT-property|POST]] command.&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Sugar_Network/API&amp;diff=92740</id>
		<title>Sugar Network/API</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Sugar_Network/API&amp;diff=92740"/>
		<updated>2014-06-04T11:59:51Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: /* Base API */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the API that Sugar Network clients use to interact with a Sugar Network server. See also a guide to basic Sugar Network [[Sugar_Network/Concept|concepts]] and [[Platform_Team/Sugar_Network/Architecture|its twin page]] for a technical point of view. In addition, visit the [[Sugar_Network|introduction page]].&lt;br /&gt;
&lt;br /&gt;
{{Note/warning|Note|Until announcing API freeze, this document describes the most recent development version of the API.&amp;lt;br&amp;gt;You can find its implementation on the [[#API servers|node-devel.sugarlabs.org]] server.}}&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
To better understand this API, see a technical explanation of its [[Platform_Team/Sugar_Network/Architecture#Conceptual_level|conceptual level]] and [[#Sugar_Network_resources|objects model]] in particular.&lt;br /&gt;
&lt;br /&gt;
The API operates with [[Sugar Network]] [[#Sugar_Network_resources|resources]], which are collections of objects. All objects are identified by globally unique identifiers, GUIDs, and available for operation via [[#Base_API|basic actions]]. The API is being provided from a [[#API_servers|node server]] or a [[#Client_API|client]]. While processing requests, API providers generate [[#Notifications|events]].&lt;br /&gt;
&lt;br /&gt;
The API is [[Wikipedia:Restful|RESTful]], and is served via HTTP(S) using [[Wikipedia:Json|JSON]] notation. The common request url format is:&lt;br /&gt;
&lt;br /&gt;
 http[s]://&#039;&#039;SERVER&#039;&#039;[/&#039;&#039;RESOURCE&#039;&#039;[/&#039;&#039;GUID&#039;&#039;[/&#039;&#039;PROPERTY&#039;&#039;]]][?[cmd=&#039;&#039;COMMAND&#039;&#039;][&amp;amp;&#039;&#039;ARGUMENT&#039;&#039;=&#039;&#039;VALUE&#039;&#039;..]]&lt;br /&gt;
&lt;br /&gt;
When:&lt;br /&gt;
&lt;br /&gt;
* {{Code|SERVER}}, [[#API_servers|particular]] Sugar Network API server;&lt;br /&gt;
* {{Code|RESOURCE}}, name one of the [[#Sugar_Network_resources|existing]] resources;&lt;br /&gt;
* {{Code|GUID}}, the {{Code|RESOURCE}}&#039;s particular object;&lt;br /&gt;
* {{Code|PROPERTY}}, particular property of {{Code|GUID}} object;&lt;br /&gt;
* {{Code|COMMAND}}, optional command name; combination of HTTP request method ({{Code|GET}}, {{Code|POST}}, {{Code|PUT}}, or, {{Code|DELETE}}) and [possibly empty] {{Code|COMMAND}} composes the requested [[#Actions|action]];&lt;br /&gt;
* {{Code|ARGUMENT}}s and {{Code|VALUE}}s depend on the particular [[#Actions|action]].&lt;br /&gt;
&lt;br /&gt;
In most cases, the server replies in JSON notation. If a request fails, the replied JSON object will contain a {{Code|request}} key, with the original request, and {{Code|error}} key, with an error message.&lt;br /&gt;
&lt;br /&gt;
== API servers ==&lt;br /&gt;
&lt;br /&gt;
These are standard Sugar Network API servers publicly available.&lt;br /&gt;
&lt;br /&gt;
* [http://node-devel.sugarlabs.org/ node-devel.sugarlabs.org]&amp;lt;br&amp;gt;Development server which does not contain important data and is free for any experiments (administrative privileges for anonymous users);&lt;br /&gt;
&lt;br /&gt;
* [http://node-testing.sugarlabs.org/ node-testing.sugarlabs.org]&amp;lt;br&amp;gt;Recent stable release with regular data import from the production server; is still free for any experiments;&lt;br /&gt;
&lt;br /&gt;
* [http://node.sugarlabs.org/ node.sugarlabs.org]&amp;lt;br&amp;gt;Production server;&lt;br /&gt;
&lt;br /&gt;
* [http://localhost:5001/ localhost:5001]&amp;lt;br&amp;gt;default url to get access to [[#Client_API|local proxy]] provided from user side application.&lt;br /&gt;
&lt;br /&gt;
== Sugar Network resources ==&lt;br /&gt;
&lt;br /&gt;
{{:Sugar_Network/Resources}}&lt;br /&gt;
&lt;br /&gt;
== Base API ==&lt;br /&gt;
&lt;br /&gt;
List of actions common of all API providers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;POST&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;POST&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create new resource object.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to send:&lt;br /&gt;
* {{Code|&#039;&#039;RESOURCE}}&#039;s properties.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to receive:&lt;br /&gt;
* {{Code|guid}}, with globally unique identifier that specifies the created object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Modify resource object. By default, might be called only by {{Code|GUID}} creator.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to send:&lt;br /&gt;
* {{Code|RESOURCE}}&#039;s properties to modify.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Delete resource object. Actual object destruction won&#039;t happen, the object will be hidden. Garbage collection of hidden objects will be processed by Network administrators. By default, this action may be called only by the {{Code|GUID}} creator.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;[?offset=&#039;&#039;INTEGER&#039;&#039;][&amp;amp;limit=&#039;&#039;INTEGER&#039;&#039;][&amp;amp;query=&#039;&#039;STRING&#039;&#039;][&amp;amp;reply=&#039;&#039;PROP&#039;&#039;][&amp;amp;order_by=&amp;lt;nowiki&amp;gt;[+|-]&amp;lt;/nowiki&amp;gt;&#039;&#039;PROP&#039;&#039;][&amp;amp;group_by=&#039;&#039;PROP&#039;&#039;][&amp;amp;&#039;&#039;PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;][&amp;amp;&#039;&#039;!PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
Find resource objects.&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
* {{Code|offset}}, &#039;&#039;int&#039;&#039;&amp;lt;br&amp;gt;start index to return entries from, the default value is {{Code|0}};&lt;br /&gt;
* {{Code|limit}}, &#039;&#039;int&#039;&#039;&amp;lt;br&amp;gt;do not return more then specified value, maximal and default values are being setup on server side;&lt;br /&gt;
* {{Code|query}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;search request in [http://xapian.org/docs/queryparser.html Xapian] notation with the following additions:&lt;br /&gt;
** if property is boolean, integer or datetime, it supports searching by ranges: {{Code|&#039;&#039;PROP&#039;&#039;:[&#039;&#039;START&#039;&#039;]..[&#039;&#039;END&#039;&#039;]}};&lt;br /&gt;
** the statement {{Code|&#039;&#039;PROP&#039;&#039;&amp;lt;nowiki&amp;gt;:=&amp;lt;/nowiki&amp;gt;[&amp;quot;]&#039;&#039;VALUE&#039;&#039;[&amp;quot;]}} has the same effect as {{Code|QUERY_PROP}}; it is different to regular {{Code|&#039;&#039;PROP&#039;&#039;:&#039;&#039;VALUE&#039;&#039;}} where {{Code|VALUE}} might be a substring;&lt;br /&gt;
* {{Code|PROP}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;supplements {{Code|query}} with filtering by exact value of the {{Code|PROP}} property; the resulting query string will be {{Code|&#039;&#039;PROP&#039;&#039;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&#039;&#039;VALUE&#039;&#039; AND (&#039;&#039;QUERY&#039;&#039;)}}; argument is multiple;&lt;br /&gt;
* {{Code|!PROP}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;supplements {{Code|query}} by excluding exact value of the {{Code|PROP}} property; the resulting query string will be {{Code|NOT &#039;&#039;PROP&#039;&#039;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&#039;&#039;VALUE&#039;&#039; AND (&#039;&#039;QUERY&#039;&#039;)}}; argument is multiple;&lt;br /&gt;
* {{Code|reply}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;RESOURCE&#039;&#039; properties to return; by default, return only {{Code|guid}} property; argument is multiple;&lt;br /&gt;
* {{Code|order_by}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;property to sort the resulting list by; if starts with the {{Code|-}}, the order is descending, otherwise it is ascending;&lt;br /&gt;
* {{Code|group_by}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;property name to group resulting list by.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to receive:&lt;br /&gt;
* {{Code|total}}, total number in requested query (the reply might contain only the portion restricted by {{Code|limit}} request argument);&lt;br /&gt;
* {{Code|result}}, an array of dictionaries with resource object properties, dictionaries contain at least {{Code|guid}} property.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-resource&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;[?reply=&#039;&#039;PROP&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
* {{Code|reply}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;RESOURCE&#039;&#039; properties to return; by default, return only {{Code|guid}} property; argument is multiple;&lt;br /&gt;
&lt;br /&gt;
Return properties for a particular resource object.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to receive:&lt;br /&gt;
* properties that were specified in {{Code|reply}} argument(s), at least {{Code|guid}}.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT-property&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Modify particular resource property. By default, might be called only by {{Code|GUID}} creator.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-property&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Return property value for particular resource object.&lt;br /&gt;
&lt;br /&gt;
Data to receive:&lt;br /&gt;
* property value in JSON notation for regular properties;&lt;br /&gt;
* raw data or redirection for BLOB properties.&lt;br /&gt;
&lt;br /&gt;
=== Aggregated properties ===&lt;br /&gt;
&lt;br /&gt;
[[#resource-types|Aggregated]] properties have special API to treat their content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;POST-aggproperty&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;POST&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Submit new item. The command returns an id for newly created aggregated item. Depending on particular property, new items might be created not only by object&#039;s authors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT-aggproperty&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;/&#039;&#039;ID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Update existing aggregated item. Depending on particular property, the command is allowed either to object&#039;s authors or to aggregated item submitter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE-aggproperty&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;/&#039;&#039;ID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Delete existing aggregated item. Depending on particular property, the command is allowed either to object&#039;s authors or to aggregated item submitter.&lt;br /&gt;
&lt;br /&gt;
=== Notifications ===&lt;br /&gt;
&lt;br /&gt;
It is possible to subscribe to server events. Notification will happen using HTML5 [[wikipedia:Server-sent_events|Server-sent events]] (SSE).&lt;br /&gt;
&lt;br /&gt;
To start subscription, send the following request:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /?cmd=&#039;&#039;&#039;subscribe&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Response will be served with &#039;&#039;text/event-stream&#039;&#039; MIME type for default SSE message type. SSE message will be a JSONified object with the following, at least, attributes:&lt;br /&gt;
&lt;br /&gt;
* {{Code|event}}&amp;lt;br&amp;gt;event type.&lt;br /&gt;
&lt;br /&gt;
== Node API ==&lt;br /&gt;
&lt;br /&gt;
This is an API provided by Sugar Network nodes on top of [[#Base_API|base one]].&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
&lt;br /&gt;
Right now, the only way to be authenticated on a Sugar Network server is by running a [[Platform_Team/Sugar_Network/Implementation#sugar-network-client|local application]] on the client side and using the API it [[#Client_API|provides]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;TODO&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Authorization ===&lt;br /&gt;
&lt;br /&gt;
Read-only access is available for anonymous requests, except special content like machine serial numbers. But to process any changes, clients need to be authenticated.&lt;br /&gt;
&lt;br /&gt;
Right after creating any Sugar Network object, its author becomes the only user who can process any object modifications afterwards. Authority information will be kept in the [[#Sugar_Network_resources|author]] property and can be modified using the following commands.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;useradd&#039;&#039;&#039;&amp;amp;user=&#039;&#039;USER&#039;&#039;&amp;amp;role=&#039;&#039;ROLE&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Add another user who can modify the corresponding object. &#039;&#039;USER&#039;&#039; argument should be either &#039;&#039;User&#039;&#039; guid (for authors registered in the Sugar Network), or, full author name.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;userdel&#039;&#039;&#039;&amp;amp;user=&#039;&#039;USER&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Remove user from the authority list. It is not possible to remove yourself. &#039;&#039;USER&#039;&#039; argument should be either &#039;&#039;User&#039;&#039; guid (for authors registered in the Sugar Network), or, full author name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;TODO&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Retrieving releases ===&lt;br /&gt;
&lt;br /&gt;
To easy download Context [[#context-releases|releases]] and avoid reading raw &#039;&#039;Context.releases&#039;&#039; property, there are special high-level API commands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-solve&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;solve&#039;&#039;&#039;[&amp;amp;lsb_id=&#039;&#039;LSB_ID&#039;&#039;][&amp;amp;lsb_release=&#039;&#039;LSB_RELEASE&#039;&#039;][&amp;amp;assume=&#039;&#039;DEPENDENCY&#039;&#039;-&#039;&#039;VERSION&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
The command returns information about what particular releases should be downloaded depending on provided requirements. This command might return not only one release, e.g., activities might have dependencies either system packages or another Sugar Network Contexts.&lt;br /&gt;
&lt;br /&gt;
Solving requirements might be:&lt;br /&gt;
&lt;br /&gt;
* {{Code|LSB_ID}}, if Context releases depend on system packages, specify the [[Wikipedia:Linux_Standard_Base|LSB]] distributor id to consider while choosing particular packages;&lt;br /&gt;
* {{Code|LSB_RELEASE}}, if Context releases depend on system packages, specify the [[Wikipedia:Linux_Standard_Base|LSB]] release number of the distribution to consider while choosing particular packages;&lt;br /&gt;
* {{Code|DEPENDENCY-VERSION}}, the {{Code|assume}} argument instructs server to assume that specified [[Sugar_Network/Recipe_Specification#Dependencies|dependency]] is already available on client side and should be taken into account while solving; this is especially important for package dependencies when server considers packages available only from official repositories but users might have more recent package versions installed in local system; e.g., the above example request will fail without {{Code|sugar-0.94}} because neither {{Code|lsb_id}} nor {{Code|lsb_release}} were specified (even if LSB information is passed, server might not have information about what package versions come from official repositories).&lt;br /&gt;
&lt;br /&gt;
The resulting info is a JSON object with keys equal to Context guids and value objects for chosen release with the following keys:&lt;br /&gt;
&lt;br /&gt;
* {{Code|blob}}, bundle [[#resource-types|digest]] to download;&lt;br /&gt;
* {{Code|version}}, chosen version number;&lt;br /&gt;
* {{Code|title}}, the &#039;&#039;Context.title&#039;&#039; value;&lt;br /&gt;
* {{Code|command}}, a command to launch the bundle, only for Sugar activities.&lt;br /&gt;
&lt;br /&gt;
For example, the {{Code|&#039;&#039;&#039;GET&#039;&#039;&#039; &amp;lt;nowiki&amp;gt;/context/org.laptop.TurtleArtActivity?cmd=solve&amp;amp;assume=sugar-0.94&amp;lt;/nowiki&amp;gt;}} request returns:&lt;br /&gt;
&lt;br /&gt;
 {&lt;br /&gt;
   &amp;quot;org.laptop.TurtleArtActivity&amp;quot;: {&lt;br /&gt;
     &amp;quot;title&amp;quot;: &amp;quot;Turtle Blocks&amp;quot;,&lt;br /&gt;
     &amp;quot;version&amp;quot;: &amp;quot;202&amp;quot;,&lt;br /&gt;
     &amp;quot;blob&amp;quot;: &amp;quot;http://download.sugarlabs.org/activities/4027/turtleblocks-202.xo&amp;quot;,&lt;br /&gt;
     &amp;quot;content-type&amp;quot;: &amp;quot;application/vnd.olpc-sugar&amp;quot;,&lt;br /&gt;
     &amp;quot;size&amp;quot;: 4715955,&lt;br /&gt;
     &amp;quot;unpack_size&amp;quot;: 12873871,&lt;br /&gt;
     &amp;quot;command&amp;quot;: &amp;quot;sugar-activity TurtleArtActivity.TurtleArtActivity&amp;quot;,&lt;br /&gt;
   },&lt;br /&gt;
   &amp;quot;sugar&amp;quot;: {&lt;br /&gt;
     &amp;quot;version&amp;quot;: &amp;quot;0.94&amp;quot;,&lt;br /&gt;
   },&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-clone&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Like the [[#GET-solve|solve]] command, &#039;&#039;clone&#039;&#039; makes a solution but returns bundle itself, so, there is no way to get information about possible dependencies.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;clone&#039;&#039;&#039;[&amp;amp;lsb_id=&#039;&#039;LSB_ID&#039;&#039;][&amp;amp;lsb_release=&#039;&#039;LSB_RELEASE&#039;&#039;][&amp;amp;assume=&#039;&#039;DEPENDENCY&#039;&#039;-&#039;&#039;VERSION&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
=== Upload releases ===&lt;br /&gt;
&lt;br /&gt;
To easy upload Context [[#context-releases|releases]] and avoid writing to raw &#039;&#039;Context.releases&#039;&#039; property, there is a special high-level API command.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;POST&#039;&#039;&#039; /context?cmd=&#039;&#039;&#039;submit&#039;&#039;&#039;[&amp;amp;&#039;&#039;PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;][&amp;amp;initial]&lt;br /&gt;
&lt;br /&gt;
Where the {{Code|PROP}} arguments are optional release properties. The {{Code|initial}} argument asks the system to create new Context resource new release will belong to.&lt;br /&gt;
&lt;br /&gt;
The posting data might be two types,&lt;br /&gt;
&lt;br /&gt;
* Sugar activities in .xo bundles,&amp;lt;br&amp;gt;there is no need in {{Code|PROP}} arguments, all properties will be populated basing on metadata from a .xo bundle; including release notes from the {{Code|CHANGELOG}} file in [[Wikipedia:Markdown|Markdown]] notation; besides, only in this case {{Code|initial}} makes sense because it is the only way to get Context properties;&lt;br /&gt;
&lt;br /&gt;
* Arbitrary data,&amp;lt;br&amp;gt;all required release properties should be specified in {{Code|PROP}} arguments, at least &#039;&#039;context&#039;&#039; and &#039;&#039;version&#039;&#039;; &#039;&#039;license&#039;&#039; should be specified only if there are no existing releases to pickup license from.&lt;br /&gt;
&lt;br /&gt;
=== Node statistics ===&lt;br /&gt;
&lt;br /&gt;
The node statistics are about the entire server and depersonalized. Statistics are being collected by analyzing regular requests to an API server and stored for each Sugar Network node. To read such info, call the command:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /?cmd=&#039;&#039;&#039;stats&#039;&#039;&#039;[&amp;amp;start=&#039;&#039;SECONDS&#039;&#039;][&amp;amp;end=&#039;&#039;SECONDS&#039;&#039;][&amp;amp;event=&#039;&#039;EVENT&#039;&#039;][&amp;amp;limit=&#039;&#039;NUMBER&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
&lt;br /&gt;
* {{Code|start}} and {{Code|end}} is a time interval to get statistics for; if omitted, the beginning and the end of entire life cycle will be used;&lt;br /&gt;
* {{Code|event}}, multiple argument to specify what stats should be returned; if omitted, return all sources;&lt;br /&gt;
* {{Code|limit}}, number of stat records to return for the {{Code|start}}-{{Code|end}} interval; note that this amount is not precise, the final resultset might be smaller or bigger depending on chosen resolution; stats resolution depends on node configuration, default values are 1 day, 10 days, 30 days, 365 days; if omitted, return {{Code|end}} record only.&lt;br /&gt;
&lt;br /&gt;
Possible events are:&lt;br /&gt;
&lt;br /&gt;
* {{Code|users}}, total number of existing &#039;&#039;User&#039;&#039; objects;&lt;br /&gt;
* {{Code|contexts}}, total number of existing &#039;&#039;Context&#039;&#039; objects;&lt;br /&gt;
* {{Code|released}}, average number of newly uploaded &#039;&#039;Context.releases&#039;&#039; for specified time frame;&lt;br /&gt;
* {{Code|solved}}, average number of requested &#039;&#039;Context&#039;&#039; [[#GET-solve|solutions]] for specified time frame; note that this value does not equal to the number of solution usages on client side since solutions might be cached;&lt;br /&gt;
* {{Code|reported}}, average number of newly uploaded failure &#039;&#039;Report&#039;&#039; objects for specified time frame;&lt;br /&gt;
* {{Code|topics}}, total number of top-level &#039;&#039;Post&#039;&#039; objects;&lt;br /&gt;
* {{Code|posts}}, total number of dependent &#039;&#039;Post&#039;&#039; objects.&lt;br /&gt;
&lt;br /&gt;
== Client API ==&lt;br /&gt;
&lt;br /&gt;
The reasons to proxy Sugar Network data on users side:&lt;br /&gt;
&lt;br /&gt;
* Seamless support [[#Offline mode|offline workflow]];&lt;br /&gt;
* [[#Launching|One-click launch]] Sugar activities hosted on Sugar Network.&lt;br /&gt;
&lt;br /&gt;
Proxying happens by providing the same Sugar Network API (with some extra functionality, see below) from&lt;br /&gt;
[[Platform_Team/Sugar_Network/Implementation#sugar-network-client|local process]] launched beforehand.&lt;br /&gt;
&lt;br /&gt;
=== Offline mode ===&lt;br /&gt;
&lt;br /&gt;
Being connected to a Sugar Network node, local proxy provides [[#Node_API|original API]] from the node. If the connection is lost, the proxy will switch to local Sugar Network storage and continue working providing only [[#Base_API|base API]]. Any content created in offline mode will be uploaded to the node after getting a connection back.&lt;br /&gt;
&lt;br /&gt;
Besides, local Sugar Network storage will be reused to keep users preferences, such as:&lt;br /&gt;
&lt;br /&gt;
* Favorited Contexts&amp;lt;br&amp;gt;to select preferred &#039;&#039;Context&#039;&#039; resources; these Contexts will be marked by {{Code|favorite}} value in the &#039;&#039;Context.layer&#039;&#039; property;&lt;br /&gt;
&lt;br /&gt;
* Checked-in Contexts&amp;lt;br&amp;gt;to keep most recent Context (for &#039;&#039;activity&#039;&#039; and &#039;&#039;book&#039;&#039; types) version in local storage to make it available in offline; note that there is no need in checking-in to speedup online lunch, versions are being [[#Launching|cached]] anyway; these Contexts will be marked by {{Code|checkin}} value in the &#039;&#039;Context.layer&#039;&#039; property.&lt;br /&gt;
&lt;br /&gt;
To control users preferences there are special API commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT_favorite&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;favorite&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Set favorite status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE_favorite&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;favorite&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Unset favorite status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT_checkin&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;checkin&#039;&#039;&#039;[&amp;amp;spawn]&lt;br /&gt;
&lt;br /&gt;
Check-in the specified Context. By default, the command will return streamed &#039;&#039;text/event-stream&#039;&#039; MIME type data to monitor the progress. If the {{Code|spawn}} argument is specified, the command will exit immediately with [[#Notifications|asynchronous sending]] progress events.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE_checkin&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;checkin&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Checkout the Context.&lt;br /&gt;
&lt;br /&gt;
=== Launching ===&lt;br /&gt;
&lt;br /&gt;
Sugar Network Contexts (for &#039;&#039;activity&#039;&#039; and &#039;&#039;book&#039;&#039; types) can be launched as-is. The launching process is implicit and includes selecting the most recent (and appropriate for software contexts) version, downloading bundles from the Sugar Network, installing missed [[Sugar_Network/Recipe_Specification#Dependencies|software dependencies]], execution itself. All downloaded bundles will be cached [with further garbage collecting] to speedup further launching.&lt;br /&gt;
&lt;br /&gt;
Sugar activities will be directly executed. Book Contexts will be opened in the proper application according to its MIME type.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;launch&#039;&#039;&#039;[&amp;amp;args=&#039;&#039;ARG&#039;&#039;][&amp;amp;activity_id=&#039;&#039;ACTIVITY_ID&#039;&#039;][&amp;amp;object_id=&#039;&#039;OBJECT_ID&#039;&#039;][&amp;amp;uri=&#039;&#039;URI&#039;&#039;][&amp;amp;app=&#039;&#039;APP&#039;&#039;][&amp;amp;spawn]&lt;br /&gt;
&lt;br /&gt;
Arguments that make sense only for Sugar activities:&lt;br /&gt;
&lt;br /&gt;
* {{Code|ARG}}, command line argument to pass to launched activities, repeat {{Code|ARG}} for each argument;&lt;br /&gt;
* {{Code|ACTIVITY_ID}}, internal activity id which will be auto set if omitted;&lt;br /&gt;
* {{Code|OBJECT_ID}}, Journal object id to resume;&lt;br /&gt;
* {{Code|URI}}, URL to resume if activity supports this functionality.&lt;br /&gt;
&lt;br /&gt;
Arguments that make sense only for books:&lt;br /&gt;
&lt;br /&gt;
* {{Code|APP}}, specify application Context to open the book by; if omitted, the system will try to find most appropriate option, among all existing software Contexts.&lt;br /&gt;
&lt;br /&gt;
Common arguments:&lt;br /&gt;
&lt;br /&gt;
* {{Code|spawn}}, by default, the command will return streamed &#039;&#039;text/event-stream&#039;&#039; MIME type data to monitor the whole launching process until exiting the application; if the {{Code|spawn}} argument is specified, the command will exit immediately with [[#Notifications|asynchronous sending]] launching events.&lt;br /&gt;
&lt;br /&gt;
== Experimental API ==&lt;br /&gt;
&lt;br /&gt;
There is no guaranty that the following API will be stated as stable or frozen sometime.&lt;br /&gt;
&lt;br /&gt;
=== Access to Sugar Journal ===&lt;br /&gt;
&lt;br /&gt;
It is possible to get access to local Sugar Journal using special, &#039;&#039;journal&#039;&#039;, resource provided from [[#Client_API|client API]]. This kind of access might be useful when local applications cannot use DBus sugar-datastore API, e.g., [[wikipedia:Javascript|Javascript]] applications. API to Journal is restricted only to read-only access:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /journal?offset=&#039;&#039;INTEGER&#039;&#039;&amp;amp;limit=&#039;&#039;INTEGER&#039;&#039;[&amp;amp;query=&#039;&#039;STRING&#039;&#039;][&amp;amp;order_by=&amp;lt;nowiki&amp;gt;[+|-]&amp;lt;/nowiki&amp;gt;&#039;&#039;PROP&#039;&#039;][&amp;amp;&#039;&#039;QUERY_PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;[&amp;amp;...]]&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /journal/&#039;&#039;JOURNAL_ID&#039;&#039;[?reply=&#039;&#039;PROP&#039;&#039;[,..]]&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /journal/&#039;&#039;JOURNAL_ID&#039;&#039;/&#039;&#039;PROPERTY&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
Being HTTP based, Sugar Network API can be used in any manner regular HTTP requests can be handled. But for command-line access, there is a handy tool, {{Code|sugar-network}}, which takes care about Sugar Network specific like launching local API (if it is not already available) to get access to [[#Client_API|local proxy]].&lt;br /&gt;
&lt;br /&gt;
The sugar-network command-line format is below. Call {{Code|sugar-network --help}} for more detailed info.&lt;br /&gt;
&lt;br /&gt;
 sugar-network GET|POST|PUT|DELETE &#039;&#039;PATH&#039;&#039; &#039;&#039;ARG=VALUE&#039;&#039; [..]&lt;br /&gt;
&lt;br /&gt;
* {{Code|PATH}}, is an url path;&lt;br /&gt;
* {{Code|ARG&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;VALUE}}, request arguments as they being passed to in url.&lt;br /&gt;
&lt;br /&gt;
{{Code|POST}} and {{Code|PUT}} commands require data to pass, use the following command-line arguments:&lt;br /&gt;
&lt;br /&gt;
* {{Code|-f FILE}} to specify the file to pass;&lt;br /&gt;
* {{Code|-d DATA}} to specify string to pass;&lt;br /&gt;
* {{Code|-j}} posted data should be encoded into JSON before posting.&lt;br /&gt;
&lt;br /&gt;
== Getting involved ==&lt;br /&gt;
&lt;br /&gt;
{{:Sugar_Network/Feedback}}&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Resources&amp;diff=92739</id>
		<title>Sugar Network/Resources</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Resources&amp;diff=92739"/>
		<updated>2014-06-04T11:59:34Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following diagram shows the full list of objects implemented by the Sugar Network [[Platform Team/Sugar Network/API|API]].&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot; align=&amp;quot;let&amp;quot;&lt;br /&gt;
| [[File:Sugar-Network-diagram.png|200px|thumb|Sugar Network objects]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-types&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Property types&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Generally, Sugar Network objects&#039; property types correspond to JSON types. The only exceptions mentioned in the following list:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;enum&#039;&#039;, is an enumerated type when a value is a string from the predefined list of constants;&lt;br /&gt;
* &#039;&#039;markdown&#039;&#039;, is a string formatted in the [[Wikipedia:Markdown|Markdown]] syntax;&lt;br /&gt;
* &#039;&#039;blob&#039;&#039;, is a file represented by string value which is a [[Wikipedia:Sha1|SHA-1]] digest of file&#039;s content; the file itself can be obtained from the {{Code|&#039;&#039;&#039;GET&#039;&#039;&#039; /blobs/&#039;&#039;DIGEST&#039;&#039;}} request;&lt;br /&gt;
* &#039;&#039;aggregated&#039;&#039;, is a list of JSON objects which has [[Sugar_Network/API#Aggregated_properties|special API]] to treat its items; each aggregated item has a unique identifier; items might be created not only by the object&#039;s authors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-author&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.author&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A dictionary of authors working on the corresponding resource. Keys are Sugar Network &#039;&#039;User&#039;&#039; guids, or, if particular author is not registered in the Sugar Network, full user names. Values are dictionaries with the following keys:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;name&#039;&#039;&amp;lt;br&amp;gt;Full author&#039;s name;&lt;br /&gt;
* &#039;&#039;role&#039;&#039;&amp;lt;br&amp;gt;An integer which is a bit-wise ORed value of the following constants:&lt;br /&gt;
** &#039;&#039;0x1&#039;&#039;, author is registered in the Sugar Network (and &#039;&#039;guid&#039;&#039; key is set);&lt;br /&gt;
** &#039;&#039;0x10000&#039;&#039;, author is the original author of the corresponding resource; if it is not set, user is only a maintainer, e.g., an uploader of a book which has its original authors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-status&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.status&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is a system level property which can be set only by node editors. It is a list of &amp;quot;badges&amp;quot; editors set depending on the object quality. Currently supported statuses are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;featured&#039;&#039;, the object is popped up by node editors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-pins&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.pins&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This property makes sense only for objects provided from a [[Sugar_Network/API#Client_proxy|local proxy]]. The property is intended to store local user&#039;s preferences or statuses remote object has in local environment. Currently supported values are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;favorite&#039;&#039;, set if a user has &#039;&#039;&amp;quot;stared&amp;quot;&#039;&#039; the object;&lt;br /&gt;
* &#039;&#039;checkin&#039;&#039;, applied to Context objects only, set if a user has &#039;&#039;&amp;quot;pinned&amp;quot;&#039;&#039; the context to keep its most recent version permanently in the local system;&lt;br /&gt;
* &#039;&#039;stale&#039;&#039;, applied to Context objects only, set if previously checked-in Context might have more fresh releases on the node; it is not possible to filter Contexts by this value;&lt;br /&gt;
* &#039;&#039;inprogress&#039;&#039;, applied to Context objects only, set if the Context is in the process of downloading content from the node; it is being temporally set before launching the Context or checking it in; it is not possible to filter Contexts by this value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;context-type&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Context.type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;activity&#039;&#039;, Sugar activity;&lt;br /&gt;
* &#039;&#039;book&#039;&#039;, books in various forms;&lt;br /&gt;
* &#039;&#039;talks&#039;&#039;, offline discussion groups;&lt;br /&gt;
* &#039;&#039;project&#039;&#039;, general purpose context to group related Post objects;&lt;br /&gt;
* &#039;&#039;package&#039;&#039;, GNU/Linux package metadata.&lt;br /&gt;
&lt;br /&gt;
Context type specifies how context, and all related resources, can be used. For example, &#039;&#039;activity&#039;&#039; type assumes activity bundles uploaded to the &#039;&#039;Context.releases&#039;&#039; property, or, [[#post-type|Post.type]] depends on Context type it was created for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;context-releases&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Context.releases&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Contexts with &#039;&#039;activity&#039;&#039; or &#039;&#039;book&#039;&#039; types might have releases, i.e., activity or book versions that users can download. The &#039;&#039;releases&#039;&#039; property is aggregated where each item describes one particular version. There is no need in working with the &#039;&#039;releases&#039;&#039; property directly, there are high-level API commands to [[Sugar_Network/API#Upload_releases|upload]] and [[Sugar_Network/API#Retrieving_releases|download]] releases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;post-type&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post.type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Choose Post types according to Context [[#context-type|types]] the Post belongs to.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;topic&#039;&#039;, general purpose discussion; &#039;&#039;talks&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;review&#039;&#039;, review the Context; &#039;&#039;activity&#039;&#039; or &#039;&#039;book&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;artefact&#039;&#039;, object generated by Context application; &#039;&#039;activity&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;question&#039;&#039;, Q&amp;amp;A request; &#039;&#039;project&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;issue&#039;&#039;, problem with the Context; &#039;&#039;project&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;poll&#039;&#039;, a poll within the Context; &#039;&#039;project&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;notice&#039;&#039;, auto-generated Post for updates within the Context; Context type independent;&lt;br /&gt;
* &#039;&#039;post&#039;&#039;, a comment for a parent Post object; Context type independent.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;post-topic&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post.topic&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Only &#039;&#039;post&#039;&#039; type Post objects belong to a parent Post which guid should be specified in the &#039;&#039;topic&#039;&#039; property. The system design assumes only a two-level Posts hierarchy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;post-topic&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post.resolution&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Post types &#039;&#039;question&#039;&#039;, &#039;&#039;issue&#039;&#039;, or, &#039;&#039;poll&#039;&#039; might have a resolution to expose the current status.&lt;br /&gt;
&lt;br /&gt;
Resolutions for &#039;&#039;question&#039;&#039; Post objects:&lt;br /&gt;
* &#039;&#039;takeback&#039;&#039;, the question is taken back by the author;&lt;br /&gt;
* Post guid which is a solution for the question.&lt;br /&gt;
&lt;br /&gt;
Resolutions for &#039;&#039;issue&#039;&#039; Post objects:&lt;br /&gt;
* &#039;&#039;new&#039;&#039;, newly created issue;&lt;br /&gt;
* &#039;&#039;needinfo&#039;&#039;, posted information about the issue is insufficient, more details needed;&lt;br /&gt;
* &#039;&#039;resolved&#039;&#039;, the issue is resolved, closed;&lt;br /&gt;
* &#039;&#039;unrelated&#039;&#039;, the issue does not related to the Context, closed;&lt;br /&gt;
* &#039;&#039;obsolete&#039;&#039;, the issue is already solved in recent Context releases, closed;&lt;br /&gt;
* &#039;&#039;duplicate&#039;&#039;, the issue is a duplicate, closed.&lt;br /&gt;
&lt;br /&gt;
Resolutions for &#039;&#039;poll&#039;&#039; Post objects:&lt;br /&gt;
* &#039;&#039;open&#039;&#039;, the poll is open for votes;&lt;br /&gt;
* &#039;&#039;closed&#039;&#039;, the poll is closed for votes.&lt;br /&gt;
&lt;br /&gt;
Only the &#039;&#039;question&#039;&#039; and &#039;&#039;poll&#039;&#039; Post types allow changing resolution by the Post authors. Assigning resolution for &#039;&#039;issue&#039;&#039; type Posts is available for Context authors. Due to complex authority validations, setting resolution value can happen only via direct [[Sugar_Network/API#PUT-property|POST]] command.&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=File:Sugar-Network-diagram.png&amp;diff=92738</id>
		<title>File:Sugar-Network-diagram.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=File:Sugar-Network-diagram.png&amp;diff=92738"/>
		<updated>2014-06-04T11:43:21Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: Alsroot uploaded a new version of &amp;amp;quot;File:Sugar-Network-diagram.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Resources&amp;diff=92735</id>
		<title>Sugar Network/Resources</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Resources&amp;diff=92735"/>
		<updated>2014-06-04T07:52:37Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following diagram shows the full list of objects implemented by the Sugar Network [[Platform Team/Sugar Network/API|API]].&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot; align=&amp;quot;let&amp;quot;&lt;br /&gt;
| [[File:Sugar-Network-diagram.png|200px|thumb|Sugar Network objects]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-types&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Property types&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Generally, Sugar Network objects&#039; property types correspond to JSON types. The only exceptions mentioned in the following list:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;enum&#039;&#039;, is an enumerated type when a value is a string from the predefined list of constants;&lt;br /&gt;
* &#039;&#039;markdown&#039;&#039;, is a string formatted in the [[Wikipedia:Markdown|Markdown]] syntax;&lt;br /&gt;
* &#039;&#039;blob&#039;&#039;, is a file represented by string value which is a [[Wikipedia:Sha1|SHA-1]] digest of file&#039;s content; the file itself can be obtained from the {{Code|&#039;&#039;&#039;GET&#039;&#039;&#039; /blobs/&#039;&#039;DIGEST&#039;&#039;}} request;&lt;br /&gt;
* &#039;&#039;aggregated&#039;&#039;, is a list of JSON objects which has [[Sugar_Network/API#Aggregated_properties|special API]] to treat its items; each aggregated item has a unique identifier; items might be created not only by the object&#039;s authors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-author&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.author&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A dictionary of authors working on the corresponding resource. Keys are Sugar Network &#039;&#039;User&#039;&#039; guids, or, if particular author is not registered in the Sugar Network, full user names. Values are dictionaries with the following keys:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;name&#039;&#039;&amp;lt;br&amp;gt;Full author&#039;s name;&lt;br /&gt;
* &#039;&#039;role&#039;&#039;&amp;lt;br&amp;gt;An integer which is a bit-wise ORed value of the following constants:&lt;br /&gt;
** &#039;&#039;0x1&#039;&#039;, author is registered in the Sugar Network (and &#039;&#039;guid&#039;&#039; key is set);&lt;br /&gt;
** &#039;&#039;0x10000&#039;&#039;, author is the original author of the corresponding resource; if it is not set, user is only a maintainer, e.g., an uploader of a book which has its original authors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-status&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.status&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is a system level property which can be set only by node editors. It is a list of &amp;quot;badges&amp;quot; editors set depending on the object quality. Currently supported statuses are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;featured&#039;&#039;, the object is popped up by node editors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-pins&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.pins&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This property makes sense only for objects provided from a [[Sugar_Network/API#Client_proxy|local proxy]]. The property is intended to store local user&#039;s preferences or statuses remote object has in local environment. Currently supported values are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;favorite&#039;&#039;, set if a user has &#039;&#039;&amp;quot;stared&amp;quot;&#039;&#039; the object;&lt;br /&gt;
* &#039;&#039;checkin&#039;&#039;, applied to Context objects only, set if a user has &#039;&#039;&amp;quot;pinned&amp;quot;&#039;&#039; the context to keep its most recent version permanently in the local system;&lt;br /&gt;
* &#039;&#039;stale&#039;&#039;, applied to Context objects only, set if previously checked-in Context might have more fresh releases on the node; it is not possible to filter Contexts by this value;&lt;br /&gt;
* &#039;&#039;inprogress&#039;&#039;, applied to Context objects only, set if the Context is in the process of downloading content from the node; it is being temporally set before launching the Context or checking it in; it is not possible to filter Contexts by this value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;context-type&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Context.type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;activity&#039;&#039;, Sugar activity;&lt;br /&gt;
* &#039;&#039;book&#039;&#039;, books in various forms;&lt;br /&gt;
* &#039;&#039;talks&#039;&#039;, offline discussion groups;&lt;br /&gt;
* &#039;&#039;project&#039;&#039;, general purpose context to group related Post objects;&lt;br /&gt;
* &#039;&#039;package&#039;&#039;, GNU/Linux package metadata.&lt;br /&gt;
&lt;br /&gt;
Context type specifies how context, and all related resources, can be used. For example, &#039;&#039;activity&#039;&#039; type assumes activity bundles uploaded to the &#039;&#039;Context.releases&#039;&#039; property, or, [[#post-type|Post.type]] depends on Context type it was created for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;context-releases&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Context.releases&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Contexts with &#039;&#039;activity&#039;&#039; or &#039;&#039;book&#039;&#039; types might have releases, i.e., activity or book versions that users can download. The &#039;&#039;releases&#039;&#039; property is aggregated where each item describes one particular version. There is no need in working with the &#039;&#039;releases&#039;&#039; property directly, there are high-level API commands to [[Sugar_Network/API#Upload_releases|upload]] and [[Sugar_Network/API#Retrieving_releases|download]] releases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;post-type&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post.type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Choose Post types according to Context [[#context-type|types]] the Post belongs to.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;topic&#039;&#039;, general purpose discussion; &#039;&#039;talks&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;review&#039;&#039;, review the Context; &#039;&#039;activity&#039;&#039; or &#039;&#039;book&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;artefact&#039;&#039;, object generated by Context application; &#039;&#039;activity&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;question&#039;&#039;, Q&amp;amp;A request; &#039;&#039;project&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;issue&#039;&#039;, problem with the Context; &#039;&#039;project&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;poll&#039;&#039;, a poll within the Context; &#039;&#039;project&#039;&#039; Contexts;&lt;br /&gt;
* &#039;&#039;notice&#039;&#039;, auto-generated Post for updates within the Context; Context type independent;&lt;br /&gt;
* &#039;&#039;post&#039;&#039;, a comment for a parent Post object; Context type independent.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;post-topic&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post.topic&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Only &#039;&#039;post&#039;&#039; type Post objects belong to a parent Post which guid should be specified in the &#039;&#039;topic&#039;&#039; property. The system design assumes only a two-level Posts hierarchy.&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Resources&amp;diff=92702</id>
		<title>Sugar Network/Resources</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Resources&amp;diff=92702"/>
		<updated>2014-05-26T20:26:07Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following diagram shows the full list of objects implemented by the Sugar Network [[Platform Team/Sugar Network/API|API]].&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot; align=&amp;quot;let&amp;quot;&lt;br /&gt;
| [[File:Sugar-Network-diagram.png|200px|thumb|Sugar Network objects]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-types&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Property types&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Generally, Sugar Network objects&#039; property types correspond to JSON types. The only exceptions mentioned in the following list:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;enum&#039;&#039;, is an enumerated type when a value is a string from the predefined list of constants;&lt;br /&gt;
* &#039;&#039;markdown&#039;&#039;, is a string formatted in the [[Wikipedia:Markdown|Markdown]] syntax;&lt;br /&gt;
* &#039;&#039;blob&#039;&#039;, is a file represented by string value which is a [[Wikipedia:Sha1|SHA-1]] digest of file&#039;s content; the file itself can be obtained from the {{Code|&#039;&#039;&#039;GET&#039;&#039;&#039; /blobs/&#039;&#039;DIGEST&#039;&#039;}} request;&lt;br /&gt;
* &#039;&#039;aggregated&#039;&#039;, is a list of JSON objects which has [[Sugar_Network/API#Aggregated_properties|special API]] to treat its items; each aggregated item has a unique identifier; items might be created not only by the object&#039;s authors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-author&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.author&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A dictionary of authors working on the corresponding resource. Keys are Sugar Network &#039;&#039;User&#039;&#039; guids, or, if particular author is not registered in the Sugar Network, full user names. Values are dictionaries with the following keys:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;name&#039;&#039;&amp;lt;br&amp;gt;Full author&#039;s name;&lt;br /&gt;
* &#039;&#039;role&#039;&#039;&amp;lt;br&amp;gt;An integer which is a bit-wise ORed value of the following constants:&lt;br /&gt;
** &#039;&#039;0x1&#039;&#039;, author is registered in the Sugar Network (and &#039;&#039;guid&#039;&#039; key is set);&lt;br /&gt;
** &#039;&#039;0x10000&#039;&#039;, author is the original author of the corresponding resource; if it is not set, user is only a maintainer, e.g., an uploader of a book which has its original authors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-status&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.status&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is a system level property which can be set only by node editors. It is a list of &amp;quot;badges&amp;quot; editors set depending on the object quality. Currently supported statuses are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;featured&#039;&#039;, the object is popped up by node editors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-pins&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.pins&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This property makes sense only for objects provided from a [[Sugar_Network/API#Client_proxy|local proxy]]. The property is intended to store local user&#039;s preferences or statuses remote object has in local environment. Currently supported values are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;favorite&#039;&#039;, set if a user has &#039;&#039;&amp;quot;stared&amp;quot;&#039;&#039; the object;&lt;br /&gt;
* &#039;&#039;checkin&#039;&#039;, applied to Context objects only, set if a user has &#039;&#039;&amp;quot;pinned&amp;quot;&#039;&#039; the context to keep its most recent version permanently in the local system;&lt;br /&gt;
* &#039;&#039;stale&#039;&#039;, applied to Context objects only, set if previously checked-in Context might have more fresh releases on the node; it is not possible to filter Contexts by this value;&lt;br /&gt;
* &#039;&#039;inprogress&#039;&#039;, applied to Context objects only, set if the Context is in the process of downloading content from the node; it is being temporally set before launching the Context or checking it in; it is not possible to filter Contexts by this value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;context-type&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Context.type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;activity&#039;&#039;, Sugar activity;&lt;br /&gt;
* &#039;&#039;book&#039;&#039;, books in various forms;&lt;br /&gt;
* &#039;&#039;talks&#039;&#039;, offline discussion groups;&lt;br /&gt;
* &#039;&#039;project&#039;&#039;, general purpose context to group related Post objects;&lt;br /&gt;
* &#039;&#039;package&#039;&#039;, GNU/Linux package metadata.&lt;br /&gt;
&lt;br /&gt;
Context type specifies how context, and all related resources, can be used. For example, &#039;&#039;activity&#039;&#039; type assumes activity bundles uploaded to the &#039;&#039;Context.releases&#039;&#039; property, or, &#039;&#039;project&#039;&#039; contexts might have associated &#039;&#039;issue&#039;&#039; type Post objects.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;context-releases&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Context.releases&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Contexts with &#039;&#039;activity&#039;&#039; or &#039;&#039;book&#039;&#039; types might have releases, i.e., activity or book versions that users can download. The &#039;&#039;releases&#039;&#039; property is aggregated where each item describes one particular version. There is no need in working with the &#039;&#039;releases&#039;&#039; property directly, there are high-level API commands to [[Sugar_Network/API#Upload_releases|upload]] and [[Sugar_Network/API#Retrieving_releases|download]] releases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;post-topic&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post.topic&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Post objects might belong to a topic post. The system design assumes only a two-level Posts hierarchy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;post-type&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post.type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;topic&#039;&#039;, general purpose top-level Post;&lt;br /&gt;
* &#039;&#039;review&#039;&#039;, review the Context (topic);&lt;br /&gt;
* &#039;&#039;artefact&#039;&#039;, object generated by Context application (topic);&lt;br /&gt;
* &#039;&#039;question&#039;&#039;, Q&amp;amp;A request (topic);&lt;br /&gt;
* &#039;&#039;issue&#039;&#039;, problem with the Context (topic);&lt;br /&gt;
* &#039;&#039;idea&#039;&#039;, an idea for the Context (topic);&lt;br /&gt;
* &#039;&#039;notice&#039;&#039;, auto-generated Post for updates within the Context (topic);&lt;br /&gt;
* &#039;&#039;post&#039;&#039;, general purpose dependent Post;&lt;br /&gt;
* &#039;&#039;solution&#039;&#039;, solution for question, issue, or, idea (post).&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Resources&amp;diff=92701</id>
		<title>Sugar Network/Resources</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Resources&amp;diff=92701"/>
		<updated>2014-05-25T07:04:36Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following diagram shows the full list of objects implemented by the Sugar Network [[Platform Team/Sugar Network/API|API]].&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot; align=&amp;quot;let&amp;quot;&lt;br /&gt;
| [[File:Sugar-Network-diagram.png|200px|thumb|Sugar Network objects]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-types&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Property types&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Generally, Sugar Network objects&#039; property types correspond to JSON types. The only exceptions mentioned in the following list:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;enum&#039;&#039;, is an enumerated type when a value is a string from the predefined list of constants;&lt;br /&gt;
* &#039;&#039;markdown&#039;&#039;, is a string formatted in the [[Wikipedia:Markdown|Markdown]] syntax;&lt;br /&gt;
* &#039;&#039;blob&#039;&#039;, is a file represented by string value which is a [[Wikipedia:Sha1|SHA-1]] digest of file&#039;s content; the file itself can be obtained from the {{Code|&#039;&#039;&#039;GET&#039;&#039;&#039; /blobs/&#039;&#039;DIGEST&#039;&#039;}} request;&lt;br /&gt;
* &#039;&#039;aggregated&#039;&#039;, is a list of JSON objects which has [[Sugar_Network/API#Aggregated_properties|special API]] to treat its items; each aggregated item has a unique identifier; items might be created not only by the object&#039;s authors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-author&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.author&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A dictionary of authors working on the corresponding resource. Keys are Sugar Network &#039;&#039;User&#039;&#039; guids, or, if particular author is not registered in the Sugar Network, full user names. Values are dictionaries with the following keys:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;name&#039;&#039;&amp;lt;br&amp;gt;Full author&#039;s name;&lt;br /&gt;
* &#039;&#039;role&#039;&#039;&amp;lt;br&amp;gt;An integer which is a bit-wise ORed value of the following constants:&lt;br /&gt;
** &#039;&#039;0x1&#039;&#039;, author is registered in the Sugar Network (and &#039;&#039;guid&#039;&#039; key is set);&lt;br /&gt;
** &#039;&#039;0x10000&#039;&#039;, author is the original author of the corresponding resource; if it is not set, user is only a maintainer, e.g., an uploader of a book which has its original authors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-status&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.status&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is a system level property which can be set only by node editors. It is a list of &amp;quot;badges&amp;quot; editors set depending on the object quality. Currently supported statuses are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;featured&#039;&#039;, the object is popped up by node editors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-pins&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.pins&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This property makes sense only for objects provided from a [[Sugar_Network/API#Client_proxy|local proxy]]. The property is intended to store local user&#039;s preferences or statuses remote object has in local environment. Currently supported values are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;favorite&#039;&#039;, set if a user has &#039;&#039;&amp;quot;stared&amp;quot;&#039;&#039; the object;&lt;br /&gt;
* &#039;&#039;checkin&#039;&#039;, applied to Context objects only, set if a user has &#039;&#039;&amp;quot;pinned&amp;quot;&#039;&#039; the context to keep its most recent version permanently in the local system;&lt;br /&gt;
* &#039;&#039;stale&#039;&#039;, applied to Context objects only, set if previously checked-in Context might have more fresh releases on the node; it is not possible to filter Contexts by this value;&lt;br /&gt;
* &#039;&#039;inprogress&#039;&#039;, applied to Context objects only, set if the Context is in the process of downloading content from the node; it is being temporally set before launching the Context or checking it in; it is not possible to filter Contexts by this value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;context-type&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Context.type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Context types:&lt;br /&gt;
* &#039;&#039;activity&#039;&#039;, Sugar activity;&lt;br /&gt;
* &#039;&#039;book&#039;&#039;, books in various forms;&lt;br /&gt;
* &#039;&#039;group&#039;&#039;, offline discussion groups;&lt;br /&gt;
* &#039;&#039;package&#039;&#039;, GNU/Linux package metadata.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;context-releases&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Context.releases&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Contexts with &#039;&#039;activity&#039;&#039; or &#039;&#039;book&#039;&#039; types might have releases, i.e., activity or book versions that users can download. The &#039;&#039;releases&#039;&#039; property is aggregated where each item describes one particular version. There is no need in working with the &#039;&#039;releases&#039;&#039; property directly, there are high-level API commands to [[Sugar_Network/API#Upload_releases|upload]] and [[Sugar_Network/API#Retrieving_releases|download]] releases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;post-topic&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post.topic&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Post objects might belong to a topic post. The system design assumes only a two-level Posts hierarchy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;post-type&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post.type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;topic&#039;&#039;, general purpose top-level Post;&lt;br /&gt;
* &#039;&#039;post&#039;&#039;, general purpose dependent Post;&lt;br /&gt;
* &#039;&#039;review&#039;&#039;, review the Context (topic);&lt;br /&gt;
* &#039;&#039;object&#039;&#039;, object generated by Context application (topic);&lt;br /&gt;
* &#039;&#039;question&#039;&#039;, Q&amp;amp;A request (topic);&lt;br /&gt;
* &#039;&#039;problem&#039;&#039;, problem with the Context (topic);&lt;br /&gt;
* &#039;&#039;idea&#039;&#039;, an idea for the Context (topic);&lt;br /&gt;
* &#039;&#039;solution&#039;&#039;, solution for question, problem, or, idea (post);&lt;br /&gt;
* &#039;&#039;announce&#039;&#039;, general announcement (topic);&lt;br /&gt;
* &#039;&#039;notification&#039;&#039;, auto-generated Post for updates within the Context (topic).&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Sugar_Network/API&amp;diff=92700</id>
		<title>Sugar Network/API</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Sugar_Network/API&amp;diff=92700"/>
		<updated>2014-05-24T15:56:37Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: /* Retrieving releases */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the API that Sugar Network clients use to interact with a Sugar Network server. See also a guide to basic Sugar Network [[Sugar_Network/Concept|concepts]] and [[Platform_Team/Sugar_Network/Architecture|its twin page]] for a technical point of view. In addition, visit the [[Sugar_Network|introduction page]].&lt;br /&gt;
&lt;br /&gt;
{{Note/warning|Note|Until announcing API freeze, this document describes the most recent development version of the API.&amp;lt;br&amp;gt;You can find its implementation on the [[#API servers|node-devel.sugarlabs.org]] server.}}&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
To better understand this API, see a technical explanation of its [[Platform_Team/Sugar_Network/Architecture#Conceptual_level|conceptual level]] and [[#Sugar_Network_resources|objects model]] in particular.&lt;br /&gt;
&lt;br /&gt;
The API operates with [[Sugar Network]] [[#Sugar_Network_resources|resources]], which are collections of objects. All objects are identified by globally unique identifiers, GUIDs, and available for operation via [[#Base_API|basic actions]]. The API is being provided from a [[#API_servers|node server]] or a [[#Client_API|client]]. While processing requests, API providers generate [[#Notifications|events]].&lt;br /&gt;
&lt;br /&gt;
The API is [[Wikipedia:Restful|RESTful]], and is served via HTTP(S) using [[Wikipedia:Json|JSON]] notation. The common request url format is:&lt;br /&gt;
&lt;br /&gt;
 http[s]://&#039;&#039;SERVER&#039;&#039;[/&#039;&#039;RESOURCE&#039;&#039;[/&#039;&#039;GUID&#039;&#039;[/&#039;&#039;PROPERTY&#039;&#039;]]][?[cmd=&#039;&#039;COMMAND&#039;&#039;][&amp;amp;&#039;&#039;ARGUMENT&#039;&#039;=&#039;&#039;VALUE&#039;&#039;..]]&lt;br /&gt;
&lt;br /&gt;
When:&lt;br /&gt;
&lt;br /&gt;
* {{Code|SERVER}}, [[#API_servers|particular]] Sugar Network API server;&lt;br /&gt;
* {{Code|RESOURCE}}, name one of the [[#Sugar_Network_resources|existing]] resources;&lt;br /&gt;
* {{Code|GUID}}, the {{Code|RESOURCE}}&#039;s particular object;&lt;br /&gt;
* {{Code|PROPERTY}}, particular property of {{Code|GUID}} object;&lt;br /&gt;
* {{Code|COMMAND}}, optional command name; combination of HTTP request method ({{Code|GET}}, {{Code|POST}}, {{Code|PUT}}, or, {{Code|DELETE}}) and [possibly empty] {{Code|COMMAND}} composes the requested [[#Actions|action]];&lt;br /&gt;
* {{Code|ARGUMENT}}s and {{Code|VALUE}}s depend on the particular [[#Actions|action]].&lt;br /&gt;
&lt;br /&gt;
In most cases, the server replies in JSON notation. If a request fails, the replied JSON object will contain a {{Code|request}} key, with the original request, and {{Code|error}} key, with an error message.&lt;br /&gt;
&lt;br /&gt;
== API servers ==&lt;br /&gt;
&lt;br /&gt;
These are standard Sugar Network API servers publicly available.&lt;br /&gt;
&lt;br /&gt;
* [http://node-devel.sugarlabs.org/ node-devel.sugarlabs.org]&amp;lt;br&amp;gt;Development server which does not contain important data and is free for any experiments (administrative privileges for anonymous users);&lt;br /&gt;
&lt;br /&gt;
* [http://node-testing.sugarlabs.org/ node-testing.sugarlabs.org]&amp;lt;br&amp;gt;Recent stable release with regular data import from the production server; is still free for any experiments;&lt;br /&gt;
&lt;br /&gt;
* [http://node.sugarlabs.org/ node.sugarlabs.org]&amp;lt;br&amp;gt;Production server;&lt;br /&gt;
&lt;br /&gt;
* [http://localhost:5001/ localhost:5001]&amp;lt;br&amp;gt;default url to get access to [[#Client_API|local proxy]] provided from user side application.&lt;br /&gt;
&lt;br /&gt;
== Sugar Network resources ==&lt;br /&gt;
&lt;br /&gt;
{{:Sugar_Network/Resources}}&lt;br /&gt;
&lt;br /&gt;
== Base API ==&lt;br /&gt;
&lt;br /&gt;
List of actions common of all API providers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;POST&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;POST&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create new resource object.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to send:&lt;br /&gt;
* {{Code|&#039;&#039;RESOURCE}}&#039;s properties.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to receive:&lt;br /&gt;
* {{Code|guid}}, with globally unique identifier that specifies the created object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Modify resource object. By default, might be called only by {{Code|GUID}} creator.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to send:&lt;br /&gt;
* {{Code|RESOURCE}}&#039;s properties to modify.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Delete resource object. Actual object destruction won&#039;t happen, the object will be hidden. Garbage collection of hidden objects will be processed by Network administrators. By default, this action may be called only by the {{Code|GUID}} creator.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;[?offset=&#039;&#039;INTEGER&#039;&#039;][&amp;amp;limit=&#039;&#039;INTEGER&#039;&#039;][&amp;amp;query=&#039;&#039;STRING&#039;&#039;][&amp;amp;reply=&#039;&#039;PROP&#039;&#039;][&amp;amp;order_by=&amp;lt;nowiki&amp;gt;[+|-]&amp;lt;/nowiki&amp;gt;&#039;&#039;PROP&#039;&#039;][&amp;amp;group_by=&#039;&#039;PROP&#039;&#039;][&amp;amp;&#039;&#039;PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;][&amp;amp;&#039;&#039;!PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
Find resource objects.&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
* {{Code|offset}}, &#039;&#039;int&#039;&#039;&amp;lt;br&amp;gt;start index to return entries from, the default value is {{Code|0}};&lt;br /&gt;
* {{Code|limit}}, &#039;&#039;int&#039;&#039;&amp;lt;br&amp;gt;do not return more then specified value, maximal and default values are being setup on server side;&lt;br /&gt;
* {{Code|query}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;search request in [http://xapian.org/docs/queryparser.html Xapian] notation with the following additions:&lt;br /&gt;
** if property is boolean, integer or datetime, it supports searching by ranges: {{Code|&#039;&#039;PROP&#039;&#039;:[&#039;&#039;START&#039;&#039;]..[&#039;&#039;END&#039;&#039;]}};&lt;br /&gt;
** the statement {{Code|&#039;&#039;PROP&#039;&#039;&amp;lt;nowiki&amp;gt;:=&amp;lt;/nowiki&amp;gt;[&amp;quot;]&#039;&#039;VALUE&#039;&#039;[&amp;quot;]}} has the same effect as {{Code|QUERY_PROP}}; it is different to regular {{Code|&#039;&#039;PROP&#039;&#039;:&#039;&#039;VALUE&#039;&#039;}} where {{Code|VALUE}} might be a substring;&lt;br /&gt;
* {{Code|PROP}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;supplements {{Code|query}} with filtering by exact value of the {{Code|PROP}} property; the resulting query string will be {{Code|&#039;&#039;PROP&#039;&#039;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&#039;&#039;VALUE&#039;&#039; AND (&#039;&#039;QUERY&#039;&#039;)}}; argument is multiple;&lt;br /&gt;
* {{Code|!PROP}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;supplements {{Code|query}} by excluding exact value of the {{Code|PROP}} property; the resulting query string will be {{Code|NOT &#039;&#039;PROP&#039;&#039;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&#039;&#039;VALUE&#039;&#039; AND (&#039;&#039;QUERY&#039;&#039;)}}; argument is multiple;&lt;br /&gt;
* {{Code|reply}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;RESOURCE&#039;&#039; properties to return; by default, return only {{Code|guid}} property; argument is multiple;&lt;br /&gt;
* {{Code|order_by}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;property to sort the resulting list by; if starts with the {{Code|-}}, the order is descending, otherwise it is ascending;&lt;br /&gt;
* {{Code|group_by}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;property name to group resulting list by.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to receive:&lt;br /&gt;
* {{Code|total}}, total number in requested query (the reply might contain only the portion restricted by {{Code|limit}} request argument);&lt;br /&gt;
* {{Code|result}}, an array of dictionaries with resource object properties, dictionaries contain at least {{Code|guid}} property.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-resource&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;[?reply=&#039;&#039;PROP&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
* {{Code|reply}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;RESOURCE&#039;&#039; properties to return; by default, return only {{Code|guid}} property; argument is multiple;&lt;br /&gt;
&lt;br /&gt;
Return properties for a particular resource object.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to receive:&lt;br /&gt;
* properties that were specified in {{Code|reply}} argument(s), at least {{Code|guid}}.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-property&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Return property value for particular resource object.&lt;br /&gt;
&lt;br /&gt;
Data to receive:&lt;br /&gt;
* property value in JSON notation for regular properties;&lt;br /&gt;
* raw data or redirection for BLOB properties.&lt;br /&gt;
&lt;br /&gt;
=== Aggregated properties ===&lt;br /&gt;
&lt;br /&gt;
[[#resource-types|Aggregated]] properties have special API to treat their content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;POST-aggproperty&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;POST&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Submit new item. The command returns an id for newly created aggregated item. Depending on particular property, new items might be created not only by object&#039;s authors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT-aggproperty&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;/&#039;&#039;ID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Update existing aggregated item. Depending on particular property, the command is allowed either to object&#039;s authors or to aggregated item submitter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE-aggproperty&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;/&#039;&#039;ID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Delete existing aggregated item. Depending on particular property, the command is allowed either to object&#039;s authors or to aggregated item submitter.&lt;br /&gt;
&lt;br /&gt;
=== Notifications ===&lt;br /&gt;
&lt;br /&gt;
It is possible to subscribe to server events. Notification will happen using HTML5 [[wikipedia:Server-sent_events|Server-sent events]] (SSE).&lt;br /&gt;
&lt;br /&gt;
To start subscription, send the following request:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /?cmd=&#039;&#039;&#039;subscribe&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Response will be served with &#039;&#039;text/event-stream&#039;&#039; MIME type for default SSE message type. SSE message will be a JSONified object with the following, at least, attributes:&lt;br /&gt;
&lt;br /&gt;
* {{Code|event}}&amp;lt;br&amp;gt;event type.&lt;br /&gt;
&lt;br /&gt;
== Node API ==&lt;br /&gt;
&lt;br /&gt;
This is an API provided by Sugar Network nodes on top of [[#Base_API|base one]].&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
&lt;br /&gt;
Right now, the only way to be authenticated on a Sugar Network server is by running a [[Platform_Team/Sugar_Network/Implementation#sugar-network-client|local application]] on the client side and using the API it [[#Client_API|provides]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;TODO&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Authorization ===&lt;br /&gt;
&lt;br /&gt;
Read-only access is available for anonymous requests, except special content like machine serial numbers. But to process any changes, clients need to be authenticated.&lt;br /&gt;
&lt;br /&gt;
Right after creating any Sugar Network object, its author becomes the only user who can process any object modifications afterwards. Authority information will be kept in the [[#Sugar_Network_resources|author]] property and can be modified using the following commands.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;useradd&#039;&#039;&#039;&amp;amp;user=&#039;&#039;USER&#039;&#039;&amp;amp;role=&#039;&#039;ROLE&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Add another user who can modify the corresponding object. &#039;&#039;USER&#039;&#039; argument should be either &#039;&#039;User&#039;&#039; guid (for authors registered in the Sugar Network), or, full author name.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;userdel&#039;&#039;&#039;&amp;amp;user=&#039;&#039;USER&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Remove user from the authority list. It is not possible to remove yourself. &#039;&#039;USER&#039;&#039; argument should be either &#039;&#039;User&#039;&#039; guid (for authors registered in the Sugar Network), or, full author name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;TODO&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Retrieving releases ===&lt;br /&gt;
&lt;br /&gt;
To easy download Context [[#context-releases|releases]] and avoid reading raw &#039;&#039;Context.releases&#039;&#039; property, there are special high-level API commands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-solve&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;solve&#039;&#039;&#039;[&amp;amp;lsb_id=&#039;&#039;LSB_ID&#039;&#039;][&amp;amp;lsb_release=&#039;&#039;LSB_RELEASE&#039;&#039;][&amp;amp;assume=&#039;&#039;DEPENDENCY&#039;&#039;-&#039;&#039;VERSION&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
The command returns information about what particular releases should be downloaded depending on provided requirements. This command might return not only one release, e.g., activities might have dependencies either system packages or another Sugar Network Contexts.&lt;br /&gt;
&lt;br /&gt;
Solving requirements might be:&lt;br /&gt;
&lt;br /&gt;
* {{Code|LSB_ID}}, if Context releases depend on system packages, specify the [[Wikipedia:Linux_Standard_Base|LSB]] distributor id to consider while choosing particular packages;&lt;br /&gt;
* {{Code|LSB_RELEASE}}, if Context releases depend on system packages, specify the [[Wikipedia:Linux_Standard_Base|LSB]] release number of the distribution to consider while choosing particular packages;&lt;br /&gt;
* {{Code|DEPENDENCY-VERSION}}, the {{Code|assume}} argument instructs server to assume that specified [[Sugar_Network/Recipe_Specification#Dependencies|dependency]] is already available on client side and should be taken into account while solving; this is especially important for package dependencies when server considers packages available only from official repositories but users might have more recent package versions installed in local system; e.g., the above example request will fail without {{Code|sugar-0.94}} because neither {{Code|lsb_id}} nor {{Code|lsb_release}} were specified (even if LSB information is passed, server might not have information about what package versions come from official repositories).&lt;br /&gt;
&lt;br /&gt;
The resulting info is a JSON object with keys equal to Context guids and value objects for chosen release with the following keys:&lt;br /&gt;
&lt;br /&gt;
* {{Code|blob}}, bundle [[#resource-types|digest]] to download;&lt;br /&gt;
* {{Code|version}}, chosen version number;&lt;br /&gt;
* {{Code|title}}, the &#039;&#039;Context.title&#039;&#039; value;&lt;br /&gt;
* {{Code|command}}, a command to launch the bundle, only for Sugar activities.&lt;br /&gt;
&lt;br /&gt;
For example, the {{Code|&#039;&#039;&#039;GET&#039;&#039;&#039; &amp;lt;nowiki&amp;gt;/context/org.laptop.TurtleArtActivity?cmd=solve&amp;amp;assume=sugar-0.94&amp;lt;/nowiki&amp;gt;}} request returns:&lt;br /&gt;
&lt;br /&gt;
 {&lt;br /&gt;
   &amp;quot;org.laptop.TurtleArtActivity&amp;quot;: {&lt;br /&gt;
     &amp;quot;title&amp;quot;: &amp;quot;Turtle Blocks&amp;quot;,&lt;br /&gt;
     &amp;quot;version&amp;quot;: &amp;quot;202&amp;quot;,&lt;br /&gt;
     &amp;quot;blob&amp;quot;: &amp;quot;http://download.sugarlabs.org/activities/4027/turtleblocks-202.xo&amp;quot;,&lt;br /&gt;
     &amp;quot;content-type&amp;quot;: &amp;quot;application/vnd.olpc-sugar&amp;quot;,&lt;br /&gt;
     &amp;quot;size&amp;quot;: 4715955,&lt;br /&gt;
     &amp;quot;unpack_size&amp;quot;: 12873871,&lt;br /&gt;
     &amp;quot;command&amp;quot;: &amp;quot;sugar-activity TurtleArtActivity.TurtleArtActivity&amp;quot;,&lt;br /&gt;
   },&lt;br /&gt;
   &amp;quot;sugar&amp;quot;: {&lt;br /&gt;
     &amp;quot;version&amp;quot;: &amp;quot;0.94&amp;quot;,&lt;br /&gt;
   },&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-clone&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Like the [[#GET-solve|solve]] command, &#039;&#039;clone&#039;&#039; makes a solution but returns bundle itself, so, there is no way to get information about possible dependencies.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;clone&#039;&#039;&#039;[&amp;amp;lsb_id=&#039;&#039;LSB_ID&#039;&#039;][&amp;amp;lsb_release=&#039;&#039;LSB_RELEASE&#039;&#039;][&amp;amp;assume=&#039;&#039;DEPENDENCY&#039;&#039;-&#039;&#039;VERSION&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
=== Upload releases ===&lt;br /&gt;
&lt;br /&gt;
To easy upload Context [[#context-releases|releases]] and avoid writing to raw &#039;&#039;Context.releases&#039;&#039; property, there is a special high-level API command.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;POST&#039;&#039;&#039; /context?cmd=&#039;&#039;&#039;submit&#039;&#039;&#039;[&amp;amp;&#039;&#039;PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;][&amp;amp;initial]&lt;br /&gt;
&lt;br /&gt;
Where the {{Code|PROP}} arguments are optional release properties. The {{Code|initial}} argument asks the system to create new Context resource new release will belong to.&lt;br /&gt;
&lt;br /&gt;
The posting data might be two types,&lt;br /&gt;
&lt;br /&gt;
* Sugar activities in .xo bundles,&amp;lt;br&amp;gt;there is no need in {{Code|PROP}} arguments, all properties will be populated basing on metadata from a .xo bundle; including release notes from the {{Code|CHANGELOG}} file in [[Wikipedia:Markdown|Markdown]] notation; besides, only in this case {{Code|initial}} makes sense because it is the only way to get Context properties;&lt;br /&gt;
&lt;br /&gt;
* Arbitrary data,&amp;lt;br&amp;gt;all required release properties should be specified in {{Code|PROP}} arguments, at least &#039;&#039;context&#039;&#039; and &#039;&#039;version&#039;&#039;; &#039;&#039;license&#039;&#039; should be specified only if there are no existing releases to pickup license from.&lt;br /&gt;
&lt;br /&gt;
=== Node statistics ===&lt;br /&gt;
&lt;br /&gt;
The node statistics are about the entire server and depersonalized. Statistics are being collected by analyzing regular requests to an API server and stored for each Sugar Network node. To read such info, call the command:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /?cmd=&#039;&#039;&#039;stats&#039;&#039;&#039;[&amp;amp;start=&#039;&#039;SECONDS&#039;&#039;][&amp;amp;end=&#039;&#039;SECONDS&#039;&#039;][&amp;amp;event=&#039;&#039;EVENT&#039;&#039;][&amp;amp;limit=&#039;&#039;NUMBER&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
&lt;br /&gt;
* {{Code|start}} and {{Code|end}} is a time interval to get statistics for; if omitted, the beginning and the end of entire life cycle will be used;&lt;br /&gt;
* {{Code|event}}, multiple argument to specify what stats should be returned; if omitted, return all sources;&lt;br /&gt;
* {{Code|limit}}, number of stat records to return for the {{Code|start}}-{{Code|end}} interval; note that this amount is not precise, the final resultset might be smaller or bigger depending on chosen resolution; stats resolution depends on node configuration, default values are 1 day, 10 days, 30 days, 365 days; if omitted, return {{Code|end}} record only.&lt;br /&gt;
&lt;br /&gt;
Possible events are:&lt;br /&gt;
&lt;br /&gt;
* {{Code|users}}, total number of existing &#039;&#039;User&#039;&#039; objects;&lt;br /&gt;
* {{Code|contexts}}, total number of existing &#039;&#039;Context&#039;&#039; objects;&lt;br /&gt;
* {{Code|released}}, average number of newly uploaded &#039;&#039;Context.releases&#039;&#039; for specified time frame;&lt;br /&gt;
* {{Code|solved}}, average number of requested &#039;&#039;Context&#039;&#039; [[#GET-solve|solutions]] for specified time frame; note that this value does not equal to the number of solution usages on client side since solutions might be cached;&lt;br /&gt;
* {{Code|reported}}, average number of newly uploaded failure &#039;&#039;Report&#039;&#039; objects for specified time frame;&lt;br /&gt;
* {{Code|topics}}, total number of top-level &#039;&#039;Post&#039;&#039; objects;&lt;br /&gt;
* {{Code|posts}}, total number of dependent &#039;&#039;Post&#039;&#039; objects.&lt;br /&gt;
&lt;br /&gt;
== Client API ==&lt;br /&gt;
&lt;br /&gt;
The reasons to proxy Sugar Network data on users side:&lt;br /&gt;
&lt;br /&gt;
* Seamless support [[#Offline mode|offline workflow]];&lt;br /&gt;
* [[#Launching|One-click launch]] Sugar activities hosted on Sugar Network.&lt;br /&gt;
&lt;br /&gt;
Proxying happens by providing the same Sugar Network API (with some extra functionality, see below) from&lt;br /&gt;
[[Platform_Team/Sugar_Network/Implementation#sugar-network-client|local process]] launched beforehand.&lt;br /&gt;
&lt;br /&gt;
=== Offline mode ===&lt;br /&gt;
&lt;br /&gt;
Being connected to a Sugar Network node, local proxy provides [[#Node_API|original API]] from the node. If the connection is lost, the proxy will switch to local Sugar Network storage and continue working providing only [[#Base_API|base API]]. Any content created in offline mode will be uploaded to the node after getting a connection back.&lt;br /&gt;
&lt;br /&gt;
Besides, local Sugar Network storage will be reused to keep users preferences, such as:&lt;br /&gt;
&lt;br /&gt;
* Favorited Contexts&amp;lt;br&amp;gt;to select preferred &#039;&#039;Context&#039;&#039; resources; these Contexts will be marked by {{Code|favorite}} value in the &#039;&#039;Context.layer&#039;&#039; property;&lt;br /&gt;
&lt;br /&gt;
* Checked-in Contexts&amp;lt;br&amp;gt;to keep most recent Context (for &#039;&#039;activity&#039;&#039; and &#039;&#039;book&#039;&#039; types) version in local storage to make it available in offline; note that there is no need in checking-in to speedup online lunch, versions are being [[#Launching|cached]] anyway; these Contexts will be marked by {{Code|checkin}} value in the &#039;&#039;Context.layer&#039;&#039; property.&lt;br /&gt;
&lt;br /&gt;
To control users preferences there are special API commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT_favorite&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;favorite&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Set favorite status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE_favorite&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;favorite&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Unset favorite status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT_checkin&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;checkin&#039;&#039;&#039;[&amp;amp;spawn]&lt;br /&gt;
&lt;br /&gt;
Check-in the specified Context. By default, the command will return streamed &#039;&#039;text/event-stream&#039;&#039; MIME type data to monitor the progress. If the {{Code|spawn}} argument is specified, the command will exit immediately with [[#Notifications|asynchronous sending]] progress events.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE_checkin&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;checkin&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Checkout the Context.&lt;br /&gt;
&lt;br /&gt;
=== Launching ===&lt;br /&gt;
&lt;br /&gt;
Sugar Network Contexts (for &#039;&#039;activity&#039;&#039; and &#039;&#039;book&#039;&#039; types) can be launched as-is. The launching process is implicit and includes selecting the most recent (and appropriate for software contexts) version, downloading bundles from the Sugar Network, installing missed [[Sugar_Network/Recipe_Specification#Dependencies|software dependencies]], execution itself. All downloaded bundles will be cached [with further garbage collecting] to speedup further launching.&lt;br /&gt;
&lt;br /&gt;
Sugar activities will be directly executed. Book Contexts will be opened in the proper application according to its MIME type.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;launch&#039;&#039;&#039;[&amp;amp;args=&#039;&#039;ARG&#039;&#039;][&amp;amp;activity_id=&#039;&#039;ACTIVITY_ID&#039;&#039;][&amp;amp;object_id=&#039;&#039;OBJECT_ID&#039;&#039;][&amp;amp;uri=&#039;&#039;URI&#039;&#039;][&amp;amp;app=&#039;&#039;APP&#039;&#039;][&amp;amp;spawn]&lt;br /&gt;
&lt;br /&gt;
Arguments that make sense only for Sugar activities:&lt;br /&gt;
&lt;br /&gt;
* {{Code|ARG}}, command line argument to pass to launched activities, repeat {{Code|ARG}} for each argument;&lt;br /&gt;
* {{Code|ACTIVITY_ID}}, internal activity id which will be auto set if omitted;&lt;br /&gt;
* {{Code|OBJECT_ID}}, Journal object id to resume;&lt;br /&gt;
* {{Code|URI}}, URL to resume if activity supports this functionality.&lt;br /&gt;
&lt;br /&gt;
Arguments that make sense only for books:&lt;br /&gt;
&lt;br /&gt;
* {{Code|APP}}, specify application Context to open the book by; if omitted, the system will try to find most appropriate option, among all existing software Contexts.&lt;br /&gt;
&lt;br /&gt;
Common arguments:&lt;br /&gt;
&lt;br /&gt;
* {{Code|spawn}}, by default, the command will return streamed &#039;&#039;text/event-stream&#039;&#039; MIME type data to monitor the whole launching process until exiting the application; if the {{Code|spawn}} argument is specified, the command will exit immediately with [[#Notifications|asynchronous sending]] launching events.&lt;br /&gt;
&lt;br /&gt;
== Experimental API ==&lt;br /&gt;
&lt;br /&gt;
There is no guaranty that the following API will be stated as stable or frozen sometime.&lt;br /&gt;
&lt;br /&gt;
=== Access to Sugar Journal ===&lt;br /&gt;
&lt;br /&gt;
It is possible to get access to local Sugar Journal using special, &#039;&#039;journal&#039;&#039;, resource provided from [[#Client_API|client API]]. This kind of access might be useful when local applications cannot use DBus sugar-datastore API, e.g., [[wikipedia:Javascript|Javascript]] applications. API to Journal is restricted only to read-only access:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /journal?offset=&#039;&#039;INTEGER&#039;&#039;&amp;amp;limit=&#039;&#039;INTEGER&#039;&#039;[&amp;amp;query=&#039;&#039;STRING&#039;&#039;][&amp;amp;order_by=&amp;lt;nowiki&amp;gt;[+|-]&amp;lt;/nowiki&amp;gt;&#039;&#039;PROP&#039;&#039;][&amp;amp;&#039;&#039;QUERY_PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;[&amp;amp;...]]&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /journal/&#039;&#039;JOURNAL_ID&#039;&#039;[?reply=&#039;&#039;PROP&#039;&#039;[,..]]&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /journal/&#039;&#039;JOURNAL_ID&#039;&#039;/&#039;&#039;PROPERTY&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
Being HTTP based, Sugar Network API can be used in any manner regular HTTP requests can be handled. But for command-line access, there is a handy tool, {{Code|sugar-network}}, which takes care about Sugar Network specific like launching local API (if it is not already available) to get access to [[#Client_API|local proxy]].&lt;br /&gt;
&lt;br /&gt;
The sugar-network command-line format is below. Call {{Code|sugar-network --help}} for more detailed info.&lt;br /&gt;
&lt;br /&gt;
 sugar-network GET|POST|PUT|DELETE &#039;&#039;PATH&#039;&#039; &#039;&#039;ARG=VALUE&#039;&#039; [..]&lt;br /&gt;
&lt;br /&gt;
* {{Code|PATH}}, is an url path;&lt;br /&gt;
* {{Code|ARG&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;VALUE}}, request arguments as they being passed to in url.&lt;br /&gt;
&lt;br /&gt;
{{Code|POST}} and {{Code|PUT}} commands require data to pass, use the following command-line arguments:&lt;br /&gt;
&lt;br /&gt;
* {{Code|-f FILE}} to specify the file to pass;&lt;br /&gt;
* {{Code|-d DATA}} to specify string to pass;&lt;br /&gt;
* {{Code|-j}} posted data should be encoded into JSON before posting.&lt;br /&gt;
&lt;br /&gt;
== Getting involved ==&lt;br /&gt;
&lt;br /&gt;
{{:Sugar_Network/Feedback}}&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Resources&amp;diff=92544</id>
		<title>Sugar Network/Resources</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Resources&amp;diff=92544"/>
		<updated>2014-05-14T02:28:05Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following diagram shows the full list of objects implemented by the Sugar Network [[Platform Team/Sugar Network/API|API]].&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot; align=&amp;quot;let&amp;quot;&lt;br /&gt;
| [[File:Sugar-Network-diagram.png|200px|thumb|Sugar Network objects]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-types&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Property types&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Generally, Sugar Network objects&#039; property types correspond to JSON types. The only exceptions mentioned in the following list:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;enum&#039;&#039;, is an enumerated type when a value is a string from the predefined list of constants;&lt;br /&gt;
* &#039;&#039;markdown&#039;&#039;, is a string formatted in the [[Wikipedia:Markdown|Markdown]] syntax;&lt;br /&gt;
* &#039;&#039;blob&#039;&#039;, is a file represented by string value which is a [[Wikipedia:Sha1|SHA-1]] digest of file&#039;s content; the file itself can be obtained from the {{Code|&#039;&#039;&#039;GET&#039;&#039;&#039; /blobs/&#039;&#039;DIGEST&#039;&#039;}} request;&lt;br /&gt;
* &#039;&#039;aggregated&#039;&#039;, is a list of JSON objects which has [[Sugar_Network/API#Aggregated_properties|special API]] to treat its items; each aggregated item has a unique identifier; items might be created not only by the object&#039;s authors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-author&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.author&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A dictionary of authors working on the corresponding resource. Keys are Sugar Network &#039;&#039;User&#039;&#039; guids, or, if particular author is not registered in the Sugar Network, full user names. Values are dictionaries with the following keys:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;name&#039;&#039;&amp;lt;br&amp;gt;Full author&#039;s name;&lt;br /&gt;
* &#039;&#039;role&#039;&#039;&amp;lt;br&amp;gt;An integer which is a bit-wise ORed value of the following constants:&lt;br /&gt;
** &#039;&#039;0x1&#039;&#039;, author is registered in the Sugar Network (and &#039;&#039;guid&#039;&#039; key is set);&lt;br /&gt;
** &#039;&#039;0x10000&#039;&#039;, author is the original author of the corresponding resource; if it is not set, user is only a maintainer, e.g., an uploader of a book which has its original authors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-status&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.status&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is a system level property which can be set only by node editors. It is a list of &amp;quot;badges&amp;quot; editors set depending on the object quality. Currently supported statuses are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;featured&#039;&#039;, the object is popped up by node editors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-pins&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.pins&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This property makes sense only for objects provided from a [[Sugar_Network/API#Client_proxy|local proxy]]. The property is intended to store local user&#039;s preferences or statuses remote object has in local environment. Currently supported values are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;favorite&#039;&#039;, set if a user has &#039;&#039;&amp;quot;stared&amp;quot;&#039;&#039; the object;&lt;br /&gt;
* &#039;&#039;checkin&#039;&#039;, applied to Context objects only, set if a user has &#039;&#039;&amp;quot;pinned&amp;quot;&#039;&#039; the context to keep its most recent version permanently in the local system;&lt;br /&gt;
* &#039;&#039;stale&#039;&#039;, applied to Context objects only, set if previously checked-in Context might have more fresh releases on the node; it is not possible to filter Contexts by this value;&lt;br /&gt;
* &#039;&#039;inprogress&#039;&#039;, applied to Context objects only, set if the Context is in the process of downloading content from the node; it is being temporally set before launching the Context or checking it in; it is not possible to filter Contexts by this value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;context-type&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Context.type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Context types:&lt;br /&gt;
* &#039;&#039;activity&#039;&#039;, Sugar activity;&lt;br /&gt;
* &#039;&#039;book&#039;&#039;, books in various forms;&lt;br /&gt;
* &#039;&#039;group&#039;&#039;, offline discussion groups;&lt;br /&gt;
* &#039;&#039;package&#039;&#039;, GNU/Linux package metadata.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;context-releases&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Context.releases&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Contexts with &#039;&#039;activity&#039;&#039; or &#039;&#039;book&#039;&#039; types might have releases, i.e., activity or book versions that users can download. The &#039;&#039;releases&#039;&#039; property is aggregated where each item describes one particular version. There is no need in working with the &#039;&#039;releases&#039;&#039; property directly, there are high-level API commands to [[Sugar_Network/API#Upload_releases|upload]] and [[Sugar_Network/API#Download_releases|download]] releases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;post-topic&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post.topic&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Post objects might belong to a topic post. The system design assumes only a two-level Posts hierarchy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;post-type&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post.type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;topic&#039;&#039;, general purpose top-level Post;&lt;br /&gt;
* &#039;&#039;post&#039;&#039;, general purpose dependent Post;&lt;br /&gt;
* &#039;&#039;review&#039;&#039;, review the Context (topic);&lt;br /&gt;
* &#039;&#039;object&#039;&#039;, object generated by Context application (topic);&lt;br /&gt;
* &#039;&#039;question&#039;&#039;, Q&amp;amp;A request (topic);&lt;br /&gt;
* &#039;&#039;problem&#039;&#039;, problem with the Context (topic);&lt;br /&gt;
* &#039;&#039;idea&#039;&#039;, an idea for the Context (topic);&lt;br /&gt;
* &#039;&#039;solution&#039;&#039;, solution for question, problem, or, idea (post);&lt;br /&gt;
* &#039;&#039;announce&#039;&#039;, general announcement (topic);&lt;br /&gt;
* &#039;&#039;notification&#039;&#039;, auto-generated Post for updates within the Context (topic).&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Sugar_Network/API&amp;diff=92542</id>
		<title>Sugar Network/API</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Sugar_Network/API&amp;diff=92542"/>
		<updated>2014-05-13T14:13:53Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: /* Node statistics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the API that Sugar Network clients use to interact with a Sugar Network server. See also a guide to basic Sugar Network [[Sugar_Network/Concept|concepts]] and [[Platform_Team/Sugar_Network/Architecture|its twin page]] for a technical point of view. In addition, visit the [[Sugar_Network|introduction page]].&lt;br /&gt;
&lt;br /&gt;
{{Note/warning|Note|Until announcing API freeze, this document describes the most recent development version of the API.&amp;lt;br&amp;gt;You can find its implementation on the [[#API servers|node-devel.sugarlabs.org]] server.}}&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
To better understand this API, see a technical explanation of its [[Platform_Team/Sugar_Network/Architecture#Conceptual_level|conceptual level]] and [[#Sugar_Network_resources|objects model]] in particular.&lt;br /&gt;
&lt;br /&gt;
The API operates with [[Sugar Network]] [[#Sugar_Network_resources|resources]], which are collections of objects. All objects are identified by globally unique identifiers, GUIDs, and available for operation via [[#Base_API|basic actions]]. The API is being provided from a [[#API_servers|node server]] or a [[#Client_API|client]]. While processing requests, API providers generate [[#Notifications|events]].&lt;br /&gt;
&lt;br /&gt;
The API is [[Wikipedia:Restful|RESTful]], and is served via HTTP(S) using [[Wikipedia:Json|JSON]] notation. The common request url format is:&lt;br /&gt;
&lt;br /&gt;
 http[s]://&#039;&#039;SERVER&#039;&#039;[/&#039;&#039;RESOURCE&#039;&#039;[/&#039;&#039;GUID&#039;&#039;[/&#039;&#039;PROPERTY&#039;&#039;]]][?[cmd=&#039;&#039;COMMAND&#039;&#039;][&amp;amp;&#039;&#039;ARGUMENT&#039;&#039;=&#039;&#039;VALUE&#039;&#039;..]]&lt;br /&gt;
&lt;br /&gt;
When:&lt;br /&gt;
&lt;br /&gt;
* {{Code|SERVER}}, [[#API_servers|particular]] Sugar Network API server;&lt;br /&gt;
* {{Code|RESOURCE}}, name one of the [[#Sugar_Network_resources|existing]] resources;&lt;br /&gt;
* {{Code|GUID}}, the {{Code|RESOURCE}}&#039;s particular object;&lt;br /&gt;
* {{Code|PROPERTY}}, particular property of {{Code|GUID}} object;&lt;br /&gt;
* {{Code|COMMAND}}, optional command name; combination of HTTP request method ({{Code|GET}}, {{Code|POST}}, {{Code|PUT}}, or, {{Code|DELETE}}) and [possibly empty] {{Code|COMMAND}} composes the requested [[#Actions|action]];&lt;br /&gt;
* {{Code|ARGUMENT}}s and {{Code|VALUE}}s depend on the particular [[#Actions|action]].&lt;br /&gt;
&lt;br /&gt;
In most cases, the server replies in JSON notation. If a request fails, the replied JSON object will contain a {{Code|request}} key, with the original request, and {{Code|error}} key, with an error message.&lt;br /&gt;
&lt;br /&gt;
== API servers ==&lt;br /&gt;
&lt;br /&gt;
These are standard Sugar Network API servers publicly available.&lt;br /&gt;
&lt;br /&gt;
* [http://node-devel.sugarlabs.org/ node-devel.sugarlabs.org]&amp;lt;br&amp;gt;Development server which does not contain important data and is free for any experiments (administrative privileges for anonymous users);&lt;br /&gt;
&lt;br /&gt;
* [http://node-testing.sugarlabs.org/ node-testing.sugarlabs.org]&amp;lt;br&amp;gt;Recent stable release with regular data import from the production server; is still free for any experiments;&lt;br /&gt;
&lt;br /&gt;
* [http://node.sugarlabs.org/ node.sugarlabs.org]&amp;lt;br&amp;gt;Production server;&lt;br /&gt;
&lt;br /&gt;
* [http://localhost:5001/ localhost:5001]&amp;lt;br&amp;gt;default url to get access to [[#Client_API|local proxy]] provided from user side application.&lt;br /&gt;
&lt;br /&gt;
== Sugar Network resources ==&lt;br /&gt;
&lt;br /&gt;
{{:Sugar_Network/Resources}}&lt;br /&gt;
&lt;br /&gt;
== Base API ==&lt;br /&gt;
&lt;br /&gt;
List of actions common of all API providers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;POST&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;POST&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create new resource object.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to send:&lt;br /&gt;
* {{Code|&#039;&#039;RESOURCE}}&#039;s properties.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to receive:&lt;br /&gt;
* {{Code|guid}}, with globally unique identifier that specifies the created object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Modify resource object. By default, might be called only by {{Code|GUID}} creator.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to send:&lt;br /&gt;
* {{Code|RESOURCE}}&#039;s properties to modify.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Delete resource object. Actual object destruction won&#039;t happen, the object will be hidden. Garbage collection of hidden objects will be processed by Network administrators. By default, this action may be called only by the {{Code|GUID}} creator.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;[?offset=&#039;&#039;INTEGER&#039;&#039;][&amp;amp;limit=&#039;&#039;INTEGER&#039;&#039;][&amp;amp;query=&#039;&#039;STRING&#039;&#039;][&amp;amp;reply=&#039;&#039;PROP&#039;&#039;][&amp;amp;order_by=&amp;lt;nowiki&amp;gt;[+|-]&amp;lt;/nowiki&amp;gt;&#039;&#039;PROP&#039;&#039;][&amp;amp;group_by=&#039;&#039;PROP&#039;&#039;][&amp;amp;&#039;&#039;PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;][&amp;amp;&#039;&#039;!PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
Find resource objects.&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
* {{Code|offset}}, &#039;&#039;int&#039;&#039;&amp;lt;br&amp;gt;start index to return entries from, the default value is {{Code|0}};&lt;br /&gt;
* {{Code|limit}}, &#039;&#039;int&#039;&#039;&amp;lt;br&amp;gt;do not return more then specified value, maximal and default values are being setup on server side;&lt;br /&gt;
* {{Code|query}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;search request in [http://xapian.org/docs/queryparser.html Xapian] notation with the following additions:&lt;br /&gt;
** if property is boolean, integer or datetime, it supports searching by ranges: {{Code|&#039;&#039;PROP&#039;&#039;:[&#039;&#039;START&#039;&#039;]..[&#039;&#039;END&#039;&#039;]}};&lt;br /&gt;
** the statement {{Code|&#039;&#039;PROP&#039;&#039;&amp;lt;nowiki&amp;gt;:=&amp;lt;/nowiki&amp;gt;[&amp;quot;]&#039;&#039;VALUE&#039;&#039;[&amp;quot;]}} has the same effect as {{Code|QUERY_PROP}}; it is different to regular {{Code|&#039;&#039;PROP&#039;&#039;:&#039;&#039;VALUE&#039;&#039;}} where {{Code|VALUE}} might be a substring;&lt;br /&gt;
* {{Code|PROP}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;supplements {{Code|query}} with filtering by exact value of the {{Code|PROP}} property; the resulting query string will be {{Code|&#039;&#039;PROP&#039;&#039;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&#039;&#039;VALUE&#039;&#039; AND (&#039;&#039;QUERY&#039;&#039;)}}; argument is multiple;&lt;br /&gt;
* {{Code|!PROP}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;supplements {{Code|query}} by excluding exact value of the {{Code|PROP}} property; the resulting query string will be {{Code|NOT &#039;&#039;PROP&#039;&#039;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&#039;&#039;VALUE&#039;&#039; AND (&#039;&#039;QUERY&#039;&#039;)}}; argument is multiple;&lt;br /&gt;
* {{Code|reply}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;RESOURCE&#039;&#039; properties to return; by default, return only {{Code|guid}} property; argument is multiple;&lt;br /&gt;
* {{Code|order_by}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;property to sort the resulting list by; if starts with the {{Code|-}}, the order is descending, otherwise it is ascending;&lt;br /&gt;
* {{Code|group_by}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;property name to group resulting list by.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to receive:&lt;br /&gt;
* {{Code|total}}, total number in requested query (the reply might contain only the portion restricted by {{Code|limit}} request argument);&lt;br /&gt;
* {{Code|result}}, an array of dictionaries with resource object properties, dictionaries contain at least {{Code|guid}} property.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-resource&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;[?reply=&#039;&#039;PROP&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
* {{Code|reply}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;RESOURCE&#039;&#039; properties to return; by default, return only {{Code|guid}} property; argument is multiple;&lt;br /&gt;
&lt;br /&gt;
Return properties for a particular resource object.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to receive:&lt;br /&gt;
* properties that were specified in {{Code|reply}} argument(s), at least {{Code|guid}}.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-property&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Return property value for particular resource object.&lt;br /&gt;
&lt;br /&gt;
Data to receive:&lt;br /&gt;
* property value in JSON notation for regular properties;&lt;br /&gt;
* raw data or redirection for BLOB properties.&lt;br /&gt;
&lt;br /&gt;
=== Aggregated properties ===&lt;br /&gt;
&lt;br /&gt;
[[#resource-types|Aggregated]] properties have special API to treat their content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;POST-aggproperty&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;POST&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Submit new item. The command returns an id for newly created aggregated item. Depending on particular property, new items might be created not only by object&#039;s authors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT-aggproperty&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;/&#039;&#039;ID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Update existing aggregated item. Depending on particular property, the command is allowed either to object&#039;s authors or to aggregated item submitter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE-aggproperty&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;/&#039;&#039;ID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Delete existing aggregated item. Depending on particular property, the command is allowed either to object&#039;s authors or to aggregated item submitter.&lt;br /&gt;
&lt;br /&gt;
=== Notifications ===&lt;br /&gt;
&lt;br /&gt;
It is possible to subscribe to server events. Notification will happen using HTML5 [[wikipedia:Server-sent_events|Server-sent events]] (SSE).&lt;br /&gt;
&lt;br /&gt;
To start subscription, send the following request:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /?cmd=&#039;&#039;&#039;subscribe&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Response will be served with &#039;&#039;text/event-stream&#039;&#039; MIME type for default SSE message type. SSE message will be a JSONified object with the following, at least, attributes:&lt;br /&gt;
&lt;br /&gt;
* {{Code|event}}&amp;lt;br&amp;gt;event type.&lt;br /&gt;
&lt;br /&gt;
== Node API ==&lt;br /&gt;
&lt;br /&gt;
This is an API provided by Sugar Network nodes on top of [[#Base_API|base one]].&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
&lt;br /&gt;
Right now, the only way to be authenticated on a Sugar Network server is by running a [[Platform_Team/Sugar_Network/Implementation#sugar-network-client|local application]] on the client side and using the API it [[#Client_API|provides]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;TODO&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Authorization ===&lt;br /&gt;
&lt;br /&gt;
Read-only access is available for anonymous requests, except special content like machine serial numbers. But to process any changes, clients need to be authenticated.&lt;br /&gt;
&lt;br /&gt;
Right after creating any Sugar Network object, its author becomes the only user who can process any object modifications afterwards. Authority information will be kept in the [[#Sugar_Network_resources|author]] property and can be modified using the following commands.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;useradd&#039;&#039;&#039;&amp;amp;user=&#039;&#039;USER&#039;&#039;&amp;amp;role=&#039;&#039;ROLE&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Add another user who can modify the corresponding object. &#039;&#039;USER&#039;&#039; argument should be either &#039;&#039;User&#039;&#039; guid (for authors registered in the Sugar Network), or, full author name.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;userdel&#039;&#039;&#039;&amp;amp;user=&#039;&#039;USER&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Remove user from the authority list. It is not possible to remove yourself. &#039;&#039;USER&#039;&#039; argument should be either &#039;&#039;User&#039;&#039; guid (for authors registered in the Sugar Network), or, full author name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;TODO&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Retrieving releases ===&lt;br /&gt;
&lt;br /&gt;
To easy download Context [[#context-releases|releases]] and avoid reading raw &#039;&#039;Context.releases&#039;&#039; property, there are special high-level API commands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-solve&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;solve&#039;&#039;&#039;[&amp;amp;lsb_id=&#039;&#039;LSB_ID&#039;&#039;][&amp;amp;lsb_release=&#039;&#039;LSB_RELEASE&#039;&#039;][&amp;amp;assume=&#039;&#039;DEPENDENCY&#039;&#039;-&#039;&#039;VERSION&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
The command returns information about what particular releases should be downloaded depending on provided requirements. This command might return not only one release, e.g., activities might have dependencies either system packages or another Sugar Network Contexts.&lt;br /&gt;
&lt;br /&gt;
Solving requirements might be:&lt;br /&gt;
&lt;br /&gt;
* {{Code|LSB_ID}}, if Context releases depend on system packages, specify the [[Wikipedia:Linux_Standard_Base|LSB]] distributor id to consider while choosing particular packages;&lt;br /&gt;
* {{Code|LSB_RELEASE}}, if Context releases depend on system packages, specify the [[Wikipedia:Linux_Standard_Base|LSB]] release number of the distribution to consider while choosing particular packages;&lt;br /&gt;
* {{Code|DEPENDENCY-VERSION}}, the {{Code|assume}} argument instructs server to assume that specified [[Sugar_Network/Recipe_Specification#Dependencies|dependency]] is already available on client side and should be taken into account while solving; this is especially important for package dependencies when server considers packages available only from official repositories but users might have more recent package versions installed in local system; e.g., the above example request will fail without {{Code|sugar-0.94}} because neither {{Code|lsb_id}} nor {{Code|lsb_release}} were specified (even if LSB information is passed, server might not have information about what package versions come from official repositories).&lt;br /&gt;
&lt;br /&gt;
The resulting info is a JSON object with keys equal to Context guids and value objects for chosen release with the following keys:&lt;br /&gt;
&lt;br /&gt;
* {{Code|blob}}, bundle [[#resource-types|digest]] to download;&lt;br /&gt;
* {{Code|version}}, chosen version number;&lt;br /&gt;
* {{Code|title}}, the &#039;&#039;Context.title&#039;&#039; value;&lt;br /&gt;
* {{Code|command}}, a command to launch the bundle, only for Sugar activities.&lt;br /&gt;
&lt;br /&gt;
For example, the {{Code|&#039;&#039;&#039;GET&#039;&#039;&#039; &amp;lt;nowiki&amp;gt;/context/org.laptop.TurtleArtActivity?cmd=solve&amp;amp;assume=sugar-0.94&amp;lt;/nowiki&amp;gt;}} request returns:&lt;br /&gt;
&lt;br /&gt;
 {&lt;br /&gt;
   &amp;quot;org.laptop.TurtleArtActivity&amp;quot;: {&lt;br /&gt;
     &amp;quot;title&amp;quot;: &amp;quot;Turtle Blocks&amp;quot;,&lt;br /&gt;
     &amp;quot;version&amp;quot;: [[202], 0],&lt;br /&gt;
     &amp;quot;blob&amp;quot;: &amp;quot;http://download.sugarlabs.org/activities/4027/turtleblocks-202.xo&amp;quot;,&lt;br /&gt;
     &amp;quot;content-type&amp;quot;: &amp;quot;application/vnd.olpc-sugar&amp;quot;,&lt;br /&gt;
     &amp;quot;size&amp;quot;: 4715955,&lt;br /&gt;
     &amp;quot;unpack_size&amp;quot;: 12873871,&lt;br /&gt;
     &amp;quot;command&amp;quot;: [&amp;quot;activity&amp;quot;, &amp;quot;sugar-activity TurtleArtActivity.TurtleArtActivity&amp;quot;],&lt;br /&gt;
   },&lt;br /&gt;
   &amp;quot;sugar&amp;quot;: {&lt;br /&gt;
     &amp;quot;version&amp;quot;: [[0, 94], 0],&lt;br /&gt;
   },&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-clone&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Like the [[#GET-solve|solve]] command, &#039;&#039;clone&#039;&#039; makes a solution but returns bundle itself, so, there is no way to get information about possible dependencies.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;clone&#039;&#039;&#039;[&amp;amp;lsb_id=&#039;&#039;LSB_ID&#039;&#039;][&amp;amp;lsb_release=&#039;&#039;LSB_RELEASE&#039;&#039;][&amp;amp;assume=&#039;&#039;DEPENDENCY&#039;&#039;-&#039;&#039;VERSION&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
=== Upload releases ===&lt;br /&gt;
&lt;br /&gt;
To easy upload Context [[#context-releases|releases]] and avoid writing to raw &#039;&#039;Context.releases&#039;&#039; property, there is a special high-level API command.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;POST&#039;&#039;&#039; /context?cmd=&#039;&#039;&#039;submit&#039;&#039;&#039;[&amp;amp;&#039;&#039;PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;][&amp;amp;initial]&lt;br /&gt;
&lt;br /&gt;
Where the {{Code|PROP}} arguments are optional release properties. The {{Code|initial}} argument asks the system to create new Context resource new release will belong to.&lt;br /&gt;
&lt;br /&gt;
The posting data might be two types,&lt;br /&gt;
&lt;br /&gt;
* Sugar activities in .xo bundles,&amp;lt;br&amp;gt;there is no need in {{Code|PROP}} arguments, all properties will be populated basing on metadata from a .xo bundle; including release notes from the {{Code|CHANGELOG}} file in [[Wikipedia:Markdown|Markdown]] notation; besides, only in this case {{Code|initial}} makes sense because it is the only way to get Context properties;&lt;br /&gt;
&lt;br /&gt;
* Arbitrary data,&amp;lt;br&amp;gt;all required release properties should be specified in {{Code|PROP}} arguments, at least &#039;&#039;context&#039;&#039; and &#039;&#039;version&#039;&#039;; &#039;&#039;license&#039;&#039; should be specified only if there are no existing releases to pickup license from.&lt;br /&gt;
&lt;br /&gt;
=== Node statistics ===&lt;br /&gt;
&lt;br /&gt;
The node statistics are about the entire server and depersonalized. Statistics are being collected by analyzing regular requests to an API server and stored for each Sugar Network node. To read such info, call the command:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /?cmd=&#039;&#039;&#039;stats&#039;&#039;&#039;[&amp;amp;start=&#039;&#039;SECONDS&#039;&#039;][&amp;amp;end=&#039;&#039;SECONDS&#039;&#039;][&amp;amp;event=&#039;&#039;EVENT&#039;&#039;][&amp;amp;limit=&#039;&#039;NUMBER&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
&lt;br /&gt;
* {{Code|start}} and {{Code|end}} is a time interval to get statistics for; if omitted, the beginning and the end of entire life cycle will be used;&lt;br /&gt;
* {{Code|event}}, multiple argument to specify what stats should be returned; if omitted, return all sources;&lt;br /&gt;
* {{Code|limit}}, number of stat records to return for the {{Code|start}}-{{Code|end}} interval; note that this amount is not precise, the final resultset might be smaller or bigger depending on chosen resolution; stats resolution depends on node configuration, default values are 1 day, 10 days, 30 days, 365 days; if omitted, return {{Code|end}} record only.&lt;br /&gt;
&lt;br /&gt;
Possible events are:&lt;br /&gt;
&lt;br /&gt;
* {{Code|users}}, total number of existing &#039;&#039;User&#039;&#039; objects;&lt;br /&gt;
* {{Code|contexts}}, total number of existing &#039;&#039;Context&#039;&#039; objects;&lt;br /&gt;
* {{Code|released}}, average number of newly uploaded &#039;&#039;Context.releases&#039;&#039; for specified time frame;&lt;br /&gt;
* {{Code|solved}}, average number of requested &#039;&#039;Context&#039;&#039; [[#GET-solve|solutions]] for specified time frame; note that this value does not equal to the number of solution usages on client side since solutions might be cached;&lt;br /&gt;
* {{Code|reported}}, average number of newly uploaded failure &#039;&#039;Report&#039;&#039; objects for specified time frame;&lt;br /&gt;
* {{Code|topics}}, total number of top-level &#039;&#039;Post&#039;&#039; objects;&lt;br /&gt;
* {{Code|posts}}, total number of dependent &#039;&#039;Post&#039;&#039; objects.&lt;br /&gt;
&lt;br /&gt;
== Client API ==&lt;br /&gt;
&lt;br /&gt;
The reasons to proxy Sugar Network data on users side:&lt;br /&gt;
&lt;br /&gt;
* Seamless support [[#Offline mode|offline workflow]];&lt;br /&gt;
* [[#Launching|One-click launch]] Sugar activities hosted on Sugar Network.&lt;br /&gt;
&lt;br /&gt;
Proxying happens by providing the same Sugar Network API (with some extra functionality, see below) from&lt;br /&gt;
[[Platform_Team/Sugar_Network/Implementation#sugar-network-client|local process]] launched beforehand.&lt;br /&gt;
&lt;br /&gt;
=== Offline mode ===&lt;br /&gt;
&lt;br /&gt;
Being connected to a Sugar Network node, local proxy provides [[#Node_API|original API]] from the node. If the connection is lost, the proxy will switch to local Sugar Network storage and continue working providing only [[#Base_API|base API]]. Any content created in offline mode will be uploaded to the node after getting a connection back.&lt;br /&gt;
&lt;br /&gt;
Besides, local Sugar Network storage will be reused to keep users preferences, such as:&lt;br /&gt;
&lt;br /&gt;
* Favorited Contexts&amp;lt;br&amp;gt;to select preferred &#039;&#039;Context&#039;&#039; resources; these Contexts will be marked by {{Code|favorite}} value in the &#039;&#039;Context.layer&#039;&#039; property;&lt;br /&gt;
&lt;br /&gt;
* Checked-in Contexts&amp;lt;br&amp;gt;to keep most recent Context (for &#039;&#039;activity&#039;&#039; and &#039;&#039;book&#039;&#039; types) version in local storage to make it available in offline; note that there is no need in checking-in to speedup online lunch, versions are being [[#Launching|cached]] anyway; these Contexts will be marked by {{Code|checkin}} value in the &#039;&#039;Context.layer&#039;&#039; property.&lt;br /&gt;
&lt;br /&gt;
To control users preferences there are special API commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT_favorite&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;favorite&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Set favorite status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE_favorite&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;favorite&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Unset favorite status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT_checkin&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;checkin&#039;&#039;&#039;[&amp;amp;spawn]&lt;br /&gt;
&lt;br /&gt;
Check-in the specified Context. By default, the command will return streamed &#039;&#039;text/event-stream&#039;&#039; MIME type data to monitor the progress. If the {{Code|spawn}} argument is specified, the command will exit immediately with [[#Notifications|asynchronous sending]] progress events.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE_checkin&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;checkin&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Checkout the Context.&lt;br /&gt;
&lt;br /&gt;
=== Launching ===&lt;br /&gt;
&lt;br /&gt;
Sugar Network Contexts (for &#039;&#039;activity&#039;&#039; and &#039;&#039;book&#039;&#039; types) can be launched as-is. The launching process is implicit and includes selecting the most recent (and appropriate for software contexts) version, downloading bundles from the Sugar Network, installing missed [[Sugar_Network/Recipe_Specification#Dependencies|software dependencies]], execution itself. All downloaded bundles will be cached [with further garbage collecting] to speedup further launching.&lt;br /&gt;
&lt;br /&gt;
Sugar activities will be directly executed. Book Contexts will be opened in the proper application according to its MIME type.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;launch&#039;&#039;&#039;[&amp;amp;args=&#039;&#039;ARG&#039;&#039;][&amp;amp;activity_id=&#039;&#039;ACTIVITY_ID&#039;&#039;][&amp;amp;object_id=&#039;&#039;OBJECT_ID&#039;&#039;][&amp;amp;uri=&#039;&#039;URI&#039;&#039;][&amp;amp;app=&#039;&#039;APP&#039;&#039;][&amp;amp;spawn]&lt;br /&gt;
&lt;br /&gt;
Arguments that make sense only for Sugar activities:&lt;br /&gt;
&lt;br /&gt;
* {{Code|ARG}}, command line argument to pass to launched activities, repeat {{Code|ARG}} for each argument;&lt;br /&gt;
* {{Code|ACTIVITY_ID}}, internal activity id which will be auto set if omitted;&lt;br /&gt;
* {{Code|OBJECT_ID}}, Journal object id to resume;&lt;br /&gt;
* {{Code|URI}}, URL to resume if activity supports this functionality.&lt;br /&gt;
&lt;br /&gt;
Arguments that make sense only for books:&lt;br /&gt;
&lt;br /&gt;
* {{Code|APP}}, specify application Context to open the book by; if omitted, the system will try to find most appropriate option, among all existing software Contexts.&lt;br /&gt;
&lt;br /&gt;
Common arguments:&lt;br /&gt;
&lt;br /&gt;
* {{Code|spawn}}, by default, the command will return streamed &#039;&#039;text/event-stream&#039;&#039; MIME type data to monitor the whole launching process until exiting the application; if the {{Code|spawn}} argument is specified, the command will exit immediately with [[#Notifications|asynchronous sending]] launching events.&lt;br /&gt;
&lt;br /&gt;
== Experimental API ==&lt;br /&gt;
&lt;br /&gt;
There is no guaranty that the following API will be stated as stable or frozen sometime.&lt;br /&gt;
&lt;br /&gt;
=== Access to Sugar Journal ===&lt;br /&gt;
&lt;br /&gt;
It is possible to get access to local Sugar Journal using special, &#039;&#039;journal&#039;&#039;, resource provided from [[#Client_API|client API]]. This kind of access might be useful when local applications cannot use DBus sugar-datastore API, e.g., [[wikipedia:Javascript|Javascript]] applications. API to Journal is restricted only to read-only access:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /journal?offset=&#039;&#039;INTEGER&#039;&#039;&amp;amp;limit=&#039;&#039;INTEGER&#039;&#039;[&amp;amp;query=&#039;&#039;STRING&#039;&#039;][&amp;amp;order_by=&amp;lt;nowiki&amp;gt;[+|-]&amp;lt;/nowiki&amp;gt;&#039;&#039;PROP&#039;&#039;][&amp;amp;&#039;&#039;QUERY_PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;[&amp;amp;...]]&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /journal/&#039;&#039;JOURNAL_ID&#039;&#039;[?reply=&#039;&#039;PROP&#039;&#039;[,..]]&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /journal/&#039;&#039;JOURNAL_ID&#039;&#039;/&#039;&#039;PROPERTY&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
Being HTTP based, Sugar Network API can be used in any manner regular HTTP requests can be handled. But for command-line access, there is a handy tool, {{Code|sugar-network}}, which takes care about Sugar Network specific like launching local API (if it is not already available) to get access to [[#Client_API|local proxy]].&lt;br /&gt;
&lt;br /&gt;
The sugar-network command-line format is below. Call {{Code|sugar-network --help}} for more detailed info.&lt;br /&gt;
&lt;br /&gt;
 sugar-network GET|POST|PUT|DELETE &#039;&#039;PATH&#039;&#039; &#039;&#039;ARG=VALUE&#039;&#039; [..]&lt;br /&gt;
&lt;br /&gt;
* {{Code|PATH}}, is an url path;&lt;br /&gt;
* {{Code|ARG&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;VALUE}}, request arguments as they being passed to in url.&lt;br /&gt;
&lt;br /&gt;
{{Code|POST}} and {{Code|PUT}} commands require data to pass, use the following command-line arguments:&lt;br /&gt;
&lt;br /&gt;
* {{Code|-f FILE}} to specify the file to pass;&lt;br /&gt;
* {{Code|-d DATA}} to specify string to pass;&lt;br /&gt;
* {{Code|-j}} posted data should be encoded into JSON before posting.&lt;br /&gt;
&lt;br /&gt;
== Getting involved ==&lt;br /&gt;
&lt;br /&gt;
{{:Sugar_Network/Feedback}}&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Node_Statistics&amp;diff=92541</id>
		<title>Sugar Network/Node Statistics</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Node_Statistics&amp;diff=92541"/>
		<updated>2014-05-13T14:12:27Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: Redirected page to Sugar Network/API#Node statistics&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Sugar_Network/API#Node_statistics]]&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Sugar_Network/API&amp;diff=92540</id>
		<title>Sugar Network/API</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Sugar_Network/API&amp;diff=92540"/>
		<updated>2014-05-13T14:10:25Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: /* Node statistics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the API that Sugar Network clients use to interact with a Sugar Network server. See also a guide to basic Sugar Network [[Sugar_Network/Concept|concepts]] and [[Platform_Team/Sugar_Network/Architecture|its twin page]] for a technical point of view. In addition, visit the [[Sugar_Network|introduction page]].&lt;br /&gt;
&lt;br /&gt;
{{Note/warning|Note|Until announcing API freeze, this document describes the most recent development version of the API.&amp;lt;br&amp;gt;You can find its implementation on the [[#API servers|node-devel.sugarlabs.org]] server.}}&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
To better understand this API, see a technical explanation of its [[Platform_Team/Sugar_Network/Architecture#Conceptual_level|conceptual level]] and [[#Sugar_Network_resources|objects model]] in particular.&lt;br /&gt;
&lt;br /&gt;
The API operates with [[Sugar Network]] [[#Sugar_Network_resources|resources]], which are collections of objects. All objects are identified by globally unique identifiers, GUIDs, and available for operation via [[#Base_API|basic actions]]. The API is being provided from a [[#API_servers|node server]] or a [[#Client_API|client]]. While processing requests, API providers generate [[#Notifications|events]].&lt;br /&gt;
&lt;br /&gt;
The API is [[Wikipedia:Restful|RESTful]], and is served via HTTP(S) using [[Wikipedia:Json|JSON]] notation. The common request url format is:&lt;br /&gt;
&lt;br /&gt;
 http[s]://&#039;&#039;SERVER&#039;&#039;[/&#039;&#039;RESOURCE&#039;&#039;[/&#039;&#039;GUID&#039;&#039;[/&#039;&#039;PROPERTY&#039;&#039;]]][?[cmd=&#039;&#039;COMMAND&#039;&#039;][&amp;amp;&#039;&#039;ARGUMENT&#039;&#039;=&#039;&#039;VALUE&#039;&#039;..]]&lt;br /&gt;
&lt;br /&gt;
When:&lt;br /&gt;
&lt;br /&gt;
* {{Code|SERVER}}, [[#API_servers|particular]] Sugar Network API server;&lt;br /&gt;
* {{Code|RESOURCE}}, name one of the [[#Sugar_Network_resources|existing]] resources;&lt;br /&gt;
* {{Code|GUID}}, the {{Code|RESOURCE}}&#039;s particular object;&lt;br /&gt;
* {{Code|PROPERTY}}, particular property of {{Code|GUID}} object;&lt;br /&gt;
* {{Code|COMMAND}}, optional command name; combination of HTTP request method ({{Code|GET}}, {{Code|POST}}, {{Code|PUT}}, or, {{Code|DELETE}}) and [possibly empty] {{Code|COMMAND}} composes the requested [[#Actions|action]];&lt;br /&gt;
* {{Code|ARGUMENT}}s and {{Code|VALUE}}s depend on the particular [[#Actions|action]].&lt;br /&gt;
&lt;br /&gt;
In most cases, the server replies in JSON notation. If a request fails, the replied JSON object will contain a {{Code|request}} key, with the original request, and {{Code|error}} key, with an error message.&lt;br /&gt;
&lt;br /&gt;
== API servers ==&lt;br /&gt;
&lt;br /&gt;
These are standard Sugar Network API servers publicly available.&lt;br /&gt;
&lt;br /&gt;
* [http://node-devel.sugarlabs.org/ node-devel.sugarlabs.org]&amp;lt;br&amp;gt;Development server which does not contain important data and is free for any experiments (administrative privileges for anonymous users);&lt;br /&gt;
&lt;br /&gt;
* [http://node-testing.sugarlabs.org/ node-testing.sugarlabs.org]&amp;lt;br&amp;gt;Recent stable release with regular data import from the production server; is still free for any experiments;&lt;br /&gt;
&lt;br /&gt;
* [http://node.sugarlabs.org/ node.sugarlabs.org]&amp;lt;br&amp;gt;Production server;&lt;br /&gt;
&lt;br /&gt;
* [http://localhost:5001/ localhost:5001]&amp;lt;br&amp;gt;default url to get access to [[#Client_API|local proxy]] provided from user side application.&lt;br /&gt;
&lt;br /&gt;
== Sugar Network resources ==&lt;br /&gt;
&lt;br /&gt;
{{:Sugar_Network/Resources}}&lt;br /&gt;
&lt;br /&gt;
== Base API ==&lt;br /&gt;
&lt;br /&gt;
List of actions common of all API providers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;POST&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;POST&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create new resource object.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to send:&lt;br /&gt;
* {{Code|&#039;&#039;RESOURCE}}&#039;s properties.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to receive:&lt;br /&gt;
* {{Code|guid}}, with globally unique identifier that specifies the created object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Modify resource object. By default, might be called only by {{Code|GUID}} creator.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to send:&lt;br /&gt;
* {{Code|RESOURCE}}&#039;s properties to modify.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Delete resource object. Actual object destruction won&#039;t happen, the object will be hidden. Garbage collection of hidden objects will be processed by Network administrators. By default, this action may be called only by the {{Code|GUID}} creator.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;[?offset=&#039;&#039;INTEGER&#039;&#039;][&amp;amp;limit=&#039;&#039;INTEGER&#039;&#039;][&amp;amp;query=&#039;&#039;STRING&#039;&#039;][&amp;amp;reply=&#039;&#039;PROP&#039;&#039;][&amp;amp;order_by=&amp;lt;nowiki&amp;gt;[+|-]&amp;lt;/nowiki&amp;gt;&#039;&#039;PROP&#039;&#039;][&amp;amp;group_by=&#039;&#039;PROP&#039;&#039;][&amp;amp;&#039;&#039;PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;][&amp;amp;&#039;&#039;!PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
Find resource objects.&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
* {{Code|offset}}, &#039;&#039;int&#039;&#039;&amp;lt;br&amp;gt;start index to return entries from, the default value is {{Code|0}};&lt;br /&gt;
* {{Code|limit}}, &#039;&#039;int&#039;&#039;&amp;lt;br&amp;gt;do not return more then specified value, maximal and default values are being setup on server side;&lt;br /&gt;
* {{Code|query}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;search request in [http://xapian.org/docs/queryparser.html Xapian] notation with the following additions:&lt;br /&gt;
** if property is boolean, integer or datetime, it supports searching by ranges: {{Code|&#039;&#039;PROP&#039;&#039;:[&#039;&#039;START&#039;&#039;]..[&#039;&#039;END&#039;&#039;]}};&lt;br /&gt;
** the statement {{Code|&#039;&#039;PROP&#039;&#039;&amp;lt;nowiki&amp;gt;:=&amp;lt;/nowiki&amp;gt;[&amp;quot;]&#039;&#039;VALUE&#039;&#039;[&amp;quot;]}} has the same effect as {{Code|QUERY_PROP}}; it is different to regular {{Code|&#039;&#039;PROP&#039;&#039;:&#039;&#039;VALUE&#039;&#039;}} where {{Code|VALUE}} might be a substring;&lt;br /&gt;
* {{Code|PROP}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;supplements {{Code|query}} with filtering by exact value of the {{Code|PROP}} property; the resulting query string will be {{Code|&#039;&#039;PROP&#039;&#039;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&#039;&#039;VALUE&#039;&#039; AND (&#039;&#039;QUERY&#039;&#039;)}}; argument is multiple;&lt;br /&gt;
* {{Code|!PROP}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;supplements {{Code|query}} by excluding exact value of the {{Code|PROP}} property; the resulting query string will be {{Code|NOT &#039;&#039;PROP&#039;&#039;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&#039;&#039;VALUE&#039;&#039; AND (&#039;&#039;QUERY&#039;&#039;)}}; argument is multiple;&lt;br /&gt;
* {{Code|reply}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;RESOURCE&#039;&#039; properties to return; by default, return only {{Code|guid}} property; argument is multiple;&lt;br /&gt;
* {{Code|order_by}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;property to sort the resulting list by; if starts with the {{Code|-}}, the order is descending, otherwise it is ascending;&lt;br /&gt;
* {{Code|group_by}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;property name to group resulting list by.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to receive:&lt;br /&gt;
* {{Code|total}}, total number in requested query (the reply might contain only the portion restricted by {{Code|limit}} request argument);&lt;br /&gt;
* {{Code|result}}, an array of dictionaries with resource object properties, dictionaries contain at least {{Code|guid}} property.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-resource&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;[?reply=&#039;&#039;PROP&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
* {{Code|reply}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;RESOURCE&#039;&#039; properties to return; by default, return only {{Code|guid}} property; argument is multiple;&lt;br /&gt;
&lt;br /&gt;
Return properties for a particular resource object.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to receive:&lt;br /&gt;
* properties that were specified in {{Code|reply}} argument(s), at least {{Code|guid}}.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-property&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Return property value for particular resource object.&lt;br /&gt;
&lt;br /&gt;
Data to receive:&lt;br /&gt;
* property value in JSON notation for regular properties;&lt;br /&gt;
* raw data or redirection for BLOB properties.&lt;br /&gt;
&lt;br /&gt;
=== Aggregated properties ===&lt;br /&gt;
&lt;br /&gt;
[[#resource-types|Aggregated]] properties have special API to treat their content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;POST-aggproperty&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;POST&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Submit new item. The command returns an id for newly created aggregated item. Depending on particular property, new items might be created not only by object&#039;s authors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT-aggproperty&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;/&#039;&#039;ID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Update existing aggregated item. Depending on particular property, the command is allowed either to object&#039;s authors or to aggregated item submitter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE-aggproperty&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;/&#039;&#039;ID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Delete existing aggregated item. Depending on particular property, the command is allowed either to object&#039;s authors or to aggregated item submitter.&lt;br /&gt;
&lt;br /&gt;
=== Notifications ===&lt;br /&gt;
&lt;br /&gt;
It is possible to subscribe to server events. Notification will happen using HTML5 [[wikipedia:Server-sent_events|Server-sent events]] (SSE).&lt;br /&gt;
&lt;br /&gt;
To start subscription, send the following request:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /?cmd=&#039;&#039;&#039;subscribe&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Response will be served with &#039;&#039;text/event-stream&#039;&#039; MIME type for default SSE message type. SSE message will be a JSONified object with the following, at least, attributes:&lt;br /&gt;
&lt;br /&gt;
* {{Code|event}}&amp;lt;br&amp;gt;event type.&lt;br /&gt;
&lt;br /&gt;
== Node API ==&lt;br /&gt;
&lt;br /&gt;
This is an API provided by Sugar Network nodes on top of [[#Base_API|base one]].&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
&lt;br /&gt;
Right now, the only way to be authenticated on a Sugar Network server is by running a [[Platform_Team/Sugar_Network/Implementation#sugar-network-client|local application]] on the client side and using the API it [[#Client_API|provides]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;TODO&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Authorization ===&lt;br /&gt;
&lt;br /&gt;
Read-only access is available for anonymous requests, except special content like machine serial numbers. But to process any changes, clients need to be authenticated.&lt;br /&gt;
&lt;br /&gt;
Right after creating any Sugar Network object, its author becomes the only user who can process any object modifications afterwards. Authority information will be kept in the [[#Sugar_Network_resources|author]] property and can be modified using the following commands.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;useradd&#039;&#039;&#039;&amp;amp;user=&#039;&#039;USER&#039;&#039;&amp;amp;role=&#039;&#039;ROLE&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Add another user who can modify the corresponding object. &#039;&#039;USER&#039;&#039; argument should be either &#039;&#039;User&#039;&#039; guid (for authors registered in the Sugar Network), or, full author name.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;userdel&#039;&#039;&#039;&amp;amp;user=&#039;&#039;USER&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Remove user from the authority list. It is not possible to remove yourself. &#039;&#039;USER&#039;&#039; argument should be either &#039;&#039;User&#039;&#039; guid (for authors registered in the Sugar Network), or, full author name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;TODO&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Retrieving releases ===&lt;br /&gt;
&lt;br /&gt;
To easy download Context [[#context-releases|releases]] and avoid reading raw &#039;&#039;Context.releases&#039;&#039; property, there are special high-level API commands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-solve&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;solve&#039;&#039;&#039;[&amp;amp;lsb_id=&#039;&#039;LSB_ID&#039;&#039;][&amp;amp;lsb_release=&#039;&#039;LSB_RELEASE&#039;&#039;][&amp;amp;assume=&#039;&#039;DEPENDENCY&#039;&#039;-&#039;&#039;VERSION&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
The command returns information about what particular releases should be downloaded depending on provided requirements. This command might return not only one release, e.g., activities might have dependencies either system packages or another Sugar Network Contexts.&lt;br /&gt;
&lt;br /&gt;
Solving requirements might be:&lt;br /&gt;
&lt;br /&gt;
* {{Code|LSB_ID}}, if Context releases depend on system packages, specify the [[Wikipedia:Linux_Standard_Base|LSB]] distributor id to consider while choosing particular packages;&lt;br /&gt;
* {{Code|LSB_RELEASE}}, if Context releases depend on system packages, specify the [[Wikipedia:Linux_Standard_Base|LSB]] release number of the distribution to consider while choosing particular packages;&lt;br /&gt;
* {{Code|DEPENDENCY-VERSION}}, the {{Code|assume}} argument instructs server to assume that specified [[Sugar_Network/Recipe_Specification#Dependencies|dependency]] is already available on client side and should be taken into account while solving; this is especially important for package dependencies when server considers packages available only from official repositories but users might have more recent package versions installed in local system; e.g., the above example request will fail without {{Code|sugar-0.94}} because neither {{Code|lsb_id}} nor {{Code|lsb_release}} were specified (even if LSB information is passed, server might not have information about what package versions come from official repositories).&lt;br /&gt;
&lt;br /&gt;
The resulting info is a JSON object with keys equal to Context guids and value objects for chosen release with the following keys:&lt;br /&gt;
&lt;br /&gt;
* {{Code|blob}}, bundle [[#resource-types|digest]] to download;&lt;br /&gt;
* {{Code|version}}, chosen version number;&lt;br /&gt;
* {{Code|title}}, the &#039;&#039;Context.title&#039;&#039; value;&lt;br /&gt;
* {{Code|command}}, a command to launch the bundle, only for Sugar activities.&lt;br /&gt;
&lt;br /&gt;
For example, the {{Code|&#039;&#039;&#039;GET&#039;&#039;&#039; &amp;lt;nowiki&amp;gt;/context/org.laptop.TurtleArtActivity?cmd=solve&amp;amp;assume=sugar-0.94&amp;lt;/nowiki&amp;gt;}} request returns:&lt;br /&gt;
&lt;br /&gt;
 {&lt;br /&gt;
   &amp;quot;org.laptop.TurtleArtActivity&amp;quot;: {&lt;br /&gt;
     &amp;quot;title&amp;quot;: &amp;quot;Turtle Blocks&amp;quot;,&lt;br /&gt;
     &amp;quot;version&amp;quot;: [[202], 0],&lt;br /&gt;
     &amp;quot;blob&amp;quot;: &amp;quot;http://download.sugarlabs.org/activities/4027/turtleblocks-202.xo&amp;quot;,&lt;br /&gt;
     &amp;quot;content-type&amp;quot;: &amp;quot;application/vnd.olpc-sugar&amp;quot;,&lt;br /&gt;
     &amp;quot;size&amp;quot;: 4715955,&lt;br /&gt;
     &amp;quot;unpack_size&amp;quot;: 12873871,&lt;br /&gt;
     &amp;quot;command&amp;quot;: [&amp;quot;activity&amp;quot;, &amp;quot;sugar-activity TurtleArtActivity.TurtleArtActivity&amp;quot;],&lt;br /&gt;
   },&lt;br /&gt;
   &amp;quot;sugar&amp;quot;: {&lt;br /&gt;
     &amp;quot;version&amp;quot;: [[0, 94], 0],&lt;br /&gt;
   },&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-clone&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Like the [[#GET-solve|solve]] command, &#039;&#039;clone&#039;&#039; makes a solution but returns bundle itself, so, there is no way to get information about possible dependencies.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;clone&#039;&#039;&#039;[&amp;amp;lsb_id=&#039;&#039;LSB_ID&#039;&#039;][&amp;amp;lsb_release=&#039;&#039;LSB_RELEASE&#039;&#039;][&amp;amp;assume=&#039;&#039;DEPENDENCY&#039;&#039;-&#039;&#039;VERSION&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
=== Upload releases ===&lt;br /&gt;
&lt;br /&gt;
To easy upload Context [[#context-releases|releases]] and avoid writing to raw &#039;&#039;Context.releases&#039;&#039; property, there is a special high-level API command.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;POST&#039;&#039;&#039; /context?cmd=&#039;&#039;&#039;submit&#039;&#039;&#039;[&amp;amp;&#039;&#039;PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;][&amp;amp;initial]&lt;br /&gt;
&lt;br /&gt;
Where the {{Code|PROP}} arguments are optional release properties. The {{Code|initial}} argument asks the system to create new Context resource new release will belong to.&lt;br /&gt;
&lt;br /&gt;
The posting data might be two types,&lt;br /&gt;
&lt;br /&gt;
* Sugar activities in .xo bundles,&amp;lt;br&amp;gt;there is no need in {{Code|PROP}} arguments, all properties will be populated basing on metadata from a .xo bundle; including release notes from the {{Code|CHANGELOG}} file in [[Wikipedia:Markdown|Markdown]] notation; besides, only in this case {{Code|initial}} makes sense because it is the only way to get Context properties;&lt;br /&gt;
&lt;br /&gt;
* Arbitrary data,&amp;lt;br&amp;gt;all required release properties should be specified in {{Code|PROP}} arguments, at least &#039;&#039;context&#039;&#039; and &#039;&#039;version&#039;&#039;; &#039;&#039;license&#039;&#039; should be specified only if there are no existing releases to pickup license from.&lt;br /&gt;
&lt;br /&gt;
=== Node statistics ===&lt;br /&gt;
&lt;br /&gt;
The node statistics are about the entire server and depersonalized. Statistics are being collected by analyzing regular requests to an API server and stored for each Sugar Network node. To read such info, call the command:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /?cmd=&#039;&#039;&#039;stats&#039;&#039;&#039;[&amp;amp;start=&#039;&#039;SECONDS&#039;&#039;][&amp;amp;end=&#039;&#039;SECONDS&#039;&#039;][&amp;amp;event=&#039;&#039;EVENT&#039;&#039;][&amp;amp;limit=&#039;&#039;NUMBER&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
&lt;br /&gt;
* {{Code|start}} and {{Code|end}} is a time interval to get statistics for; if omitted, the beginning and the end of entire life cycle will be used;&lt;br /&gt;
* {{Code|event}}, multiple argument to specify what [[Sugar_Network/Node_Statistics#Common_statistics|stats]] should be returned; if omitted, return all sources;&lt;br /&gt;
* {{Code|limit}}, number of stat records to return for the {{Code|start}}-{{Code|end}} interval; note that this amount is not precise, the final resultset might be smaller or bigger depending on chosen resolution; stats resolution depends on node configuration, default values are 1 day, 10 days, 30 days, 365 days; if omitted, return {{Code|end}} record only.&lt;br /&gt;
&lt;br /&gt;
Possible events are:&lt;br /&gt;
&lt;br /&gt;
* {{Code|users}}, total number of existing &#039;&#039;User&#039;&#039; objects;&lt;br /&gt;
* {{Code|contexts}}, total number of existing &#039;&#039;Context&#039;&#039; objects;&lt;br /&gt;
* {{Code|released}}, average number of newly uploaded &#039;&#039;Context.releases&#039;&#039; for specified time frame;&lt;br /&gt;
* {{Code|solved}}, average number of requested &#039;&#039;Context&#039;&#039; [[#GET-solve|solutions]] for specified time frame; note that this value does not equal to the number of solution usages on client side since solutions might be cached;&lt;br /&gt;
* {{Code|reported}}, average number of newly uploaded failure &#039;&#039;Report&#039;&#039; objects for specified time frame;&lt;br /&gt;
* {{Code|topics}}, total number of top-level &#039;&#039;Post&#039;&#039; objects;&lt;br /&gt;
* {{Code|posts}}, total number of dependent &#039;&#039;Post&#039;&#039; objects.&lt;br /&gt;
&lt;br /&gt;
== Client API ==&lt;br /&gt;
&lt;br /&gt;
The reasons to proxy Sugar Network data on users side:&lt;br /&gt;
&lt;br /&gt;
* Seamless support [[#Offline mode|offline workflow]];&lt;br /&gt;
* [[#Launching|One-click launch]] Sugar activities hosted on Sugar Network.&lt;br /&gt;
&lt;br /&gt;
Proxying happens by providing the same Sugar Network API (with some extra functionality, see below) from&lt;br /&gt;
[[Platform_Team/Sugar_Network/Implementation#sugar-network-client|local process]] launched beforehand.&lt;br /&gt;
&lt;br /&gt;
=== Offline mode ===&lt;br /&gt;
&lt;br /&gt;
Being connected to a Sugar Network node, local proxy provides [[#Node_API|original API]] from the node. If the connection is lost, the proxy will switch to local Sugar Network storage and continue working providing only [[#Base_API|base API]]. Any content created in offline mode will be uploaded to the node after getting a connection back.&lt;br /&gt;
&lt;br /&gt;
Besides, local Sugar Network storage will be reused to keep users preferences, such as:&lt;br /&gt;
&lt;br /&gt;
* Favorited Contexts&amp;lt;br&amp;gt;to select preferred &#039;&#039;Context&#039;&#039; resources; these Contexts will be marked by {{Code|favorite}} value in the &#039;&#039;Context.layer&#039;&#039; property;&lt;br /&gt;
&lt;br /&gt;
* Checked-in Contexts&amp;lt;br&amp;gt;to keep most recent Context (for &#039;&#039;activity&#039;&#039; and &#039;&#039;book&#039;&#039; types) version in local storage to make it available in offline; note that there is no need in checking-in to speedup online lunch, versions are being [[#Launching|cached]] anyway; these Contexts will be marked by {{Code|checkin}} value in the &#039;&#039;Context.layer&#039;&#039; property.&lt;br /&gt;
&lt;br /&gt;
To control users preferences there are special API commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT_favorite&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;favorite&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Set favorite status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE_favorite&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;favorite&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Unset favorite status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT_checkin&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;checkin&#039;&#039;&#039;[&amp;amp;spawn]&lt;br /&gt;
&lt;br /&gt;
Check-in the specified Context. By default, the command will return streamed &#039;&#039;text/event-stream&#039;&#039; MIME type data to monitor the progress. If the {{Code|spawn}} argument is specified, the command will exit immediately with [[#Notifications|asynchronous sending]] progress events.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE_checkin&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;checkin&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Checkout the Context.&lt;br /&gt;
&lt;br /&gt;
=== Launching ===&lt;br /&gt;
&lt;br /&gt;
Sugar Network Contexts (for &#039;&#039;activity&#039;&#039; and &#039;&#039;book&#039;&#039; types) can be launched as-is. The launching process is implicit and includes selecting the most recent (and appropriate for software contexts) version, downloading bundles from the Sugar Network, installing missed [[Sugar_Network/Recipe_Specification#Dependencies|software dependencies]], execution itself. All downloaded bundles will be cached [with further garbage collecting] to speedup further launching.&lt;br /&gt;
&lt;br /&gt;
Sugar activities will be directly executed. Book Contexts will be opened in the proper application according to its MIME type.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;launch&#039;&#039;&#039;[&amp;amp;args=&#039;&#039;ARG&#039;&#039;][&amp;amp;activity_id=&#039;&#039;ACTIVITY_ID&#039;&#039;][&amp;amp;object_id=&#039;&#039;OBJECT_ID&#039;&#039;][&amp;amp;uri=&#039;&#039;URI&#039;&#039;][&amp;amp;app=&#039;&#039;APP&#039;&#039;][&amp;amp;spawn]&lt;br /&gt;
&lt;br /&gt;
Arguments that make sense only for Sugar activities:&lt;br /&gt;
&lt;br /&gt;
* {{Code|ARG}}, command line argument to pass to launched activities, repeat {{Code|ARG}} for each argument;&lt;br /&gt;
* {{Code|ACTIVITY_ID}}, internal activity id which will be auto set if omitted;&lt;br /&gt;
* {{Code|OBJECT_ID}}, Journal object id to resume;&lt;br /&gt;
* {{Code|URI}}, URL to resume if activity supports this functionality.&lt;br /&gt;
&lt;br /&gt;
Arguments that make sense only for books:&lt;br /&gt;
&lt;br /&gt;
* {{Code|APP}}, specify application Context to open the book by; if omitted, the system will try to find most appropriate option, among all existing software Contexts.&lt;br /&gt;
&lt;br /&gt;
Common arguments:&lt;br /&gt;
&lt;br /&gt;
* {{Code|spawn}}, by default, the command will return streamed &#039;&#039;text/event-stream&#039;&#039; MIME type data to monitor the whole launching process until exiting the application; if the {{Code|spawn}} argument is specified, the command will exit immediately with [[#Notifications|asynchronous sending]] launching events.&lt;br /&gt;
&lt;br /&gt;
== Experimental API ==&lt;br /&gt;
&lt;br /&gt;
There is no guaranty that the following API will be stated as stable or frozen sometime.&lt;br /&gt;
&lt;br /&gt;
=== Access to Sugar Journal ===&lt;br /&gt;
&lt;br /&gt;
It is possible to get access to local Sugar Journal using special, &#039;&#039;journal&#039;&#039;, resource provided from [[#Client_API|client API]]. This kind of access might be useful when local applications cannot use DBus sugar-datastore API, e.g., [[wikipedia:Javascript|Javascript]] applications. API to Journal is restricted only to read-only access:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /journal?offset=&#039;&#039;INTEGER&#039;&#039;&amp;amp;limit=&#039;&#039;INTEGER&#039;&#039;[&amp;amp;query=&#039;&#039;STRING&#039;&#039;][&amp;amp;order_by=&amp;lt;nowiki&amp;gt;[+|-]&amp;lt;/nowiki&amp;gt;&#039;&#039;PROP&#039;&#039;][&amp;amp;&#039;&#039;QUERY_PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;[&amp;amp;...]]&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /journal/&#039;&#039;JOURNAL_ID&#039;&#039;[?reply=&#039;&#039;PROP&#039;&#039;[,..]]&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /journal/&#039;&#039;JOURNAL_ID&#039;&#039;/&#039;&#039;PROPERTY&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
Being HTTP based, Sugar Network API can be used in any manner regular HTTP requests can be handled. But for command-line access, there is a handy tool, {{Code|sugar-network}}, which takes care about Sugar Network specific like launching local API (if it is not already available) to get access to [[#Client_API|local proxy]].&lt;br /&gt;
&lt;br /&gt;
The sugar-network command-line format is below. Call {{Code|sugar-network --help}} for more detailed info.&lt;br /&gt;
&lt;br /&gt;
 sugar-network GET|POST|PUT|DELETE &#039;&#039;PATH&#039;&#039; &#039;&#039;ARG=VALUE&#039;&#039; [..]&lt;br /&gt;
&lt;br /&gt;
* {{Code|PATH}}, is an url path;&lt;br /&gt;
* {{Code|ARG&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;VALUE}}, request arguments as they being passed to in url.&lt;br /&gt;
&lt;br /&gt;
{{Code|POST}} and {{Code|PUT}} commands require data to pass, use the following command-line arguments:&lt;br /&gt;
&lt;br /&gt;
* {{Code|-f FILE}} to specify the file to pass;&lt;br /&gt;
* {{Code|-d DATA}} to specify string to pass;&lt;br /&gt;
* {{Code|-j}} posted data should be encoded into JSON before posting.&lt;br /&gt;
&lt;br /&gt;
== Getting involved ==&lt;br /&gt;
&lt;br /&gt;
{{:Sugar_Network/Feedback}}&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Sugar_Network/API&amp;diff=92539</id>
		<title>Sugar Network/API</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Sugar_Network/API&amp;diff=92539"/>
		<updated>2014-05-13T14:08:53Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: /* Node statistics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the API that Sugar Network clients use to interact with a Sugar Network server. See also a guide to basic Sugar Network [[Sugar_Network/Concept|concepts]] and [[Platform_Team/Sugar_Network/Architecture|its twin page]] for a technical point of view. In addition, visit the [[Sugar_Network|introduction page]].&lt;br /&gt;
&lt;br /&gt;
{{Note/warning|Note|Until announcing API freeze, this document describes the most recent development version of the API.&amp;lt;br&amp;gt;You can find its implementation on the [[#API servers|node-devel.sugarlabs.org]] server.}}&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
To better understand this API, see a technical explanation of its [[Platform_Team/Sugar_Network/Architecture#Conceptual_level|conceptual level]] and [[#Sugar_Network_resources|objects model]] in particular.&lt;br /&gt;
&lt;br /&gt;
The API operates with [[Sugar Network]] [[#Sugar_Network_resources|resources]], which are collections of objects. All objects are identified by globally unique identifiers, GUIDs, and available for operation via [[#Base_API|basic actions]]. The API is being provided from a [[#API_servers|node server]] or a [[#Client_API|client]]. While processing requests, API providers generate [[#Notifications|events]].&lt;br /&gt;
&lt;br /&gt;
The API is [[Wikipedia:Restful|RESTful]], and is served via HTTP(S) using [[Wikipedia:Json|JSON]] notation. The common request url format is:&lt;br /&gt;
&lt;br /&gt;
 http[s]://&#039;&#039;SERVER&#039;&#039;[/&#039;&#039;RESOURCE&#039;&#039;[/&#039;&#039;GUID&#039;&#039;[/&#039;&#039;PROPERTY&#039;&#039;]]][?[cmd=&#039;&#039;COMMAND&#039;&#039;][&amp;amp;&#039;&#039;ARGUMENT&#039;&#039;=&#039;&#039;VALUE&#039;&#039;..]]&lt;br /&gt;
&lt;br /&gt;
When:&lt;br /&gt;
&lt;br /&gt;
* {{Code|SERVER}}, [[#API_servers|particular]] Sugar Network API server;&lt;br /&gt;
* {{Code|RESOURCE}}, name one of the [[#Sugar_Network_resources|existing]] resources;&lt;br /&gt;
* {{Code|GUID}}, the {{Code|RESOURCE}}&#039;s particular object;&lt;br /&gt;
* {{Code|PROPERTY}}, particular property of {{Code|GUID}} object;&lt;br /&gt;
* {{Code|COMMAND}}, optional command name; combination of HTTP request method ({{Code|GET}}, {{Code|POST}}, {{Code|PUT}}, or, {{Code|DELETE}}) and [possibly empty] {{Code|COMMAND}} composes the requested [[#Actions|action]];&lt;br /&gt;
* {{Code|ARGUMENT}}s and {{Code|VALUE}}s depend on the particular [[#Actions|action]].&lt;br /&gt;
&lt;br /&gt;
In most cases, the server replies in JSON notation. If a request fails, the replied JSON object will contain a {{Code|request}} key, with the original request, and {{Code|error}} key, with an error message.&lt;br /&gt;
&lt;br /&gt;
== API servers ==&lt;br /&gt;
&lt;br /&gt;
These are standard Sugar Network API servers publicly available.&lt;br /&gt;
&lt;br /&gt;
* [http://node-devel.sugarlabs.org/ node-devel.sugarlabs.org]&amp;lt;br&amp;gt;Development server which does not contain important data and is free for any experiments (administrative privileges for anonymous users);&lt;br /&gt;
&lt;br /&gt;
* [http://node-testing.sugarlabs.org/ node-testing.sugarlabs.org]&amp;lt;br&amp;gt;Recent stable release with regular data import from the production server; is still free for any experiments;&lt;br /&gt;
&lt;br /&gt;
* [http://node.sugarlabs.org/ node.sugarlabs.org]&amp;lt;br&amp;gt;Production server;&lt;br /&gt;
&lt;br /&gt;
* [http://localhost:5001/ localhost:5001]&amp;lt;br&amp;gt;default url to get access to [[#Client_API|local proxy]] provided from user side application.&lt;br /&gt;
&lt;br /&gt;
== Sugar Network resources ==&lt;br /&gt;
&lt;br /&gt;
{{:Sugar_Network/Resources}}&lt;br /&gt;
&lt;br /&gt;
== Base API ==&lt;br /&gt;
&lt;br /&gt;
List of actions common of all API providers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;POST&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;POST&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create new resource object.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to send:&lt;br /&gt;
* {{Code|&#039;&#039;RESOURCE}}&#039;s properties.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to receive:&lt;br /&gt;
* {{Code|guid}}, with globally unique identifier that specifies the created object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Modify resource object. By default, might be called only by {{Code|GUID}} creator.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to send:&lt;br /&gt;
* {{Code|RESOURCE}}&#039;s properties to modify.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Delete resource object. Actual object destruction won&#039;t happen, the object will be hidden. Garbage collection of hidden objects will be processed by Network administrators. By default, this action may be called only by the {{Code|GUID}} creator.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;[?offset=&#039;&#039;INTEGER&#039;&#039;][&amp;amp;limit=&#039;&#039;INTEGER&#039;&#039;][&amp;amp;query=&#039;&#039;STRING&#039;&#039;][&amp;amp;reply=&#039;&#039;PROP&#039;&#039;][&amp;amp;order_by=&amp;lt;nowiki&amp;gt;[+|-]&amp;lt;/nowiki&amp;gt;&#039;&#039;PROP&#039;&#039;][&amp;amp;group_by=&#039;&#039;PROP&#039;&#039;][&amp;amp;&#039;&#039;PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;][&amp;amp;&#039;&#039;!PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
Find resource objects.&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
* {{Code|offset}}, &#039;&#039;int&#039;&#039;&amp;lt;br&amp;gt;start index to return entries from, the default value is {{Code|0}};&lt;br /&gt;
* {{Code|limit}}, &#039;&#039;int&#039;&#039;&amp;lt;br&amp;gt;do not return more then specified value, maximal and default values are being setup on server side;&lt;br /&gt;
* {{Code|query}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;search request in [http://xapian.org/docs/queryparser.html Xapian] notation with the following additions:&lt;br /&gt;
** if property is boolean, integer or datetime, it supports searching by ranges: {{Code|&#039;&#039;PROP&#039;&#039;:[&#039;&#039;START&#039;&#039;]..[&#039;&#039;END&#039;&#039;]}};&lt;br /&gt;
** the statement {{Code|&#039;&#039;PROP&#039;&#039;&amp;lt;nowiki&amp;gt;:=&amp;lt;/nowiki&amp;gt;[&amp;quot;]&#039;&#039;VALUE&#039;&#039;[&amp;quot;]}} has the same effect as {{Code|QUERY_PROP}}; it is different to regular {{Code|&#039;&#039;PROP&#039;&#039;:&#039;&#039;VALUE&#039;&#039;}} where {{Code|VALUE}} might be a substring;&lt;br /&gt;
* {{Code|PROP}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;supplements {{Code|query}} with filtering by exact value of the {{Code|PROP}} property; the resulting query string will be {{Code|&#039;&#039;PROP&#039;&#039;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&#039;&#039;VALUE&#039;&#039; AND (&#039;&#039;QUERY&#039;&#039;)}}; argument is multiple;&lt;br /&gt;
* {{Code|!PROP}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;supplements {{Code|query}} by excluding exact value of the {{Code|PROP}} property; the resulting query string will be {{Code|NOT &#039;&#039;PROP&#039;&#039;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&#039;&#039;VALUE&#039;&#039; AND (&#039;&#039;QUERY&#039;&#039;)}}; argument is multiple;&lt;br /&gt;
* {{Code|reply}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;RESOURCE&#039;&#039; properties to return; by default, return only {{Code|guid}} property; argument is multiple;&lt;br /&gt;
* {{Code|order_by}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;property to sort the resulting list by; if starts with the {{Code|-}}, the order is descending, otherwise it is ascending;&lt;br /&gt;
* {{Code|group_by}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;property name to group resulting list by.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to receive:&lt;br /&gt;
* {{Code|total}}, total number in requested query (the reply might contain only the portion restricted by {{Code|limit}} request argument);&lt;br /&gt;
* {{Code|result}}, an array of dictionaries with resource object properties, dictionaries contain at least {{Code|guid}} property.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-resource&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;[?reply=&#039;&#039;PROP&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
* {{Code|reply}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;RESOURCE&#039;&#039; properties to return; by default, return only {{Code|guid}} property; argument is multiple;&lt;br /&gt;
&lt;br /&gt;
Return properties for a particular resource object.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to receive:&lt;br /&gt;
* properties that were specified in {{Code|reply}} argument(s), at least {{Code|guid}}.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-property&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Return property value for particular resource object.&lt;br /&gt;
&lt;br /&gt;
Data to receive:&lt;br /&gt;
* property value in JSON notation for regular properties;&lt;br /&gt;
* raw data or redirection for BLOB properties.&lt;br /&gt;
&lt;br /&gt;
=== Aggregated properties ===&lt;br /&gt;
&lt;br /&gt;
[[#resource-types|Aggregated]] properties have special API to treat their content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;POST-aggproperty&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;POST&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Submit new item. The command returns an id for newly created aggregated item. Depending on particular property, new items might be created not only by object&#039;s authors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT-aggproperty&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;/&#039;&#039;ID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Update existing aggregated item. Depending on particular property, the command is allowed either to object&#039;s authors or to aggregated item submitter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE-aggproperty&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;/&#039;&#039;ID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Delete existing aggregated item. Depending on particular property, the command is allowed either to object&#039;s authors or to aggregated item submitter.&lt;br /&gt;
&lt;br /&gt;
=== Notifications ===&lt;br /&gt;
&lt;br /&gt;
It is possible to subscribe to server events. Notification will happen using HTML5 [[wikipedia:Server-sent_events|Server-sent events]] (SSE).&lt;br /&gt;
&lt;br /&gt;
To start subscription, send the following request:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /?cmd=&#039;&#039;&#039;subscribe&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Response will be served with &#039;&#039;text/event-stream&#039;&#039; MIME type for default SSE message type. SSE message will be a JSONified object with the following, at least, attributes:&lt;br /&gt;
&lt;br /&gt;
* {{Code|event}}&amp;lt;br&amp;gt;event type.&lt;br /&gt;
&lt;br /&gt;
== Node API ==&lt;br /&gt;
&lt;br /&gt;
This is an API provided by Sugar Network nodes on top of [[#Base_API|base one]].&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
&lt;br /&gt;
Right now, the only way to be authenticated on a Sugar Network server is by running a [[Platform_Team/Sugar_Network/Implementation#sugar-network-client|local application]] on the client side and using the API it [[#Client_API|provides]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;TODO&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Authorization ===&lt;br /&gt;
&lt;br /&gt;
Read-only access is available for anonymous requests, except special content like machine serial numbers. But to process any changes, clients need to be authenticated.&lt;br /&gt;
&lt;br /&gt;
Right after creating any Sugar Network object, its author becomes the only user who can process any object modifications afterwards. Authority information will be kept in the [[#Sugar_Network_resources|author]] property and can be modified using the following commands.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;useradd&#039;&#039;&#039;&amp;amp;user=&#039;&#039;USER&#039;&#039;&amp;amp;role=&#039;&#039;ROLE&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Add another user who can modify the corresponding object. &#039;&#039;USER&#039;&#039; argument should be either &#039;&#039;User&#039;&#039; guid (for authors registered in the Sugar Network), or, full author name.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;userdel&#039;&#039;&#039;&amp;amp;user=&#039;&#039;USER&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Remove user from the authority list. It is not possible to remove yourself. &#039;&#039;USER&#039;&#039; argument should be either &#039;&#039;User&#039;&#039; guid (for authors registered in the Sugar Network), or, full author name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;TODO&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Retrieving releases ===&lt;br /&gt;
&lt;br /&gt;
To easy download Context [[#context-releases|releases]] and avoid reading raw &#039;&#039;Context.releases&#039;&#039; property, there are special high-level API commands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-solve&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;solve&#039;&#039;&#039;[&amp;amp;lsb_id=&#039;&#039;LSB_ID&#039;&#039;][&amp;amp;lsb_release=&#039;&#039;LSB_RELEASE&#039;&#039;][&amp;amp;assume=&#039;&#039;DEPENDENCY&#039;&#039;-&#039;&#039;VERSION&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
The command returns information about what particular releases should be downloaded depending on provided requirements. This command might return not only one release, e.g., activities might have dependencies either system packages or another Sugar Network Contexts.&lt;br /&gt;
&lt;br /&gt;
Solving requirements might be:&lt;br /&gt;
&lt;br /&gt;
* {{Code|LSB_ID}}, if Context releases depend on system packages, specify the [[Wikipedia:Linux_Standard_Base|LSB]] distributor id to consider while choosing particular packages;&lt;br /&gt;
* {{Code|LSB_RELEASE}}, if Context releases depend on system packages, specify the [[Wikipedia:Linux_Standard_Base|LSB]] release number of the distribution to consider while choosing particular packages;&lt;br /&gt;
* {{Code|DEPENDENCY-VERSION}}, the {{Code|assume}} argument instructs server to assume that specified [[Sugar_Network/Recipe_Specification#Dependencies|dependency]] is already available on client side and should be taken into account while solving; this is especially important for package dependencies when server considers packages available only from official repositories but users might have more recent package versions installed in local system; e.g., the above example request will fail without {{Code|sugar-0.94}} because neither {{Code|lsb_id}} nor {{Code|lsb_release}} were specified (even if LSB information is passed, server might not have information about what package versions come from official repositories).&lt;br /&gt;
&lt;br /&gt;
The resulting info is a JSON object with keys equal to Context guids and value objects for chosen release with the following keys:&lt;br /&gt;
&lt;br /&gt;
* {{Code|blob}}, bundle [[#resource-types|digest]] to download;&lt;br /&gt;
* {{Code|version}}, chosen version number;&lt;br /&gt;
* {{Code|title}}, the &#039;&#039;Context.title&#039;&#039; value;&lt;br /&gt;
* {{Code|command}}, a command to launch the bundle, only for Sugar activities.&lt;br /&gt;
&lt;br /&gt;
For example, the {{Code|&#039;&#039;&#039;GET&#039;&#039;&#039; &amp;lt;nowiki&amp;gt;/context/org.laptop.TurtleArtActivity?cmd=solve&amp;amp;assume=sugar-0.94&amp;lt;/nowiki&amp;gt;}} request returns:&lt;br /&gt;
&lt;br /&gt;
 {&lt;br /&gt;
   &amp;quot;org.laptop.TurtleArtActivity&amp;quot;: {&lt;br /&gt;
     &amp;quot;title&amp;quot;: &amp;quot;Turtle Blocks&amp;quot;,&lt;br /&gt;
     &amp;quot;version&amp;quot;: [[202], 0],&lt;br /&gt;
     &amp;quot;blob&amp;quot;: &amp;quot;http://download.sugarlabs.org/activities/4027/turtleblocks-202.xo&amp;quot;,&lt;br /&gt;
     &amp;quot;content-type&amp;quot;: &amp;quot;application/vnd.olpc-sugar&amp;quot;,&lt;br /&gt;
     &amp;quot;size&amp;quot;: 4715955,&lt;br /&gt;
     &amp;quot;unpack_size&amp;quot;: 12873871,&lt;br /&gt;
     &amp;quot;command&amp;quot;: [&amp;quot;activity&amp;quot;, &amp;quot;sugar-activity TurtleArtActivity.TurtleArtActivity&amp;quot;],&lt;br /&gt;
   },&lt;br /&gt;
   &amp;quot;sugar&amp;quot;: {&lt;br /&gt;
     &amp;quot;version&amp;quot;: [[0, 94], 0],&lt;br /&gt;
   },&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-clone&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Like the [[#GET-solve|solve]] command, &#039;&#039;clone&#039;&#039; makes a solution but returns bundle itself, so, there is no way to get information about possible dependencies.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;clone&#039;&#039;&#039;[&amp;amp;lsb_id=&#039;&#039;LSB_ID&#039;&#039;][&amp;amp;lsb_release=&#039;&#039;LSB_RELEASE&#039;&#039;][&amp;amp;assume=&#039;&#039;DEPENDENCY&#039;&#039;-&#039;&#039;VERSION&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
=== Upload releases ===&lt;br /&gt;
&lt;br /&gt;
To easy upload Context [[#context-releases|releases]] and avoid writing to raw &#039;&#039;Context.releases&#039;&#039; property, there is a special high-level API command.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;POST&#039;&#039;&#039; /context?cmd=&#039;&#039;&#039;submit&#039;&#039;&#039;[&amp;amp;&#039;&#039;PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;][&amp;amp;initial]&lt;br /&gt;
&lt;br /&gt;
Where the {{Code|PROP}} arguments are optional release properties. The {{Code|initial}} argument asks the system to create new Context resource new release will belong to.&lt;br /&gt;
&lt;br /&gt;
The posting data might be two types,&lt;br /&gt;
&lt;br /&gt;
* Sugar activities in .xo bundles,&amp;lt;br&amp;gt;there is no need in {{Code|PROP}} arguments, all properties will be populated basing on metadata from a .xo bundle; including release notes from the {{Code|CHANGELOG}} file in [[Wikipedia:Markdown|Markdown]] notation; besides, only in this case {{Code|initial}} makes sense because it is the only way to get Context properties;&lt;br /&gt;
&lt;br /&gt;
* Arbitrary data,&amp;lt;br&amp;gt;all required release properties should be specified in {{Code|PROP}} arguments, at least &#039;&#039;context&#039;&#039; and &#039;&#039;version&#039;&#039;; &#039;&#039;license&#039;&#039; should be specified only if there are no existing releases to pickup license from.&lt;br /&gt;
&lt;br /&gt;
=== Node statistics ===&lt;br /&gt;
&lt;br /&gt;
The node statistics are about the entire server and depersonalized. Statistics are being collected by analyzing regular requests to an API server and stored for each Sugar Network node. To read such info, call the command:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /?cmd=&#039;&#039;&#039;stats&#039;&#039;&#039;[&amp;amp;start=&#039;&#039;SECONDS&#039;&#039;][&amp;amp;end=&#039;&#039;SECONDS&#039;&#039;][&amp;amp;event=&#039;&#039;EVENT&#039;&#039;][&amp;amp;limit=&#039;&#039;NUMBER&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
&lt;br /&gt;
* {{Code|start}} and {{Code|end}} is a time interval to get statistics for; if omitted, the beginning and the end of entire life cycle will be used;&lt;br /&gt;
* {{Code|event}}, multiple argument to specify what [[Sugar_Network/Node_Statistics#Common_statistics|stats]] should be returned; if omitted, return all sources;&lt;br /&gt;
* {{Code|limit}}, number of stat records to return for the {{Code|start}}-{{Code|end}} interval; note that this amount is not precise, the final resultset might be smaller or bigger depending on chosen resolution; stats resolution depends on node configuration, default values are 1 day, 10 days, 30 days, 365 days; if omitted, return {{Code|end}} record only.&lt;br /&gt;
&lt;br /&gt;
Possible events are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;users&#039;&#039;&#039;, total number of existing &#039;&#039;User&#039;&#039; objects;&lt;br /&gt;
* &#039;&#039;&#039;contexts&#039;&#039;&#039;, total number of existing &#039;&#039;Context&#039;&#039; objects;&lt;br /&gt;
* &#039;&#039;&#039;released&#039;&#039;&#039;, average number of newly uploaded &#039;&#039;Context.releases&#039;&#039; for specified time frame;&lt;br /&gt;
* &#039;&#039;&#039;solved&#039;&#039;&#039;, average number of requested &#039;&#039;Context&#039;&#039; [[#GET-solve|solutions]] for specified time frame; note that this value does not equal to the number of solution usages on client side since solutions might be cached;&lt;br /&gt;
* &#039;&#039;&#039;reported&#039;&#039;&#039;, average number of newly uploaded failure &#039;&#039;Report&#039;&#039; objects for specified time frame;&lt;br /&gt;
* &#039;&#039;&#039;topics&#039;&#039;&#039;, total number of top-level &#039;&#039;Post&#039;&#039; objects;&lt;br /&gt;
* &#039;&#039;&#039;posts&#039;&#039;&#039;, total number of dependent &#039;&#039;Post&#039;&#039; objects.&lt;br /&gt;
&lt;br /&gt;
== Client API ==&lt;br /&gt;
&lt;br /&gt;
The reasons to proxy Sugar Network data on users side:&lt;br /&gt;
&lt;br /&gt;
* Seamless support [[#Offline mode|offline workflow]];&lt;br /&gt;
* [[#Launching|One-click launch]] Sugar activities hosted on Sugar Network.&lt;br /&gt;
&lt;br /&gt;
Proxying happens by providing the same Sugar Network API (with some extra functionality, see below) from&lt;br /&gt;
[[Platform_Team/Sugar_Network/Implementation#sugar-network-client|local process]] launched beforehand.&lt;br /&gt;
&lt;br /&gt;
=== Offline mode ===&lt;br /&gt;
&lt;br /&gt;
Being connected to a Sugar Network node, local proxy provides [[#Node_API|original API]] from the node. If the connection is lost, the proxy will switch to local Sugar Network storage and continue working providing only [[#Base_API|base API]]. Any content created in offline mode will be uploaded to the node after getting a connection back.&lt;br /&gt;
&lt;br /&gt;
Besides, local Sugar Network storage will be reused to keep users preferences, such as:&lt;br /&gt;
&lt;br /&gt;
* Favorited Contexts&amp;lt;br&amp;gt;to select preferred &#039;&#039;Context&#039;&#039; resources; these Contexts will be marked by {{Code|favorite}} value in the &#039;&#039;Context.layer&#039;&#039; property;&lt;br /&gt;
&lt;br /&gt;
* Checked-in Contexts&amp;lt;br&amp;gt;to keep most recent Context (for &#039;&#039;activity&#039;&#039; and &#039;&#039;book&#039;&#039; types) version in local storage to make it available in offline; note that there is no need in checking-in to speedup online lunch, versions are being [[#Launching|cached]] anyway; these Contexts will be marked by {{Code|checkin}} value in the &#039;&#039;Context.layer&#039;&#039; property.&lt;br /&gt;
&lt;br /&gt;
To control users preferences there are special API commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT_favorite&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;favorite&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Set favorite status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE_favorite&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;favorite&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Unset favorite status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT_checkin&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;checkin&#039;&#039;&#039;[&amp;amp;spawn]&lt;br /&gt;
&lt;br /&gt;
Check-in the specified Context. By default, the command will return streamed &#039;&#039;text/event-stream&#039;&#039; MIME type data to monitor the progress. If the {{Code|spawn}} argument is specified, the command will exit immediately with [[#Notifications|asynchronous sending]] progress events.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE_checkin&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;checkin&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Checkout the Context.&lt;br /&gt;
&lt;br /&gt;
=== Launching ===&lt;br /&gt;
&lt;br /&gt;
Sugar Network Contexts (for &#039;&#039;activity&#039;&#039; and &#039;&#039;book&#039;&#039; types) can be launched as-is. The launching process is implicit and includes selecting the most recent (and appropriate for software contexts) version, downloading bundles from the Sugar Network, installing missed [[Sugar_Network/Recipe_Specification#Dependencies|software dependencies]], execution itself. All downloaded bundles will be cached [with further garbage collecting] to speedup further launching.&lt;br /&gt;
&lt;br /&gt;
Sugar activities will be directly executed. Book Contexts will be opened in the proper application according to its MIME type.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;launch&#039;&#039;&#039;[&amp;amp;args=&#039;&#039;ARG&#039;&#039;][&amp;amp;activity_id=&#039;&#039;ACTIVITY_ID&#039;&#039;][&amp;amp;object_id=&#039;&#039;OBJECT_ID&#039;&#039;][&amp;amp;uri=&#039;&#039;URI&#039;&#039;][&amp;amp;app=&#039;&#039;APP&#039;&#039;][&amp;amp;spawn]&lt;br /&gt;
&lt;br /&gt;
Arguments that make sense only for Sugar activities:&lt;br /&gt;
&lt;br /&gt;
* {{Code|ARG}}, command line argument to pass to launched activities, repeat {{Code|ARG}} for each argument;&lt;br /&gt;
* {{Code|ACTIVITY_ID}}, internal activity id which will be auto set if omitted;&lt;br /&gt;
* {{Code|OBJECT_ID}}, Journal object id to resume;&lt;br /&gt;
* {{Code|URI}}, URL to resume if activity supports this functionality.&lt;br /&gt;
&lt;br /&gt;
Arguments that make sense only for books:&lt;br /&gt;
&lt;br /&gt;
* {{Code|APP}}, specify application Context to open the book by; if omitted, the system will try to find most appropriate option, among all existing software Contexts.&lt;br /&gt;
&lt;br /&gt;
Common arguments:&lt;br /&gt;
&lt;br /&gt;
* {{Code|spawn}}, by default, the command will return streamed &#039;&#039;text/event-stream&#039;&#039; MIME type data to monitor the whole launching process until exiting the application; if the {{Code|spawn}} argument is specified, the command will exit immediately with [[#Notifications|asynchronous sending]] launching events.&lt;br /&gt;
&lt;br /&gt;
== Experimental API ==&lt;br /&gt;
&lt;br /&gt;
There is no guaranty that the following API will be stated as stable or frozen sometime.&lt;br /&gt;
&lt;br /&gt;
=== Access to Sugar Journal ===&lt;br /&gt;
&lt;br /&gt;
It is possible to get access to local Sugar Journal using special, &#039;&#039;journal&#039;&#039;, resource provided from [[#Client_API|client API]]. This kind of access might be useful when local applications cannot use DBus sugar-datastore API, e.g., [[wikipedia:Javascript|Javascript]] applications. API to Journal is restricted only to read-only access:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /journal?offset=&#039;&#039;INTEGER&#039;&#039;&amp;amp;limit=&#039;&#039;INTEGER&#039;&#039;[&amp;amp;query=&#039;&#039;STRING&#039;&#039;][&amp;amp;order_by=&amp;lt;nowiki&amp;gt;[+|-]&amp;lt;/nowiki&amp;gt;&#039;&#039;PROP&#039;&#039;][&amp;amp;&#039;&#039;QUERY_PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;[&amp;amp;...]]&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /journal/&#039;&#039;JOURNAL_ID&#039;&#039;[?reply=&#039;&#039;PROP&#039;&#039;[,..]]&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /journal/&#039;&#039;JOURNAL_ID&#039;&#039;/&#039;&#039;PROPERTY&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
Being HTTP based, Sugar Network API can be used in any manner regular HTTP requests can be handled. But for command-line access, there is a handy tool, {{Code|sugar-network}}, which takes care about Sugar Network specific like launching local API (if it is not already available) to get access to [[#Client_API|local proxy]].&lt;br /&gt;
&lt;br /&gt;
The sugar-network command-line format is below. Call {{Code|sugar-network --help}} for more detailed info.&lt;br /&gt;
&lt;br /&gt;
 sugar-network GET|POST|PUT|DELETE &#039;&#039;PATH&#039;&#039; &#039;&#039;ARG=VALUE&#039;&#039; [..]&lt;br /&gt;
&lt;br /&gt;
* {{Code|PATH}}, is an url path;&lt;br /&gt;
* {{Code|ARG&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;VALUE}}, request arguments as they being passed to in url.&lt;br /&gt;
&lt;br /&gt;
{{Code|POST}} and {{Code|PUT}} commands require data to pass, use the following command-line arguments:&lt;br /&gt;
&lt;br /&gt;
* {{Code|-f FILE}} to specify the file to pass;&lt;br /&gt;
* {{Code|-d DATA}} to specify string to pass;&lt;br /&gt;
* {{Code|-j}} posted data should be encoded into JSON before posting.&lt;br /&gt;
&lt;br /&gt;
== Getting involved ==&lt;br /&gt;
&lt;br /&gt;
{{:Sugar_Network/Feedback}}&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Resources&amp;diff=92538</id>
		<title>Sugar Network/Resources</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Resources&amp;diff=92538"/>
		<updated>2014-05-13T13:56:41Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following diagram shows the full list of objects implemented by the Sugar Network [[Platform Team/Sugar Network/API|API]].&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot; align=&amp;quot;let&amp;quot;&lt;br /&gt;
| [[File:Sugar-Network-diagram.png|200px|thumb|Sugar Network objects]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-types&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Property types&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Generally, Sugar Network objects&#039; property types correspond to JSON types. The only exceptions mentioned in the following list:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;enum&#039;&#039;, is an enumerated type when a value is a string from the predefined list of constants;&lt;br /&gt;
* &#039;&#039;markdown&#039;&#039;, is a string formatted in the [[Wikipedia:Markdown|Markdown]] syntax;&lt;br /&gt;
* &#039;&#039;blob&#039;&#039;, is a file represented by string value which is a [[Wikipedia:Sha1|SHA-1]] digest of file&#039;s content; the file itself can be obtained from the {{Code|&#039;&#039;&#039;GET&#039;&#039;&#039; /blobs/&#039;&#039;DIGEST&#039;&#039;}} request;&lt;br /&gt;
* &#039;&#039;aggregated&#039;&#039;, is a list of JSON objects which has [[Sugar_Network/API#Aggregated_properties|special API]] to treat its items; each aggregated item has a unique identifier; items might be created not only by the object&#039;s authors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-author&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.author&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A dictionary of authors working on the corresponding resource. Keys are Sugar Network &#039;&#039;User&#039;&#039; guids, or, if particular author is not registered in the Sugar Network, full user names. Values are dictionaries with the following keys:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;name&#039;&#039;&amp;lt;br&amp;gt;Full author&#039;s name;&lt;br /&gt;
* &#039;&#039;role&#039;&#039;&amp;lt;br&amp;gt;An integer which is a bit-wise ORed value of the following constants:&lt;br /&gt;
** &#039;&#039;0x1&#039;&#039;, author is registered in the Sugar Network (and &#039;&#039;guid&#039;&#039; key is set);&lt;br /&gt;
** &#039;&#039;0x10000&#039;&#039;, author is the original author of the corresponding resource; if it is not set, user is only a maintainer, e.g., an uploader of a book which has its original authors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-status&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.status&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is a system level property which can be set only by node editors. It is a list of &amp;quot;badges&amp;quot; editors set depending on the object quality. Currently supported statuses are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;featured&#039;&#039;, the object is popped up by node editors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-pins&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.pins&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This property makes sense only for objects provided from a [[Sugar_Network/API#Client_proxy|local proxy]]. The property is intended to store local user&#039;s preferences or statuses remote object has in local environment. Currently supported values are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;favorite&#039;&#039;, set if a user has &#039;&#039;&amp;quot;stared&amp;quot;&#039;&#039; the object;&lt;br /&gt;
* &#039;&#039;checkin&#039;&#039;, applied to Context objects only, set if a user has &#039;&#039;&amp;quot;pinned&amp;quot;&#039;&#039; the context to keep its most recent version permanently in the local system;&lt;br /&gt;
* &#039;&#039;stale&#039;&#039;, applied to Context objects only, set if previously checked-in Context might have more fresh releases on the node; it is not possible to filter Contexts by this value;&lt;br /&gt;
* &#039;&#039;inprogress&#039;&#039;, applied to Context objects only, set if the Context is in the process of downloading content from the node; it is being temporally set before launching the Context or checking it in; it is not possible to filter Contexts by this value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;context-type&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Context.type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Context types:&lt;br /&gt;
* &#039;&#039;activity&#039;&#039;, Sugar activity;&lt;br /&gt;
* &#039;&#039;book&#039;&#039;, books in various forms;&lt;br /&gt;
* &#039;&#039;group&#039;&#039;, offline discussion groups;&lt;br /&gt;
* &#039;&#039;package&#039;&#039;, GNU/Linux package metadata.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;context-releases&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Context.releases&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Contexts with &#039;&#039;activity&#039;&#039; or &#039;&#039;book&#039;&#039; types might have releases, i.e., activity or book versions that users can download. The &#039;&#039;releases&#039;&#039; property is aggregated where each item describes one particular version. There is no need in working with the &#039;&#039;releases&#039;&#039; property directly, there are high-level API commands to [[Sugar_Network/API#Upload_releases|upload]] and [[Sugar_Network/API#Download_releases|download]] releases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;post-type&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post.type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;review&#039;&#039;, Review the Context;&lt;br /&gt;
* &#039;&#039;object&#039;&#039;, Object generated by Context application;&lt;br /&gt;
* &#039;&#039;question&#039;&#039;, Q&amp;amp;A request;&lt;br /&gt;
* &#039;&#039;problem&#039;&#039;, Problem with the Context;&lt;br /&gt;
* &#039;&#039;idea&#039;&#039;, An idea fr the Context;&lt;br /&gt;
* &#039;&#039;solution&#039;&#039;, Solution for question, problem, or, idea;&lt;br /&gt;
* &#039;&#039;announce&#039;&#039;, General announcement;&lt;br /&gt;
* &#039;&#039;notification&#039;&#039;, Auto-generated Post for updates within the Context;&lt;br /&gt;
* &#039;&#039;post&#039;&#039;, General purpose dependent Post.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post.topic&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Post objects might belong to a topic post. The system design assumes only two-level Posts hierarchy.&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Resources&amp;diff=92537</id>
		<title>Sugar Network/Resources</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Resources&amp;diff=92537"/>
		<updated>2014-05-13T13:43:00Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following diagram shows the full list of objects implemented by the Sugar Network [[Platform Team/Sugar Network/API|API]].&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot; align=&amp;quot;let&amp;quot;&lt;br /&gt;
| [[File:Sugar-Network-diagram.png|200px|thumb|Sugar Network objects]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-types&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Property types&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Generally, Sugar Network objects&#039; property types correspond to JSON types. The only exceptions mentioned in the following list:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;enum&#039;&#039;, is an enumerated type when a value is a string from the predefined list of constants;&lt;br /&gt;
* &#039;&#039;markdown&#039;&#039;, is a string formatted in the [[Wikipedia:Markdown|Markdown]] syntax;&lt;br /&gt;
* &#039;&#039;blob&#039;&#039;, is a file represented by string value which is a [[Wikipedia:Sha1|SHA-1]] digest of file&#039;s content; the file itself can be obtained from the {{Code|&#039;&#039;&#039;GET&#039;&#039;&#039; /blobs/&#039;&#039;DIGEST&#039;&#039;}} request;&lt;br /&gt;
* &#039;&#039;aggregated&#039;&#039;, is a list of JSON objects which has [[Sugar_Network/API#Aggregated_properties|special API]] to treat its items; each aggregated item has a unique identifier; items might be created not only by the object&#039;s authors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-author&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.author&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A dictionary of authors working on the corresponding resource. Keys are Sugar Network &#039;&#039;User&#039;&#039; guids, or, if particular author is not registered in the Sugar Network, full user names. Values are dictionaries with the following keys:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;name&#039;&#039;&amp;lt;br&amp;gt;Full author&#039;s name;&lt;br /&gt;
* &#039;&#039;role&#039;&#039;&amp;lt;br&amp;gt;An integer which is a bit-wise ORed value of the following constants:&lt;br /&gt;
** &#039;&#039;0x1&#039;&#039;, author is registered in the Sugar Network (and &#039;&#039;guid&#039;&#039; key is set);&lt;br /&gt;
** &#039;&#039;0x10000&#039;&#039;, author is the original author of the corresponding resource; if it is not set, user is only a maintainer, e.g., an uploader of a book which has its original authors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-status&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.status&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is a system level property which can be set only by node editors. It is a list of &amp;quot;badges&amp;quot; editors set depending on the object quality. Currently supported statuses are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;featured&#039;&#039;, the object is popped up by node editors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;resource-pins&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resource.pins&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This property makes sense only for objects provided from a [[Sugar_Network/API#Client_proxy|local proxy]]. The property is intended to store local user&#039;s preferences or statuses remote object has in local environment. Currently supported values are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;favorite&#039;&#039;, set if a user has &#039;&#039;&amp;quot;stared&amp;quot;&#039;&#039; the object;&lt;br /&gt;
* &#039;&#039;checkin&#039;&#039;, applied to Context objects only, set if a user has &#039;&#039;&amp;quot;pinned&amp;quot;&#039;&#039; the context to keep its most recent version permanently in the local system;&lt;br /&gt;
* &#039;&#039;stale&#039;&#039;, applied to Context objects only, set if previously checked-in Context might have more fresh releases on the node; it is not possible to filter Contexts by this value;&lt;br /&gt;
* &#039;&#039;inprogress&#039;&#039;, applied to Context objects only, set if the Context is in the process of downloading content from the node; it is being temporally set before launching the Context or checking it in; it is not possible to filter Contexts by this value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;context-type&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Context.type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Context types:&lt;br /&gt;
* &#039;&#039;activity&#039;&#039;, Sugar activity;&lt;br /&gt;
* &#039;&#039;book&#039;&#039;, books in various forms;&lt;br /&gt;
* &#039;&#039;group&#039;&#039;, offline discussion groups;&lt;br /&gt;
* &#039;&#039;package&#039;&#039;, GNU/Linux package metadata.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;context-releases&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Context.releases&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Contexts with &#039;&#039;activity&#039;&#039; or &#039;&#039;book&#039;&#039; types might have releases, i.e., activity or book versions that users can download. The &#039;&#039;releases&#039;&#039; property is aggregated where each item describes one particular version. There is no need in working with the &#039;&#039;releases&#039;&#039; property directly, there are high-level API commands to [[Sugar_Network/API#Upload_releases|upload]] and [[Sugar_Network/API#Download_releases|download]] releases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;post-type&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post.type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;review&#039;&#039;, Review the Context;&lt;br /&gt;
* &#039;&#039;object&#039;&#039;, Object generated by Context application;&lt;br /&gt;
* &#039;&#039;question&#039;&#039;, Q&amp;amp;A request;&lt;br /&gt;
* &#039;&#039;problem&#039;&#039;, Problem with the Context;&lt;br /&gt;
* &#039;&#039;idea&#039;&#039;, An idea fr the Context;&lt;br /&gt;
* &#039;&#039;solution&#039;&#039;, Solution for question, problem, or, idea;&lt;br /&gt;
* &#039;&#039;announce&#039;&#039;, General announcement;&lt;br /&gt;
* &#039;&#039;notification&#039;&#039;, Auto-generated Post for updates within the Context;&lt;br /&gt;
* &#039;&#039;post&#039;&#039;, General purpose dependent Post.&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=File:Sugar-Network-diagram.png&amp;diff=92536</id>
		<title>File:Sugar-Network-diagram.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=File:Sugar-Network-diagram.png&amp;diff=92536"/>
		<updated>2014-05-13T12:00:01Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: Alsroot uploaded a new version of &amp;amp;quot;File:Sugar-Network-diagram.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Node_Statistics&amp;diff=92535</id>
		<title>Sugar Network/Node Statistics</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Node_Statistics&amp;diff=92535"/>
		<updated>2014-05-13T11:58:13Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
This page describes the statistics that [[Sugar Network]] nodes generate. The statistics are about the entire server and not [[Platform_Team/Usage_Statistics|personalized]]. Note that the statistics are targeted for the interests of educational researchers rather than service maintainers, for technical details look for [http://jita.sugarlabs.org/node.sugarlabs.org/ HTTP stats].&lt;br /&gt;
&lt;br /&gt;
Statistics will be collected by analyzing regular requests to an API server and stored for each Sugar Network node. It will be  possible to get direct access to these stats using node&#039;s [[Sugar_Network/API#Node_statistics|API]].&lt;br /&gt;
&lt;br /&gt;
== Events ==&lt;br /&gt;
&lt;br /&gt;
Statistics will be collected per Sugar Network [[Sugar_Network/Resources|resource type]].&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;users&#039;&#039;&#039;&amp;lt;br&amp;gt;Total number of existing &#039;&#039;User&#039;&#039; objects;&lt;br /&gt;
* &#039;&#039;&#039;contexts&#039;&#039;&#039;&amp;lt;br&amp;gt;Total number of existing &#039;&#039;Context&#039;&#039; objects;&lt;br /&gt;
* &#039;&#039;&#039;released&#039;&#039;&#039;&amp;lt;br&amp;gt;Average number of newly uploaded &#039;&#039;Context.releases&#039;&#039; for specified time frame;&lt;br /&gt;
* &#039;&#039;&#039;solved&#039;&#039;&#039;&amp;lt;br&amp;gt;Average number of requested &#039;&#039;Context&#039;&#039; [[Sugar_Network/API#GET-solve|solutions]] for specified time frame; note that this stats value does not equal to the number of solution usages on client side since solutions might be cached;&lt;br /&gt;
* &#039;&#039;&#039;reported&#039;&#039;&#039;&amp;lt;br&amp;gt;Average number of newly uploaded failure &#039;&#039;Reports&#039;&#039; objects for specified time frame;&lt;br /&gt;
* &#039;&#039;&#039;topics&#039;&#039;&#039;&amp;lt;br&amp;gt;Total number of top-level &#039;&#039;Post&#039;&#039; objects;&lt;br /&gt;
* &#039;&#039;&#039;posts&#039;&#039;&#039;&amp;lt;br&amp;gt;Total number of dependent &#039;&#039;Post&#039;&#039; objects.&lt;br /&gt;
&lt;br /&gt;
== Getting involved ==&lt;br /&gt;
&lt;br /&gt;
{{:Sugar_Network/Feedback}}&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Node_Statistics&amp;diff=92534</id>
		<title>Sugar Network/Node Statistics</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Node_Statistics&amp;diff=92534"/>
		<updated>2014-05-13T10:46:16Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
This page describes the statistics that [[Sugar Network]] nodes generate. The statistics are about the entire server and not [[Platform_Team/Usage_Statistics|personalized]]. Note that the statistics are targeted for the interests of educational researchers rather than service maintainers, for technical details look for [http://jita.sugarlabs.org/node.sugarlabs.org/ HTTP stats].&lt;br /&gt;
&lt;br /&gt;
Statistics will be collected by analyzing regular requests to an API server and stored for each Sugar Network node. It will be  possible to get direct access to these stats using node&#039;s [[Sugar_Network/API#Node_statistics|API]].&lt;br /&gt;
&lt;br /&gt;
== Common statistics ==&lt;br /&gt;
&lt;br /&gt;
Statistics will be collected per Sugar Network [[Sugar_Network/Resources|resource type]].&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;users&#039;&#039;&#039;&amp;lt;br&amp;gt;Total number of existing &#039;&#039;User&#039;&#039; objects;&lt;br /&gt;
* &#039;&#039;&#039;contexts&#039;&#039;&#039;&amp;lt;br&amp;gt;Total number of existing &#039;&#039;Context&#039;&#039; objects;&lt;br /&gt;
* &#039;&#039;&#039;released&#039;&#039;&#039;&amp;lt;br&amp;gt;Average number of newly uploaded &#039;&#039;Context.releases&#039;&#039; for specified time frame;&lt;br /&gt;
* &#039;&#039;&#039;solved&#039;&#039;&#039;&amp;lt;br&amp;gt;Average number of requested &#039;&#039;Context&#039;&#039; [[Sugar_Network/API#GET-solve|solutions]] for specified time frame; note that this stats value does not equal to the number of solution usages on client side since solutions might be cached;&lt;br /&gt;
* &#039;&#039;&#039;reported&#039;&#039;&#039;&amp;lt;br&amp;gt;Average number of newly uploaded failure &#039;&#039;Reports&#039;&#039; objects for specified time frame;&lt;br /&gt;
* &#039;&#039;&#039;topics&#039;&#039;&#039;&amp;lt;br&amp;gt;Total number of top-level &#039;&#039;Post&#039;&#039; objects;&lt;br /&gt;
* &#039;&#039;&#039;posts&#039;&#039;&#039;&amp;lt;br&amp;gt;Total number of dependent &#039;&#039;Post&#039;&#039; objects.&lt;br /&gt;
&lt;br /&gt;
== Per object statistics ==&lt;br /&gt;
&lt;br /&gt;
While calculating [[#Common_statistics|common]] statistics, nodes generate per object sums as well.&lt;br /&gt;
&lt;br /&gt;
These are the Sugar Network [[Sugar_Network/Resources|resources]] that will be affected:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Context&#039;&#039; properties:&lt;br /&gt;
* &#039;&#039;&#039;Context.rating&#039;&#039;&#039;&amp;lt;br&amp;gt;Average rating given to the &#039;&#039;Context&#039;&#039; while reviewing, rating value is a tuple of votes sum and number of reviews;&lt;br /&gt;
* &#039;&#039;&#039;Context.solves&#039;&#039;&#039;&amp;lt;br&amp;gt;Total number of requested [[Sugar_Network/API#GET-solve|solutions]] for the &#039;&#039;Context&#039;&#039;; note that this value does not equal to the number of solution usages on client side since solutions might be cached.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Post&#039;&#039; properties:&lt;br /&gt;
* &#039;&#039;&#039;Post.rating&#039;&#039;&#039;&amp;lt;br&amp;gt;Average rating given to the &#039;&#039;Post&#039;&#039; while reviewing, rating value is a tuple of votes sum and number of reviews.&lt;br /&gt;
&lt;br /&gt;
== Getting involved ==&lt;br /&gt;
&lt;br /&gt;
{{:Sugar_Network/Feedback}}&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Sugar_Network/API&amp;diff=92533</id>
		<title>Sugar Network/API</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Sugar_Network/API&amp;diff=92533"/>
		<updated>2014-05-12T23:43:25Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: /* Node statistics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the API that Sugar Network clients use to interact with a Sugar Network server. See also a guide to basic Sugar Network [[Sugar_Network/Concept|concepts]] and [[Platform_Team/Sugar_Network/Architecture|its twin page]] for a technical point of view. In addition, visit the [[Sugar_Network|introduction page]].&lt;br /&gt;
&lt;br /&gt;
{{Note/warning|Note|Until announcing API freeze, this document describes the most recent development version of the API.&amp;lt;br&amp;gt;You can find its implementation on the [[#API servers|node-devel.sugarlabs.org]] server.}}&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
To better understand this API, see a technical explanation of its [[Platform_Team/Sugar_Network/Architecture#Conceptual_level|conceptual level]] and [[#Sugar_Network_resources|objects model]] in particular.&lt;br /&gt;
&lt;br /&gt;
The API operates with [[Sugar Network]] [[#Sugar_Network_resources|resources]], which are collections of objects. All objects are identified by globally unique identifiers, GUIDs, and available for operation via [[#Base_API|basic actions]]. The API is being provided from a [[#API_servers|node server]] or a [[#Client_API|client]]. While processing requests, API providers generate [[#Notifications|events]].&lt;br /&gt;
&lt;br /&gt;
The API is [[Wikipedia:Restful|RESTful]], and is served via HTTP(S) using [[Wikipedia:Json|JSON]] notation. The common request url format is:&lt;br /&gt;
&lt;br /&gt;
 http[s]://&#039;&#039;SERVER&#039;&#039;[/&#039;&#039;RESOURCE&#039;&#039;[/&#039;&#039;GUID&#039;&#039;[/&#039;&#039;PROPERTY&#039;&#039;]]][?[cmd=&#039;&#039;COMMAND&#039;&#039;][&amp;amp;&#039;&#039;ARGUMENT&#039;&#039;=&#039;&#039;VALUE&#039;&#039;..]]&lt;br /&gt;
&lt;br /&gt;
When:&lt;br /&gt;
&lt;br /&gt;
* {{Code|SERVER}}, [[#API_servers|particular]] Sugar Network API server;&lt;br /&gt;
* {{Code|RESOURCE}}, name one of the [[#Sugar_Network_resources|existing]] resources;&lt;br /&gt;
* {{Code|GUID}}, the {{Code|RESOURCE}}&#039;s particular object;&lt;br /&gt;
* {{Code|PROPERTY}}, particular property of {{Code|GUID}} object;&lt;br /&gt;
* {{Code|COMMAND}}, optional command name; combination of HTTP request method ({{Code|GET}}, {{Code|POST}}, {{Code|PUT}}, or, {{Code|DELETE}}) and [possibly empty] {{Code|COMMAND}} composes the requested [[#Actions|action]];&lt;br /&gt;
* {{Code|ARGUMENT}}s and {{Code|VALUE}}s depend on the particular [[#Actions|action]].&lt;br /&gt;
&lt;br /&gt;
In most cases, the server replies in JSON notation. If a request fails, the replied JSON object will contain a {{Code|request}} key, with the original request, and {{Code|error}} key, with an error message.&lt;br /&gt;
&lt;br /&gt;
== API servers ==&lt;br /&gt;
&lt;br /&gt;
These are standard Sugar Network API servers publicly available.&lt;br /&gt;
&lt;br /&gt;
* [http://node-devel.sugarlabs.org/ node-devel.sugarlabs.org]&amp;lt;br&amp;gt;Development server which does not contain important data and is free for any experiments (administrative privileges for anonymous users);&lt;br /&gt;
&lt;br /&gt;
* [http://node-testing.sugarlabs.org/ node-testing.sugarlabs.org]&amp;lt;br&amp;gt;Recent stable release with regular data import from the production server; is still free for any experiments;&lt;br /&gt;
&lt;br /&gt;
* [http://node.sugarlabs.org/ node.sugarlabs.org]&amp;lt;br&amp;gt;Production server;&lt;br /&gt;
&lt;br /&gt;
* [http://localhost:5001/ localhost:5001]&amp;lt;br&amp;gt;default url to get access to [[#Client_API|local proxy]] provided from user side application.&lt;br /&gt;
&lt;br /&gt;
== Sugar Network resources ==&lt;br /&gt;
&lt;br /&gt;
{{:Sugar_Network/Resources}}&lt;br /&gt;
&lt;br /&gt;
== Base API ==&lt;br /&gt;
&lt;br /&gt;
List of actions common of all API providers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;POST&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;POST&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create new resource object.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to send:&lt;br /&gt;
* {{Code|&#039;&#039;RESOURCE}}&#039;s properties.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to receive:&lt;br /&gt;
* {{Code|guid}}, with globally unique identifier that specifies the created object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Modify resource object. By default, might be called only by {{Code|GUID}} creator.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to send:&lt;br /&gt;
* {{Code|RESOURCE}}&#039;s properties to modify.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Delete resource object. Actual object destruction won&#039;t happen, the object will be hidden. Garbage collection of hidden objects will be processed by Network administrators. By default, this action may be called only by the {{Code|GUID}} creator.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;[?offset=&#039;&#039;INTEGER&#039;&#039;][&amp;amp;limit=&#039;&#039;INTEGER&#039;&#039;][&amp;amp;query=&#039;&#039;STRING&#039;&#039;][&amp;amp;reply=&#039;&#039;PROP&#039;&#039;][&amp;amp;order_by=&amp;lt;nowiki&amp;gt;[+|-]&amp;lt;/nowiki&amp;gt;&#039;&#039;PROP&#039;&#039;][&amp;amp;group_by=&#039;&#039;PROP&#039;&#039;][&amp;amp;&#039;&#039;PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;][&amp;amp;&#039;&#039;!PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
Find resource objects.&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
* {{Code|offset}}, &#039;&#039;int&#039;&#039;&amp;lt;br&amp;gt;start index to return entries from, the default value is {{Code|0}};&lt;br /&gt;
* {{Code|limit}}, &#039;&#039;int&#039;&#039;&amp;lt;br&amp;gt;do not return more then specified value, maximal and default values are being setup on server side;&lt;br /&gt;
* {{Code|query}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;search request in [http://xapian.org/docs/queryparser.html Xapian] notation with the following additions:&lt;br /&gt;
** if property is boolean, integer or datetime, it supports searching by ranges: {{Code|&#039;&#039;PROP&#039;&#039;:[&#039;&#039;START&#039;&#039;]..[&#039;&#039;END&#039;&#039;]}};&lt;br /&gt;
** the statement {{Code|&#039;&#039;PROP&#039;&#039;&amp;lt;nowiki&amp;gt;:=&amp;lt;/nowiki&amp;gt;[&amp;quot;]&#039;&#039;VALUE&#039;&#039;[&amp;quot;]}} has the same effect as {{Code|QUERY_PROP}}; it is different to regular {{Code|&#039;&#039;PROP&#039;&#039;:&#039;&#039;VALUE&#039;&#039;}} where {{Code|VALUE}} might be a substring;&lt;br /&gt;
* {{Code|PROP}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;supplements {{Code|query}} with filtering by exact value of the {{Code|PROP}} property; the resulting query string will be {{Code|&#039;&#039;PROP&#039;&#039;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&#039;&#039;VALUE&#039;&#039; AND (&#039;&#039;QUERY&#039;&#039;)}}; argument is multiple;&lt;br /&gt;
* {{Code|!PROP}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;supplements {{Code|query}} by excluding exact value of the {{Code|PROP}} property; the resulting query string will be {{Code|NOT &#039;&#039;PROP&#039;&#039;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&#039;&#039;VALUE&#039;&#039; AND (&#039;&#039;QUERY&#039;&#039;)}}; argument is multiple;&lt;br /&gt;
* {{Code|reply}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;RESOURCE&#039;&#039; properties to return; by default, return only {{Code|guid}} property; argument is multiple;&lt;br /&gt;
* {{Code|order_by}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;property to sort the resulting list by; if starts with the {{Code|-}}, the order is descending, otherwise it is ascending;&lt;br /&gt;
* {{Code|group_by}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;property name to group resulting list by.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to receive:&lt;br /&gt;
* {{Code|total}}, total number in requested query (the reply might contain only the portion restricted by {{Code|limit}} request argument);&lt;br /&gt;
* {{Code|result}}, an array of dictionaries with resource object properties, dictionaries contain at least {{Code|guid}} property.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-resource&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;[?reply=&#039;&#039;PROP&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
* {{Code|reply}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;RESOURCE&#039;&#039; properties to return; by default, return only {{Code|guid}} property; argument is multiple;&lt;br /&gt;
&lt;br /&gt;
Return properties for a particular resource object.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to receive:&lt;br /&gt;
* properties that were specified in {{Code|reply}} argument(s), at least {{Code|guid}}.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-property&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Return property value for particular resource object.&lt;br /&gt;
&lt;br /&gt;
Data to receive:&lt;br /&gt;
* property value in JSON notation for regular properties;&lt;br /&gt;
* raw data or redirection for BLOB properties.&lt;br /&gt;
&lt;br /&gt;
=== Aggregated properties ===&lt;br /&gt;
&lt;br /&gt;
[[#resource-types|Aggregated]] properties have special API to treat their content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;POST-aggproperty&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;POST&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Submit new item. The command returns an id for newly created aggregated item. Depending on particular property, new items might be created not only by object&#039;s authors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT-aggproperty&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;/&#039;&#039;ID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Update existing aggregated item. Depending on particular property, the command is allowed either to object&#039;s authors or to aggregated item submitter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE-aggproperty&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;/&#039;&#039;ID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Delete existing aggregated item. Depending on particular property, the command is allowed either to object&#039;s authors or to aggregated item submitter.&lt;br /&gt;
&lt;br /&gt;
=== Notifications ===&lt;br /&gt;
&lt;br /&gt;
It is possible to subscribe to server events. Notification will happen using HTML5 [[wikipedia:Server-sent_events|Server-sent events]] (SSE).&lt;br /&gt;
&lt;br /&gt;
To start subscription, send the following request:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /?cmd=&#039;&#039;&#039;subscribe&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Response will be served with &#039;&#039;text/event-stream&#039;&#039; MIME type for default SSE message type. SSE message will be a JSONified object with the following, at least, attributes:&lt;br /&gt;
&lt;br /&gt;
* {{Code|event}}&amp;lt;br&amp;gt;event type.&lt;br /&gt;
&lt;br /&gt;
== Node API ==&lt;br /&gt;
&lt;br /&gt;
This is an API provided by Sugar Network nodes on top of [[#Base_API|base one]].&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
&lt;br /&gt;
Right now, the only way to be authenticated on a Sugar Network server is by running a [[Platform_Team/Sugar_Network/Implementation#sugar-network-client|local application]] on the client side and using the API it [[#Client_API|provides]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;TODO&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Authorization ===&lt;br /&gt;
&lt;br /&gt;
Read-only access is available for anonymous requests, except special content like machine serial numbers. But to process any changes, clients need to be authenticated.&lt;br /&gt;
&lt;br /&gt;
Right after creating any Sugar Network object, its author becomes the only user who can process any object modifications afterwards. Authority information will be kept in the [[#Sugar_Network_resources|author]] property and can be modified using the following commands.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;useradd&#039;&#039;&#039;&amp;amp;user=&#039;&#039;USER&#039;&#039;&amp;amp;role=&#039;&#039;ROLE&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Add another user who can modify the corresponding object. &#039;&#039;USER&#039;&#039; argument should be either &#039;&#039;User&#039;&#039; guid (for authors registered in the Sugar Network), or, full author name.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;userdel&#039;&#039;&#039;&amp;amp;user=&#039;&#039;USER&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Remove user from the authority list. It is not possible to remove yourself. &#039;&#039;USER&#039;&#039; argument should be either &#039;&#039;User&#039;&#039; guid (for authors registered in the Sugar Network), or, full author name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;TODO&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Retrieving releases ===&lt;br /&gt;
&lt;br /&gt;
To easy download Context [[#context-releases|releases]] and avoid reading raw &#039;&#039;Context.releases&#039;&#039; property, there are special high-level API commands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-solve&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;solve&#039;&#039;&#039;[&amp;amp;lsb_id=&#039;&#039;LSB_ID&#039;&#039;][&amp;amp;lsb_release=&#039;&#039;LSB_RELEASE&#039;&#039;][&amp;amp;assume=&#039;&#039;DEPENDENCY&#039;&#039;-&#039;&#039;VERSION&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
The command returns information about what particular releases should be downloaded depending on provided requirements. This command might return not only one release, e.g., activities might have dependencies either system packages or another Sugar Network Contexts.&lt;br /&gt;
&lt;br /&gt;
Solving requirements might be:&lt;br /&gt;
&lt;br /&gt;
* {{Code|LSB_ID}}, if Context releases depend on system packages, specify the [[Wikipedia:Linux_Standard_Base|LSB]] distributor id to consider while choosing particular packages;&lt;br /&gt;
* {{Code|LSB_RELEASE}}, if Context releases depend on system packages, specify the [[Wikipedia:Linux_Standard_Base|LSB]] release number of the distribution to consider while choosing particular packages;&lt;br /&gt;
* {{Code|DEPENDENCY-VERSION}}, the {{Code|assume}} argument instructs server to assume that specified [[Sugar_Network/Recipe_Specification#Dependencies|dependency]] is already available on client side and should be taken into account while solving; this is especially important for package dependencies when server considers packages available only from official repositories but users might have more recent package versions installed in local system; e.g., the above example request will fail without {{Code|sugar-0.94}} because neither {{Code|lsb_id}} nor {{Code|lsb_release}} were specified (even if LSB information is passed, server might not have information about what package versions come from official repositories).&lt;br /&gt;
&lt;br /&gt;
The resulting info is a JSON object with keys equal to Context guids and value objects for chosen release with the following keys:&lt;br /&gt;
&lt;br /&gt;
* {{Code|blob}}, bundle [[#resource-types|digest]] to download;&lt;br /&gt;
* {{Code|version}}, chosen version number;&lt;br /&gt;
* {{Code|title}}, the &#039;&#039;Context.title&#039;&#039; value;&lt;br /&gt;
* {{Code|command}}, a command to launch the bundle, only for Sugar activities.&lt;br /&gt;
&lt;br /&gt;
For example, the {{Code|&#039;&#039;&#039;GET&#039;&#039;&#039; &amp;lt;nowiki&amp;gt;/context/org.laptop.TurtleArtActivity?cmd=solve&amp;amp;assume=sugar-0.94&amp;lt;/nowiki&amp;gt;}} request returns:&lt;br /&gt;
&lt;br /&gt;
 {&lt;br /&gt;
   &amp;quot;org.laptop.TurtleArtActivity&amp;quot;: {&lt;br /&gt;
     &amp;quot;title&amp;quot;: &amp;quot;Turtle Blocks&amp;quot;,&lt;br /&gt;
     &amp;quot;version&amp;quot;: [[202], 0],&lt;br /&gt;
     &amp;quot;blob&amp;quot;: &amp;quot;http://download.sugarlabs.org/activities/4027/turtleblocks-202.xo&amp;quot;,&lt;br /&gt;
     &amp;quot;content-type&amp;quot;: &amp;quot;application/vnd.olpc-sugar&amp;quot;,&lt;br /&gt;
     &amp;quot;size&amp;quot;: 4715955,&lt;br /&gt;
     &amp;quot;unpack_size&amp;quot;: 12873871,&lt;br /&gt;
     &amp;quot;command&amp;quot;: [&amp;quot;activity&amp;quot;, &amp;quot;sugar-activity TurtleArtActivity.TurtleArtActivity&amp;quot;],&lt;br /&gt;
   },&lt;br /&gt;
   &amp;quot;sugar&amp;quot;: {&lt;br /&gt;
     &amp;quot;version&amp;quot;: [[0, 94], 0],&lt;br /&gt;
   },&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-clone&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Like the [[#GET-solve|solve]] command, &#039;&#039;clone&#039;&#039; makes a solution but returns bundle itself, so, there is no way to get information about possible dependencies.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;clone&#039;&#039;&#039;[&amp;amp;lsb_id=&#039;&#039;LSB_ID&#039;&#039;][&amp;amp;lsb_release=&#039;&#039;LSB_RELEASE&#039;&#039;][&amp;amp;assume=&#039;&#039;DEPENDENCY&#039;&#039;-&#039;&#039;VERSION&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
=== Upload releases ===&lt;br /&gt;
&lt;br /&gt;
To easy upload Context [[#context-releases|releases]] and avoid writing to raw &#039;&#039;Context.releases&#039;&#039; property, there is a special high-level API command.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;POST&#039;&#039;&#039; /context?cmd=&#039;&#039;&#039;submit&#039;&#039;&#039;[&amp;amp;&#039;&#039;PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;][&amp;amp;initial]&lt;br /&gt;
&lt;br /&gt;
Where the {{Code|PROP}} arguments are optional release properties. The {{Code|initial}} argument asks the system to create new Context resource new release will belong to.&lt;br /&gt;
&lt;br /&gt;
The posting data might be two types,&lt;br /&gt;
&lt;br /&gt;
* Sugar activities in .xo bundles,&amp;lt;br&amp;gt;there is no need in {{Code|PROP}} arguments, all properties will be populated basing on metadata from a .xo bundle; including release notes from the {{Code|CHANGELOG}} file in [[Wikipedia:Markdown|Markdown]] notation; besides, only in this case {{Code|initial}} makes sense because it is the only way to get Context properties;&lt;br /&gt;
&lt;br /&gt;
* Arbitrary data,&amp;lt;br&amp;gt;all required release properties should be specified in {{Code|PROP}} arguments, at least &#039;&#039;context&#039;&#039; and &#039;&#039;version&#039;&#039;; &#039;&#039;license&#039;&#039; should be specified only if there are no existing releases to pickup license from.&lt;br /&gt;
&lt;br /&gt;
=== Node statistics ===&lt;br /&gt;
&lt;br /&gt;
While working, Sugar Network servers collect depersonalized and common [[Sugar_Network/Node_Statistics|statistics]]. To read such info, call the command:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /?cmd=&#039;&#039;&#039;stats&#039;&#039;&#039;[&amp;amp;start=&#039;&#039;SECONDS&#039;&#039;][&amp;amp;end=&#039;&#039;SECONDS&#039;&#039;][&amp;amp;event=&#039;&#039;EVENT&#039;&#039;][&amp;amp;limit=&#039;&#039;NUMBER&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
&lt;br /&gt;
* {{Code|start}} and {{Code|end}} is a time interval to get statistics for; if omitted, the beginning and the end of entire life cycle will be used;&lt;br /&gt;
* {{Code|event}}, multiple argument to specify what [[Sugar_Network/Node_Statistics#Common_statistics|stats]] should be returned; if omitted, return all sources;&lt;br /&gt;
* {{Code|limit}}, number of stat records to return for the {{Code|start}}-{{Code|end}} interval; note that this amount is not precise, the final resultset might be smaller or bigger depending on chosen resolution; stats resolution depends on node configuration, default values are 1 day, 10 days, 30 days, 365 days; if omitted, return {{Code|end}} record only.&lt;br /&gt;
&lt;br /&gt;
== Client API ==&lt;br /&gt;
&lt;br /&gt;
The reasons to proxy Sugar Network data on users side:&lt;br /&gt;
&lt;br /&gt;
* Seamless support [[#Offline mode|offline workflow]];&lt;br /&gt;
* [[#Launching|One-click launch]] Sugar activities hosted on Sugar Network.&lt;br /&gt;
&lt;br /&gt;
Proxying happens by providing the same Sugar Network API (with some extra functionality, see below) from&lt;br /&gt;
[[Platform_Team/Sugar_Network/Implementation#sugar-network-client|local process]] launched beforehand.&lt;br /&gt;
&lt;br /&gt;
=== Offline mode ===&lt;br /&gt;
&lt;br /&gt;
Being connected to a Sugar Network node, local proxy provides [[#Node_API|original API]] from the node. If the connection is lost, the proxy will switch to local Sugar Network storage and continue working providing only [[#Base_API|base API]]. Any content created in offline mode will be uploaded to the node after getting a connection back.&lt;br /&gt;
&lt;br /&gt;
Besides, local Sugar Network storage will be reused to keep users preferences, such as:&lt;br /&gt;
&lt;br /&gt;
* Favorited Contexts&amp;lt;br&amp;gt;to select preferred &#039;&#039;Context&#039;&#039; resources; these Contexts will be marked by {{Code|favorite}} value in the &#039;&#039;Context.layer&#039;&#039; property;&lt;br /&gt;
&lt;br /&gt;
* Checked-in Contexts&amp;lt;br&amp;gt;to keep most recent Context (for &#039;&#039;activity&#039;&#039; and &#039;&#039;book&#039;&#039; types) version in local storage to make it available in offline; note that there is no need in checking-in to speedup online lunch, versions are being [[#Launching|cached]] anyway; these Contexts will be marked by {{Code|checkin}} value in the &#039;&#039;Context.layer&#039;&#039; property.&lt;br /&gt;
&lt;br /&gt;
To control users preferences there are special API commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT_favorite&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;favorite&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Set favorite status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE_favorite&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;favorite&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Unset favorite status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT_checkin&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;checkin&#039;&#039;&#039;[&amp;amp;spawn]&lt;br /&gt;
&lt;br /&gt;
Check-in the specified Context. By default, the command will return streamed &#039;&#039;text/event-stream&#039;&#039; MIME type data to monitor the progress. If the {{Code|spawn}} argument is specified, the command will exit immediately with [[#Notifications|asynchronous sending]] progress events.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE_checkin&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;checkin&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Checkout the Context.&lt;br /&gt;
&lt;br /&gt;
=== Launching ===&lt;br /&gt;
&lt;br /&gt;
Sugar Network Contexts (for &#039;&#039;activity&#039;&#039; and &#039;&#039;book&#039;&#039; types) can be launched as-is. The launching process is implicit and includes selecting the most recent (and appropriate for software contexts) version, downloading bundles from the Sugar Network, installing missed [[Sugar_Network/Recipe_Specification#Dependencies|software dependencies]], execution itself. All downloaded bundles will be cached [with further garbage collecting] to speedup further launching.&lt;br /&gt;
&lt;br /&gt;
Sugar activities will be directly executed. Book Contexts will be opened in the proper application according to its MIME type.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;launch&#039;&#039;&#039;[&amp;amp;args=&#039;&#039;ARG&#039;&#039;][&amp;amp;activity_id=&#039;&#039;ACTIVITY_ID&#039;&#039;][&amp;amp;object_id=&#039;&#039;OBJECT_ID&#039;&#039;][&amp;amp;uri=&#039;&#039;URI&#039;&#039;][&amp;amp;app=&#039;&#039;APP&#039;&#039;][&amp;amp;spawn]&lt;br /&gt;
&lt;br /&gt;
Arguments that make sense only for Sugar activities:&lt;br /&gt;
&lt;br /&gt;
* {{Code|ARG}}, command line argument to pass to launched activities, repeat {{Code|ARG}} for each argument;&lt;br /&gt;
* {{Code|ACTIVITY_ID}}, internal activity id which will be auto set if omitted;&lt;br /&gt;
* {{Code|OBJECT_ID}}, Journal object id to resume;&lt;br /&gt;
* {{Code|URI}}, URL to resume if activity supports this functionality.&lt;br /&gt;
&lt;br /&gt;
Arguments that make sense only for books:&lt;br /&gt;
&lt;br /&gt;
* {{Code|APP}}, specify application Context to open the book by; if omitted, the system will try to find most appropriate option, among all existing software Contexts.&lt;br /&gt;
&lt;br /&gt;
Common arguments:&lt;br /&gt;
&lt;br /&gt;
* {{Code|spawn}}, by default, the command will return streamed &#039;&#039;text/event-stream&#039;&#039; MIME type data to monitor the whole launching process until exiting the application; if the {{Code|spawn}} argument is specified, the command will exit immediately with [[#Notifications|asynchronous sending]] launching events.&lt;br /&gt;
&lt;br /&gt;
== Experimental API ==&lt;br /&gt;
&lt;br /&gt;
There is no guaranty that the following API will be stated as stable or frozen sometime.&lt;br /&gt;
&lt;br /&gt;
=== Access to Sugar Journal ===&lt;br /&gt;
&lt;br /&gt;
It is possible to get access to local Sugar Journal using special, &#039;&#039;journal&#039;&#039;, resource provided from [[#Client_API|client API]]. This kind of access might be useful when local applications cannot use DBus sugar-datastore API, e.g., [[wikipedia:Javascript|Javascript]] applications. API to Journal is restricted only to read-only access:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /journal?offset=&#039;&#039;INTEGER&#039;&#039;&amp;amp;limit=&#039;&#039;INTEGER&#039;&#039;[&amp;amp;query=&#039;&#039;STRING&#039;&#039;][&amp;amp;order_by=&amp;lt;nowiki&amp;gt;[+|-]&amp;lt;/nowiki&amp;gt;&#039;&#039;PROP&#039;&#039;][&amp;amp;&#039;&#039;QUERY_PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;[&amp;amp;...]]&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /journal/&#039;&#039;JOURNAL_ID&#039;&#039;[?reply=&#039;&#039;PROP&#039;&#039;[,..]]&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /journal/&#039;&#039;JOURNAL_ID&#039;&#039;/&#039;&#039;PROPERTY&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
Being HTTP based, Sugar Network API can be used in any manner regular HTTP requests can be handled. But for command-line access, there is a handy tool, {{Code|sugar-network}}, which takes care about Sugar Network specific like launching local API (if it is not already available) to get access to [[#Client_API|local proxy]].&lt;br /&gt;
&lt;br /&gt;
The sugar-network command-line format is below. Call {{Code|sugar-network --help}} for more detailed info.&lt;br /&gt;
&lt;br /&gt;
 sugar-network GET|POST|PUT|DELETE &#039;&#039;PATH&#039;&#039; &#039;&#039;ARG=VALUE&#039;&#039; [..]&lt;br /&gt;
&lt;br /&gt;
* {{Code|PATH}}, is an url path;&lt;br /&gt;
* {{Code|ARG&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;VALUE}}, request arguments as they being passed to in url.&lt;br /&gt;
&lt;br /&gt;
{{Code|POST}} and {{Code|PUT}} commands require data to pass, use the following command-line arguments:&lt;br /&gt;
&lt;br /&gt;
* {{Code|-f FILE}} to specify the file to pass;&lt;br /&gt;
* {{Code|-d DATA}} to specify string to pass;&lt;br /&gt;
* {{Code|-j}} posted data should be encoded into JSON before posting.&lt;br /&gt;
&lt;br /&gt;
== Getting involved ==&lt;br /&gt;
&lt;br /&gt;
{{:Sugar_Network/Feedback}}&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Sugar_Network/API&amp;diff=92525</id>
		<title>Sugar Network/API</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Sugar_Network/API&amp;diff=92525"/>
		<updated>2014-05-12T13:11:31Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: /* Retrieving releases */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the API that Sugar Network clients use to interact with a Sugar Network server. See also a guide to basic Sugar Network [[Sugar_Network/Concept|concepts]] and [[Platform_Team/Sugar_Network/Architecture|its twin page]] for a technical point of view. In addition, visit the [[Sugar_Network|introduction page]].&lt;br /&gt;
&lt;br /&gt;
{{Note/warning|Note|Until announcing API freeze, this document describes the most recent development version of the API.&amp;lt;br&amp;gt;You can find its implementation on the [[#API servers|node-devel.sugarlabs.org]] server.}}&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
To better understand this API, see a technical explanation of its [[Platform_Team/Sugar_Network/Architecture#Conceptual_level|conceptual level]] and [[#Sugar_Network_resources|objects model]] in particular.&lt;br /&gt;
&lt;br /&gt;
The API operates with [[Sugar Network]] [[#Sugar_Network_resources|resources]], which are collections of objects. All objects are identified by globally unique identifiers, GUIDs, and available for operation via [[#Base_API|basic actions]]. The API is being provided from a [[#API_servers|node server]] or a [[#Client_API|client]]. While processing requests, API providers generate [[#Notifications|events]].&lt;br /&gt;
&lt;br /&gt;
The API is [[Wikipedia:Restful|RESTful]], and is served via HTTP(S) using [[Wikipedia:Json|JSON]] notation. The common request url format is:&lt;br /&gt;
&lt;br /&gt;
 http[s]://&#039;&#039;SERVER&#039;&#039;[/&#039;&#039;RESOURCE&#039;&#039;[/&#039;&#039;GUID&#039;&#039;[/&#039;&#039;PROPERTY&#039;&#039;]]][?[cmd=&#039;&#039;COMMAND&#039;&#039;][&amp;amp;&#039;&#039;ARGUMENT&#039;&#039;=&#039;&#039;VALUE&#039;&#039;..]]&lt;br /&gt;
&lt;br /&gt;
When:&lt;br /&gt;
&lt;br /&gt;
* {{Code|SERVER}}, [[#API_servers|particular]] Sugar Network API server;&lt;br /&gt;
* {{Code|RESOURCE}}, name one of the [[#Sugar_Network_resources|existing]] resources;&lt;br /&gt;
* {{Code|GUID}}, the {{Code|RESOURCE}}&#039;s particular object;&lt;br /&gt;
* {{Code|PROPERTY}}, particular property of {{Code|GUID}} object;&lt;br /&gt;
* {{Code|COMMAND}}, optional command name; combination of HTTP request method ({{Code|GET}}, {{Code|POST}}, {{Code|PUT}}, or, {{Code|DELETE}}) and [possibly empty] {{Code|COMMAND}} composes the requested [[#Actions|action]];&lt;br /&gt;
* {{Code|ARGUMENT}}s and {{Code|VALUE}}s depend on the particular [[#Actions|action]].&lt;br /&gt;
&lt;br /&gt;
In most cases, the server replies in JSON notation. If a request fails, the replied JSON object will contain a {{Code|request}} key, with the original request, and {{Code|error}} key, with an error message.&lt;br /&gt;
&lt;br /&gt;
== API servers ==&lt;br /&gt;
&lt;br /&gt;
These are standard Sugar Network API servers publicly available.&lt;br /&gt;
&lt;br /&gt;
* [http://node-devel.sugarlabs.org/ node-devel.sugarlabs.org]&amp;lt;br&amp;gt;Development server which does not contain important data and is free for any experiments (administrative privileges for anonymous users);&lt;br /&gt;
&lt;br /&gt;
* [http://node-testing.sugarlabs.org/ node-testing.sugarlabs.org]&amp;lt;br&amp;gt;Recent stable release with regular data import from the production server; is still free for any experiments;&lt;br /&gt;
&lt;br /&gt;
* [http://node.sugarlabs.org/ node.sugarlabs.org]&amp;lt;br&amp;gt;Production server;&lt;br /&gt;
&lt;br /&gt;
* [http://localhost:5001/ localhost:5001]&amp;lt;br&amp;gt;default url to get access to [[#Client_API|local proxy]] provided from user side application.&lt;br /&gt;
&lt;br /&gt;
== Sugar Network resources ==&lt;br /&gt;
&lt;br /&gt;
{{:Sugar_Network/Resources}}&lt;br /&gt;
&lt;br /&gt;
== Base API ==&lt;br /&gt;
&lt;br /&gt;
List of actions common of all API providers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;POST&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;POST&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create new resource object.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to send:&lt;br /&gt;
* {{Code|&#039;&#039;RESOURCE}}&#039;s properties.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to receive:&lt;br /&gt;
* {{Code|guid}}, with globally unique identifier that specifies the created object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Modify resource object. By default, might be called only by {{Code|GUID}} creator.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to send:&lt;br /&gt;
* {{Code|RESOURCE}}&#039;s properties to modify.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Delete resource object. Actual object destruction won&#039;t happen, the object will be hidden. Garbage collection of hidden objects will be processed by Network administrators. By default, this action may be called only by the {{Code|GUID}} creator.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;[?offset=&#039;&#039;INTEGER&#039;&#039;][&amp;amp;limit=&#039;&#039;INTEGER&#039;&#039;][&amp;amp;query=&#039;&#039;STRING&#039;&#039;][&amp;amp;reply=&#039;&#039;PROP&#039;&#039;][&amp;amp;order_by=&amp;lt;nowiki&amp;gt;[+|-]&amp;lt;/nowiki&amp;gt;&#039;&#039;PROP&#039;&#039;][&amp;amp;group_by=&#039;&#039;PROP&#039;&#039;][&amp;amp;&#039;&#039;PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;][&amp;amp;&#039;&#039;!PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
Find resource objects.&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
* {{Code|offset}}, &#039;&#039;int&#039;&#039;&amp;lt;br&amp;gt;start index to return entries from, the default value is {{Code|0}};&lt;br /&gt;
* {{Code|limit}}, &#039;&#039;int&#039;&#039;&amp;lt;br&amp;gt;do not return more then specified value, maximal and default values are being setup on server side;&lt;br /&gt;
* {{Code|query}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;search request in [http://xapian.org/docs/queryparser.html Xapian] notation with the following additions:&lt;br /&gt;
** if property is boolean, integer or datetime, it supports searching by ranges: {{Code|&#039;&#039;PROP&#039;&#039;:[&#039;&#039;START&#039;&#039;]..[&#039;&#039;END&#039;&#039;]}};&lt;br /&gt;
** the statement {{Code|&#039;&#039;PROP&#039;&#039;&amp;lt;nowiki&amp;gt;:=&amp;lt;/nowiki&amp;gt;[&amp;quot;]&#039;&#039;VALUE&#039;&#039;[&amp;quot;]}} has the same effect as {{Code|QUERY_PROP}}; it is different to regular {{Code|&#039;&#039;PROP&#039;&#039;:&#039;&#039;VALUE&#039;&#039;}} where {{Code|VALUE}} might be a substring;&lt;br /&gt;
* {{Code|PROP}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;supplements {{Code|query}} with filtering by exact value of the {{Code|PROP}} property; the resulting query string will be {{Code|&#039;&#039;PROP&#039;&#039;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&#039;&#039;VALUE&#039;&#039; AND (&#039;&#039;QUERY&#039;&#039;)}}; argument is multiple;&lt;br /&gt;
* {{Code|!PROP}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;supplements {{Code|query}} by excluding exact value of the {{Code|PROP}} property; the resulting query string will be {{Code|NOT &#039;&#039;PROP&#039;&#039;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&#039;&#039;VALUE&#039;&#039; AND (&#039;&#039;QUERY&#039;&#039;)}}; argument is multiple;&lt;br /&gt;
* {{Code|reply}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;RESOURCE&#039;&#039; properties to return; by default, return only {{Code|guid}} property; argument is multiple;&lt;br /&gt;
* {{Code|order_by}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;property to sort the resulting list by; if starts with the {{Code|-}}, the order is descending, otherwise it is ascending;&lt;br /&gt;
* {{Code|group_by}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;property name to group resulting list by.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to receive:&lt;br /&gt;
* {{Code|total}}, total number in requested query (the reply might contain only the portion restricted by {{Code|limit}} request argument);&lt;br /&gt;
* {{Code|result}}, an array of dictionaries with resource object properties, dictionaries contain at least {{Code|guid}} property.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-resource&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;[?reply=&#039;&#039;PROP&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
* {{Code|reply}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;RESOURCE&#039;&#039; properties to return; by default, return only {{Code|guid}} property; argument is multiple;&lt;br /&gt;
&lt;br /&gt;
Return properties for a particular resource object.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to receive:&lt;br /&gt;
* properties that were specified in {{Code|reply}} argument(s), at least {{Code|guid}}.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-property&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Return property value for particular resource object.&lt;br /&gt;
&lt;br /&gt;
Data to receive:&lt;br /&gt;
* property value in JSON notation for regular properties;&lt;br /&gt;
* raw data or redirection for BLOB properties.&lt;br /&gt;
&lt;br /&gt;
=== Aggregated properties ===&lt;br /&gt;
&lt;br /&gt;
[[#resource-types|Aggregated]] properties have special API to treat their content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;POST-aggproperty&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;POST&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Submit new item. The command returns an id for newly created aggregated item. Depending on particular property, new items might be created not only by object&#039;s authors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT-aggproperty&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;/&#039;&#039;ID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Update existing aggregated item. Depending on particular property, the command is allowed either to object&#039;s authors or to aggregated item submitter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE-aggproperty&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;/&#039;&#039;ID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Delete existing aggregated item. Depending on particular property, the command is allowed either to object&#039;s authors or to aggregated item submitter.&lt;br /&gt;
&lt;br /&gt;
=== Notifications ===&lt;br /&gt;
&lt;br /&gt;
It is possible to subscribe to server events. Notification will happen using HTML5 [[wikipedia:Server-sent_events|Server-sent events]] (SSE).&lt;br /&gt;
&lt;br /&gt;
To start subscription, send the following request:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /?cmd=&#039;&#039;&#039;subscribe&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Response will be served with &#039;&#039;text/event-stream&#039;&#039; MIME type for default SSE message type. SSE message will be a JSONified object with the following, at least, attributes:&lt;br /&gt;
&lt;br /&gt;
* {{Code|event}}&amp;lt;br&amp;gt;event type.&lt;br /&gt;
&lt;br /&gt;
== Node API ==&lt;br /&gt;
&lt;br /&gt;
This is an API provided by Sugar Network nodes on top of [[#Base_API|base one]].&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
&lt;br /&gt;
Right now, the only way to be authenticated on a Sugar Network server is by running a [[Platform_Team/Sugar_Network/Implementation#sugar-network-client|local application]] on the client side and using the API it [[#Client_API|provides]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;TODO&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Authorization ===&lt;br /&gt;
&lt;br /&gt;
Read-only access is available for anonymous requests, except special content like machine serial numbers. But to process any changes, clients need to be authenticated.&lt;br /&gt;
&lt;br /&gt;
Right after creating any Sugar Network object, its author becomes the only user who can process any object modifications afterwards. Authority information will be kept in the [[#Sugar_Network_resources|author]] property and can be modified using the following commands.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;useradd&#039;&#039;&#039;&amp;amp;user=&#039;&#039;USER&#039;&#039;&amp;amp;role=&#039;&#039;ROLE&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Add another user who can modify the corresponding object. &#039;&#039;USER&#039;&#039; argument should be either &#039;&#039;User&#039;&#039; guid (for authors registered in the Sugar Network), or, full author name.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;userdel&#039;&#039;&#039;&amp;amp;user=&#039;&#039;USER&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Remove user from the authority list. It is not possible to remove yourself. &#039;&#039;USER&#039;&#039; argument should be either &#039;&#039;User&#039;&#039; guid (for authors registered in the Sugar Network), or, full author name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;TODO&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Retrieving releases ===&lt;br /&gt;
&lt;br /&gt;
To easy download Context [[#context-releases|releases]] and avoid reading raw &#039;&#039;Context.releases&#039;&#039; property, there are special high-level API commands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-solve&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;solve&#039;&#039;&#039;[&amp;amp;lsb_id=&#039;&#039;LSB_ID&#039;&#039;][&amp;amp;lsb_release=&#039;&#039;LSB_RELEASE&#039;&#039;][&amp;amp;assume=&#039;&#039;DEPENDENCY&#039;&#039;-&#039;&#039;VERSION&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
The command returns information about what particular releases should be downloaded depending on provided requirements. This command might return not only one release, e.g., activities might have dependencies either system packages or another Sugar Network Contexts.&lt;br /&gt;
&lt;br /&gt;
Solving requirements might be:&lt;br /&gt;
&lt;br /&gt;
* {{Code|LSB_ID}}, if Context releases depend on system packages, specify the [[Wikipedia:Linux_Standard_Base|LSB]] distributor id to consider while choosing particular packages;&lt;br /&gt;
* {{Code|LSB_RELEASE}}, if Context releases depend on system packages, specify the [[Wikipedia:Linux_Standard_Base|LSB]] release number of the distribution to consider while choosing particular packages;&lt;br /&gt;
* {{Code|DEPENDENCY-VERSION}}, the {{Code|assume}} argument instructs server to assume that specified [[Sugar_Network/Recipe_Specification#Dependencies|dependency]] is already available on client side and should be taken into account while solving; this is especially important for package dependencies when server considers packages available only from official repositories but users might have more recent package versions installed in local system; e.g., the above example request will fail without {{Code|sugar-0.94}} because neither {{Code|lsb_id}} nor {{Code|lsb_release}} were specified (even if LSB information is passed, server might not have information about what package versions come from official repositories).&lt;br /&gt;
&lt;br /&gt;
The resulting info is a JSON object with keys equal to Context guids and value objects for chosen release with the following keys:&lt;br /&gt;
&lt;br /&gt;
* {{Code|blob}}, bundle [[#resource-types|digest]] to download;&lt;br /&gt;
* {{Code|version}}, chosen version number;&lt;br /&gt;
* {{Code|title}}, the &#039;&#039;Context.title&#039;&#039; value;&lt;br /&gt;
* {{Code|command}}, a command to launch the bundle, only for Sugar activities.&lt;br /&gt;
&lt;br /&gt;
For example, the {{Code|&#039;&#039;&#039;GET&#039;&#039;&#039; &amp;lt;nowiki&amp;gt;/context/org.laptop.TurtleArtActivity?cmd=solve&amp;amp;assume=sugar-0.94&amp;lt;/nowiki&amp;gt;}} request returns:&lt;br /&gt;
&lt;br /&gt;
 {&lt;br /&gt;
   &amp;quot;org.laptop.TurtleArtActivity&amp;quot;: {&lt;br /&gt;
     &amp;quot;title&amp;quot;: &amp;quot;Turtle Blocks&amp;quot;,&lt;br /&gt;
     &amp;quot;version&amp;quot;: [[202], 0],&lt;br /&gt;
     &amp;quot;blob&amp;quot;: &amp;quot;http://download.sugarlabs.org/activities/4027/turtleblocks-202.xo&amp;quot;,&lt;br /&gt;
     &amp;quot;content-type&amp;quot;: &amp;quot;application/vnd.olpc-sugar&amp;quot;,&lt;br /&gt;
     &amp;quot;size&amp;quot;: 4715955,&lt;br /&gt;
     &amp;quot;unpack_size&amp;quot;: 12873871,&lt;br /&gt;
     &amp;quot;command&amp;quot;: [&amp;quot;activity&amp;quot;, &amp;quot;sugar-activity TurtleArtActivity.TurtleArtActivity&amp;quot;],&lt;br /&gt;
   },&lt;br /&gt;
   &amp;quot;sugar&amp;quot;: {&lt;br /&gt;
     &amp;quot;version&amp;quot;: [[0, 94], 0],&lt;br /&gt;
   },&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-clone&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Like the [[#GET-solve|solve]] command, &#039;&#039;clone&#039;&#039; makes a solution but returns bundle itself, so, there is no way to get information about possible dependencies.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;clone&#039;&#039;&#039;[&amp;amp;lsb_id=&#039;&#039;LSB_ID&#039;&#039;][&amp;amp;lsb_release=&#039;&#039;LSB_RELEASE&#039;&#039;][&amp;amp;assume=&#039;&#039;DEPENDENCY&#039;&#039;-&#039;&#039;VERSION&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
=== Upload releases ===&lt;br /&gt;
&lt;br /&gt;
To easy upload Context [[#context-releases|releases]] and avoid writing to raw &#039;&#039;Context.releases&#039;&#039; property, there is a special high-level API command.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;POST&#039;&#039;&#039; /context?cmd=&#039;&#039;&#039;submit&#039;&#039;&#039;[&amp;amp;&#039;&#039;PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;][&amp;amp;initial]&lt;br /&gt;
&lt;br /&gt;
Where the {{Code|PROP}} arguments are optional release properties. The {{Code|initial}} argument asks the system to create new Context resource new release will belong to.&lt;br /&gt;
&lt;br /&gt;
The posting data might be two types,&lt;br /&gt;
&lt;br /&gt;
* Sugar activities in .xo bundles,&amp;lt;br&amp;gt;there is no need in {{Code|PROP}} arguments, all properties will be populated basing on metadata from a .xo bundle; including release notes from the {{Code|CHANGELOG}} file in [[Wikipedia:Markdown|Markdown]] notation; besides, only in this case {{Code|initial}} makes sense because it is the only way to get Context properties;&lt;br /&gt;
&lt;br /&gt;
* Arbitrary data,&amp;lt;br&amp;gt;all required release properties should be specified in {{Code|PROP}} arguments, at least &#039;&#039;context&#039;&#039; and &#039;&#039;version&#039;&#039;; &#039;&#039;license&#039;&#039; should be specified only if there are no existing releases to pickup license from.&lt;br /&gt;
&lt;br /&gt;
=== Node statistics ===&lt;br /&gt;
&lt;br /&gt;
While working, Sugar Network servers collect depersonalized and common [[Sugar_Network/Node_Statistics|statistics]]. To read such info, call the command:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /?cmd=&#039;&#039;&#039;stats&#039;&#039;&#039;&amp;amp;records=&#039;&#039;NUMBER&#039;&#039;[&amp;amp;start=&#039;&#039;SECONDS&#039;&#039;][&amp;amp;end=&#039;&#039;SECONDS&#039;&#039;][&amp;amp;source=&#039;&#039;STATS-NAME&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
&lt;br /&gt;
* {{Code|records}}, number of stat records to return for the {{Code|start}}-{{Code|end}} interval; note that this amount is not precise, the final resultset might be smaller or bigger depending on chosen resolution; stats resolution depends on node configuration, default values are 1 day, 10 days, 30 days, 365 days;&lt;br /&gt;
* {{Code|start}} and {{Code|end}} is a time interval to get statistics for; if omitted, the beginning and the end of entire life cycle will be used;&lt;br /&gt;
* {{Code|source}}, multiple argument to specify what [[Sugar_Network/Node_Statistics#Common_statistics|stats]] should be returned; if omitted, return all sources.&lt;br /&gt;
&lt;br /&gt;
== Client API ==&lt;br /&gt;
&lt;br /&gt;
The reasons to proxy Sugar Network data on users side:&lt;br /&gt;
&lt;br /&gt;
* Seamless support [[#Offline mode|offline workflow]];&lt;br /&gt;
* [[#Launching|One-click launch]] Sugar activities hosted on Sugar Network.&lt;br /&gt;
&lt;br /&gt;
Proxying happens by providing the same Sugar Network API (with some extra functionality, see below) from&lt;br /&gt;
[[Platform_Team/Sugar_Network/Implementation#sugar-network-client|local process]] launched beforehand.&lt;br /&gt;
&lt;br /&gt;
=== Offline mode ===&lt;br /&gt;
&lt;br /&gt;
Being connected to a Sugar Network node, local proxy provides [[#Node_API|original API]] from the node. If the connection is lost, the proxy will switch to local Sugar Network storage and continue working providing only [[#Base_API|base API]]. Any content created in offline mode will be uploaded to the node after getting a connection back.&lt;br /&gt;
&lt;br /&gt;
Besides, local Sugar Network storage will be reused to keep users preferences, such as:&lt;br /&gt;
&lt;br /&gt;
* Favorited Contexts&amp;lt;br&amp;gt;to select preferred &#039;&#039;Context&#039;&#039; resources; these Contexts will be marked by {{Code|favorite}} value in the &#039;&#039;Context.layer&#039;&#039; property;&lt;br /&gt;
&lt;br /&gt;
* Checked-in Contexts&amp;lt;br&amp;gt;to keep most recent Context (for &#039;&#039;activity&#039;&#039; and &#039;&#039;book&#039;&#039; types) version in local storage to make it available in offline; note that there is no need in checking-in to speedup online lunch, versions are being [[#Launching|cached]] anyway; these Contexts will be marked by {{Code|checkin}} value in the &#039;&#039;Context.layer&#039;&#039; property.&lt;br /&gt;
&lt;br /&gt;
To control users preferences there are special API commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT_favorite&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;favorite&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Set favorite status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE_favorite&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;favorite&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Unset favorite status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT_checkin&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;checkin&#039;&#039;&#039;[&amp;amp;spawn]&lt;br /&gt;
&lt;br /&gt;
Check-in the specified Context. By default, the command will return streamed &#039;&#039;text/event-stream&#039;&#039; MIME type data to monitor the progress. If the {{Code|spawn}} argument is specified, the command will exit immediately with [[#Notifications|asynchronous sending]] progress events.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE_checkin&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;checkin&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Checkout the Context.&lt;br /&gt;
&lt;br /&gt;
=== Launching ===&lt;br /&gt;
&lt;br /&gt;
Sugar Network Contexts (for &#039;&#039;activity&#039;&#039; and &#039;&#039;book&#039;&#039; types) can be launched as-is. The launching process is implicit and includes selecting the most recent (and appropriate for software contexts) version, downloading bundles from the Sugar Network, installing missed [[Sugar_Network/Recipe_Specification#Dependencies|software dependencies]], execution itself. All downloaded bundles will be cached [with further garbage collecting] to speedup further launching.&lt;br /&gt;
&lt;br /&gt;
Sugar activities will be directly executed. Book Contexts will be opened in the proper application according to its MIME type.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;launch&#039;&#039;&#039;[&amp;amp;args=&#039;&#039;ARG&#039;&#039;][&amp;amp;activity_id=&#039;&#039;ACTIVITY_ID&#039;&#039;][&amp;amp;object_id=&#039;&#039;OBJECT_ID&#039;&#039;][&amp;amp;uri=&#039;&#039;URI&#039;&#039;][&amp;amp;app=&#039;&#039;APP&#039;&#039;][&amp;amp;spawn]&lt;br /&gt;
&lt;br /&gt;
Arguments that make sense only for Sugar activities:&lt;br /&gt;
&lt;br /&gt;
* {{Code|ARG}}, command line argument to pass to launched activities, repeat {{Code|ARG}} for each argument;&lt;br /&gt;
* {{Code|ACTIVITY_ID}}, internal activity id which will be auto set if omitted;&lt;br /&gt;
* {{Code|OBJECT_ID}}, Journal object id to resume;&lt;br /&gt;
* {{Code|URI}}, URL to resume if activity supports this functionality.&lt;br /&gt;
&lt;br /&gt;
Arguments that make sense only for books:&lt;br /&gt;
&lt;br /&gt;
* {{Code|APP}}, specify application Context to open the book by; if omitted, the system will try to find most appropriate option, among all existing software Contexts.&lt;br /&gt;
&lt;br /&gt;
Common arguments:&lt;br /&gt;
&lt;br /&gt;
* {{Code|spawn}}, by default, the command will return streamed &#039;&#039;text/event-stream&#039;&#039; MIME type data to monitor the whole launching process until exiting the application; if the {{Code|spawn}} argument is specified, the command will exit immediately with [[#Notifications|asynchronous sending]] launching events.&lt;br /&gt;
&lt;br /&gt;
== Experimental API ==&lt;br /&gt;
&lt;br /&gt;
There is no guaranty that the following API will be stated as stable or frozen sometime.&lt;br /&gt;
&lt;br /&gt;
=== Access to Sugar Journal ===&lt;br /&gt;
&lt;br /&gt;
It is possible to get access to local Sugar Journal using special, &#039;&#039;journal&#039;&#039;, resource provided from [[#Client_API|client API]]. This kind of access might be useful when local applications cannot use DBus sugar-datastore API, e.g., [[wikipedia:Javascript|Javascript]] applications. API to Journal is restricted only to read-only access:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /journal?offset=&#039;&#039;INTEGER&#039;&#039;&amp;amp;limit=&#039;&#039;INTEGER&#039;&#039;[&amp;amp;query=&#039;&#039;STRING&#039;&#039;][&amp;amp;order_by=&amp;lt;nowiki&amp;gt;[+|-]&amp;lt;/nowiki&amp;gt;&#039;&#039;PROP&#039;&#039;][&amp;amp;&#039;&#039;QUERY_PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;[&amp;amp;...]]&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /journal/&#039;&#039;JOURNAL_ID&#039;&#039;[?reply=&#039;&#039;PROP&#039;&#039;[,..]]&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /journal/&#039;&#039;JOURNAL_ID&#039;&#039;/&#039;&#039;PROPERTY&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
Being HTTP based, Sugar Network API can be used in any manner regular HTTP requests can be handled. But for command-line access, there is a handy tool, {{Code|sugar-network}}, which takes care about Sugar Network specific like launching local API (if it is not already available) to get access to [[#Client_API|local proxy]].&lt;br /&gt;
&lt;br /&gt;
The sugar-network command-line format is below. Call {{Code|sugar-network --help}} for more detailed info.&lt;br /&gt;
&lt;br /&gt;
 sugar-network GET|POST|PUT|DELETE &#039;&#039;PATH&#039;&#039; &#039;&#039;ARG=VALUE&#039;&#039; [..]&lt;br /&gt;
&lt;br /&gt;
* {{Code|PATH}}, is an url path;&lt;br /&gt;
* {{Code|ARG&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;VALUE}}, request arguments as they being passed to in url.&lt;br /&gt;
&lt;br /&gt;
{{Code|POST}} and {{Code|PUT}} commands require data to pass, use the following command-line arguments:&lt;br /&gt;
&lt;br /&gt;
* {{Code|-f FILE}} to specify the file to pass;&lt;br /&gt;
* {{Code|-d DATA}} to specify string to pass;&lt;br /&gt;
* {{Code|-j}} posted data should be encoded into JSON before posting.&lt;br /&gt;
&lt;br /&gt;
== Getting involved ==&lt;br /&gt;
&lt;br /&gt;
{{:Sugar_Network/Feedback}}&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Node_Statistics&amp;diff=92523</id>
		<title>Sugar Network/Node Statistics</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Node_Statistics&amp;diff=92523"/>
		<updated>2014-05-12T09:46:48Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: /* Common statistics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
This page describes the statistics that [[Sugar Network]] nodes generate. The statistics are about the entire server and not [[Platform_Team/Usage_Statistics|personalized]]. Note that the statistics are targeted for the interests of educational researchers rather than service maintainers, for technical details look for [http://jita.sugarlabs.org/node.sugarlabs.org/ HTTP stats].&lt;br /&gt;
&lt;br /&gt;
Statistics will be collected by analyzing regular requests to an API server and stored for each Sugar Network node. It will be  possible to get direct access to these stats using node&#039;s [[Sugar_Network/API#Node_statistics|API]].&lt;br /&gt;
&lt;br /&gt;
== Common statistics ==&lt;br /&gt;
&lt;br /&gt;
Statistics will be collected per Sugar Network [[Sugar_Network/Resources|resource type]].&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;users&#039;&#039;&#039;&amp;lt;br&amp;gt;Total number of existing &#039;&#039;User&#039;&#039; objects;&lt;br /&gt;
* &#039;&#039;&#039;contexts&#039;&#039;&#039;&amp;lt;br&amp;gt;Total number of existing &#039;&#039;Context&#039;&#039; objects;&lt;br /&gt;
* &#039;&#039;&#039;released&#039;&#039;&#039;&amp;lt;br&amp;gt;Average number of newly uploaded &#039;&#039;Context.releases&#039;&#039; for specified time frame;&lt;br /&gt;
* &#039;&#039;&#039;solved&#039;&#039;&#039;&amp;lt;br&amp;gt;Average number of requested &#039;&#039;Context&#039;&#039; [[Sugar_Network/API#GET-solve|solutions]] for specified time frame; note that this stats value does not equal to the number of solution usages on client side since solutions might be cached;&lt;br /&gt;
* &#039;&#039;&#039;reported&#039;&#039;&#039;&amp;lt;br&amp;gt;Average number of newly uploaded failure &#039;&#039;Reports&#039;&#039; objects for specified time frame;&lt;br /&gt;
* &#039;&#039;&#039;topics&#039;&#039;&#039;&amp;lt;br&amp;gt;Total number of top-level &#039;&#039;Post&#039;&#039; objects;&lt;br /&gt;
* &#039;&#039;&#039;posts&#039;&#039;&#039;&amp;lt;br&amp;gt;Total number of dependent &#039;&#039;Post&#039;&#039; objects.&lt;br /&gt;
&lt;br /&gt;
== Per object statistics ==&lt;br /&gt;
&lt;br /&gt;
While calculating [[#Common_statistics|common]] statistics, nodes generate per object sums as well.&lt;br /&gt;
&lt;br /&gt;
These are the Sugar Network [[Sugar_Network/Resources|resources]] that will be affected:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Context&#039;&#039; properties:&lt;br /&gt;
* &#039;&#039;&#039;Context.rating&#039;&#039;&#039;&amp;lt;br&amp;gt;Average rating given to the &#039;&#039;Context&#039;&#039; while reviewing, rating value is a tuple of votes sum and number of reviews;&lt;br /&gt;
* &#039;&#039;&#039;Context.retrieves&#039;&#039;&#039;&amp;lt;br&amp;gt;Number of retrieves of &#039;&#039;Context&#039;&#039; releases.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Post&#039;&#039; properties:&lt;br /&gt;
* &#039;&#039;&#039;Post.rating&#039;&#039;&#039;&amp;lt;br&amp;gt;Average rating given to the &#039;&#039;Post&#039;&#039; while reviewing, rating value is a tuple of votes sum and number of reviews.&lt;br /&gt;
&lt;br /&gt;
== Getting involved ==&lt;br /&gt;
&lt;br /&gt;
{{:Sugar_Network/Feedback}}&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Node_Statistics&amp;diff=92522</id>
		<title>Sugar Network/Node Statistics</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Node_Statistics&amp;diff=92522"/>
		<updated>2014-05-12T09:44:36Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: /* Common statistics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
This page describes the statistics that [[Sugar Network]] nodes generate. The statistics are about the entire server and not [[Platform_Team/Usage_Statistics|personalized]]. Note that the statistics are targeted for the interests of educational researchers rather than service maintainers, for technical details look for [http://jita.sugarlabs.org/node.sugarlabs.org/ HTTP stats].&lt;br /&gt;
&lt;br /&gt;
Statistics will be collected by analyzing regular requests to an API server and stored for each Sugar Network node. It will be  possible to get direct access to these stats using node&#039;s [[Sugar_Network/API#Node_statistics|API]].&lt;br /&gt;
&lt;br /&gt;
== Common statistics ==&lt;br /&gt;
&lt;br /&gt;
Statistics will be collected per Sugar Network [[Sugar_Network/Resources|resource type]].&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;users&#039;&#039;&#039;&amp;lt;br&amp;gt;Total number of existing &#039;&#039;User&#039;&#039; objects;&lt;br /&gt;
* &#039;&#039;&#039;contexts&#039;&#039;&#039;&amp;lt;br&amp;gt;Total number of existing &#039;&#039;Context&#039;&#039; objects;&lt;br /&gt;
* &#039;&#039;&#039;released&#039;&#039;&#039;&amp;lt;br&amp;gt;Average number of newly uploaded &#039;&#039;Context.releases&#039;&#039; for specified time frame;&lt;br /&gt;
* &#039;&#039;&#039;solved&#039;&#039;&#039;&amp;lt;br&amp;gt;Average number of requested &#039;&#039;Context&#039;&#039; [[Sugar_Network/API#GET-solve|solutions]] for specified time frame; note that this stats value does not equal to the number of solution usages on client side since solutions might be cached;&lt;br /&gt;
* &#039;&#039;&#039;reported&#039;&#039;&#039;&amp;lt;br&amp;gt;Average number of newly uploaded failure &#039;&#039;Reports&#039;&#039; objects for specified time frame;&lt;br /&gt;
* &#039;&#039;&#039;topics&#039;&#039;&#039;&amp;lt;br&amp;gt;Total number of top-level &#039;&#039;Post&#039;&#039; objects;&lt;br /&gt;
* &#039;&#039;&#039;feedback&#039;&#039;&#039;&amp;lt;br&amp;gt;Total number of dependent &#039;&#039;Post&#039;&#039; objects.&lt;br /&gt;
&lt;br /&gt;
== Per object statistics ==&lt;br /&gt;
&lt;br /&gt;
While calculating [[#Common_statistics|common]] statistics, nodes generate per object sums as well.&lt;br /&gt;
&lt;br /&gt;
These are the Sugar Network [[Sugar_Network/Resources|resources]] that will be affected:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Context&#039;&#039; properties:&lt;br /&gt;
* &#039;&#039;&#039;Context.rating&#039;&#039;&#039;&amp;lt;br&amp;gt;Average rating given to the &#039;&#039;Context&#039;&#039; while reviewing, rating value is a tuple of votes sum and number of reviews;&lt;br /&gt;
* &#039;&#039;&#039;Context.retrieves&#039;&#039;&#039;&amp;lt;br&amp;gt;Number of retrieves of &#039;&#039;Context&#039;&#039; releases.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Post&#039;&#039; properties:&lt;br /&gt;
* &#039;&#039;&#039;Post.rating&#039;&#039;&#039;&amp;lt;br&amp;gt;Average rating given to the &#039;&#039;Post&#039;&#039; while reviewing, rating value is a tuple of votes sum and number of reviews.&lt;br /&gt;
&lt;br /&gt;
== Getting involved ==&lt;br /&gt;
&lt;br /&gt;
{{:Sugar_Network/Feedback}}&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Sugar_Network/API&amp;diff=92521</id>
		<title>Sugar Network/API</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Sugar_Network/API&amp;diff=92521"/>
		<updated>2014-05-12T08:56:28Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: /* Node statistics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the API that Sugar Network clients use to interact with a Sugar Network server. See also a guide to basic Sugar Network [[Sugar_Network/Concept|concepts]] and [[Platform_Team/Sugar_Network/Architecture|its twin page]] for a technical point of view. In addition, visit the [[Sugar_Network|introduction page]].&lt;br /&gt;
&lt;br /&gt;
{{Note/warning|Note|Until announcing API freeze, this document describes the most recent development version of the API.&amp;lt;br&amp;gt;You can find its implementation on the [[#API servers|node-devel.sugarlabs.org]] server.}}&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
To better understand this API, see a technical explanation of its [[Platform_Team/Sugar_Network/Architecture#Conceptual_level|conceptual level]] and [[#Sugar_Network_resources|objects model]] in particular.&lt;br /&gt;
&lt;br /&gt;
The API operates with [[Sugar Network]] [[#Sugar_Network_resources|resources]], which are collections of objects. All objects are identified by globally unique identifiers, GUIDs, and available for operation via [[#Base_API|basic actions]]. The API is being provided from a [[#API_servers|node server]] or a [[#Client_API|client]]. While processing requests, API providers generate [[#Notifications|events]].&lt;br /&gt;
&lt;br /&gt;
The API is [[Wikipedia:Restful|RESTful]], and is served via HTTP(S) using [[Wikipedia:Json|JSON]] notation. The common request url format is:&lt;br /&gt;
&lt;br /&gt;
 http[s]://&#039;&#039;SERVER&#039;&#039;[/&#039;&#039;RESOURCE&#039;&#039;[/&#039;&#039;GUID&#039;&#039;[/&#039;&#039;PROPERTY&#039;&#039;]]][?[cmd=&#039;&#039;COMMAND&#039;&#039;][&amp;amp;&#039;&#039;ARGUMENT&#039;&#039;=&#039;&#039;VALUE&#039;&#039;..]]&lt;br /&gt;
&lt;br /&gt;
When:&lt;br /&gt;
&lt;br /&gt;
* {{Code|SERVER}}, [[#API_servers|particular]] Sugar Network API server;&lt;br /&gt;
* {{Code|RESOURCE}}, name one of the [[#Sugar_Network_resources|existing]] resources;&lt;br /&gt;
* {{Code|GUID}}, the {{Code|RESOURCE}}&#039;s particular object;&lt;br /&gt;
* {{Code|PROPERTY}}, particular property of {{Code|GUID}} object;&lt;br /&gt;
* {{Code|COMMAND}}, optional command name; combination of HTTP request method ({{Code|GET}}, {{Code|POST}}, {{Code|PUT}}, or, {{Code|DELETE}}) and [possibly empty] {{Code|COMMAND}} composes the requested [[#Actions|action]];&lt;br /&gt;
* {{Code|ARGUMENT}}s and {{Code|VALUE}}s depend on the particular [[#Actions|action]].&lt;br /&gt;
&lt;br /&gt;
In most cases, the server replies in JSON notation. If a request fails, the replied JSON object will contain a {{Code|request}} key, with the original request, and {{Code|error}} key, with an error message.&lt;br /&gt;
&lt;br /&gt;
== API servers ==&lt;br /&gt;
&lt;br /&gt;
These are standard Sugar Network API servers publicly available.&lt;br /&gt;
&lt;br /&gt;
* [http://node-devel.sugarlabs.org/ node-devel.sugarlabs.org]&amp;lt;br&amp;gt;Development server which does not contain important data and is free for any experiments (administrative privileges for anonymous users);&lt;br /&gt;
&lt;br /&gt;
* [http://node-testing.sugarlabs.org/ node-testing.sugarlabs.org]&amp;lt;br&amp;gt;Recent stable release with regular data import from the production server; is still free for any experiments;&lt;br /&gt;
&lt;br /&gt;
* [http://node.sugarlabs.org/ node.sugarlabs.org]&amp;lt;br&amp;gt;Production server;&lt;br /&gt;
&lt;br /&gt;
* [http://localhost:5001/ localhost:5001]&amp;lt;br&amp;gt;default url to get access to [[#Client_API|local proxy]] provided from user side application.&lt;br /&gt;
&lt;br /&gt;
== Sugar Network resources ==&lt;br /&gt;
&lt;br /&gt;
{{:Sugar_Network/Resources}}&lt;br /&gt;
&lt;br /&gt;
== Base API ==&lt;br /&gt;
&lt;br /&gt;
List of actions common of all API providers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;POST&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;POST&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create new resource object.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to send:&lt;br /&gt;
* {{Code|&#039;&#039;RESOURCE}}&#039;s properties.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to receive:&lt;br /&gt;
* {{Code|guid}}, with globally unique identifier that specifies the created object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Modify resource object. By default, might be called only by {{Code|GUID}} creator.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to send:&lt;br /&gt;
* {{Code|RESOURCE}}&#039;s properties to modify.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Delete resource object. Actual object destruction won&#039;t happen, the object will be hidden. Garbage collection of hidden objects will be processed by Network administrators. By default, this action may be called only by the {{Code|GUID}} creator.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;[?offset=&#039;&#039;INTEGER&#039;&#039;][&amp;amp;limit=&#039;&#039;INTEGER&#039;&#039;][&amp;amp;query=&#039;&#039;STRING&#039;&#039;][&amp;amp;reply=&#039;&#039;PROP&#039;&#039;][&amp;amp;order_by=&amp;lt;nowiki&amp;gt;[+|-]&amp;lt;/nowiki&amp;gt;&#039;&#039;PROP&#039;&#039;][&amp;amp;group_by=&#039;&#039;PROP&#039;&#039;][&amp;amp;&#039;&#039;PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;][&amp;amp;&#039;&#039;!PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
Find resource objects.&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
* {{Code|offset}}, &#039;&#039;int&#039;&#039;&amp;lt;br&amp;gt;start index to return entries from, the default value is {{Code|0}};&lt;br /&gt;
* {{Code|limit}}, &#039;&#039;int&#039;&#039;&amp;lt;br&amp;gt;do not return more then specified value, maximal and default values are being setup on server side;&lt;br /&gt;
* {{Code|query}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;search request in [http://xapian.org/docs/queryparser.html Xapian] notation with the following additions:&lt;br /&gt;
** if property is boolean, integer or datetime, it supports searching by ranges: {{Code|&#039;&#039;PROP&#039;&#039;:[&#039;&#039;START&#039;&#039;]..[&#039;&#039;END&#039;&#039;]}};&lt;br /&gt;
** the statement {{Code|&#039;&#039;PROP&#039;&#039;&amp;lt;nowiki&amp;gt;:=&amp;lt;/nowiki&amp;gt;[&amp;quot;]&#039;&#039;VALUE&#039;&#039;[&amp;quot;]}} has the same effect as {{Code|QUERY_PROP}}; it is different to regular {{Code|&#039;&#039;PROP&#039;&#039;:&#039;&#039;VALUE&#039;&#039;}} where {{Code|VALUE}} might be a substring;&lt;br /&gt;
* {{Code|PROP}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;supplements {{Code|query}} with filtering by exact value of the {{Code|PROP}} property; the resulting query string will be {{Code|&#039;&#039;PROP&#039;&#039;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&#039;&#039;VALUE&#039;&#039; AND (&#039;&#039;QUERY&#039;&#039;)}}; argument is multiple;&lt;br /&gt;
* {{Code|!PROP}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;supplements {{Code|query}} by excluding exact value of the {{Code|PROP}} property; the resulting query string will be {{Code|NOT &#039;&#039;PROP&#039;&#039;&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&#039;&#039;VALUE&#039;&#039; AND (&#039;&#039;QUERY&#039;&#039;)}}; argument is multiple;&lt;br /&gt;
* {{Code|reply}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;RESOURCE&#039;&#039; properties to return; by default, return only {{Code|guid}} property; argument is multiple;&lt;br /&gt;
* {{Code|order_by}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;property to sort the resulting list by; if starts with the {{Code|-}}, the order is descending, otherwise it is ascending;&lt;br /&gt;
* {{Code|group_by}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;property name to group resulting list by.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to receive:&lt;br /&gt;
* {{Code|total}}, total number in requested query (the reply might contain only the portion restricted by {{Code|limit}} request argument);&lt;br /&gt;
* {{Code|result}}, an array of dictionaries with resource object properties, dictionaries contain at least {{Code|guid}} property.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-resource&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;[?reply=&#039;&#039;PROP&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
* {{Code|reply}}, &#039;&#039;str&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;RESOURCE&#039;&#039; properties to return; by default, return only {{Code|guid}} property; argument is multiple;&lt;br /&gt;
&lt;br /&gt;
Return properties for a particular resource object.&lt;br /&gt;
&lt;br /&gt;
JSON object keys to receive:&lt;br /&gt;
* properties that were specified in {{Code|reply}} argument(s), at least {{Code|guid}}.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-property&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Return property value for particular resource object.&lt;br /&gt;
&lt;br /&gt;
Data to receive:&lt;br /&gt;
* property value in JSON notation for regular properties;&lt;br /&gt;
* raw data or redirection for BLOB properties.&lt;br /&gt;
&lt;br /&gt;
=== Aggregated properties ===&lt;br /&gt;
&lt;br /&gt;
[[#resource-types|Aggregated]] properties have special API to treat their content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;POST-aggproperty&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;POST&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Submit new item. The command returns an id for newly created aggregated item. Depending on particular property, new items might be created not only by object&#039;s authors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT-aggproperty&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;/&#039;&#039;ID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Update existing aggregated item. Depending on particular property, the command is allowed either to object&#039;s authors or to aggregated item submitter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE-aggproperty&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;/&#039;&#039;PROP&#039;&#039;/&#039;&#039;ID&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Delete existing aggregated item. Depending on particular property, the command is allowed either to object&#039;s authors or to aggregated item submitter.&lt;br /&gt;
&lt;br /&gt;
=== Notifications ===&lt;br /&gt;
&lt;br /&gt;
It is possible to subscribe to server events. Notification will happen using HTML5 [[wikipedia:Server-sent_events|Server-sent events]] (SSE).&lt;br /&gt;
&lt;br /&gt;
To start subscription, send the following request:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /?cmd=&#039;&#039;&#039;subscribe&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Response will be served with &#039;&#039;text/event-stream&#039;&#039; MIME type for default SSE message type. SSE message will be a JSONified object with the following, at least, attributes:&lt;br /&gt;
&lt;br /&gt;
* {{Code|event}}&amp;lt;br&amp;gt;event type.&lt;br /&gt;
&lt;br /&gt;
== Node API ==&lt;br /&gt;
&lt;br /&gt;
This is an API provided by Sugar Network nodes on top of [[#Base_API|base one]].&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
&lt;br /&gt;
Right now, the only way to be authenticated on a Sugar Network server is by running a [[Platform_Team/Sugar_Network/Implementation#sugar-network-client|local application]] on the client side and using the API it [[#Client_API|provides]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;TODO&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Authorization ===&lt;br /&gt;
&lt;br /&gt;
Read-only access is available for anonymous requests, except special content like machine serial numbers. But to process any changes, clients need to be authenticated.&lt;br /&gt;
&lt;br /&gt;
Right after creating any Sugar Network object, its author becomes the only user who can process any object modifications afterwards. Authority information will be kept in the [[#Sugar_Network_resources|author]] property and can be modified using the following commands.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;useradd&#039;&#039;&#039;&amp;amp;user=&#039;&#039;USER&#039;&#039;&amp;amp;role=&#039;&#039;ROLE&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Add another user who can modify the corresponding object. &#039;&#039;USER&#039;&#039; argument should be either &#039;&#039;User&#039;&#039; guid (for authors registered in the Sugar Network), or, full author name.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /&#039;&#039;RESOURCE&#039;&#039;/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;userdel&#039;&#039;&#039;&amp;amp;user=&#039;&#039;USER&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Remove user from the authority list. It is not possible to remove yourself. &#039;&#039;USER&#039;&#039; argument should be either &#039;&#039;User&#039;&#039; guid (for authors registered in the Sugar Network), or, full author name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;TODO&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Retrieving releases ===&lt;br /&gt;
&lt;br /&gt;
To easy download Context [[#context-releases|releases]] and avoid reading raw &#039;&#039;Context.releases&#039;&#039; property, there are special high-level API commands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-solve&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;solve&#039;&#039;&#039;[&amp;amp;lsb_id=&#039;&#039;LSB_ID&#039;&#039;][&amp;amp;lsb_release=&#039;&#039;LSB_RELEASE&#039;&#039;][&amp;amp;assume=&#039;&#039;DEPENDENCY&#039;&#039;-&#039;&#039;VERSION&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
The command returns information about what particular releases should be downloaded depending on provided requirements. This command might return not only one release, e.g., activities might have dependencies either system packages or another Sugar Network Contexts.&lt;br /&gt;
&lt;br /&gt;
Solving requirements might be:&lt;br /&gt;
&lt;br /&gt;
* {{Code|LSB_ID}}, if Context releases depend on system packages, specify the [[Wikipedia:Linux_Standard_Base|LSB]] distributor id to consider while choosing particular packages;&lt;br /&gt;
* {{Code|LSB_RELEASE}}, if Context releases depend on system packages, specify the [[Wikipedia:Linux_Standard_Base|LSB]] release number of the distribution to consider while choosing particular packages;&lt;br /&gt;
* {{Code|DEPENDENCY-VERSION}}, the {{Code|assume}} argument instructs server to assume that specified [[Sugar_Network/Recipe_Specification#Dependencies|dependency]] is already available on client side and should be taken into account while solving; this is especially important for package dependencies when server considers packages available only from official repositories but users might have more recent package versions installed in local system; e.g., the above example request will fail without {{Code|sugar-0.94}} because neither {{Code|lsb_id}} nor {{Code|lsb_release}} were specified (even if LSB information is passed, server might not have information about what package versions come from official repositories).&lt;br /&gt;
&lt;br /&gt;
The resulting info is a JSON object with keys equal to Context guids and value objects for chosen release with the following keys:&lt;br /&gt;
&lt;br /&gt;
* {{Code|blob}}, bundle [[#resource-types|digest]] to download;&lt;br /&gt;
* {{Code|version}}, chosen version number;&lt;br /&gt;
* {{Code|title}}, the &#039;&#039;Context.title&#039;&#039; value;&lt;br /&gt;
* {{Code|command}}, a command to launch the bundle, only for Sugar activities.&lt;br /&gt;
&lt;br /&gt;
For example, the {{Code|&#039;&#039;&#039;GET&#039;&#039;&#039; &amp;lt;nowiki&amp;gt;/context/org.laptop.TurtleArtActivity?cmd=solve&amp;amp;assume=sugar-0.94&amp;lt;/nowiki&amp;gt;}} request returns:&lt;br /&gt;
&lt;br /&gt;
 {&lt;br /&gt;
   &amp;quot;org.laptop.TurtleArtActivity&amp;quot;: {&lt;br /&gt;
     &amp;quot;title&amp;quot;: &amp;quot;Turtle Blocks&amp;quot;,&lt;br /&gt;
     &amp;quot;version&amp;quot;: [[202], 0],&lt;br /&gt;
     &amp;quot;blob&amp;quot;: &amp;quot;http://download.sugarlabs.org/activities/4027/turtleblocks-202.xo&amp;quot;,&lt;br /&gt;
     &amp;quot;content-type&amp;quot;: &amp;quot;application/vnd.olpc-sugar&amp;quot;,&lt;br /&gt;
     &amp;quot;size&amp;quot;: 4715955,&lt;br /&gt;
     &amp;quot;unpack_size&amp;quot;: 12873871,&lt;br /&gt;
     &amp;quot;command&amp;quot;: [&amp;quot;activity&amp;quot;, &amp;quot;sugar-activity TurtleArtActivity.TurtleArtActivity&amp;quot;],&lt;br /&gt;
   },&lt;br /&gt;
   &amp;quot;sugar&amp;quot;: {&lt;br /&gt;
     &amp;quot;version&amp;quot;: [[0, 94], 0],&lt;br /&gt;
   },&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;GET-clone&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Like the [[#GET-solve|solve]] command, &#039;&#039;clone&#039;&#039; makes a solution but returns bundle itself, so, there is no way to get information about possible dependencies.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;clone&#039;&#039;&#039;[&amp;amp;requires=&#039;&#039;DEPENDENCY&#039;&#039;][&amp;amp;lsb_id=&#039;&#039;LSB_ID&#039;&#039;][&amp;amp;lsb_release=&#039;&#039;LSB_RELEASE&#039;&#039;][&amp;amp;assume=&#039;&#039;CONTEXT&#039;&#039;-&#039;&#039;VERSION&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
=== Upload releases ===&lt;br /&gt;
&lt;br /&gt;
To easy upload Context [[#context-releases|releases]] and avoid writing to raw &#039;&#039;Context.releases&#039;&#039; property, there is a special high-level API command.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;POST&#039;&#039;&#039; /context?cmd=&#039;&#039;&#039;submit&#039;&#039;&#039;[&amp;amp;&#039;&#039;PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;][&amp;amp;initial]&lt;br /&gt;
&lt;br /&gt;
Where the {{Code|PROP}} arguments are optional release properties. The {{Code|initial}} argument asks the system to create new Context resource new release will belong to.&lt;br /&gt;
&lt;br /&gt;
The posting data might be two types,&lt;br /&gt;
&lt;br /&gt;
* Sugar activities in .xo bundles,&amp;lt;br&amp;gt;there is no need in {{Code|PROP}} arguments, all properties will be populated basing on metadata from a .xo bundle; including release notes from the {{Code|CHANGELOG}} file in [[Wikipedia:Markdown|Markdown]] notation; besides, only in this case {{Code|initial}} makes sense because it is the only way to get Context properties;&lt;br /&gt;
&lt;br /&gt;
* Arbitrary data,&amp;lt;br&amp;gt;all required release properties should be specified in {{Code|PROP}} arguments, at least &#039;&#039;context&#039;&#039; and &#039;&#039;version&#039;&#039;; &#039;&#039;license&#039;&#039; should be specified only if there are no existing releases to pickup license from.&lt;br /&gt;
&lt;br /&gt;
=== Node statistics ===&lt;br /&gt;
&lt;br /&gt;
While working, Sugar Network servers collect depersonalized and common [[Sugar_Network/Node_Statistics|statistics]]. To read such info, call the command:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /?cmd=&#039;&#039;&#039;stats&#039;&#039;&#039;&amp;amp;records=&#039;&#039;NUMBER&#039;&#039;[&amp;amp;start=&#039;&#039;SECONDS&#039;&#039;][&amp;amp;end=&#039;&#039;SECONDS&#039;&#039;][&amp;amp;source=&#039;&#039;STATS-NAME&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
&lt;br /&gt;
* {{Code|records}}, number of stat records to return for the {{Code|start}}-{{Code|end}} interval; note that this amount is not precise, the final resultset might be smaller or bigger depending on chosen resolution; stats resolution depends on node configuration, default values are 1 day, 10 days, 30 days, 365 days;&lt;br /&gt;
* {{Code|start}} and {{Code|end}} is a time interval to get statistics for; if omitted, the beginning and the end of entire life cycle will be used;&lt;br /&gt;
* {{Code|source}}, multiple argument to specify what [[Sugar_Network/Node_Statistics#Common_statistics|stats]] should be returned; if omitted, return all sources.&lt;br /&gt;
&lt;br /&gt;
== Client API ==&lt;br /&gt;
&lt;br /&gt;
The reasons to proxy Sugar Network data on users side:&lt;br /&gt;
&lt;br /&gt;
* Seamless support [[#Offline mode|offline workflow]];&lt;br /&gt;
* [[#Launching|One-click launch]] Sugar activities hosted on Sugar Network.&lt;br /&gt;
&lt;br /&gt;
Proxying happens by providing the same Sugar Network API (with some extra functionality, see below) from&lt;br /&gt;
[[Platform_Team/Sugar_Network/Implementation#sugar-network-client|local process]] launched beforehand.&lt;br /&gt;
&lt;br /&gt;
=== Offline mode ===&lt;br /&gt;
&lt;br /&gt;
Being connected to a Sugar Network node, local proxy provides [[#Node_API|original API]] from the node. If the connection is lost, the proxy will switch to local Sugar Network storage and continue working providing only [[#Base_API|base API]]. Any content created in offline mode will be uploaded to the node after getting a connection back.&lt;br /&gt;
&lt;br /&gt;
Besides, local Sugar Network storage will be reused to keep users preferences, such as:&lt;br /&gt;
&lt;br /&gt;
* Favorited Contexts&amp;lt;br&amp;gt;to select preferred &#039;&#039;Context&#039;&#039; resources; these Contexts will be marked by {{Code|favorite}} value in the &#039;&#039;Context.layer&#039;&#039; property;&lt;br /&gt;
&lt;br /&gt;
* Checked-in Contexts&amp;lt;br&amp;gt;to keep most recent Context (for &#039;&#039;activity&#039;&#039; and &#039;&#039;book&#039;&#039; types) version in local storage to make it available in offline; note that there is no need in checking-in to speedup online lunch, versions are being [[#Launching|cached]] anyway; these Contexts will be marked by {{Code|checkin}} value in the &#039;&#039;Context.layer&#039;&#039; property.&lt;br /&gt;
&lt;br /&gt;
To control users preferences there are special API commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT_favorite&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;favorite&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Set favorite status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE_favorite&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;favorite&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Unset favorite status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;PUT_checkin&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;PUT&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;checkin&#039;&#039;&#039;[&amp;amp;spawn]&lt;br /&gt;
&lt;br /&gt;
Check-in the specified Context. By default, the command will return streamed &#039;&#039;text/event-stream&#039;&#039; MIME type data to monitor the progress. If the {{Code|spawn}} argument is specified, the command will exit immediately with [[#Notifications|asynchronous sending]] progress events.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;DELETE_checkin&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DELETE&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;checkin&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Checkout the Context.&lt;br /&gt;
&lt;br /&gt;
=== Launching ===&lt;br /&gt;
&lt;br /&gt;
Sugar Network Contexts (for &#039;&#039;activity&#039;&#039; and &#039;&#039;book&#039;&#039; types) can be launched as-is. The launching process is implicit and includes selecting the most recent (and appropriate for software contexts) version, downloading bundles from the Sugar Network, installing missed [[Sugar_Network/Recipe_Specification#Dependencies|software dependencies]], execution itself. All downloaded bundles will be cached [with further garbage collecting] to speedup further launching.&lt;br /&gt;
&lt;br /&gt;
Sugar activities will be directly executed. Book Contexts will be opened in the proper application according to its MIME type.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /context/&#039;&#039;GUID&#039;&#039;?cmd=&#039;&#039;&#039;launch&#039;&#039;&#039;[&amp;amp;args=&#039;&#039;ARG&#039;&#039;][&amp;amp;activity_id=&#039;&#039;ACTIVITY_ID&#039;&#039;][&amp;amp;object_id=&#039;&#039;OBJECT_ID&#039;&#039;][&amp;amp;uri=&#039;&#039;URI&#039;&#039;][&amp;amp;app=&#039;&#039;APP&#039;&#039;][&amp;amp;spawn]&lt;br /&gt;
&lt;br /&gt;
Arguments that make sense only for Sugar activities:&lt;br /&gt;
&lt;br /&gt;
* {{Code|ARG}}, command line argument to pass to launched activities, repeat {{Code|ARG}} for each argument;&lt;br /&gt;
* {{Code|ACTIVITY_ID}}, internal activity id which will be auto set if omitted;&lt;br /&gt;
* {{Code|OBJECT_ID}}, Journal object id to resume;&lt;br /&gt;
* {{Code|URI}}, URL to resume if activity supports this functionality.&lt;br /&gt;
&lt;br /&gt;
Arguments that make sense only for books:&lt;br /&gt;
&lt;br /&gt;
* {{Code|APP}}, specify application Context to open the book by; if omitted, the system will try to find most appropriate option, among all existing software Contexts.&lt;br /&gt;
&lt;br /&gt;
Common arguments:&lt;br /&gt;
&lt;br /&gt;
* {{Code|spawn}}, by default, the command will return streamed &#039;&#039;text/event-stream&#039;&#039; MIME type data to monitor the whole launching process until exiting the application; if the {{Code|spawn}} argument is specified, the command will exit immediately with [[#Notifications|asynchronous sending]] launching events.&lt;br /&gt;
&lt;br /&gt;
== Experimental API ==&lt;br /&gt;
&lt;br /&gt;
There is no guaranty that the following API will be stated as stable or frozen sometime.&lt;br /&gt;
&lt;br /&gt;
=== Access to Sugar Journal ===&lt;br /&gt;
&lt;br /&gt;
It is possible to get access to local Sugar Journal using special, &#039;&#039;journal&#039;&#039;, resource provided from [[#Client_API|client API]]. This kind of access might be useful when local applications cannot use DBus sugar-datastore API, e.g., [[wikipedia:Javascript|Javascript]] applications. API to Journal is restricted only to read-only access:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /journal?offset=&#039;&#039;INTEGER&#039;&#039;&amp;amp;limit=&#039;&#039;INTEGER&#039;&#039;[&amp;amp;query=&#039;&#039;STRING&#039;&#039;][&amp;amp;order_by=&amp;lt;nowiki&amp;gt;[+|-]&amp;lt;/nowiki&amp;gt;&#039;&#039;PROP&#039;&#039;][&amp;amp;&#039;&#039;QUERY_PROP&#039;&#039;=&#039;&#039;VALUE&#039;&#039;[&amp;amp;...]]&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /journal/&#039;&#039;JOURNAL_ID&#039;&#039;[?reply=&#039;&#039;PROP&#039;&#039;[,..]]&lt;br /&gt;
 &#039;&#039;&#039;GET&#039;&#039;&#039; /journal/&#039;&#039;JOURNAL_ID&#039;&#039;/&#039;&#039;PROPERTY&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
Being HTTP based, Sugar Network API can be used in any manner regular HTTP requests can be handled. But for command-line access, there is a handy tool, {{Code|sugar-network}}, which takes care about Sugar Network specific like launching local API (if it is not already available) to get access to [[#Client_API|local proxy]].&lt;br /&gt;
&lt;br /&gt;
The sugar-network command-line format is below. Call {{Code|sugar-network --help}} for more detailed info.&lt;br /&gt;
&lt;br /&gt;
 sugar-network GET|POST|PUT|DELETE &#039;&#039;PATH&#039;&#039; &#039;&#039;ARG=VALUE&#039;&#039; [..]&lt;br /&gt;
&lt;br /&gt;
* {{Code|PATH}}, is an url path;&lt;br /&gt;
* {{Code|ARG&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;VALUE}}, request arguments as they being passed to in url.&lt;br /&gt;
&lt;br /&gt;
{{Code|POST}} and {{Code|PUT}} commands require data to pass, use the following command-line arguments:&lt;br /&gt;
&lt;br /&gt;
* {{Code|-f FILE}} to specify the file to pass;&lt;br /&gt;
* {{Code|-d DATA}} to specify string to pass;&lt;br /&gt;
* {{Code|-j}} posted data should be encoded into JSON before posting.&lt;br /&gt;
&lt;br /&gt;
== Getting involved ==&lt;br /&gt;
&lt;br /&gt;
{{:Sugar_Network/Feedback}}&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Node_Statistics&amp;diff=92518</id>
		<title>Sugar Network/Node Statistics</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Sugar_Network/Node_Statistics&amp;diff=92518"/>
		<updated>2014-05-12T03:49:58Z</updated>

		<summary type="html">&lt;p&gt;Alsroot: /* Common statistics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
This page describes the statistics that [[Sugar Network]] nodes generate. The statistics are about the entire server and not [[Platform_Team/Usage_Statistics|personalized]]. Note that the statistics are targeted for the interests of educational researchers rather than service maintainers, for technical details look for [http://jita.sugarlabs.org/node.sugarlabs.org/ HTTP stats].&lt;br /&gt;
&lt;br /&gt;
Statistics will be collected by analyzing regular requests to an API server and stored for each Sugar Network node. It will be  possible to get direct access to these stats using node&#039;s [[Sugar_Network/API#Node_statistics|API]].&lt;br /&gt;
&lt;br /&gt;
== Common statistics ==&lt;br /&gt;
&lt;br /&gt;
Statistics will be collected per Sugar Network [[Sugar_Network/Resources|resource type]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;User&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;user.total&#039;&#039;&#039;&amp;lt;br&amp;gt;Total number of existing objects.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Context&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;context.total&#039;&#039;&#039;&amp;lt;br&amp;gt;Total number of existing objects.&lt;br /&gt;
* &#039;&#039;&#039;context.released&#039;&#039;&#039;&amp;lt;br&amp;gt;Average number of newly uploaded releases for specified time frame;&lt;br /&gt;
* &#039;&#039;&#039;context.solved&#039;&#039;&#039;&amp;lt;br&amp;gt;Average number of requested [[Sugar_Network/API#GET-solve|solutions]] for specified time frame; note that this stats value does not equal to the number of solution usages on client side since solutions might be cached;&lt;br /&gt;
* &#039;&#039;&#039;context.reported&#039;&#039;&#039;&amp;lt;br&amp;gt;Average number of newly uploaded failure &#039;&#039;Reports&#039;&#039; for specified time frame;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Post&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;post.topics&#039;&#039;&#039;&amp;lt;br&amp;gt;Total number of top-level &#039;&#039;Post&#039;&#039; objects;&lt;br /&gt;
* &#039;&#039;&#039;post.feedback&#039;&#039;&#039;&amp;lt;br&amp;gt;Total number of dependent &#039;&#039;Post&#039;&#039; objects.&lt;br /&gt;
&lt;br /&gt;
== Per object statistics ==&lt;br /&gt;
&lt;br /&gt;
While calculating [[#Common_statistics|common]] statistics, nodes generate per object sums as well.&lt;br /&gt;
&lt;br /&gt;
These are the Sugar Network [[Sugar_Network/Resources|resources]] that will be affected:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Context&#039;&#039; properties:&lt;br /&gt;
* &#039;&#039;&#039;Context.rating&#039;&#039;&#039;&amp;lt;br&amp;gt;Average rating given to the &#039;&#039;Context&#039;&#039; while reviewing, rating value is a tuple of votes sum and number of reviews;&lt;br /&gt;
* &#039;&#039;&#039;Context.retrieves&#039;&#039;&#039;&amp;lt;br&amp;gt;Number of retrieves of &#039;&#039;Context&#039;&#039; releases.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Post&#039;&#039; properties:&lt;br /&gt;
* &#039;&#039;&#039;Post.rating&#039;&#039;&#039;&amp;lt;br&amp;gt;Average rating given to the &#039;&#039;Post&#039;&#039; while reviewing, rating value is a tuple of votes sum and number of reviews.&lt;br /&gt;
&lt;br /&gt;
== Getting involved ==&lt;br /&gt;
&lt;br /&gt;
{{:Sugar_Network/Feedback}}&lt;/div&gt;</summary>
		<author><name>Alsroot</name></author>
	</entry>
</feed>