Skip to main content
paradime.admin.git reads how a workspace reaches its git repository, connects a repository, and manages the workspace’s deploy key. For the GraphQL operations, see Git repositories.
Prerequisites
  • These operations are part of the Enterprise plan. On other plans, they raise AdminPlanUpgradeRequiredException.
  • Your API key needs the Git repository admin capability group.
  • The admin client of the paradime-io package. See Admin client.
The examples on this page use this client:

Get the repository and deploy key

Reads the workspace’s git repository, how Paradime reaches it, and the workspace’s deploy key. When the workspace has no deploy key yet, a key with the Git repository admin group creates the first one.
Optional[str]
default:"None"
The workspace to read, for a company API key.
Optional[GitRepository]
The repository, or None when the server returned none.

Connect a repository

Connects the workspace’s repository. Sending the same input again changes nothing and starts no job. Pass one of three connection inputs:
  • DeployKeyConnectionInput: Paradime clones and pushes with the workspace’s deploy key. Add the key to the repository with write access first. With validate_repository=True (the default), the clone, the dbt_project.yml check, the production sync and the editor restart run in a job.
  • GitHubAppConnectionInput: through the Paradime GitHub App. See Connect through the GitHub App.
  • GitLabAppConnectionInput: through the company’s GitLab connection. See Connect a GitLab repository.
The GitHub App and GitLab connections finish before the call returns.
DeployKeyConnectionInput | GitHubAppConnectionInput | GitLabAppConnectionInput
required
How Paradime reaches the repository. See Types.
Optional[str]
default:"None"
The workspace to change, for a company API key.
ConnectGitRepositoryResult
The repository now (git_repository) and, when the deploy key connects it with validation, the cloning job (job). Wait for the job with admin.jobs.wait. Its result is a GitRepositoryConnectResult.
A workspace that already has a cloned repository refuses a different repository with AdminConflictException. Pass force=True in DeployKeyConnectionInput to replace it.

Check repository access

Starts a job that checks the workspace’s deploy key can push to a repository. Changes nothing. The job fails with CONNECTION_TEST_FAILED when the key can’t push.
str
required
The repository’s SSH URI.
Optional[str]
default:"None"
The workspace to use, for a company API key.
AdminJob
The job. Wait for it with admin.jobs.wait. Its result is a GitRepositoryCheckResult.

Rotate the deploy key

Replaces the workspace’s deploy key. Every call makes a new key.
bool
default:"False"
Rotate a key that the connected repository uses. Without it, that call raises AdminConflictException. Clone and push break until you add the new key to the repository.
Optional[str]
default:"None"
The workspace to change, for a company API key.
GitDeployKey
The new deploy key.

Types

Import the models and enums from paradime.apis.admin.git.types.
input
input
input
model
GitRepositoryState values: