rebase.Client

Low-level API client used by Rebase SDK handles.

Signature

class rebase.Client(
    *,
    api_key: str | None = None,
    api_url: str | None = None,
    profile: str | None = None,
    access_token: str | None = None,
)

Most users do not need to construct Client directly. Use rebase setup, rebase.configure(...), and the higher-level handles such as rebase.Project, rebase.Function, and rebase.Workflow.

Parameters

ParameterTypeDescription
api_key`strNone`
api_url`strNone`
profile`strNone`
access_token`strNone`

Common Methods

MethodDescription
request(method, path, **kwargs)Send a raw request to the Rebase API.
list_projects()List projects in the active workspace.
get_project(project_id)Fetch a project record.
list_endpoints(project_id=None)List endpoint records.
get_endpoint(endpoint_id)Fetch an endpoint record.
invoke_endpoint(endpoint, parameters=None)Invoke an endpoint record returned by the API.
get_workspace()Fetch the active workspace record.
update_workspace(...)Update active workspace metadata and source backing.
list_environment_policies()List dev, staging, and prod deployment policies for the active workspace.
update_environment_policy(environment, ...)Protect or unprotect an environment.
create_gitops_deployment_intent(...)Create a GitOps deployment request for committed GitHub-backed source.

Environment and GitOps Methods

These methods back the CLI GitOps workflow. Most users should use rebase environment and rebase deploy instead of calling them directly.

client = rebase.Client()
client.list_environment_policies()
client.update_environment_policy("prod", deploy_mode="gitops", protected=True, require_pr=True)

create_gitops_deployment_intent(...) requires repository metadata, source path, commit SHA, branch, environment, and a Rebase-generated plan. Protected environments require a workspace or project GitHub connection before the intent can be created.

On this page