-
Notifications
You must be signed in to change notification settings - Fork 21
/
api.txt
1568 lines (1319 loc) · 65 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
====
Copyright (C) 2015 Red Hat, Inc. ([email protected])
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
====
CGImport(metadata, directory)
description: Import build from a content generator
metadata can be one of the following
- json encoded string representing the metadata
- a dictionary (parsed metadata)
- a filename containing the metadata
_listapi()
addBType(name)
description: Add a new btype with the given name
addExternalRPM(rpminfo, external_repo, strict=True)
description: Import an external RPM
This call is mainly for testing. Normal access will be through
a host call
addExternalRepoToTag(tag_info, repo_info, priority)
description: Add an external repo to a tag
addGroupMember(group, user, strict=True)
description: Add user to group
addHost(hostname, arches, krb_principal=None)
description: Add a host to the database
addHostToChannel(hostname, channel_name, create=False)
description: Add the host to the specified channel
Channel must already exist unless create option is specified
addRPMSig(an_rpm, data)
description: Store a signature header for an rpm
data: the signature header encoded as base64
addVolume(name, strict=True)
description: Add a new storage volume in the database
assignTask(task_id, host, force=False)
description: Assign a task to a host
Specify force=True to assign a non-free task
build(src, target, opts=None, priority=None, channel=None)
description: Create a build task
priority: the amount to increase (or decrease) the task priority, relative
to the default priority; higher values mean lower priority; only
admins have the right to specify a negative priority here
channel: the channel to allocate the task to
Returns the task id
buildContainer(src, target, opts=None, priority=None, channel='container')
description: Create a container build task
target: the build target
priority: the amount to increase (or decrease) the task priority, relative
to the default priority; higher values mean lower priority; only
admins have the right to specify a negative priority here
channel: the channel to allocate the task to (defaults to the "container"
channel)
Returns the task ID
buildFromCVS(url, tag)
buildImage(name, version, arch, target, ksfile, img_type, opts=None, priority=None)
description:
Create an image using a kickstart file and group package list.
buildImageIndirection(opts=None, priority=None)
description:
Create an image using two other images and an indirection template
buildImageOz(name, version, arches, target, inst_tree, opts=None, priority=None)
description:
Create an image using a kickstart file and group package list.
buildMap()
description: Map which builds were used in the buildroots of other builds
To be used for garbage collection
buildReferences(build, limit=None)
cancelBuild(buildID)
description: Cancel the build with the given buildID
If the build is associated with a task, cancel the task as well.
Return True if the build was successfully canceled, False if not.
cancelTask(task_id, recurse=True)
description: Cancel a task
cancelTaskChildren(task_id)
description: Cancel a task's children, but not the task itself
cancelTaskFull(task_id, strict=True)
description: Cancel a task and all tasks in its group
chainBuild(srcs, target, opts=None, priority=None, channel=None)
description: Create a chained build task for building sets of packages in order
srcs: list of pkg lists, ie [[src00, src01, src03],[src20],[src30,src31],...]
where each of the top-level lists gets built and a new repo is created
before the next list is built.
target: build target
priority: the amount to increase (or decrease) the task priority, relative
to the default priority; higher values mean lower priority; only
admins have the right to specify a negative priority here
channel: the channel to allocate the task to
Returns a list of all the dependent task ids
chainMaven(builds, target, opts=None, priority=None, channel='maven')
description: Create a Maven chain-build task
builds: a list of maps defining the parameters for the sequence of builds
target: the build target
priority: the amount to increase (or decrease) the task priority, relative
to the default priority; higher values mean lower priority; only
admins have the right to specify a negative priority here
channel: the channel to allocate the task to (defaults to the "maven" channel)
Returns the task ID
changeBuildVolume(build, volume, strict=True)
description: Move a build to a different storage volume
checkTagAccess(tag_id, user_id=None)
description: Determine if user has access to tag package with tag.
Returns a tuple (access, override, reason)
access: a boolean indicating whether access is allowed
override: a boolean indicating whether access may be forced
reason: the reason access is blocked
checkTagPackage(tag, pkg)
description: Check that pkg is in the list for tag. Returns true/false
checkUpload(path, name, verify=None, tail=None)
description: Return basic information about an uploaded file
count(methodName, *args, **kw)
description: Execute the XML-RPC method with the given name and count the results.
A method return value of None will return O, a return value of type "list", "tuple", or "dict"
will return len(value), and a return value of any other type will return 1. An invalid
methodName will raise an AttributeError, and invalid arguments will raise a TypeError.
createBuildTarget(name, build_tag, dest_tag)
description: Create a new build target
createEmptyBuild(name, version, release, epoch, owner=None)
createExternalRepo(name, url)
description: Create a new external repo with the given name and url.
Return a map containing the id, name, and url
of the new repo.
createImageBuild(build_info)
description:
Associate image metadata with an existing build. The build must not
already have associated image metadata.
createMavenBuild(build_info, maven_info)
description:
Associate Maven metadata with an existing build. The build must
not already have associated Maven metadata. maven_info must be a dict
containing group_id, artifact_id, and version entries.
createNotification(user_id, package_id, tag_id, success_only)
description: Create a new notification. If the user_id does not match the currently logged-in user
and the currently logged-in user is not an admin, raise a GenericError.
createTag(name, parent=None, arches=None, perm=None, locked=False, maven_support=False, maven_include_all=False, extra=None)
description: Create a new tag
createUser(username, status=None, krb_principal=None)
description: Add a user to the database
createWinBuild(build_info, win_info)
description:
Associate Windows metadata with an existing build. The build must
not already have associated Windows metadata. win_info must be a dict
containing a platform entry.
debugFunction(name, *args, **kwargs)
deleteBuild(build, strict=True, min_ref_age=604800)
description: delete a build, if possible
Attempts to delete a build. A build can only be deleted if it is
unreferenced.
If strict is true (default), an exception is raised if the build cannot
be deleted.
Note that a deleted build is not completely gone. It is marked deleted and some
data remains in the database. Mainly, the rpms are removed.
Note in particular that deleting a build DOES NOT free any NVRs (or NVRAs) for
reuse.
Returns True if successful, False otherwise
deleteBuildTarget(buildTargetInfo)
description: Delete the build target with the given name. If no build target
exists, raise a GenericError.
deleteExternalRepo(info)
description: Delete an external repo
deleteNotification(id)
description: Delete the notification with the given ID. If the currently logged-in
user is not the owner of the notification or an admin, raise a GenericError.
deleteTag(tagInfo)
description: Delete the specified tag.
disableHost(hostname)
description: Mark a host as disabled
disableUser(username)
description: Disable logins by the specified user
downloadTaskOutput(taskID, fileName, offset=0, size=-1)
description: Download the file with the given name, generated by the task with the
given ID.
dropGroupMember(group, user)
description: Drop user from group
echo(*args)
editBuildTarget(buildTargetInfo, name, build_tag, dest_tag)
description: Set the build_tag and dest_tag of an existing build_target to new values
editExternalRepo(info, name=None, url=None)
description: Edit an existing external repo
editHost(hostInfo, **kw)
description: Edit information for an existing host.
hostInfo specifies the host to edit, either as an integer (id)
or a string (name).
fields to be changed are specified as keyword parameters:
- arches
- capacity
- description
- comment
Returns True if changes are made to the database, False otherwise.
editTag(tagInfo, name, arches, locked, permissionID, extra=None)
description: Edit information for an existing tag.
editTag2(tagInfo, **kwargs)
description: Edit information for an existing tag.
tagInfo specifies the tag to edit
fields changes are provided as keyword arguments:
name: rename the tag
arches: change the arch list
locked: lock or unlock the tag
perm: change the permission requirement
maven_support: whether Maven repos should be generated for the tag
maven_include_all: include every build in this tag (including multiple
versions of the same package) in the Maven repo
extra: extra tag parameters (dictionary)
editTagExternalRepo(tag_info, repo_info, priority)
description: Edit a tag<->external repo association
This allows you to update the priority without removing/adding the repo.
enableHost(hostname)
description: Mark a host as enabled
enableUser(username)
description: Enable logins by the specified user
error()
description: debugging. raise an error
exclusiveSession(*args, **opts)
description: Make this session exclusive
fault()
description: debugging. raise an error
filterResults(methodName, *args, **kw)
description: Execute the XML-RPC method with the given name and filter the results
based on the options specified in the keywork option "filterOpts". The method
must return a list of maps. Any other return type will result in a TypeError.
Currently supported options are:
- offset: the number of elements to trim off the front of the list
- limit: the maximum number of results to return
- order: the map key to use to sort the list; the list will be sorted before
offset or limit are applied
- noneGreatest: when sorting, consider 'None' to be greater than all other values;
python considers None less than all other values, but Postgres sorts
NULL higher than all other values; default to True for consistency
with database sorts
findBuildID(X, strict=False)
freeTask(task_id)
description: Free a task
getAPIVersion()
getActiveRepos()
description: Get data on all active repos
This is a list of all the repos that the repo daemon needs to worry about.
getAllArches()
description: Return a list of all (canonical) arches available from hosts
getAllPerms()
description: Get a list of all permissions in the system. Returns a list of maps. Each
map contains the following keys:
- id
- name
getArchive(archive_id, strict=False)
description:
Get information about the archive with the given ID. Returns a map
containing the following keys:
id: unique id of the archive file (integer)
type_id: id of the archive type (Java jar, Solaris pkg, Windows exe, etc.) (integer)
build_id: id of the build that generated this archive (integer)
buildroot_id: id of the buildroot where this archive was built (integer)
filename: name of the archive (string)
size: size of the archive (integer)
checksum: checksum of the archive (string)
checksum_type: type of the checksum (integer)
If the archive is part of a Maven build, the following keys will be included:
group_id
artifact_id
version
If the archive is part of a Windows builds, the following keys will be included:
relpath
platforms
flags
If the archive is part of an image build, and it is the image file that
contains the root partitioning ('/'), there will be a additional fields:
rootid
arch
getArchiveFile(archive_id, filename)
description:
Get information about a file with the given filename
contained in the archive with the given ID.
Returns a map with with following keys:
archive_id: id of the archive the file is contained in (integer)
name: name of the file (string)
size: uncompressed size of the file (integer)
getArchiveType(filename=None, type_name=None, type_id=None, strict=False)
description:
Get the archive type for the given filename, type_name, or type_id.
getArchiveTypes()
description: Return a list of all supported archivetypes
getAverageBuildDuration(package)
description: Get the average duration of a build of the given package.
Returns a floating-point value indicating the
average number of seconds the package took to build. If the package
has never been built, return None.
getBuild(buildInfo, strict=False)
description: Return information about a build.
buildID may be either a int ID, a string NVR, or a map containing
'name', 'version' and 'release.
A map will be returned containing the following keys:
id: build ID
package_id: ID of the package built
package_name: name of the package built
name: same as package_name
version
release
epoch
nvr
state
task_id: ID of the task that kicked off the build
owner_id: ID of the user who kicked off the build
owner_name: name of the user who kicked off the build
volume_id: ID of the storage volume
volume_name: name of the storage volume
creation_event_id: id of the create_event
creation_time: time the build was created (text)
creation_ts: time the build was created (epoch)
start_time: time the build was started (may be null)
start_ts: time the build was started (epoch, may be null)
completion_time: time the build was completed (may be null)
completion_ts: time the build was completed (epoch, may be null)
source: the SCM URL of the sources used in the build
extra: dictionary with extra data about the build
If there is no build matching the buildInfo given, and strict is specified,
raise an error. Otherwise return None.
getBuildConfig(tag, event=None)
description: Return build configuration associated with a tag
getBuildNotification(id)
description: Get the build notification with the given ID. Return None
if there is no notification with the given ID.
getBuildNotifications(userID=None)
description: Get build notifications for the user with the given ID. If no ID
is specified, get the notifications for the currently logged-in user. If
there is no currently logged-in user, raise a GenericError.
getBuildTarget(info, event=None, strict=False)
description: Return the build target with the given name or ID.
If there is no matching build target, return None.
getBuildTargets(info=None, event=None, buildTagID=None, destTagID=None, queryOpts=None)
description: Return data on all the build targets
provide event to query at a different time
getBuildType(buildInfo, strict=False)
description: Return type info about the build
buildInfo should be a valid build specification
Returns a dictionary whose keys are type names and whose values are
the type info corresponding to that type
getBuildroot(buildrootID, strict=False)
description: Return information about a buildroot. buildrootID must be an int ID.
getBuildrootListing(id)
description: Return a list of packages in the buildroot
getChangelogEntries(buildID=None, taskID=None, filepath=None, author=None, before=None, after=None, queryOpts=None)
description: Get changelog entries for the build with the given ID,
or for the rpm generated by the given task at the given path
- author: only return changelogs with a matching author
- before: only return changelogs from before the given date (in UTC)
(a datetime object, a string in the 'YYYY-MM-DD HH24:MI:SS format, or integer seconds
since the epoch)
- after: only return changelogs from after the given date (in UTC)
(a datetime object, a string in the 'YYYY-MM-DD HH24:MI:SS format, or integer seconds
since the epoch)
- queryOpts: query options used by the QueryProcessor
If "order" is not specified in queryOpts, results will be returned in reverse chronological
order.
Results will be returned as a list of maps with 'date', 'author', and 'text' keys.
If there are no results, an empty list will be returned.
getChannel(channelInfo, strict=False)
description: Return information about a channel.
getEvent(id)
description:
Get information about the event with the given id.
A map will be returned with the following keys:
- id (integer): id of the event
- ts (float): timestamp the event was created, in
seconds since the epoch
If no event with the given id exists, an error will be raised.
getExternalRepo(info, strict=False, event=None)
description: Get information about a single external repo.
info can either be a string (name) or an integer (id).
Returns a map containing the id, name, and url of the
repo. If strict is True and no external repo has the
given name or id, raise an error.
getExternalRepoList(tag_info, event=None)
description:
Get an ordered list of all external repos associated with the tags in the
hierarchy rooted at the specified tag. External repos will be returned
depth-first, and ordered by priority for each tag. Duplicates will be
removed. Returns a list of maps containing the following fields:
tag_id
tag_name
external_repo_id
external_repo_name
url
priority
getFullInheritance(tag, event=None, reverse=False, stops=None, jumps=None)
getGlobalInheritance(event=None)
getGroupMembers(group)
description: Get the members of a group
getHost(hostInfo, strict=False)
description: Get information about the given host. hostInfo may be
either a string (hostname) or int (host id). A map will be returned
containign the following data:
- id
- user_id
- name
- arches
- task_load
- capacity
- description
- comment
- ready
- enabled
getImageArchive(archive_id, strict=False)
description:
Retrieve image-specific information about an archive.
Returns a map containing the following keys:
archive_id: id of the build (integer)
arch: the architecture of the image
rootid: True if this image has the root '/' partition
getImageBuild(buildInfo, strict=False)
description:
Retrieve image-specific information about a build.
buildInfo can be either a string (n-v-r) or an integer
(build ID). This function really only exists to verify a build
is an image build; there is no additional data.
Returns a map containing the following keys:
build_id: id of the build
getInheritanceData(tag, event=None)
description: Return inheritance data for tag
getLastEvent(before=None)
description:
Get the id and timestamp of the last event recorded in the system.
Events are usually created as the result of a configuration change
in the database.
If "before" (int or float) is specified, return the last event
that occurred before that time (in seconds since the epoch).
If there is no event before the given time, an error will be raised.
Note that due to differences in precision between the database and python,
this method can return an event with a timestamp the same or slightly higher
(by a few microseconds) than the value of "before" provided. Code using this
method should check that the timestamp returned is in fact lower than the parameter.
When trying to find information about a specific event, the getEvent() method
should be used.
getLastHostUpdate(hostID)
description: Return the latest update timestampt for the host
The timestamp represents the last time the host with the given
ID contacted the hub. Returns None if the host has never contacted
the hub.
getLatestBuilds(tag, event=None, package=None, type=None)
description: List latest builds for tag (inheritance enabled)
getLatestMavenArchives(tag, event=None, inherit=True)
description: Return a list of the latest Maven archives in the tag, as of the given event
(or now if event is None). If inherit is True, follow the tag hierarchy
and return a list of the latest archives for all tags in the tree.
getLatestRPMS(tag, package=None, arch=None, event=None, rpmsigs=False, type=None)
description: List latest RPMS for tag (inheritance enabled)
getLoggedInUser()
description: Return information about the currently logged-in user. Returns data
in the same format as getUser(), plus the authtype. If there is no
currently logged-in user, return None.
getMavenArchive(archive_id, strict=False)
description:
Retrieve Maven-specific information about an archive.
Returns a map containing the following keys:
archive_id: id of the build (integer)
group_id: Maven groupId (string)
artifact_id: Maven artifact_Id (string)
version: Maven version (string)
getMavenBuild(buildInfo, strict=False)
description:
Retrieve Maven-specific information about a build.
buildInfo can be either a string (n-v-r) or an integer
(build ID).
Returns a map containing the following keys:
build_id: id of the build (integer)
group_id: Maven groupId (string)
artifact_id: Maven artifact_Id (string)
version: Maven version (string)
getNextRelease(build_info)
description: find the last successful or deleted build of this N-V
getPackage(info, strict=False, create=False)
description: Get the id,name for package
getPackageConfig(tag, pkg, event=None)
description: Get config for package in tag
getPackageID(name)
getPerms()
description: Get a list of the permissions granted to the currently logged-in user.
getProductInfo(label)
description:
Get a list of the versions and variants of a product with the given label.
getProductListings(productLabel, buildInfo)
description:
Get a map of which variants of the given product included packages built
by the given build, and which arches each variant included.
getRPM(rpminfo, strict=False, multi=False)
description: Get information about the specified RPM
rpminfo may be any one of the following:
- a int ID
- a string N-V-R.A
- a string N-V-R.A@location
- a map containing 'name', 'version', 'release', and 'arch'
(and optionally 'location')
If specified, location should match the name of an external repo
A map will be returned, with the following keys:
- id
- name
- version
- release
- arch
- epoch
- payloadhash
- size
- buildtime
- build_id
- buildroot_id
- external_repo_id
- external_repo_name
- metadata_only
- extra
If there is no RPM with the given ID, None is returned, unless strict
is True in which case an exception is raised
If more than one RPM matches, and multi is True, then a list of results is
returned. If multi is False, a single match is returned (an internal one if
possible).
getRPMDeps(rpmID, depType=None, queryOpts=None)
description: Return dependency information about the RPM with the given ID.
If depType is specified, restrict results to dependencies of the given type.
Otherwise, return all dependency information. A list of maps will be returned,
each with the following keys:
- name
- version
- flags
- type
If there is no RPM with the given ID, or the RPM has no dependency information,
an empty list will be returned.
getRPMFile(rpmID, filename)
description:
Get info about the file in the given RPM with the given filename.
A map will be returned with the following keys:
- rpm_id
- name
- digest
- md5 (alias for digest)
- digest_algo
- size
- flags
If no such file exists, an empty map will be returned.
getRPMHeaders(rpmID=None, taskID=None, filepath=None, headers=None)
description:
Get the requested headers from the rpm. Header names are case-insensitive.
If a header is requested that does not exist an exception will be raised.
Returns a map of header names to values. If the specified ID
is not valid or the rpm does not exist on the file system, an empty map
will be returned.
getRepo(tag, state=None, event=None)
getSessionInfo()
getTag(tagInfo, strict=False, event=None)
description: Get tag information based on the tagInfo. tagInfo may be either
a string (the tag name) or an int (the tag ID).
Returns a map containing the following keys:
- id : unique id for the tag
- name : name of the tag
- perm_id : permission id (may be null)
- perm : permission name (may be null)
- arches : tag arches (string, may be null)
- locked : lock setting (boolean)
- maven_support : maven support flag (boolean)
- maven_include_all : maven include all flag (boolean)
- extra : extra tag parameters (dictionary)
If there is no tag matching the given tagInfo, and strict is False,
return None. If strict is True, raise a GenericError.
Note that in order for a tag to 'exist', it must have an active entry
in tag_config. A tag whose name appears in the tag table but has no
active tag_config entry is considered deleted.
getTagExternalRepos(tag_info=None, repo_info=None, event=None)
description:
Get a list of tag<->external repo associations.
Returns a map containing the following fields:
tag_id
tag_name
external_repo_id
external_repo_name
url
priority
getTagGroups(tag, event=None, inherit=True, incl_pkgs=True, incl_reqs=True)
description: Return group data for the tag with blocked entries removed
Also scrubs data into an xmlrpc-safe format (no integer keys)
getTagID(info, strict=False, create=False)
description: Get the id for tag
getTaskChildren(task_id, request=False)
description: Return a list of the children
of the Task with the given ID.
getTaskDescendents(task_id, request=False)
description: Get all descendents of the task with the given ID.
Return a map of task_id -> list of child tasks. If the given
task has no descendents, the map will contain a single elements
mapping the given task ID to an empty list. Map keys will be strings
representing integers, due to limitations in xmlrpclib. If "request"
is true, the parameters sent with the xmlrpc request will be decoded and
included in the map.
getTaskInfo(task_id, request=False)
description: Get information about a task
getTaskRequest(taskId)
getTaskResult(taskId)
getUser(userInfo=None, strict=False)
description: Return information about a user.
userInfo may be either a str (Kerberos principal or name) or an int (user id).
A map will be returned with the following keys:
id: user id
name: user name
status: user status (int), may be null
usertype: user type (int), 0 person, 1 for host, may be null
krb_principal: the user's Kerberos principal
getUserPerms(userID)
description: Get a list of the permissions granted to the user with the given ID.
getVolume(volume, strict=False)
getWinArchive(archive_id, strict=False)
description:
Retrieve Windows-specific information about an archive.
Returns a map containing the following keys:
archive_id: id of the build (integer)
relpath: the relative path where the file is located (string)
platforms: space-separated list of platforms the file is suitable for use on (string)
flags: space-separated list of flags used when building the file (fre, chk) (string)
getWinBuild(buildInfo, strict=False)
description:
Retrieve Windows-specific information about a build.
buildInfo can be either a string (n-v-r) or an integer
(build ID).
Returns a map containing the following keys:
build_id: id of the build (integer)
platform: the platform the build was performed on (string)
grantCGAccess(user, cg, create=False)
description: Grant user access to act as the given content generator
grantPermission(userinfo, permission, create=False)
description: Grant a permission to a user
groupListAdd(taginfo, grpinfo, block=False, force=False, **opts)
description: Add to (or update) group list for tag
groupListBlock(taginfo, grpinfo)
description: Block the group in tag
groupListRemove(taginfo, grpinfo, force=False)
description: Remove group from the list for tag
Really this shouldn't be used except in special cases
Most of the time you really want to use the block or unblock functions
groupListUnblock(taginfo, grpinfo)
description: Unblock the group in tag
If the group is blocked in this tag, then simply remove the block.
Otherwise, raise an error
groupPackageListAdd(taginfo, grpinfo, pkg_name, block=False, force=False, **opts)
description: Add package to group for tag
groupPackageListBlock(taginfo, grpinfo, pkg_name)
description: Block the package in group-tag
groupPackageListRemove(taginfo, grpinfo, pkg_name, force=False)
description: Remove package from the list for group-tag
Really this shouldn't be used except in special cases
Most of the time you really want to use the block or unblock functions
groupPackageListUnblock(taginfo, grpinfo, pkg_name)
description: Unblock the package in group-tag
If blocked (directly) in this tag, then simply remove the block.
Otherwise, raise an error
groupReqListAdd(taginfo, grpinfo, reqinfo, block=False, force=False, **opts)
description: Add group requirement to group for tag
groupReqListBlock(taginfo, grpinfo, reqinfo)
description: Block the group requirement in group-tag
groupReqListRemove(taginfo, grpinfo, reqinfo, force=False)
description: Remove group requirement from the list for group-tag
Really this shouldn't be used except in special cases
Most of the time you really want to use the block or unblock functions
groupReqListUnblock(taginfo, grpinfo, reqinfo)
description: Unblock the group requirement in group-tag
If blocked (directly) in this tag, then simply remove the block.
Otherwise, raise an error
hasPerm(perm)
description: Check if the logged-in user has the given permission. Return False if
they do not have the permission, or if they are not logged-in.
hello(*args)
host.assertPolicy(name, data, default='deny')
host.checkPolicy(name, data, default='deny', strict=False)
host.closeTask(task_id, response)
host.completeBuild(task_id, build_id, srpm, rpms, brmap=None, logs=None)
description: Import final build contents into the database
host.completeImageBuild(task_id, build_id, results)
description: Set an image build to the COMPLETE state
host.completeMavenBuild(task_id, build_id, maven_results, rpm_results)
description: Complete the Maven build.
host.completeWinBuild(task_id, build_id, results, rpm_results)
description: Complete a Windows build
host.createMavenBuild(build_info, maven_info)
description:
Associate Maven metadata with an existing build. Used
by the rpm2maven plugin.
host.evalPolicy(name, data)
description: Evaluate named policy with given data and return the result
host.failBuild(task_id, build_id)
description: Mark the build as failed. If the current state is not
'BUILDING', or the current competion_time is not null, a
GenericError will be raised.
host.failTask(task_id, response)
host.freeTasks(tasks)
host.getHost()
description: Return information about this host
host.getHostTasks()
host.getID()
host.getLoadData()
host.getTask()
host.importArchive(filepath, buildinfo, type, typeInfo)
description:
Import an archive file and associate it with a build. The archive can
be any non-rpm filetype supported by Koji. Used by the rpm2maven plugin.
host.importImage(task_id, build_id, results)
description:
Import a built image, populating the database with metadata and
moving the image to its final location.
host.importWrapperRPMs(task_id, build_id, rpm_results)
description: Import the wrapper rpms and associate them with the given build. The build
must not have any existing rpms associated with it.
host.initBuild(data)
description: Create a stub (rpm) build entry.
This is done at the very beginning of the build to inform the
system the build is underway.
This function is only called for rpm builds, other build types
have their own init function
host.initImageBuild(task_id, build_info)
description: create a new in-progress image build
host.initMavenBuild(task_id, build_info, maven_info)
description: Create a new in-progress Maven build
Synthesize the release number by taking the (integer) release of the
last successful build and incrementing it.
host.initWinBuild(task_id, build_info, win_info)
description:
Create a new in-progress Windows build.
host.isEnabled()
host.moveBuildToScratch(task_id, srpm, rpms, logs=None)
description: Move a completed scratch build into place (not imported)
host.moveImageBuildToScratch(task_id, results)
description: move a completed image scratch build into place
host.moveMavenBuildToScratch(task_id, results, rpm_results)
description: Move a completed Maven scratch build into place (not imported)
host.moveWinBuildToScratch(task_id, results, rpm_results)
description: Move a completed Windows scratch build into place (not imported)
host.newBuildRoot(repo, arch, task_id=None)
host.openTask(task_id)
host.repoAddRPM(repo_id, path)
description: Add an uploaded rpm to a repo
host.repoDone(repo_id, data, expire=False)
description: Move repo data into place, mark as ready, and expire earlier repos
repo_id: the id of the repo
data: a dictionary of the form { arch: (uploadpath, files), ...}
expire(optional): if set to true, mark the repo expired immediately*
* This is used when a repo from an older event is generated
host.repoInit(tag, with_src=False, with_debuginfo=False, event=None)
description: Initialize a new repo for tag
host.setBuildRootList(brootid, rpmlist, task_id=None)
host.setBuildRootState(brootid, state, task_id=None)
host.setTaskWeight(task_id, weight)
host.subtask(method, arglist, parent, **opts)
host.subtask2(_HostExports__parent, _HostExports__taskopts, _HostExports__method, *args, **opts)
description: A wrapper around subtask with optional signature
Parameters:
__parent: task id of the parent task
__taskopts: dictionary of task options
__method: the method to be invoked
Remaining args are passed on to the subtask
host.tagBuild(task_id, tag, build, force=False, fromtag=None)
description: Tag a build (host version)
This tags as the user who owns the task
If fromtag is specified, also untag the package (i.e. move in a single
transaction)
No return value
host.tagNotification(is_successful, tag_id, from_id, build_id, user_id, ignore_success=False, failure_msg='')
description: Create a tag notification message.
Handles creation of tagNotification tasks for hosts.
host.taskSetWait(parent, tasks)
host.taskWait(parent)
host.taskWaitResults(parent, tasks)
host.updateBuildRootList(brootid, rpmlist, task_id=None)
host.updateBuildrootArchives(brootid, task_id, archives, project=False)
host.updateHost(task_load, ready)
host.updateMavenBuildRootList(brootid, task_id, mavenlist, ignore=None, project=False, ignore_unknown=False, extra_deps=None)
imageMigrationEnabled()
importArchive(filepath, buildinfo, type, typeInfo)
description:
Import an archive file and associate it with a build. The archive can
be any non-rpm filetype supported by Koji.
filepath: path to the archive file (relative to the Koji workdir)
buildinfo: information about the build to associate the archive with
May be a string (NVR), integer (buildID), or dict (containing keys: name, version, release)
type: type of the archive being imported. Currently supported archive types: maven, win
typeInfo: dict of type-specific information
importBuildInPlace(build)
description: Import a package already in the packages directory
This is used for bootstrapping the database
Parameters:
build: a dictionary with fields: name, version, release
importRPM(path, basename)
description: Import an RPM into the database.
The file must be uploaded first.
kpatchBuild(kernel, source, opts=None)
description: Create a kpatchBuild task
krbLogin(*args, **opts)
listArchiveFiles(archive_id, queryOpts=None)
description:
Get information about the files contained in the archive with the given ID.
Returns a list of maps with with following keys:
archive_id: id of the archive the file is contained in (integer)
name: name of the file (string)
size: uncompressed size of the file (integer)
listArchives(buildID=None, buildrootID=None, componentBuildrootID=None, hostID=None, type=None, filename=None, size=None, checksum=None, typeInfo=None, queryOpts=None, imageID=None, archiveID=None)
description:
Retrieve information about archives.
If buildID is not null it will restrict the list to archives built by the build with that ID.
If buildrootID is not null it will restrict the list to archives built in the buildroot with that ID.
If componentBuildrootID is not null it will restrict the list to archives that were present in the
buildroot with that ID.
If hostID is not null it will restrict the list to archives built on the host with that ID.
If filename, size, and/or checksum are not null it will filter the results to entries matching the provided values.
Returns a list of maps containing the following keys:
id: unique id of the archive file (integer)
type_id: id of the archive type (Java jar, Solaris pkg, Windows exe, etc.) (integer)
type_name: name of the archive type
type_description: description of the archive
type_extensions: valid extensions for the type
build_id: id of the build that generated this archive (integer)
buildroot_id: id of the buildroot where this archive was built (integer)
filename: name of the archive (string)
size: size of the archive (integer)
checksum: checksum of the archive (string)
checksum_type: the checksum type (integer)
If componentBuildrootID is specified, then the map will also contain the following key:
project: whether the archive was pulled in as a project dependency, or as part of the
build environment setup (boolean)
If 'type' is specified, then the archives listed will be limited
those associated with additional metadata of the given type.
Currently supported types are:
maven, win, image
If 'maven' is specified as a type, each returned map will contain
these additional keys:
group_id: Maven groupId (string)
artifact_id: Maven artifactId (string)
version: Maven version (string)
if 'win' is specified as a type, each returned map will contain
these additional keys:
relpath: the relative path where the file is located (string)
platforms: space-separated list of platforms the file is suitable for use on (string)
flags: space-separated list of flags used when building the file (fre, chk) (string)
if 'image' is specified as a type, each returned map will contain an