ExDaytona.Api.Git (ex_daytona v0.4.0)

Copy Markdown View Source

API calls for all endpoints tagged Git.

Summary

Functions

Add files to Git staging Add files to the Git staging area

Add a remote Add (or overwrite) a remote in the Git repository

Authenticate Git Persist Git credentials globally via the credential store. Stores the password in plaintext on disk.

Checkout branch or commit Switch to a different branch or commit in the Git repository

Clone a Git repository Clone a Git repository to the specified path. Defaults to strict TLS verification; set insecure_skip_tls=true to skip verification for self-signed or private-CA Git servers.

Commit changes Commit staged changes to the Git repository

Configure Git user Configure the Git user name and email at the given scope

Create a new branch Create a new branch in the Git repository

Delete a branch Delete a branch from the Git repository

Get commit history Get the commit history of the Git repository

Get a Git config value Get a Git config value at the given scope (null when unset)

Get Git status Get the Git status of the repository at the specified path

Initialize a Git repository Initialize a new Git repository at the specified path

List branches Get a list of all branches in the Git repository

List remotes List the remotes configured in the Git repository

Pull changes from remote Pull changes from the remote Git repository

Push changes to remote Push local changes to the remote Git repository

Reset repository Reset the current HEAD to the specified state

Restore files Restore working tree files or unstage changes

Set a Git config value Set a Git config key/value at the given scope

Functions

add_files(connection, git_add_request, opts \\ [])

@spec add_files(Tesla.Env.client(), ExDaytona.Model.GitAddRequest.t(), keyword()) ::
  {:ok, nil}
  | {:ok, ExDaytona.Model.ErrorResponse.t()}
  | {:error, Tesla.Env.t()}

Add files to Git staging Add files to the Git staging area

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • git_add_request (GitAddRequest): Add files request
  • opts (keyword): Optional parameters

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure

add_remote(connection, git_add_remote_request, opts \\ [])

@spec add_remote(
  Tesla.Env.client(),
  ExDaytona.Model.GitAddRemoteRequest.t(),
  keyword()
) ::
  {:ok, nil} | {:error, Tesla.Env.t()}

Add a remote Add (or overwrite) a remote in the Git repository

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • git_add_remote_request (GitAddRemoteRequest): Add remote request
  • opts (keyword): Optional parameters

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure

authenticate(connection, git_authenticate_request, opts \\ [])

@spec authenticate(
  Tesla.Env.client(),
  ExDaytona.Model.GitAuthenticateRequest.t(),
  keyword()
) ::
  {:ok, nil} | {:error, Tesla.Env.t()}

Authenticate Git Persist Git credentials globally via the credential store. Stores the password in plaintext on disk.

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • git_authenticate_request (GitAuthenticateRequest): Authenticate request
  • opts (keyword): Optional parameters

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure

checkout_branch(connection, git_checkout_request, opts \\ [])

@spec checkout_branch(
  Tesla.Env.client(),
  ExDaytona.Model.GitCheckoutRequest.t(),
  keyword()
) ::
  {:ok, nil}
  | {:ok, ExDaytona.Model.ErrorResponse.t()}
  | {:error, Tesla.Env.t()}

Checkout branch or commit Switch to a different branch or commit in the Git repository

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • git_checkout_request (GitCheckoutRequest): Checkout request
  • opts (keyword): Optional parameters

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure

clone_repository(connection, git_clone_request, opts \\ [])

@spec clone_repository(
  Tesla.Env.client(),
  ExDaytona.Model.GitCloneRequest.t(),
  keyword()
) ::
  {:ok, nil}
  | {:ok, ExDaytona.Model.ErrorResponse.t()}
  | {:error, Tesla.Env.t()}

Clone a Git repository Clone a Git repository to the specified path. Defaults to strict TLS verification; set insecure_skip_tls=true to skip verification for self-signed or private-CA Git servers.

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • git_clone_request (GitCloneRequest): Clone repository request
  • opts (keyword): Optional parameters

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure

commit_changes(connection, git_commit_request, opts \\ [])

Commit changes Commit staged changes to the Git repository

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • git_commit_request (GitCommitRequest): Commit request
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExDaytona.Model.GitCommitResponse.t} on success
  • {:error, Tesla.Env.t} on failure

configure_user(connection, git_configure_user_request, opts \\ [])

@spec configure_user(
  Tesla.Env.client(),
  ExDaytona.Model.GitConfigureUserRequest.t(),
  keyword()
) ::
  {:ok, nil} | {:error, Tesla.Env.t()}

Configure Git user Configure the Git user name and email at the given scope

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • git_configure_user_request (GitConfigureUserRequest): Configure user request
  • opts (keyword): Optional parameters

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure

create_branch(connection, git_branch_request, opts \\ [])

@spec create_branch(
  Tesla.Env.client(),
  ExDaytona.Model.GitBranchRequest.t(),
  keyword()
) ::
  {:ok, nil}
  | {:ok, ExDaytona.Model.ErrorResponse.t()}
  | {:error, Tesla.Env.t()}

Create a new branch Create a new branch in the Git repository

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • git_branch_request (GitBranchRequest): Create branch request
  • opts (keyword): Optional parameters

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure

delete_branch(connection, git_delete_branch_request, opts \\ [])

