Is API the only way to create a distro?
Hi, I looked around in the web UI and man osc, can't find a way to create a distribution from either place. So is POSTing /distributions the only way to do so? Regards, Kai
On Donnerstag, 16. September 2021, 17:15:47 CEST Kai Liu wrote:
Hi,
I looked around in the web UI and man osc, can't find a way to create a distribution from either place. So is POSTing /distributions the only way to do so?
yes -- Adrian Schroeter <adrian@suse.de> Build Infrastructure Project Manager SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nuernberg, Germany (HRB 247165, AG München), Geschäftsführer: Felix Imendörffer
On 2021/09/16 Thu 17:16, Adrian Schröter wrote:
On Donnerstag, 16. September 2021, 17:15:47 CEST Kai Liu wrote:
Hi,
I looked around in the web UI and man osc, can't find a way to create a distribution from either place. So is POSTing /distributions the only way to do so?
yes
Thanks!
On 2021/09/16 Thu 17:16, Adrian Schröter wrote:
On Donnerstag, 16. September 2021, 17:15:47 CEST Kai Liu wrote:
Hi,
I looked around in the web UI and man osc, can't find a way to create a distribution from either place. So is POSTing /distributions the only way to do so?
yes
I tried to create a distribution: osc api -X POST -T test.xml /distributions/ But it returned an error: Server returned an error: HTTP Error 422: Unprocessable Entity I first thought I put something wrong in my test.xml, so I get the data from boo/distributions, copied the openSUSE 15.3 part out to test.xml, like below: <distribution vendor="openSUSE" version="15.3" id="19032"> <name>openSUSE Leap 15.3</name> <project>openSUSE:Leap:15.3</project> <reponame>15.3</reponame> <repository>standard</repository> <link>http://www.opensuse.org/</link> <icon url="https://static.opensuse.org/distributions/logos/opensuse.png" width="8" height="8"/> <icon url="https://static.opensuse.org/distributions/logos/opensuse.png" width="16" height="16"/> <architecture>x86_64</architecture> </distribution> And tried again. It gave me the same error. Am I missing anything? Regards, Kai
On Samstag, 18. September 2021, 13:50:48 CEST Kai Liu wrote:
On 2021/09/16 Thu 17:16, Adrian Schröter wrote:
On Donnerstag, 16. September 2021, 17:15:47 CEST Kai Liu wrote:
Hi,
I looked around in the web UI and man osc, can't find a way to create a distribution from either place. So is POSTing /distributions the only way to do so?
yes
I tried to create a distribution:
osc api -X POST -T test.xml /distributions/
easiest is osc api -e /distributions
But it returned an error:
Server returned an error: HTTP Error 422: Unprocessable Entity
I first thought I put something wrong in my test.xml, so I get the data from boo/distributions, copied the openSUSE 15.3 part out to test.xml, like below:
<distribution vendor="openSUSE" version="15.3" id="19032"> <name>openSUSE Leap 15.3</name> <project>openSUSE:Leap:15.3</project> <reponame>15.3</reponame> <repository>standard</repository> <link>http://www.opensuse.org/</link> <icon url="https://static.opensuse.org/distributions/logos/opensuse.png" width="8" height="8"/> <icon url="https://static.opensuse.org/distributions/logos/opensuse.png" width="16" height="16"/> <architecture>x86_64</architecture> </distribution>
And tried again. It gave me the same error. Am I missing anything?
I believe the outer <distributions> ... </distributions> (plural) are missing here -- Adrian Schroeter <adrian@suse.de> Build Infrastructure Project Manager SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nuernberg, Germany (HRB 247165, AG München), Geschäftsführer: Felix Imendörffer
On 2021/09/20 Mon 08:15, Adrian Schröter wrote:
I believe the outer
<distributions> ... </distributions>
(plural) are missing here
I didn't include <distributions> because the example and the schema in the API doc do not include it. And I have indeed tried with it, didn't help. I finally found that the "id" attribute of <distribution> tag is mandatory. It's marked as optional in the API doc, and I thought it should be auto-generated by the backend. But it turned out not. After included the id attribute I can create the distro. Regards, Kai
participants (2)
-
Adrian Schröter
-
Kai Liu