client-python icon indicating copy to clipboard operation
client-python copied to clipboard

`first` parameter is not customizable when using the `getAll` option in `list` method

Open axelfahy opened this issue 1 year ago • 0 comments

Description

When using the list method of entities with the getAll parameter, the first parameter is overwritten.

For example, trying to run:

reports = opencti_api_client.report.list(
    first=200,
    withPagination=True,
    orderBy="published",
    orderMode="desc",
    getAll=True,
)

will not fetch the report 200 by 200 since the first value is overwritten:

https://github.com/OpenCTI-Platform/client-python/blob/1b66a210300505f40dac2b27c2111c333ffc590e/pycti/entities/opencti_report.py#L281-L282

This is the same for the list method of all entities.

Environment

  1. OS (where OpenCTI server runs): pycti client
  2. OpenCTI version: pycti==5.8.7
  3. Other environment details:

Reproducible Steps

Steps to create the smallest reproducible scenario:

  1. List entities with the getAll parameter and the first parameter
  2. Observe that the first parameter has been changed.

Expected Output

I expected to be able to specify the first and the getAll parameter.

Actual Output

Number of queries done is not the one expected since the first parameter has been changed.

axelfahy avatar Sep 18 '23 13:09 axelfahy