@spec delete_branch(
  Tesla.Env.client(),
  ExDaytona.Model.GitDeleteBranchRequest.t(),
  keyword()
) ::
  {:ok, nil}
  | {:ok, ExDaytona.Model.ErrorResponse.t()}
  | {:error, Tesla.Env.t()}

Delete a branch Delete a branch from the Git repository

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • git_delete_branch_request (GitDeleteBranchRequest): Delete branch request
  • opts (keyword): Optional parameters

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure

get_commit_history(connection, path, opts \\ [])

@spec get_commit_history(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, ExDaytona.Model.ErrorResponse.t()}
  | {:ok, [ExDaytona.Model.GitCommitInfo.t()]}
  | {:error, Tesla.Env.t()}

Get commit history Get the commit history of the Git repository

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • path (String.t): Repository path
  • opts (keyword): Optional parameters

Returns

  • {:ok, [%GitCommitInfo{}, ...]} on success
  • {:error, Tesla.Env.t} on failure

get_git_config(connection, key, opts \\ [])

@spec get_git_config(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, ExDaytona.Model.GitConfigResponse.t()} | {:error, Tesla.Env.t()}

Get a Git config value Get a Git config value at the given scope (null when unset)

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • key (String.t): Config key (e.g. user.name)
  • opts (keyword): Optional parameters
    • :path (String.t): Repository path (required for local scope)
    • :scope (String.t): Config scope: global (default), local or system

Returns

  • {:ok, ExDaytona.Model.GitConfigResponse.t} on success
  • {:error, Tesla.Env.t} on failure

get_status(connection, path, opts \\ [])

@spec get_status(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, ExDaytona.Model.ErrorResponse.t()}
  | {:ok, ExDaytona.Model.GitStatus.t()}
  | {:error, Tesla.Env.t()}

Get Git status Get the Git status of the repository at the specified path

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • path (String.t): Repository path
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExDaytona.Model.GitStatus.t} on success
  • {:error, Tesla.Env.t} on failure

init_repository(connection, git_init_request, opts \\ [])

@spec init_repository(
  Tesla.Env.client(),
  ExDaytona.Model.GitInitRequest.t(),
  keyword()
) ::
  {:ok, nil} | {:error, Tesla.Env.t()}

Initialize a Git repository Initialize a new Git repository at the specified path

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • git_init_request (GitInitRequest): Init repository request
  • opts (keyword): Optional parameters

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure

list_branches(connection, path, opts \\ [])

@spec list_branches(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, ExDaytona.Model.ErrorResponse.t()}
  | {:ok, ExDaytona.Model.ListBranchResponse.t()}
  | {:error, Tesla.Env.t()}

List branches Get a list of all branches in the Git repository

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • path (String.t): Repository path
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExDaytona.Model.ListBranchResponse.t} on success
  • {:error, Tesla.Env.t} on failure

list_remotes(connection, path, opts \\ [])

@spec list_remotes(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, ExDaytona.Model.ListRemotesResponse.t()} | {:error, Tesla.Env.t()}

List remotes List the remotes configured in the Git repository

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • path (String.t): Repository path
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExDaytona.Model.ListRemotesResponse.t} on success
  • {:error, Tesla.Env.t} on failure

pull_changes(connection, git_pull_request, opts \\ [])

@spec pull_changes(Tesla.Env.client(), ExDaytona.Model.GitPullRequest.t(), keyword()) ::
  {:ok, nil}
  | {:ok, ExDaytona.Model.ErrorResponse.t()}
  | {:error, Tesla.Env.t()}

Pull changes from remote Pull changes from the remote Git repository

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • git_pull_request (GitPullRequest): Pull request
  • opts (keyword): Optional parameters

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure

push_changes(connection, git_push_request, opts \\ [])

@spec push_changes(Tesla.Env.client(), ExDaytona.Model.GitPushRequest.t(), keyword()) ::
  {:ok, nil} | {:error, Tesla.Env.t()}

Push changes to remote Push local changes to the remote Git repository

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • git_push_request (GitPushRequest): Push request
  • opts (keyword): Optional parameters

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure

reset_changes(connection, git_reset_request, opts \\ [])

@spec reset_changes(
  Tesla.Env.client(),
  ExDaytona.Model.GitResetRequest.t(),
  keyword()
) ::
  {:ok, nil} | {:error, Tesla.Env.t()}

Reset repository Reset the current HEAD to the specified state

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • git_reset_request (GitResetRequest): Reset request
  • opts (keyword): Optional parameters

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure

restore_files(connection, git_restore_request, opts \\ [])

@spec restore_files(
  Tesla.Env.client(),
  ExDaytona.Model.GitRestoreRequest.t(),
  keyword()
) ::
  {:ok, nil}
  | {:ok, ExDaytona.Model.ErrorResponse.t()}
  | {:error, Tesla.Env.t()}

Restore files Restore working tree files or unstage changes

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • git_restore_request (GitRestoreRequest): Restore request
  • opts (keyword): Optional parameters

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure

set_git_config(connection, git_set_config_request, opts \\ [])

@spec set_git_config(
  Tesla.Env.client(),
  ExDaytona.Model.GitSetConfigRequest.t(),
  keyword()
) ::
  {:ok, nil} | {:error, Tesla.Env.t()}

Set a Git config value Set a Git config key/value at the given scope

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • git_set_config_request (GitSetConfigRequest): Set config request
  • opts (keyword): Optional parameters

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure