Warning
Client version 2 is obsolete, please use Client version 3 instead.
Project resource represents copr projects and operations with them.
Access to the projects is done through projects(). property of initialized CoprClient. That property is an instance of ProjectHandle. Projects are represented by Project class.
Field | Type | Can edit? | Description |
---|---|---|---|
id | number | no | unique identifier |
owner | string | no | username of the project owner |
group | string | no |
|
name | string | no |
|
description | string | yes | project description |
instructions | string | yes | installation instructions |
homepage | string(URL) | yes | project homepage URL |
contact | string(URL or email) | yes | contact with the project maintainer |
disable_createrepo | bool | yes | disables automatic repository metadata generation |
build_enable_net | bool | yes | set default value for new builds option enable_net |
repos | list of string | yes | list of additional repositories to be enabled during the build |
Note
all following examples assume that we use cl as an instance of client_v2.client.CoprClient
>>> plist_1 = cl.project.get_list(limit=10)
# filter by name
>>> plist_2 = cl.project.get_list(name="copr")
# search by string
>>> plist_2 = cl.project.get_list(search_query="copr")
>>> p = cl.projects.get_one(1835)
>>> p.description = "Nothing"
>>> p.update()
>>> p.delete()
Note
Here you could also provide list of chroots, which should be activated. Use key chroots.
>>> res = cl.projects.create(name="my_cool_project",
owner="vgologuz",
instructions="don't touch me!",
chroots=["fedora-22-x86_64"])
>>> print(res)
<Project #5384: vgologuz/my_cool_project>
Note
see also Project chroot
# get all lists
>>> chroots = p.get_project_chroot_list()
>>> print("\n".join(map(str, chroots)))
<Project chroot: fedora-21-x86_64, additional packages: [], comps size if any: 0>
<Project chroot: fedora-21-i386, additional packages: [], comps size if any: 0>
# get one chroot
>>> chroot_1 = p.get_project_chroot("fedora-22-i386")
# enable chroot for project
>>> p.enable_project_chroot("fedora-22-x86_64)
Note
see also Build
>>> p.get_builds(limit=5)
>>> pbuilds = p.get_builds(limit=5)
>>> print(pbuilds[3])
<Build #138414 state: failed>
# submit new builds
>>> p.create_build_from_url(srpm_url="http://example.com/my.src.rpm")
>>> p.create_build_from_file(file_path="/tmp/my.src.rpm")