cicd.core
cicd.core.action
cicd.core.cli
cicd.core.client
- class cicd.core.client.Client
Bases:
objectBase class that provides building blocks for API wrappers.
Clients are per-class singletons.
- BASE_URL: str | None = None
- config(base_url: str | None = None, token: str | None = None, **kwargs) T
Config the client.
- Parameters:
base_url – The base url of the APIs.
token – The API token used in each request.
- Returns:
The current client.
- make_headers() Dict[str, Any]
Make up headers for each requests.
Subclasses override this function to append/modify request headers.
- make_paging_params(paging: int | Tuple[int, int] | List[int]) Dict[str, Any]
Make up paging params for request params.
- request(endpoint: str, method: str = 'get', as_type: Type[D] | None = None, to_list: bool = False, **kwargs) D | None
Make an API request.
- Parameters:
endpoint – The API endpoint.
method – The request method (default as
get).as_type – The model to which the raw content should be converted.
to_list – Whether the return value should be a list, used together with
as_type.
- Returns:
The model/list of models (if
as_typeis specified), or the json content, or the raw content.
- token: str | None = None
cicd.core.env
- class cicd.core.env.Env
Bases:
ProviderMixin- ci: bool = False
cicd.core.logger
- cicd.core.logger.default_formatter(fmt=None)
- cicd.core.logger.setup_logger(name, fmt=None) Logger