gerrit.config package

Submodules

gerrit.config.caches module

class gerrit.config.caches.Cache(name: str, gerrit)[source]

Bases: object

flush()[source]

Flushes a cache.

Returns:

class gerrit.config.caches.Caches(gerrit)[source]

Bases: object

flush(name)[source]

Flushes a cache.

Parameters:

name – cache name

Returns:

get(name)[source]

Retrieves information about a cache.

Parameters:

name – cache name

Returns:

list()[source]

Lists the caches of the server. Caches defined by plugins are included.

Returns:

operation(input_)[source]

Cache Operations

input_ = {
    "operation": "FLUSH_ALL"
}
gerrit.config.caches.operation(input_)
Parameters:

input – the CacheOperationInput entity, https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#cache-operation-input

Returns:

gerrit.config.config module

class gerrit.config.config.GerritConfig(gerrit)[source]

Bases: object

property caches
check_consistency(input_)[source]

Runs consistency checks and returns detected problems.

input_ = {
    "check_accounts": {},
    "check_account_external_ids": {}
}
result = client.config.check_consistency(input_)
Parameters:

input – the ConsistencyCheckInput entity, https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#consistency-check-input

Returns:

confirm_email(input_)[source]

Confirms that the user owns an email address. If the token is invalid or if it’s the token of another user the request fails and the response is ‘422 Unprocessable Entity’.

input_ = {
    "token": "Enim+QNbAo6TV8Hur8WwoUypI6apG7qBPvF+bw==$MTAwMDAwNDp0ZXN0QHRlc3QuZGU="
}
result = client.config.confirm_email(input_)
Parameters:

input – the EmailConfirmationInput entity, https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#email-confirmation-input

Returns:

get_default_diff_preferences()[source]

Returns the default diff preferences for the server.

Returns:

get_default_edit_preferences()[source]

Returns the default edit preferences for the server.

Returns:

get_default_user_preferences()[source]

Returns the default user preferences for the server.

Returns:

get_server_info()[source]

get the information about the Gerrit server configuration.

Returns:

get_summary(option=None)[source]

Retrieves a summary of the current server state.

Parameters:

option – query option.such as jvm or gc

Returns:

get_top_menus()[source]

Returns the list of additional top menu entries.

Returns:

get_version()[source]

get the version of the Gerrit server.

Returns:

index_changes(input_)[source]

Index a set of changes

input_ = {changes: ["foo~101", "bar~202"]}
gerrit.config.index_changes(input_)
Parameters:

input – the IndexChangesInput entity, https://gerrit-review.googlesource.com/Documentation/rest-api-config.html#index-changes-input

Returns:

list_capabilities()[source]

Lists the capabilities that are available in the system. There are two kinds of capabilities: core and plugin-owned capabilities.

Returns:

reload_config()[source]

Reloads the gerrit.config configuration.

Returns:

set_default_diff_preferences(input_)[source]

Sets the default diff preferences for the server.

input_ = {
    "context": 10,
    "tab_size": 8,
    "line_length": 80,
    "cursor_blink_rate": 0,
    "intraline_difference": true,
    "show_line_endings": true,
    "show_tabs": true,
    "show_whitespace_errors": true,
    "syntax_highlighting": true,
    "auto_hide_diff_table_header": true,
    "theme": "DEFAULT",
    "ignore_whitespace": "IGNORE_NONE"
}
result = client.config.set_default_diff_preferences(input_)
Parameters:

input – the DiffPreferencesInput entity, https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#diff-preferences-input

Returns:

set_default_edit_preferences(input_)[source]

Sets the default edit preferences for the server.

input_ = {
    "tab_size": 8,
    "line_length": 80,
    "indent_unit": 2,
    "cursor_blink_rate": 0,
    "show_tabs": true,
    "syntax_highlighting": true,
    "match_brackets": true,
    "auto_close_brackets": true,
    "theme": "DEFAULT",
    "key_map_type": "DEFAULT"
}
result = client.config.set_default_edit_preferences(input_)
Parameters:

input – the EditPreferencesInfo entity, https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#edit-preferences-input

Returns:

set_default_user_preferences(input_)[source]

Sets the default user preferences for the server.

input_ = {
    "changes_per_page": 50
}
result = client.config.set_default_user_preferences(input_)
Parameters:

input – the PreferencesInput entity, https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#preferences-input

Returns:

property tasks

gerrit.config.tasks module

class gerrit.config.tasks.Task(task_id: str, gerrit)[source]

Bases: object

delete()[source]

Kills a task from the background work queue that the Gerrit daemon is currently performing, or will perform in the near future.

Returns:

class gerrit.config.tasks.Tasks(gerrit)[source]

Bases: object

delete(id_)[source]

Kills a task from the background work queue that the Gerrit daemon is currently performing, or will perform in the near future.

Parameters:

id – task id

Returns:

get(id_)[source]

Retrieves a task from the background work queue that the Gerrit daemon is currently performing, or will perform in the near future.

Parameters:

id – task id

Returns:

list()[source]

Lists the tasks from the background work queues that the Gerrit daemon is currently performing, or will perform in the near future.

Returns:

Module contents