Handlers¶
Project¶
-
class
copr.client_v2.handlers.
ProjectHandle
(client, nc, root_url, projects_href)[source]¶ -
get_list
(search_query=None, owner=None, name=None, limit=None, offset=None)[source]¶ Retrieves projects object according to the given parameters
- Parameters
search_query (str) – search projects with such string
owner (str) – owner username
name (str) – project name
limit (int) – limit number of projects
offset (int) – number of projects to skip
- Return type
-
get_one
(project_id)[source]¶ Retrieves project object.
- Parameters
project_id (int) – project identifier
- Return type
-
create
(name, owner, chroots, description=None, instructions=None, homepage=None, contact=None, disable_createrepo=None, build_enable_net=None, repos=None)[source]¶ Creates new project
- Parameters
name – project name
owner – username
chroots – list of mock chroot to be used in project
description –
instructions –
homepage –
contact –
disable_createrepo (bool) –
build_enable_net (bool) –
repos – list of additional repos enabled for builds
- Return type
-
update
(project_entity)[source]¶ Updates project.
- Parameters
project_entity (
ProjectEntity
) – project entity to use for update- Return type
-
delete
(project_id)[source]¶ Deletes project.
- Parameters
project_id (int) – project identifier
- Return type
-
Project chroot¶
-
class
copr.client_v2.handlers.
ProjectChrootHandle
(client, nc, root_url)[source]¶ -
-
get_one
(project, name)[source]¶ Retrieves project chroot object.
- Parameters
project (
Project
) – parent project for the chrootname (str) – chroot name
- Return type
-
get_list
(project)[source]¶ Retrieves project chroot list object.
- Parameters
project (
Project
) – parent project for the chroot- Return type
-
disable
(project, name)[source]¶ Disables one chroot for the project
- Parameters
project (
Project
) – parent project for the chrootname (str) – chroot name to disable
-
enable
(project, name, buildroot_pkgs=None)[source]¶ Enables one chroot for the project
- Parameters
project (
Project
) – parent project for the chrootname (str) – chroot name to enable
- Params buildroot_pkgs
packages to add into the buildroot
- Return type
-
update
(project, chroot_entity)[source]¶ - Parameters
chroot_entity (
entities.ProjectChrootEntity
) – Entity to update- Return type
-
Build¶
-
class
copr.client_v2.handlers.
BuildHandle
(client, nc, root_url, builds_href)[source]¶ -
get_one
(build_id)[source]¶ Retrieves builds object
- Parameters
build_id (int) – id of the target build
- Return type
-
get_list
(project_id=None, owner=None, limit=None, offset=None)[source]¶ Retrieves builds object according to the given parameters
- Parameters
owner – name of the project owner
project_id – id of the project
limit – limit number of builds
offset – number of builds to skip
- Return type
-
cancel
(build_entity)[source]¶ Cancels the given build
- Parameters
build_entity (
BuildEntity
) – build entity to delete- Return type
-
delete
(build_id)[source]¶ Deletes the given build
- Parameters
build_id (int) – build id to delete
- Return type
-
create_from_url
(project_id, srpm_url, chroots=None, enable_net=True)[source]¶ Creates new build using public url to the srpm file
- Parameters
project_id (int) – id of the project where we want to submit new build
srpm_url (str) – url to the source rpm
chroots (list) – which chroots should be used during the build
enable_net (bool) – allows to disable network access during the build, default: True
- Returns
created build
- Return type
-
create_from_file
(project_id, file_path=None, file_obj=None, file_name=None, chroots=None, enable_net=True)[source]¶ Creates new build using srpm upload, please specify either
file_path
or (file_obj
,file_name
).- Parameters
project_id (int) – id of the project where we want to submit new build
file_path (str) – path to the srpm file
file_obj (file) – file-like object to read from
file_name (str) – name for the uploaded file
chroots (list) – which chroots should be used during the build
enable_net (bool) – allows to disable network access during the build, default: True
- Returns
created build
- Return type
-
Build task¶
-
class
copr.client_v2.handlers.
BuildTaskHandle
(client, nc, root_url, build_tasks_href)[source]¶ -
get_list
(owner=None, project_id=None, build_id=None, state=None, offset=None, limit=None)[source]¶ Retrieves build tasks list according to the given parameters
- Parameters
owner (str) – build tasks from the project owner by this user
project_id (int) – get tasks only from this project, when used query parameter
owner
is ignoredbuild_id (int) – get tasks only from this build, when used query parameters
owner
andproject_id
are ignoredstate (str) – get build tasks only with this state, allowed values:
failed
,succeeded
,canceled
,running
,pending
,starting
,importing
limit (int) – limit number of projects
offset (int) – number of projects to skip
- Return type
-
Mock chroot¶
-
class
copr.client_v2.handlers.
MockChrootHandle
(client, nc, root_url, href)[source]¶ -
get_one
(name)[source]¶ Retrieves mock chroot object.
- Parameters
name (str) – chroot name
- Return type
-