Documentation
¶
Overview ¶
Package client provides an abstraction for interacting with otf services either remotely or locally.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶ added in v0.0.32
type Client interface {
CreateOrganization(ctx context.Context, opts organization.OrganizationCreateOptions) (*organization.Organization, error)
DeleteOrganization(ctx context.Context, organization string) error
GetWorkspace(ctx context.Context, workspaceID string) (*workspace.Workspace, error)
GetWorkspaceByName(ctx context.Context, organization, workspace string) (*workspace.Workspace, error)
ListWorkspaces(ctx context.Context, opts workspace.ListOptions) (*workspace.WorkspaceList, error)
UpdateWorkspace(ctx context.Context, workspaceID string, opts workspace.UpdateOptions) (*workspace.Workspace, error)
ListVariables(ctx context.Context, workspaceID string) ([]*variable.Variable, error)
CreateAgentToken(ctx context.Context, opts auth.CreateAgentTokenOptions) (*auth.AgentToken, error)
GetAgentToken(ctx context.Context, token string) (*auth.AgentToken, error)
GetPlanFile(ctx context.Context, id string, format run.PlanFormat) ([]byte, error)
UploadPlanFile(ctx context.Context, id string, plan []byte, format run.PlanFormat) error
GetLockFile(ctx context.Context, id string) ([]byte, error)
UploadLockFile(ctx context.Context, id string, lockFile []byte) error
ListRuns(ctx context.Context, opts run.RunListOptions) (*run.RunList, error)
GetRun(ctx context.Context, id string) (*run.Run, error)
StartPhase(ctx context.Context, id string, phase otf.PhaseType, opts run.PhaseStartOptions) (*run.Run, error)
FinishPhase(ctx context.Context, id string, phase otf.PhaseType, opts run.PhaseFinishOptions) (*run.Run, error)
DownloadConfig(ctx context.Context, id string) ([]byte, error)
Watch(context.Context, run.WatchOptions) (<-chan otf.Event, error)
// CreateRegistrySession creates a registry session for the given organization.
CreateRegistrySession(ctx context.Context, opts auth.CreateRegistrySessionOptions) (*auth.RegistrySession, error)
CreateStateVersion(ctx context.Context, opts state.CreateStateVersionOptions) (*state.Version, error)
DownloadCurrentState(ctx context.Context, workspaceID string) ([]byte, error)
CreateUser(ctx context.Context, username string, opts ...auth.NewUserOption) (*auth.User, error)
DeleteUser(ctx context.Context, username string) error
AddOrganizationMembership(ctx context.Context, username, organization string) error
RemoveOrganizationMembership(ctx context.Context, username, organization string) error
AddTeamMembership(ctx context.Context, username, teamID string) error
RemoveTeamMembership(ctx context.Context, username, teamID string) error
CreateTeam(ctx context.Context, opts auth.NewTeamOptions) (*auth.Team, error)
GetTeam(ctx context.Context, organization, team string) (*auth.Team, error)
DeleteTeam(ctx context.Context, teamID string) error
Hostname() string
otf.PutChunkService
workspace.LockService
}
Client is those service endpoints that support both in-process and remote invocation. Intended for use with the agent (the internal agent is in-process, while the external agent is remote) as well as the CLI.
type LocalClient ¶ added in v0.0.32
Click to show internal directories.
Click to hide internal directories.