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)

Configure a Git provider

import hopsworks

project = hopsworks.login()

git_api = project.get_git_api()

git_api.set_provider("GitHub", "my_user", "my_token")
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

Raises

  • RestAPIError: If unable to configure the git provider

Retrieval#

[source]

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

[source]

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#

[source]

git_provider#

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


[source]

username#

Username set for the provider


Methods#

[source]

delete#

GitProvider.delete()

Remove the git provider configuration.

Raises

RestAPIError.