CoprClient — python-copr 1.48 documentation

### Navigation

- index
- next |
- previous |
- python-copr 1.48 documentation »

# CoprClient

class `copr.client.client.` `CoprClient`(config=None)

  Main interface to the copr service

  Variables: | username (unicode) – username used by default for all requests login (unicode) – user login, used for identification token (unicode) – copr api token copr_url (unicode) – used as copr projects root

  Could be created:
    - directly by providing a dict with credentionals
    - using static method `CoprClient.create_from_file_config()`
  static `create_from_file_config`(filepath=None)

    Creates Copr client using the information from the config file.

    Parameters: | filepath (str) – specifies config location, default: “~/.config/copr”
    Return type: | `CoprClient`

  `create_project`(projectname, chroots, description=None, instructions=None, repos=None, initial_pkgs=None)

    Creates a new copr project Auth required.

    Parameters: | projectname – Copr project name chroots – List of target chroots description – [optional] Project description instructions – [optional] Instructions for end users
    Returns: | `CoprResponse` with additional fields: handle: `ProjectHandle` text fields: “message”

  `get_project_details`(projectname, username=None)

    Returns project details

    Parameters: | projectname – Copr projectname username – [optional] use alternative username
    Returns: | `CoprResponse` with additional fields: text fields: “description”, “instructions”, “last_modified”, “name” chroots_list: list of `ProjectChrootWrapper`

  `delete_project`(projectname, username=None)

    Deletes the entire project. Auth required.

    Parameters: | projectname – Copr projectname username – [optional] use alternative username
    Returns: | `CoprResponse` with additional fields: text fields: “message”

  `modify_project`(projectname, username=None, description=None, instructions=None, repos=None)

    Modifies main project configuration. Auth required.

    Parameters: | projectname – Copr project name username – [optional] use alternative username description – [optional] project description instructions – [optional] instructions for end users repos – [optional] list of additional repos to be used during the build process
    Returns: | `CoprResponse` with additional fields: handle: `ProjectHandle` text fields: “buildroot_pkgs”

  `get_projects_list`(username=None)

    Returns list of projects created by the user

    Parameters: | username – [optional] use alternative username
    Returns: | `CoprResponse` with additional fields: projects_list: list of `ProjectWrapper`

  `create_new_build`(projectname, pkgs, username=None, timeout=None, memory=None, chroots=None)

    Creates new build

    Parameters: | projectname – name of Copr project (without user namespace) pkgs – list of packages to include in build username – [optional] use alternative username timeout – [optional] build timeout memory – [optional] amount of required memory for build process chroots – [optional] build only with given chroots
    Returns: | `CoprResponse` with additional fields: builds_list: list of `BuildWrapper`

  `get_build_details`(build_id, projectname=None, username=None)

    Returns build details.

    Parameters: | build_id (int) – Build identifier projectname – [optional] Copr project name username – [optional] Copr project owner
    Returns: | `CoprResponse` with additional fields: handle: `BuildHandle` text fields: “project”, “owner”, “status”, “results”, “submitted_on”, “started_on”, “ended_on”, “built_pkgs”, “src_pkg”, “src_version”

  `cancel_build`(build_id, projectname=None, username=None)

    Cancels build. Auth required. If build can’t be canceled do nothing.

    Parameters: | build_id (int) – Build identifier projectname – [optional] Copr project name username – [optional] Copr project owner
    Returns: | `CoprResponse` with additional fields: handle: `BuildHandle` text fields: “status”

  `get_project_chroot_details`(projectname, chrootname, username=None)

    Returns details of chroot used in project

    Parameters: | projectname – Copr project name chrootname – chroot name username – [optional] use alternative username
    Returns: | `CoprResponse` with additional fields: handle: `ProjectChrootHandle` text fields: “buildroot_pkgs”

  `modify_project_chroot_details`(projectname, chrootname, pkgs=None, username=None)

    Modifies chroot used in project

    Parameters: | projectname – Copr project name chrootname – chroot name username – [optional] use alternative username
    Returns: | `CoprResponse` with additional fields: handle: `ProjectChrootHandle` text fields: “buildroot_pkgs”

  `search_projects`(query)

    Search projects by substring

    Parameters: | query – substring to search
    Returns: | `CoprResponse` with additional fields: projects_list: list of `ProjectWrapper`

### Navigation

- index
- next |
- previous |
- python-copr 1.48 documentation »