API Reference#

class cirun.Cirun(token=None)[source]#

Cirun Client to interact to cirun’s API

add_repo_to_resources(org, repo, resources, teams=None, roles=None, users=None, users_from_json=None, policy_args=None)[source]#

Grants access to the resource for the repository

Parameters#

org: str

GitHub Organization

repo: str

GitHub Repository

resources: List[str]

List of resources

teams: List[str]

List of teams

roles: List[str]

List of roles

users: List[str]

List of users

users_from_json: List[str]

List of users from a json url

policy_args: Optional[Dict[str, Any]]

Policy arguments, this is a dictionary of key values, currently the only supported argument is {"pull_request": True} or {"pull_request": False}

Returns#

requests.Response

cloud_connect(name, credentials, print_error=False)[source]#

Connect a cloud provider to cirun.

Parameters#

name: str

Name of cloud provider

credentials: str

Cloud Credentials

Returns#

dict:

Response json

clouds(print_error=False)[source]#

Returns all the connected cloud

get_repos(print_error=False)[source]#

Get all the repositories connected to cirun.

remove_repo_from_resources(org, repo, resources)[source]#

Removes the access to the resource for the repository.

Parameters#

org: str

GitHub Organization

repo: str

GitHub Repository

resources: List[str]

List of resources

Returns#

requests.Response

set_repo(name, active=True, print_error=False, installation_id=None)[source]#

Activate repository for Cirun

Parameters#

name: str

Repository name

active: bool

True to activate, False otherwise. Default is True

installation_id: int

Cirun App’s Installation ID for the Organization

Returns#

dict