Changes

Jump to navigation Jump to search
1,018 bytes added ,  05:51, 8 May 2014
Line 175: Line 175:  
''TODO''
 
''TODO''
   −
=== Download releases ===
+
=== Retrieving releases ===
    
To easy download Context [[#context-releases|releases]] and avoid reading raw ''Context.releases'' property, there are special high-level API commands.
 
To easy download Context [[#context-releases|releases]] and avoid reading raw ''Context.releases'' property, there are special high-level API commands.
Line 181: Line 181:  
<div id="GET-solve"></div>
 
<div id="GET-solve"></div>
   −
  '''GET''' /context/''GUID''?cmd='''solve'''[&requires=''DEPENDENCY''][&lsb_id=''LSB_ID''][&lsb_release=''LSB_RELEASE'']
+
  '''GET''' /context/''GUID''?cmd='''solve'''[&requires=''DEPENDENCY''][&lsb_id=''LSB_ID''][&lsb_release=''LSB_RELEASE''][&assume=''CONTEXT''-''VERSION'']
    
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.
 
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.
Line 189: Line 189:  
* {{Code|DEPENDENCY}}, solved release should conform the specified [[Sugar_Network/Recipe_Specification#Dependencies|dependencies]]; the argument might be multiple;
 
* {{Code|DEPENDENCY}}, solved release should conform the specified [[Sugar_Network/Recipe_Specification#Dependencies|dependencies]]; the argument might be multiple;
 
* {{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;
 
* {{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;
* {{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.
+
* {{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;
 +
* {{Code|CONTEXT-VERSION}}, the {{Code|assume}} argument instructs server to assume that specified Context release is already available on client side and should be taken into account while solving; this is especially important for package dependencies when server considers package versions available only from official repositories but users might have more recent package releases.
    
The resulting info is a JSON object with keys equal to Context guids and value objects for chosen release with the following keys:
 
The resulting info is a JSON object with keys equal to Context guids and value objects for chosen release with the following keys:
Line 197: Line 198:  
* {{Code|title}}, the ''Context.title'' value;
 
* {{Code|title}}, the ''Context.title'' value;
 
* {{Code|command}}, a command to launch the bundle, only for Sugar activities.
 
* {{Code|command}}, a command to launch the bundle, only for Sugar activities.
 +
 +
For example, the {{Code|'''GET''' <nowiki>/context/org.laptop.TurtleArtActivity?cmd=solve&assume=sugar-0.94</nowiki>}} request returns:
 +
 +
{
 +
  "org.laptop.TurtleArtActivity": {
 +
    "title": "Turtle Blocks",
 +
    "version": [[202], 0],
 +
    "blob": "http://download.sugarlabs.org/activities/4027/turtleblocks-202.xo",
 +
    "content-type": "application/vnd.olpc-sugar",
 +
    "size": 4715955,
 +
    "unpack_size": 12873871,
 +
    "command": ["activity", "sugar-activity TurtleArtActivity.TurtleArtActivity"],
 +
  },
 +
  "sugar": {
 +
    "version": [[0, 94], 0],
 +
  },
 +
}
    
<div id="GET-resolve"></div>
 
<div id="GET-resolve"></div>
   −
'''GET''' /context/''GUID''?cmd='''resolve'''[&requires=''DEPENDENCY''][&lsb_id=''LSB_ID''][&lsb_release=''LSB_RELEASE'']
+
Like the [[#GET-solve|solve]] command, ''resolve'' makes a solution but returns bundle itself, i.e., it ignores possible dependencies.
   −
Like the [[#GET-solve|solve]] command, ''resolve'' makes a solution but returns bundle itself, i.e., it ignores possible dependencies.
+
'''GET''' /context/''GUID''?cmd='''resolve'''[&requires=''DEPENDENCY''][&lsb_id=''LSB_ID''][&lsb_release=''LSB_RELEASE''][&assume=''CONTEXT''-''VERSION'']
    
=== Upload releases ===
 
=== Upload releases ===

Navigation menu