GitProvider API#
Handle#
get_git_api#
Project.get_git_api()
Get the git repository api for the project.
Returns
GitApi
: The Git Api handle
Creation#
set_provider#
GitApi.set_provider(provider, username, token)
Configure a Git provider
import hopsworks
project = hopsworks.login()
git_api = project.get_git_api()
git_api.set_provider("GitHub", "my_user", "my_token")
- provider
str
: Name of git provider. Valid values are "GitHub", "GitLab" and "BitBucket". - username
str
: Username for the git provider service - token
str
: Token to set for the git provider service
Raises
RestAPIError
: If unable to configure the git provider
Retrieval#
get_provider#
GitApi.get_provider(provider)
Get the configured Git provider
Arguments
- provider
str
: Name of git provider. Valid values are "GitHub", "GitLab" and "BitBucket".
Returns
GitProvider
: The git provider
Raises
RestAPIError
: If unable to get the git provider
get_providers#
GitApi.get_providers()
Get the configured Git providers
Returns
List[GitProvider]
: List of git provider objects
Raises
RestAPIError
: If unable to get the git providers
Properties#
git_provider#
Name of the provider, can be GitHub, GitLab or BitBucket
username#
Username set for the provider
Methods#
delete#
GitProvider.delete()
Remove the git provider configuration.
Raises
RestAPIError
.