Skip to content

GitProvider API#

Handle#

[source]

get_git_api#

Project.get_git_api()

Get the git repository api for the project.

Returns

GitApi: The Git Api handle


Creation#

[source]

set_provider#

GitApi.set_provider(provider, username, token, host=None)

Configure a Git provider

import hopsworks

project = hopsworks.login()

git_api = project.get_git_api()

git_api.set_provider("GitHub", "my_user", "my_token", host="github.com")
Arguments

  • 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
  • host str: host for the git provider e.g. github.com for GitHub, gitlab.com for GitLab, bitbucket.org for BitBucket

Raises

  • hopsworks.client.exceptions.RestAPIError: If the backend encounters an error when handling the request

Retrieval#

[source]

get_provider#

GitApi.get_provider(provider, host=None)

Get the configured Git provider

Arguments

  • provider str: Name of git provider. Valid values are "GitHub", "GitLab" and "BitBucket".
  • host str: Optional host for the git provider e.g. github.com for GitHub, gitlab.com for GitLab, bitbucket.org for BitBucket

Returns

GitProvider: The git provider or None if it does not exist.

Raises

  • hopsworks.client.exceptions.RestAPIError: If the backend encounters an error when handling the request

[source]

get_providers#

GitApi.get_providers()

Get the configured Git providers

Returns

List[GitProvider]: List of git provider objects

Raises

  • hopsworks.client.exceptions.RestAPIError: If the backend encounters an error when handling the request

Properties#

[source]

git_provider#

Name of the provider, can be GitHub, GitLab or BitBucket


[source]

host#

Host of the provider, can be for example github.com for GitHub, gitlab.com for GitLab or bitbucket.org for BitBucket


[source]

username#

Username set for the provider


Methods#

[source]

delete#

GitProvider.delete()

Remove the git provider configuration.

Raises

  • hopsworks.client.exceptions.RestAPIError: If the backend encounters an error when handling the request