Skip to content

Garbage Collection

get_gc_schedule() async

Get Garbage Collection schedule.

Returns:

Type Description
Schedule

The gc's schedule.

create_gc_schedule(schedule) async

Create a Garbage Collection schedule.

Parameters:

Name Type Description Default
schedule Schedule

The schedule to create

required

Returns:

Type Description
str

The location of the created schedule.

update_gc_schedule(schedule) async

Update the Garbage Collection schedule.

Parameters:

Name Type Description Default
schedule Schedule

The new schedule to set

required

get_gc_jobs(query=None, sort=None, page=1, page_size=10, limit=None) async

Get Garbage Collection history for all jobs, optionally filtered by query.

Parameters:

Name Type Description Default
query Optional[str]

A query string to filter the Garbage Collection results logs.

Supported query patterns are:

* exact match(`"k=v"`)
* fuzzy match(`"k=~v"`)
* range(`"k=[min~max]"`)
* list with union releationship(`"k={v1 v2 v3}"`)
* list with intersection relationship(`"k=(v1 v2 v3)"`).

The value of range and list can be:

* string(enclosed by `"` or `'`)
* integer
* time(in format `"2020-04-09 02:36:00"`)

All of these query patterns should be put in the query string and separated by ",". e.g. "k1=v1,k2=~v2,k3=[min~max]"

None
sort Optional[str]

The sort order of the logs.

None
page int

The page of results to return

1
page_size int

The number of results to return per page

10
limit Optional[int]

The maximum number of results to return.

None

Returns:

Type Description
List[GCHistory]

List of Garbage Collection logs.

get_gc_job(gc_id) async

Get a specific Garbage Collection job.

Parameters:

Name Type Description Default
gc_id int

The ID of the Garbage Collection job to get information about.

required

Returns:

Type Description
GCHistory

Information about the Garbage Collection job.

get_gc_log(gc_id, as_list=True) async

Get log output for a specific Garbage Collection job.

Results are returned as a list of lines, or as a single string if as_list is False.

Parameters:

Name Type Description Default
gc_id int

The ID of the Garbage Collection job to get the log for

required
as_list bool

If True, return the log as a list of lines, otherwise as single string.

True

Returns:

Type Description
Union[List[str], str]

The log output for the Garbage Collection job.