-
Notifications
You must be signed in to change notification settings - Fork 434
/
api.txt
1912 lines (1062 loc) · 44.6 KB
/
api.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
= Open Build Service API
Version: 2.7
Only authenticated users are allowed to access the API. Authentication is done
by sending a Basic HTTP Authorisation header.
Do NOT simply add api calls here without discussion before.
The main base routes are:
/source : To handle all source submissions and project setups
/build : To access build results and their states
/published : Read access to published repositories
/search : Access to search interface
== Table of Contents
Contents:
== About
GET /about
Get information about API.
XmlResult: about
== Architectures
GET /architectures
Get a list of all known architectures known to OBS in general.
This is not the list of architectures provided by this instance, go
to /configuration for this
XmlResult: architecture list
== Issue Trackers
GET /issue_trackers
Get the list of available issue trackers
XmlResult: issue_trackers
<name>: Issue tracker name
GET /issue_trackers/<name>
Read issue tracker data.
XmlResult: issue_tracker
PUT /issue_tracker/<name>
Update issue tracker data.
XmlResult: status
POST /issue_tracker/<name>
Create new issue tracker.
XmlResult: issue_tracker
DELETE /issue_tracker/<name>
Delete issue tracker.
XmlResult: status
GET /issue_trackers/show_url_for
Parameters:
issue: attribute used for issue search (example: 'bnc#123456')
== Distribution List
GET /distributions
Get the list of base distributions hosted on this OBS instance
XmlResult: distributions
PUT /distributions
Write the list of base distributions hosted on this OBS instance
XmlResult: distributions
GET /distributions/<distribution_id>
Get data of one base distributions hosted on this OBS instance
XmlResult: status
POST /distributions/<distribution_id>
Modifies one base distribution entry. Distro must be hosted on the OBS instance
XmlResult: status
GET /distributions/include_remotes
Get the list of base distributions hosted on this OBS instance and on all used remote instances
XmlResult: distributions
== User data
<userid>: Id of user
<groupid> Id of group
GET /person/<userid>
Read user data.
XmlResult: user
PUT /person/<userid>
Write user data.
XmlBody: user
XmlResult: status
POST /person?cmd=register
Can be used to register a new user, if OBS instance is allowing this.
POST /person/<userid>
cmd=change_password to post the new password in the request body. Just the first line gets used.
XmlBody: password
XmlResult: status
Parameters:
cmd: change_password
cmd: lock # will lock the user and his home projects
cmd: delete # will mark the user as deleted and remove her home projects
GET /person/<userid>/token
Lists all authentification token for a user
XmlResult: tokenlist
POST /person/<userid>/token
Create a new authentification token for this user. It may be limited for a specific package
via optional project&package parameters.
cmd: create
project: create a token for a specific project
package: create a token for a specific package
XmlResult: status
DELETE /person/<userid>/token/<id>
Delete a specific authentification token. The <id> is listed in GET call.
XmlResult: status
== Group data
GET /group
List available groups
XmlResult: directory
Parameters:
login: List available groups of this user.
GET /group/<group title>
Read group data.
XmlResult: group
PUT /group/<group title>
Write group data.
XmlBody: user
XmlResult: status
POST /group/<group title>
Modify group data.
Multiple commands on processing group.
add_user: add a user to a group
remove_user: remove a user from a group
set_email: set email adress of group.
Parameters:
userid: user login name, required for add_user and remove_user command
email: email address for set_email command. email of group gets removed if not defined
XmlResult: status
DELETE /group/<group title>
Delete a group.
XmlResult: status
== Sources
=== Projects
GET /source/
Read list of projects.
XmlResult: directory
Parameters:
deleted: show deleted projects instead of existing
POST /source
Commands on processing sources globally. Possible commands are
branch: branch a set of packages based on attributes or on existing request
orderkiwirepos: sort the repositories inside of a kiwi file according to path relationships
createmaintenanceincident: create mainatenance incident projects based on attribute search
Parameters:
linkrev: linked revision, optional (for linkrev=base)
attribute: attribute used for package search, default is OBS:Maintained
update_project_attribute: attribute name used to find out possible existing update projects of a package
request: branch by request, branch all packages in actions of request for superseding it
noaccess: the new created project will be read protected
target_project: project which will get used or created
GET /source/<project>/_meta
Read project meta file.
Parameters:
rev: revision, mandatory
XmlResult: project
PUT /source/<project>/_meta
Write project meta file.
Parameters:
comment: comment, optional
XmlBody: project
XmlResult: status
DELETE /source/<project>
Deletes specified project. All packages of this project are deleted as if a
DELETE request were issued for each package.
Parameters:
force: If force = 1, the project is deleted even if repositories of other
projects include a path to a repository from this project. The path
in the other repository is replaced by one pointing to 'deleted/standard',
preventing the build and publishing of the other repository.
comment: comment, optional
XmlResult: status
GET /source/<project>/_attribute/<attribute>
Get all attributes or a specific one
XmlBody: attribute
POST /source/<project>/_attribute/<attribute>
Modifies a specific attribute as in body
Parameters:
comment: comment, optional
XmlResult: status
DELETE /source/<project>/_attribute/<attribute>
Removes a specific attribute
Parameters:
comment: comment, optional
XmlResult: status
GET /source/<project>/_config
Read project configuration
Parameters:
rev: revision, mandatory
Result: configuration as text/plain
PUT /source/<project>/_config
Change project configuration
Parameters:
comment: comment, optional
XmlResult: status
GET /source/<project>/_pattern
Get list of all patterns set up for this project
XmlResult: pattern
GET /source/<project>/_pattern/<patternfile>
Get pattern
XmlResult: pattern
PUT /source/<project>/_pattern/<patternfile>
Write pattern
XmlBody: pattern
XmlResult: status
DELETE /source/<project>/_pattern/<patternfile>
Remove pattern
XmlResult: status
GET /source/<project>/_pubkey
Get project GPG key. If the project has no own key (default), it uses
the first available one in the namespace hierarchy, ending at the global
buildservice key.
Result: gpgkey
DELETE /source/<project>/_pubkey
Removes the current gpg key. Has no effect if no key is set.
XmlResult: status
POST /source/<project>
Multiple commands on processing sources in package. Possible commands are
createkey: Generate a new gpg key. If the project already has an own gpg key, the old key is discarded.
extendkey: Extend the expiration date of gpg keys.
undelete: undelete the project and all packages existing when the project got removed.
showlinked: List all projects linking to this one
copy: copy the entire project
move: ADMIN ONLY. schedulers need to be stopped. move all sources and binaries around from oproject.
createmaintenanceincident: create a single mainatenance incident project as sub project
createpatchinfo: create a new patchinfo package collecting all mentioned issues in sources
addchannels: add channel packages and repositories for matching packages in project
modifychannels: modify existing channels by specified mode
set_flag: change a defined flag, requires at least flag and status parameters
remove_flag: remove a defined flag, requires at least flag and status parameters
lock: lock a project
unlock: unlock a locked project
release: release sources and binaries according to release target specification
Parameters:
noaccess: the new created project will be read protected
repository: set_flag for given repository or release just this repository (optional)
arch: set_flag for given arch (optional)
flag: modify this flag (build/publish/..) for set_flag command
status: enable or disable for set_flag command
comment: description for the history
# for modifychannels and addchannels command only:
mode: how to deal with disabled channels: add_disabled(default), skip_disabled, enable_all
# for copy command only:
oproject: origin project name (required)
resign: resign all binaries with new target project key
makeolder: make a split, the source is bumped by two numbers and target by one
withhistory: copies sources with history on copy command
withbinaries: copies also binaries on copy command
noservice: do not run source services
setrelease: define a specific release tag when used with "release" command. Setting it to "-" strips
the release string. Note: this modifies only the filename.
=== Packages
GET /source/<project>
Read list of packages.
XmlResult: package directory.xsd
Parameters:
deleted: show deleted package instead of existing
expand: include also packages from linked projects
view: issues, can be used to show all tracked issues for all packages in project
productlist, shows all containing products, unifies result when used with expand
verboseproductlist, same as productlist, but with detailed information about the product
GET /source/<project>/<package>
Package source listing
Parameters:
rev: revision of new package, optional
linkrev: linked revision, optional
emptylink: bool, , optional
expand: bool, expand links, optional
meta: bool, switch to meta files, optional
view: The "info" view will show data like source version, md5sums and build description files. May be used together with parse, arch or repository parameter, optional
"issues" can be used to show all tracked issues for all packages in project, optional
"products" show all products of a package (works only on "_product" packages)
extension: filter for file extension, optional
lastworking: bool, show sources of last mergeable sources in case of conflicting changes, optional
withlinked: bool, show all used package containers (in case of multiple link indirections) in linkinfo information, optional
deleted: bool, show content of deleted package instance
parse: bool, for view=info: take build description into account, optional
arch: string, for view=info: parse buildinfo for this architecture, optinal
repository: string, for view=info: parse buildinfo for this repository, optinal
product: string, limit the product view to a given product
XmlResult: package directory.xsd
GET /source/<project>/<package>/_meta
Read project meta data.
Parameters:
rev: revision of new package, optional
XmlResult: package
PUT /source/<project>/<package>/_meta
Write project meta data. Writing of the project meta data commits the packages
contained in the project to the build backend.
Parameters:
comment: comment, optional
XmlBody: package
XmlResult: status
DELETE /source/<project>/<package>
Deletes specified package including all source files
Parameters:
comment: comment, optional
XmlResult: status
GET /source/<project>/<package>/_attribute/<attribute>
Get all attributes or a specific one
XmlBody: attribute
POST /source/<project>/<package>/_attribute/<attribute>
Modifies a specific attribute as in body
Parameters:
comment: comment, optional
XmlResult: status
DELETE /source/<project>/<package>/_attribute/<attribute>
Removes a specific attribute
Parameters:
comment: comment, optional
XmlResult: status
GET /source/<project>/<package>/_history
Get package commit history
XmlResult: revisionlist
POST /source/<project>/<package>?cmd=showlinked
List all package instances linking to this one.
Result: package list
POST /source/<project>/<package>?cmd=diff
Create a source diff
Parameters:
rev: revision of new package, optional
oproject: old project, optional
opackage: old package, optional
orev: old revision, optional
Result: diff as text/plain
POST /source/<project>/<package>?cmd=instantiate
Instantiate a package container, which is available via project links only so far.
Parameters:
makeoriginolder: optional, can be used to modify source and target to guarantee that new version
stay older also on future updates in older code stream
XmlResult: status
POST /source/<project>/<package>?cmd=release
Releases sources and binaries of that package. This requires a set
release target in the repository definitions of <project>. Also the
trigger must be set to "manual"
Parameters:
comment: description for the history
repository: limit the release to the specified repository
target_repository: specify the target repository name (together with target_project)
target_project: overwrites the target definition from project meta
(repository and target_repository parameter required as well)
XmlResult: status
POST /source/<project>/<package>?cmd=unlock
Unlocks a locked package
Parameters:
comment: description for the history
XmlResult: status
POST /source/<project>/<package>?cmd=branch
Create a source link from a package of an existing project to a
new subproject of the requesters home project.
The default target is home:<user>:branches:<project>/<package>
A possible defined devel project in the package meta data gets ignored.
Parameters:
ignoredevel: bool, optional
target_project: target project name, optional
target_package: target package name, optional
noaccess: the new created project will be read protected, bool, optional
missingok: the target package does not exist
newinstance: the target package exists only via project links, but the link should point to given project
add_repositories: bool, optional, adds repositories base on source project (default for new projects)
update_path_elements: bool, optional, update all path elements if needed (used repositories depend on each other)
extend_package_names: bool, optional, extends package and repository names to allow multiple instances of same package
add_repositories_rebuild: use defined rebuild policy for new repos ("transitive", "direct" or "local") or copy it from the source project ("copy")
add_repositories_block: use defined block policy for new repos
XmlResult: status
POST /source/<project>/<package>?cmd=set_flag
Modify or set a defined flag for package
Parameters:
repository: set_flag for given repository (optional)
arch: set_flag for given arch (optional)
flag: modify this flag (build/publish/..) for set_flag command
status: enable or disable for set_flag command
XmlResult: status
POST /source/<project>/<package>?cmd=createSpecFileTemplate
Create template for RPM SPEC file. Returns an error, if the SPEC file already
exists.
XmlResult: status
POST /source/<project>/<package>?cmd=commit
Commits package changes to buildservice
Parameters:
rev: revision, mandatory
comment: comment, optional
XmlResult: status
POST /source/<project>/<package>?cmd=collectbuildenv
Creates _buildenv files based on origin package builds. This can be used
to re-use exact older build enviroment even when further new binary packages
got added. For example to re-build an old maintenance update in the same way.
Parameters:
oproject: Origin project to copy from (required)
opackage: Origin package to copy from (required)
comment: Optional comment by the user
XmlResult: status
POST /source/<project>/<package>?cmd=importchannel
Import a kiwi channel file for OBS. Project names will be set
to update projects if defined.
Parameters:
target_project: optional target repository to set
target_repository: optional target repository to set
XmlResult: status
POST /source/<project>/<package>?deleteuploadrev
Removes all changes made to the upload revision and reverts to last revision
Parameters:
none
XmlResult: status
=== Source files
<filename>: File name
GET /source/<project>/<package>
Get directory listing of all source files in the package
Parameters:
rev: package source revision, optional
linkrev: linked revision, optional
expand: expand links, optional
meta: switch to meta files
lastworking: auto detect last working link revision, optional
view: The "cpio" view will stream all files as cpio, optional
extension: filter for file extension, optional
GET /source/<project>/<package>/<filename>
Read source file.
Result: Content of file
Parameters:
meta: switch to meta files
PUT /source/<project>/<package>/<filename>
Write source file.
Parameters:
rev: if set to 'upload', multiple files can be uploaded one by one in one commit, before
finishing the commit with cmd=commit (see below), optional
comment: comment, optional
keeplink: bool, optional
meta: switch to meta files
Body: Content of file
XmlResult: status
DELETE /source/<project>/<package>/<filename>
Delete source file.
XmlResult: status
Parameters:
meta: switch to meta files
POST /source/<project>/<package>
Multiple commands on processing sources in package. Possible commands are
diff: for server side diff
linkdiff: for server side diff of a linked or branched package
servicediff: shows the changes of the service run
commit: commit files in upload revision
commitfilelist: commit defined files in upload revision
deleteuploadrev: delete all uploaded sources which are not committed yet
copy: copy package sources from another package
undelete: undelete the package
unlock: unlock a package with lock enabled. A comment is required.
release: release sources and binaries according to release target specification
branch: branch a package into another one
linktobranch: convert a plain source link into a full branch
enablechannel: adds repositories and enable this channel package
updatepatchinfo: update _patchinfo file, esp. the issues list
remove_flag: remove a specific flag from meta (flag must be defined, optionally arch and repository)
set_flag: remove a specific flag from meta (flag must be defined, optionally arch and repository)
showlinked: show all source packages linking to this one
deleteuploadrev: delete all uploaded, but not yet commited files.
rebuild: rebuild all builds
getprojectservices: list all service defined in project spaces defined for this package.
runservice: trigger run of defined services in _service file
waitservice: returns when all services have finished, code 200 when service run was successful
mergeservice: drops the _service file and commits all server side generated files
time: set the time on undelete operation (admin only operation)
wipe: wipe all build results of this package
Parameters:
rev: package source revision, optional
linkrev: linked revision, optional
orev: origin package source revision as defined in opackage/project, optional
olinkrev: origin linked revision, optional
oproject: origin project, used as base project
opackage: origin package, used as base package
requestid: log the requestid in source history, optional (copy and commitfilelist only)
expand: expand links, optional
keeplink: keep link on source commit, optional
repairlink: repair link on source commit, optional
dontupdatesource: Do not update origin package, optional (copy only)
noservice: do not run source services
comment: comment for history, optional
meta: switch to meta files
arch: architecture when using flag modifing command
repository: repository when using flag modifing command
view: may be "xml" for structured answered (for diff commands)
withissues: set to get issues parsed from changelogs (for diff commands)
onlyissues: used to limit to issues (for diff commands)
setrelease: define a specific release tag when used with "release" command. Setting it to "-" strips
the release string.
GET /source/<project>/<package>/<binary>/_attribute/<attribute>
Get all attributes or a specific one
XmlBody: attribute
POST /source/<project>/<package>/<binary>/_attribute/<attribute>
Modifies a specific attribute as in body
Parameters:
comment: comment, optional
XmlResult: status
DELETE /source/<project>/<package>/<binary>/_attribute/<attribute>
Removes a specific attribute
Parameters:
comment: comment, optional
XmlResult: status
== Requests
GET /request
Get a list of requests. When using the "view=collection" you need also to filter
either by user, project or package.
Parameters:
view: collection, return a collection of requests instead of directory listing
user: filter for given user, includes all target projects and packages where
the user is maintainer and also open review requests
project: limit to result to defined target project or review requests
package: limit to result to defined target package or review requests
states: filter for given request state, multiple matches can be added as comma seperated list (eg states=new,review)
types: filter for given action types (comma seperated)
roles: filter for given roles (creator, maintainer, reviewer, source or target)
withhistory: includes the request history in result
withfullhistory: includes the request and review history in result
limit: to limit the result to the given number of requests
XmlResult: collection
GET /request/<id>
Get a request
Parameters:
withhistory: includes the request history in result
withfullhistory: includes the request and review history in result
XmlResult: request
POST /request
Create a new request
XmlResult: request
Commands on processing requests
create: to crfeate a new request
Parameters:
addrevision: ask the server to add revisions of current sources to the request
PUT /request/<id>
Modify a request. NOTE: Only admins can change all parts of a request.
XmlResult: request
POST /request/<id>?cmd=diff
Shows the diff of all affected packages.
Result: diff as text/plain
POST /request/<id>
Modify a request
XmlResult: request
Commands on processing requests
addreview: Adds a review to a request
assignreview: Adds a review for a user and accepts it for the used group
changestate: Modifies the state of a request
changereviewstate: Modifies the state of a review inside a request
setpriority: Modifies the priority of a requst
setincident: Change the target incident for maintenance_incident actions
setacceptat: Set or modify the accept_at time. Either specified by time parameter or now.
Parameters:
newstate: Define the new state
priority: Define the new priority
by_user: Specify the user of the new review
by_group: Specify the group of the new review
by_project: Specify the project of the new review
by_package: Specify the user of the new review
incident: Specifiy inicdent number for setincident
time: Specifiy time for setacceptat
== Attribute definition api
GET /attribute/
List all attribute namespaces
XmlResult: directory
GET /attribute/<namespace>/
List all attributes under given namespace
XmlResult: directory
GET /attribute/<namespace>/_meta
shows namespace setup
XmlResult: attribute_namespace_meta
DELETE /attribute/<namespace>/_meta
Delete a attribute namespace and all attributes below
XmlResult: status
PUT /attribute/<namespace>/_meta
change attribute namespace meta
XmlBody: attribute_namespace_meta_data
XmlResult: status
GET /attribute/<namespace>/<name>/_meta
shows attribute setup
XmlResult: attribute_meta
DELETE /attribute/<namespace>/<name>/_meta
Delete a attribute and all its values in projects or packages
XmlResult: status
PUT /attribute/<namespace>/<name>/_meta
change attribute meta