Hi hackers,
I want to share my current thoughts about the Rest Api for the registration.
Please have a look and feel free to comment and ask.
Registration Configuration:
---------------------------------
* /registration/config
GET
get registration server
returns:
<registrationconfig>
<server>
<url>https://myregistration.server.com/center/regsvc</url>
</server>
</registrationconfig>
PUT
set new registration server
the certificate is inclueded as well
post data:
<registrationconfig>
<server>
<url>https://somewhere.else.com/center/regsvc</url>
</server>
<certificate>
<data>
<![CDATA[
-----BEGIN CERTIFICATE-----
MIIFIDCCBAigAwIBAgIJAPP6cY6saTFlMA0GCSqGSIb3DQEBBQUAMIGPMQswCQYD
VQQGEwJERTEPMA0 ......... 60QTef32lxeuVH9Kve8gGZiMwDqcJfl
J8NLO3kNW3Zys2p4agg22yttmUs=
-----END CERTIFICATE-----
]]>
</data>
</certificate>
</registrationconfig>
return value is the same as for GET
Run Registration:
---------------------------------
* /registration
POST
run registration and return the/a result
post data:
<registration>
<options>
<debug>2</debug>
<nooptional>1</nooptional>
<nohwdata>1</nohwdata>
<forcereg>0</forcereg>
<httpproxy>http://my.proxy</httpproxy>
<httpsproxy>http://my.proxy</httpsproxy>
</options>
<arguments>
<argument>
<name>key</name>
<value>val</value>
</argument>
...
</arguments>
<registration>
returns:
<registration>
<status>finished|missinginfo|error</status>
<message>Some text to display</message>
<guid>systemsguid</guid>
<!-- in case of missing arguments -->
<missingarguments>
<argument>
<name>missingkey</name>
<type>string|text|number</type>
</argument>
...
</missingarguments>
<!-- in case of success and services or repos got changed -->
<changedrepos>
<repo>
<name>repoName</name>
<alias>myRepoName</alias>
<urls>
<url>http://some.host/repo/xy</url>
...
</urls>
<priority>80</priority>
<autorefresh>true</autorefresh>
<enabled>true</enabled>
<status>added|deleted</status>
</repo>
...
</changedrepos>
<changedservices>
<service>
<name>some-serv1</name>
<url>http://some.host/services/serv1</url>
<status>added|deleted</status>
</service>
...
</changedservices>
</registration>
There is only one action to perform the registration. And all data has to be
send for each request, as it operates in stateless context.
The following action depends on the answer to the request. If there are
arguments missing a following call is needed (together with the additional
arguments). Otherwise the changes to the package system are returned if the
registration succeeded.
Thanks for comments.
Ciao,
Daniel
--
J. Daniel Schmidt