Resources — python-copr 1.63 documentation

# Resources

## Project

see entity attributes at Project entity attributes.

class `copr.client_v2.resources.` `Project`(entity, handle, **kwargs)

  `update`()

    Updates project using the current state.

    Shortcut for for `ProjectHandle.update()`

    Return type: | `OperationResult`

  `delete`()

    Updates project using the current state

    Return type: | `OperationResult`

  `get_self`()

    Retrieves fresh project object from the service

    Return type: | `Project`

  `get_builds`(**query_options)

    Get builds owned by this project

    Parameters: | query_options – see `handlers.BuildHandle.get_list()`
    Return type: | `BuildsList`

  `get_build_tasks`(**query_options)

    Get build tasks owned by this project

    Parameters: | query_options – see `handlers.BuildHandle.get_list()`
    Return type: | `BuildTasksList`

  `get_project_chroot`(name)

    Retrieves project chroot object by the given name

    Parameters: | name (str) – mock chroot name
    Return type: | `ProjectChroot`

  `get_project_chroot_list`()

    Retrieves project chroots list

    Return type: | `ProjectChrootList`

  `enable_project_chroot`(name)

    Enables given chroot for this project

    Shortcut for for `ProjectChrootHandle.enable()`

    Parameters: | name (str) – mock chroot name
    Return type: | `OperationResult`

  `create_build_from_file`(*args, **kwargs)

    Shortcut for `BuildHandle.create_from_file()` (here you don’t need to specify project_id)

  `create_build_from_url`(*args, **kwargs)

    Shortcut for `BuildHandle.create_from_file()` (here you don’t need to specify project_id)

class `copr.client_v2.resources.` `ProjectList`(handle, **kwargs)

  `next_page`()

    Retrieves next chunk of the Project list for the same query options

    Return type: | `ProjectList`

  `projects`

    Return type: | list of `Project`

## Project chroot

see entity attributes at Project chroot entity attributes.

class `copr.client_v2.resources.` `ProjectChroot`(entity, handle, project, **kwargs)

  `disable`()

    Disables chroot for the bound project

    Return type: | `OperationResult`

  `update`()

    Updates chroot with the current entity state

    Return type: | `OperationResult`

class `copr.client_v2.resources.` `ProjectChrootList`(handle, project, **kwargs)

  List of the `ProjectChroot` in the one Project.

  `chroots`

    Return type: | list of `ProjectChroot`

  `enable`(name)

    Enables mock chroot for the current project

    Return type: | `OperationResult`

## Build

see entity attributes at Build entity attributes.

class `copr.client_v2.resources.` `Build`(entity, handle, **kwargs)

  `get_self`()

    Retrieves fresh build object from the service

    Return type: | `Build`

  `cancel`()

    Updates the current build

    Return type: | `OperationResult`

  `delete`()

    Deletes the current build

    Return type: | `OperationResult`

  `get_build_tasks`(**query_options)

    Get build tasks owned by this build

    Parameters: | query_options – see `handlers.BuildHandle.get_list()`
    Return type: | `BuildTasksList`

class `copr.client_v2.resources.` `BuildList`(handle, **kwargs)

  `next_page`()

    Retrieves next chunk of the Build list for the same query options

    Return type: | `BuildList`

  `builds`

    Return type: | `BuildList`

## Build task

see entity attributes at Build task entity attributes.

class `copr.client_v2.resources.` `BuildTask`(entity, handle, **kwargs)

  `get_self`()

    Retrieves fresh build task object from the service

    Return type: | `Build`

class `copr.client_v2.resources.` `BuildTaskList`(handle, **kwargs)

  List of build tasks

  `build_tasks`

    Return type: | list of `BuildTask`

## Mock chroot

see entity attributes at Mock chroot entity attributes.

class `copr.client_v2.resources.` `MockChroot`(entity, handle, **kwargs)

class `copr.client_v2.resources.` `MockChrootList`(handle, **kwargs)

  List of the mock chroots supported by the service

  `chroots`

    Return type: | list of `MockChroot`

## Operation result

class `copr.client_v2.resources.` `OperationResult`(handle, response=None, entity=None, options=None, expected_status=200)

  Fake resource to represent results of the requested operation

  `new_location`

    Contains an url to the new location produced by an operation If operation doesn’t produce a new location would contain None

    Return type: | str

  `is_successful`()

    Performs check if status code is equal to the expected value of particular request.

    Return type: | bool