Git Repos

class Git_Repos(session_kwargs, client, return_type='raw')

Civis API /git_repos endpoint:

import civis
client = civis.APIClient()
# Call client.git_repos.<method>(<arguments>) to make a request, e.g.:
client.git_repos.list(...)

Methods

delete(id)

Remove the bookmark on a git repository

get(id)

Get a bookmarked git repository

get_refs(id)

Get all branches and tags of a bookmarked git repository

list(*[, limit, page_num, order, order_dir, ...])

List bookmarked git repositories

list_refs(id)

Get all branches and tags of a bookmarked git repository

post(repo_url)

Bookmark a git repository

delete(id: int) Response

Remove the bookmark on a git repository

API URL: DELETE /git_repos/{id}

Parameters:
idint

The ID for this git repository.

Returns:
None

Response code 204: success

get(id: int) Response

Get a bookmarked git repository

API URL: GET /git_repos/{id}

Parameters:
idint

The ID for this git repository.

Returns:
civis.Response
  • idint

    The ID for this git repository.

  • repo_urlstr

    The URL for this git repository.

  • created_at : str (time)

  • updated_at : str (time)

get_refs(id: int) Response

Get all branches and tags of a bookmarked git repository

API URL: GET /git_repos/{id}/refs

Parameters:
idint

The ID for this git repository.

Returns:
civis.Response
  • branchesList[str]

    List of branch names of this git repository.

  • tagsList[str]

    List of tag names of this git repository.

list(*, limit: int = None, page_num: int = None, order: str = None, order_dir: str = None, iterator: bool = None) ListResponse | PaginatedResponse

List bookmarked git repositories

API URL: GET /git_repos

Parameters:
limitint, optional

Number of results to return. Defaults to 20. Maximum allowed is 100.

page_numint, optional

Page number of the results to return. Defaults to the first page, 1.

orderstr, optional

The field on which to order the result set. Defaults to repo_url. Must be one of: repo_url, created_at.

order_dirstr, optional

Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc.

iteratorbool, optional

If True, return a generator (specifically, a civis.PaginatedResponse object) to iterate over all responses. Use it when more results than the maximum allowed by ‘limit’ are needed. When True, ‘page_num’ is ignored. If False, return a civis.ListResponse object (= a list of civis.Response objects), whose size is determined by ‘limit’. Defaults to False.

Returns:
civis.ListResponse | civis.PaginatedResponse
  • idint

    The ID for this git repository.

  • repo_urlstr

    The URL for this git repository.

  • created_at : str (time)

  • updated_at : str (time)

list_refs(id: int) ListResponse

Get all branches and tags of a bookmarked git repository

API URL: GET /git_repos/{id}/refs

Warning

The method name <client>.git_repos.list_refs is deprecated and will be removed at civis-python v3.0.0 (no release timeline yet). Please switch to <client>.git_repos.get_refs for the same method.

Parameters:
idint

The ID for this git repository.

Returns:
civis.Response
  • branchesList[str]

    List of branch names of this git repository.

  • tagsList[str]

    List of tag names of this git repository.

post(repo_url: str) Response

Bookmark a git repository

API URL: POST /git_repos

Parameters:
repo_urlstr

The URL for this git repository.

Returns:
civis.Response
  • idint

    The ID for this git repository.

  • repo_urlstr

    The URL for this git repository.

  • created_at : str (time)

  • updated_at : str (time)