xia_engine_gitlab.engine_notes.GitlabNoteEngineClient
- class xia_engine_gitlab.engine_notes.GitlabNoteEngineClient(api_host: str, api_token: str, **kwargs)
Bases:
GitlabEngineClient- __init__(api_host: str, api_token: str, **kwargs)
Methods
__init__(api_host, api_token, **kwargs)check_file_exists(project_id, branch, path)check_response(response)commit_file(project_id, branch, path, ...[, ...])create_branch(project_id, branch_name, ref)create_merge_request(project_id, title, ...)create_note(project_name, parent_name, ...)Create note page
delete_branch(project_id, branch_name)get_branch_info(project_id, branch_name)get_default_branch_from_name(api_endpoint, ...)Get default branch name from the given name
get_file_content(project_id, branch, path[, ...])Get file content
get_group_id_from_name(api_endpoint, ...)get_issue_branch_name(issue_name, issue_iid)get_issue_commit_name(issue_name, issue_iid)get_issue_iid_from_name(api_endpoint, ...)get_issue_mr_name(issue_name, issue_iid)get_merge_request_commits(project_id, title)get_milestone_branch_name(milestone_name)get_milestone_id_from_name(api_endpoint, ...)get_milestone_info_from_issue(api_endpoint, ...)get_milestone_mr_name(milestone_name)get_mr_iid_from_branch(api_endpoint, ...[, ...])get_mr_iid_from_name(api_endpoint, ...)get_mr_iid_from_title(api_endpoint, ...)get_note(project_name, parent_name, note_id)Update note page
get_project_id_from_name(api_endpoint, ...)merge_merge_request(project_id, title[, ...])pipeline_exists(api_endpoint, api_token, ...)rebase_merge_request(project_id, title)split_header_body(full_content)update_note(project_name, parent_name, ...)Update Note
Attributes
cost_ratio- create_note(project_name: str, parent_name: str, note_content: str, cost: float = 0.0, cost_description: str = '')
Create note page
- Parameters
project_name – Project name
parent_name – Parent name which could hold the note
note_content – database content
cost – Cost of the note, only supported for issue based note and merge request based note
cost_description – Cost description
- classmethod get_default_branch_from_name(api_endpoint: str, api_token: str, project_id: int) str
Get default branch name from the given name
- Parameters
api_endpoint –
api_token –
project_id –
Returns:
- get_file_content(project_id, branch: str, path: str, with_encoding: bool = False)
Get file content
- Returns
when with_encoding is true and the content is binary, will return base64 string instead binary result
- get_note(project_name: str, parent_name: str, note_id: int)
Update note page
- Parameters
project_name – Project name
parent_name – Parent name which could hold the note
note_id – Note ID
- update_note(project_name: str, parent_name: str, note_id: int, note_content: str)
Update Note
- Parameters
project_name – Project name
parent_name – Parent name which could hold the note
note_id – Note ID
note_content – Note content