Skip to content

Commit

Permalink
Add OpenAPI specifications for source cmd orderkiwirepos
Browse files Browse the repository at this point in the history
  • Loading branch information
rubhanazeem committed Nov 30, 2021
1 parent a6556eb commit 4889dae
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/api/public/apidocs-new/OBS-v2.10.50.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,10 @@ paths:

/source?cmd=createmaintenanceincident:
$ref: 'paths/source_createmaintenanceincident.yaml'

/source?cmd=branch:
$ref: 'paths/source_branch.yaml'
/source?cmd=orderkiwirepos:
$ref: 'paths/source_orderkiwirepos.yaml'

/trigger/{operation}:
$ref: 'paths/trigger_operation.yaml'
Expand Down
26 changes: 26 additions & 0 deletions src/api/public/apidocs-new/components/schemas/kiwi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
type: object
properties:
name:
type: string
xml:
attribute: true
schemaversion:
type: string
xml:
attribute: true
repository:
type: array
items:
type: object
properties:
source:
type: object
properties:
path:
type: string
xml:
attribute: true
xml:
name: repository
xml:
name: image
54 changes: 54 additions & 0 deletions src/api/public/apidocs-new/paths/source_orderkiwirepos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
post:
summary: Sort the repositories inside of a kiwi file according to path relationships.
description: This API takes kiwi XML file in the request body and sort the repositories based on priority.
requestBody:
required: true
content:
application/xml; charset=utf-8:
schema:
$ref: '../components/schemas/kiwi.yaml'
example: |
<image name="{exc_image_base_name}" schemaversion="7.4">
<repository type="rpm-md" priority="99" alias="kiwi">
<source path="obs://Virtualization:Appliances:Builder/openSUSE_Leap_15.3"/>
</repository>
<repository type="rpm-md" priority="1" alias="OS" imageinclude="true">
<source path="{exc_repo}"/>
</repository>
</image>
responses:
'200':
description: Sorted list of repositories
content:
text/xml:
schema:
$ref: '../components/schemas/kiwi.yaml'
example: |
<image name="{exc_image_base_name}" schemaversion="7.4">
<repository type="rpm-md" priority="1" alias="OS" imageinclude="true">
<source path="{exc_repo}"/>
</repository>
<repository type="rpm-md" priority="99" alias="kiwi">
<source path="obs://Virtualization:Appliances:Builder/openSUSE_Leap_15.3"/>
</repository>
</image>
'400':
description: Bad Request
content:
application/xml; charset=utf-8:
schema:
type: object
properties:
code:
type: string
xml:
attribute: true
summary:
type: string
xml:
name: status
example:
code: 400
summary: '/srv/obs/sources/:upload/1344: not xml'
tags:
- Sources

0 comments on commit 4889dae

Please sign in to comment.