YaST/Web/Development/Registration
From openSUSE
(Difference between revisions)
| Revision as of 18:51, 21 September 2009 Jdsn (Talk | contribs) � Previous diff |
Revision as of 17:11, 22 September 2009 Jdsn (Talk | contribs) Next diff → |
||
| Line 6: | Line 6: | ||
| [[Image:Web_registration_workflow.png|450px]] | [[Image:Web_registration_workflow.png|450px]] | ||
| + | |||
| + | |||
| + | ==REST API== | ||
| + | |||
| + | |||
| + | * /registration/configuration | ||
| + | '''GET''': get registration server and certificate information | ||
| + | |||
| + | returns: | ||
| + | |||
| + | <registrationconfig> | ||
| + | <server> | ||
| + | <url>https://myregistration.server.com/center/regsvc</url> | ||
| + | </server> | ||
| + | <certificate> | ||
| + | <data> | ||
| + | <![CDATA[ | ||
| + | -----BEGIN CERTIFICATE----- | ||
| + | MIIFIDCCBAigAwIBAgIJAPP6cY6saTFlMA0GCSqGSIb3DQEBBQUAMIGPMQswCQYD | ||
| + | VQQGEwJERTEPMA0 ......... 60QTef32lxeuVH9Kve8gGZiMwDqcJfl | ||
| + | J8NLO3kNW3Zys2p4agg22yttmUs= | ||
| + | -----END CERTIFICATE----- | ||
| + | ]]> | ||
| + | </data> | ||
| + | </certificate> | ||
| + | </registrationconfig> | ||
| + | |||
| + | |||
| + | '''PUT''': set new registration server and certificate | ||
| + | |||
| + | 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> | ||
| + | |||
| + | |||
| + | The return is the same as for '''GET'''. | ||
| + | |||
| + | * /registration | ||
| + | |||
| + | '''POST''': runs registration and returns the result | ||
| + | |||
| + | post data: | ||
| + | |||
| + | <registration> | ||
| + | <options> | ||
| + | <debug>2</debug> | ||
| + | <forcereg>false</forcereg> | ||
| + | <!- not sure about this two lines --> | ||
| + | <nooptional>true</nooptional> | ||
| + | <nohwdata>true</nohwdata> | ||
| + | <!- or rather call it --> | ||
| + | <optional>false</optional> | ||
| + | <hwdata>false</hwdata> | ||
| + | <!- besides the meaning it changes the assumptions; FYI: the default is to send optional and hardware data --> | ||
| + | <!- omitting these options would switch to default and enable them; not intuitive and needs an explaination in docs --> | ||
| + | </options> | ||
| + | <arguments> | ||
| + | <argument> | ||
| + | <name>key</name> | ||
| + | <value>val</value> | ||
| + | </argument> | ||
| + | ... | ||
| + | </arguments> | ||
| + | <registration> | ||
| + | |||
| + | |||
| + | returns: | ||
| + | |||
| + | <registration> | ||
| + | <status>finished|missinginfo|error</status> | ||
| + | <exitcode>1234</exitcode> | ||
| + | <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> | ||
Revision as of 17:11, 22 September 2009
Development Documentation for the Registration via WebYaST
Here are two diagrams showing how the registration is supposed to work.
REST API
- /registration/configuration
GET: get registration server and certificate information
returns:
<registrationconfig>
<server>
<url>https://myregistration.server.com/center/regsvc</url>
</server>
<certificate>
<data>
<![CDATA[
-----BEGIN CERTIFICATE-----
MIIFIDCCBAigAwIBAgIJAPP6cY6saTFlMA0GCSqGSIb3DQEBBQUAMIGPMQswCQYD
VQQGEwJERTEPMA0 ......... 60QTef32lxeuVH9Kve8gGZiMwDqcJfl
J8NLO3kNW3Zys2p4agg22yttmUs=
-----END CERTIFICATE-----
]]>
</data>
</certificate>
</registrationconfig>
PUT: set new registration server and certificate
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>
The return is the same as for GET.
- /registration
POST: runs registration and returns the result
post data:
<registration>
<options>
<debug>2</debug>
<forcereg>false</forcereg>
<!- not sure about this two lines -->
<nooptional>true</nooptional>
<nohwdata>true</nohwdata>
<!- or rather call it -->
<optional>false</optional>
<hwdata>false</hwdata>
<!- besides the meaning it changes the assumptions; FYI: the default is to send optional and hardware data -->
<!- omitting these options would switch to default and enable them; not intuitive and needs an explaination in docs -->
</options>
<arguments>
<argument>
<name>key</name>
<value>val</value>
</argument>
...
</arguments>
<registration>
returns:
<registration>
<status>finished|missinginfo|error</status>
<exitcode>1234</exitcode>
<guid>systemsguid</guid>??
<missingarguments>
<argument>
<name>missingkey</name>
<type>string|text|number</type>
</argument>
...
</missingarguments>
<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>

