saltext.github.utils.gh.rulesets¶
Operations on GitHub repository and organization rulesets.
- saltext.github.utils.gh.rulesets.build_path(ruleset_type, *, owner=None, repo_name=None, org_name=None, ruleset_id=None)[source]¶
Build the API path for ruleset operations.
- ruleset_type
Ruleset type, either
repoororg.- owner
Owner of the repository. Required for
reporulesets (the calling functions default it to the connection’s owner).- repo_name
Repo name. Required for
reporulesets.- org_name
Org name. Required for
orgrulesets (the calling functions default it to the connection’s owner).- ruleset_id
ID of a specific ruleset to address.
- saltext.github.utils.gh.rulesets.check_params(ruleset_params, required=None)[source]¶
Ensure a ruleset parameter payload is a mapping and contains all required keys.
- ruleset_params
Payload to check.
- required
Optional set of parameter names that must be present.
- saltext.github.utils.gh.rulesets.list_all(conn, ruleset_type, *, owner=None, repo_name=None, org_name=None, headers=None, per_page=None)[source]¶
Return all rulesets of a repository or organization.
- conn
GitHubConnectionto use.
Other parameters as described in
build_path().headersis a mapping of extra headers to send.
- saltext.github.utils.gh.rulesets.get(conn, ruleset_id, ruleset_type, *, owner=None, repo_name=None, org_name=None, headers=None)[source]¶
Return the data of a specific ruleset.
- conn
GitHubConnectionto use.- ruleset_id
ID of the ruleset to retrieve.
Other parameters as described in
build_path().headersis a mapping of extra headers to send.
- saltext.github.utils.gh.rulesets.create(conn, ruleset_params, ruleset_type, *, owner=None, repo_name=None, org_name=None, headers=None)[source]¶
Create a new ruleset. Returns the data of the created ruleset.
- conn
GitHubConnectionto use.- ruleset_params
Ruleset definition. Must contain at least
nameandenforcement.
Other parameters as described in
build_path().headersis a mapping of extra headers to send.
- saltext.github.utils.gh.rulesets.update(conn, ruleset_id, ruleset_params, ruleset_type, *, owner=None, repo_name=None, org_name=None, headers=None)[source]¶
Update an existing ruleset. Returns the data of the updated ruleset.
- conn
GitHubConnectionto use.- ruleset_id
ID of the ruleset to update.
- ruleset_params
Updated ruleset definition.
Other parameters as described in
build_path().headersis a mapping of extra headers to send.
- saltext.github.utils.gh.rulesets.delete(conn, ruleset_id, ruleset_type, *, owner=None, repo_name=None, org_name=None, headers=None)[source]¶
Delete a ruleset.
- conn
GitHubConnectionto use.- ruleset_id
ID of the ruleset to delete.
Other parameters as described in
build_path().headersis a mapping of extra headers to send.