YaST/Research/YaaS/Team 2
From openSUSE
| Revision as of 16:12, 1 July 2008 Dmacvicar (Talk | contribs) � Previous diff |
Revision as of 09:43, 2 July 2008 Haass (Talk | contribs) Next diff → |
||
| Line 91: | Line 91: | ||
| '''NTP''' | '''NTP''' | ||
| - | GET /services/ntp/status | + | GET /services/ntp/ == status |
| - | POST /services/ntp/start | + | |
| - | POST /services/ntp/stop | + | PUT /services/ntp/ == reload |
| - | POST /services/ntp/restart | + | |
| + | DELETE /services/ntp/ == stop | ||
| + | |||
| + | POST /services/ntp/ == start | ||
| GET /services/ntp/config | GET /services/ntp/config | ||
| Line 112: | Line 115: | ||
| DELETE /service/ntp/config/servers/server1 | DELETE /service/ntp/config/servers/server1 | ||
| - | GET /services/ntp | ||
| - | |||
| - | returns links to status,start,stop,restart,config | ||
| '''/etc/sysconfig''' | '''/etc/sysconfig''' | ||
Revision as of 09:43, 2 July 2008
Conventions
clear namespaces
- /services namespace
- /services/ntp
- /service/ntp/config
- /service/ntp/config/servers
In this example, /services should return a document with possible links where to go. /services/ntp should return information about the service and also possible links.
In this case /services/ntp/config is a resource. It does not follow REST style 100% as there is only instance (we need research here on what is the convention) but it follows the rules: noun, no verbs in the url, and you can get it, set it, update it, or delete it (?). The GET method should also provide links to the different settings that could be interesting as resources.
The case of /service/ntp/config/servers is a REST resource.
Duncan 16:12, 1 July 2008 (UTC) discussion pending on what to do with actions. REST does not allow actions to be in the URLs, but we need them for things like service start/stop
API Timezone possibilities:
GET /time
returns <time><systemtime>...</systemtime> <timezone>...<timezone> </time>
PUT /time
GET /time/systemtime
returns systemtime
GET /time/timezone
Checking permissions
GET /acl/time
Some thoughts about packagemanagement It is more complex :-)
GET /packages
returns package1(attr1,attr2,..), package2(attr1,attrr2,..)
GET /packages/pakckage1
returns attr1,atrr2,.... of a package
GET /repositories/repo1
returns name,Url, Link to additional data "full" which would be
GET /repositories/repo1/full
User Management
GET /users?view=ids
returns user1,user2,user3
GET /users/root
returns homedir,.....
PUT /users/root PUT /users/root/password
some use:
GET /acl/users/root/password
returns true/false
Another possibility for restricting result values:
GET /users?limit=100
returns user1..user100
GET /users?start=101&limit=100
returns user101..user200
GET /users?regexp=a*
returns a1,a2,a3
NTP
GET /services/ntp/ == status
PUT /services/ntp/ == reload
DELETE /services/ntp/ == stop
POST /services/ntp/ == start
GET /services/ntp/config
returns config of server1,server2,server3,...
GET /services/ntp/config/servers
returns server1, server2, server3
PUT /services/ntp/config/servers
POST /service/ntp/config/servers
Create a new server
DELETE /service/ntp/config/servers/server1
/etc/sysconfig
GET /sysconfig
returns links to apache,network,firewall
GET /sysconfig/apache GET /sysconfig/apache/modules PUT /sysconfig/apache/modules
Apache
GET /services/apache/rhosts
returns links to myserver, otherserver
GET /services/apache/rhosts/myserver
POST /services/apache/rhosts POST /apache/sysconfig

