Documentation
¶
Overview ¶
Registers personal access token for Databricks to do operations on behalf of the user.
Index ¶
- type CreateCredentials
- type CreateCredentialsResponse
- type CredentialInfo
- type Delete
- type Get
- type GetCredentialsResponse
- type GitCredentialsAPI
- func (a *GitCredentialsAPI) Create(ctx context.Context, request CreateCredentials) (*CreateCredentialsResponse, error)
- func (a *GitCredentialsAPI) CredentialInfoGitProviderToCredentialIdMap(ctx context.Context) (map[string]int64, error)
- func (a *GitCredentialsAPI) Delete(ctx context.Context, request Delete) error
- func (a *GitCredentialsAPI) DeleteByCredentialId(ctx context.Context, credentialId int64) error
- func (a *GitCredentialsAPI) Get(ctx context.Context, request Get) (*CredentialInfo, error)
- func (a *GitCredentialsAPI) GetByCredentialId(ctx context.Context, credentialId int64) (*CredentialInfo, error)
- func (a *GitCredentialsAPI) GetByGitProvider(ctx context.Context, name string) (*CredentialInfo, error)
- func (a *GitCredentialsAPI) Impl() GitCredentialsService
- func (a *GitCredentialsAPI) ListAll(ctx context.Context) ([]CredentialInfo, error)
- func (a *GitCredentialsAPI) Update(ctx context.Context, request UpdateCredentials) error
- func (a *GitCredentialsAPI) WithImpl(impl GitCredentialsService) *GitCredentialsAPI
- type GitCredentialsService
- type UpdateCredentials
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateCredentials ¶
type CreateCredentials struct {
// Git provider. This field is case-insensitive. The available Git providers
// are awsCodeCommit, azureDevOpsServices,
GitProvider string `json:"git_provider"`
// Git username.
GitUsername string `json:"git_username,omitempty"`
// The personal access token used to authenticate to the corresponding Git
// provider.
PersonalAccessToken string `json:"personal_access_token,omitempty"`
}
type CreateCredentialsResponse ¶
type CreateCredentialsResponse struct {
// ID of the credential object in the workspace.
CredentialId int64 `json:"credential_id,omitempty"`
// Git provider. This field is case-insensitive. The available Git providers
// are awsCodeCommit, azureDevOpsServices,
GitProvider string `json:"git_provider,omitempty"`
// Git username.
GitUsername string `json:"git_username,omitempty"`
}
type CredentialInfo ¶
type CredentialInfo struct {
// ID of the credential object in the workspace.
CredentialId int64 `json:"credential_id,omitempty"`
// Git provider. This field is case-insensitive. The available Git providers
// are awsCodeCommit, azureDevOpsServices,
GitProvider string `json:"git_provider,omitempty"`
// Git username.
GitUsername string `json:"git_username,omitempty"`
}
type Delete ¶
type Delete struct {
// The ID for the corresponding credential to access.
CredentialId int64 `json:"-" url:"-"`
}
Delete a credential
type Get ¶
type Get struct {
// The ID for the corresponding credential to access.
CredentialId int64 `json:"-" url:"-"`
}
Get a credential entry
type GetCredentialsResponse ¶
type GetCredentialsResponse struct {
Credentials []CredentialInfo `json:"credentials,omitempty"`
}
type GitCredentialsAPI ¶
type GitCredentialsAPI struct {
// contains filtered or unexported fields
}
Registers personal access token for Databricks to do operations on behalf of the user.
See [more info](https://docs.databricks.com/repos/get-access-tokens-from-git-provider.html).
func NewGitCredentials ¶
func NewGitCredentials(client *client.DatabricksClient) *GitCredentialsAPI
func (*GitCredentialsAPI) Create ¶
func (a *GitCredentialsAPI) Create(ctx context.Context, request CreateCredentials) (*CreateCredentialsResponse, error)
Create a credential entry
Creates a Git credential entry for the user. Only one Git credential per user is supported, so any attempts to create credentials if an entry already exists will fail. Use the PATCH endpoint to update existing credentials, or the DELETE endpoint to delete existing credentials.
func (*GitCredentialsAPI) CredentialInfoGitProviderToCredentialIdMap ¶
func (a *GitCredentialsAPI) CredentialInfoGitProviderToCredentialIdMap(ctx context.Context) (map[string]int64, error)
CredentialInfoGitProviderToCredentialIdMap calls GitCredentialsAPI.ListAll and creates a map of results with CredentialInfo.GitProvider as key and CredentialInfo.CredentialId as value.
Returns an error if there's more than one CredentialInfo with the same .GitProvider.
Note: All CredentialInfo instances are loaded into memory before creating a map.
This method is generated by Databricks SDK Code Generator.
func (*GitCredentialsAPI) Delete ¶
func (a *GitCredentialsAPI) Delete(ctx context.Context, request Delete) error
Delete a credential
Deletes the specified Git credential.
func (*GitCredentialsAPI) DeleteByCredentialId ¶
func (a *GitCredentialsAPI) DeleteByCredentialId(ctx context.Context, credentialId int64) error
Delete a credential
Deletes the specified Git credential.
func (*GitCredentialsAPI) Get ¶
func (a *GitCredentialsAPI) Get(ctx context.Context, request Get) (*CredentialInfo, error)
Get a credential entry
Gets the Git credential with the specified credential ID.
func (*GitCredentialsAPI) GetByCredentialId ¶
func (a *GitCredentialsAPI) GetByCredentialId(ctx context.Context, credentialId int64) (*CredentialInfo, error)
Get a credential entry
Gets the Git credential with the specified credential ID.
func (*GitCredentialsAPI) GetByGitProvider ¶
func (a *GitCredentialsAPI) GetByGitProvider(ctx context.Context, name string) (*CredentialInfo, error)
GetByGitProvider calls GitCredentialsAPI.CredentialInfoGitProviderToCredentialIdMap and returns a single CredentialInfo.
Returns an error if there's more than one CredentialInfo with the same .GitProvider.
Note: All CredentialInfo instances are loaded into memory before returning matching by name.
This method is generated by Databricks SDK Code Generator.
func (*GitCredentialsAPI) Impl ¶
func (a *GitCredentialsAPI) Impl() GitCredentialsService
Impl returns low-level GitCredentials API implementation
func (*GitCredentialsAPI) ListAll ¶
func (a *GitCredentialsAPI) ListAll(ctx context.Context) ([]CredentialInfo, error)
Get Git credentials
Lists the calling user's Git credentials. One credential per user is supported.
This method is generated by Databricks SDK Code Generator.
func (*GitCredentialsAPI) Update ¶
func (a *GitCredentialsAPI) Update(ctx context.Context, request UpdateCredentials) error
Update a credential
Updates the specified Git credential.
func (*GitCredentialsAPI) WithImpl ¶
func (a *GitCredentialsAPI) WithImpl(impl GitCredentialsService) *GitCredentialsAPI
WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks.
type GitCredentialsService ¶
type GitCredentialsService interface {
// Create a credential entry
//
// Creates a Git credential entry for the user. Only one Git credential per
// user is supported, so any attempts to create credentials if an entry
// already exists will fail. Use the PATCH endpoint to update existing
// credentials, or the DELETE endpoint to delete existing credentials.
Create(ctx context.Context, request CreateCredentials) (*CreateCredentialsResponse, error)
// Delete a credential
//
// Deletes the specified Git credential.
Delete(ctx context.Context, request Delete) error
// Get a credential entry
//
// Gets the Git credential with the specified credential ID.
Get(ctx context.Context, request Get) (*CredentialInfo, error)
// Get Git credentials
//
// Lists the calling user's Git credentials. One credential per user is
// supported.
//
// Use ListAll() to get all CredentialInfo instances
List(ctx context.Context) (*GetCredentialsResponse, error)
// Update a credential
//
// Updates the specified Git credential.
Update(ctx context.Context, request UpdateCredentials) error
}
Registers personal access token for Databricks to do operations on behalf of the user.
See [more info](https://docs.databricks.com/repos/get-access-tokens-from-git-provider.html).
type UpdateCredentials ¶
type UpdateCredentials struct {
// The ID for the corresponding credential to access.
CredentialId int64 `json:"-" url:"-"`
// Git provider. This field is case-insensitive. The available Git providers
// are awsCodeCommit, azureDevOpsServices,
GitProvider string `json:"git_provider,omitempty"`
// Git username.
GitUsername string `json:"git_username,omitempty"`
// The personal access token used to authenticate to the corresponding Git
// provider.
PersonalAccessToken string `json:"personal_access_token,omitempty"`
}