sdk

package
v1.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2024 License: MPL-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ClientIdEnvVar       = "CHUSHI_CLIENT_ID"
	ClientSecretEnvVar   = "CHUSHI_CLIENT_SECRET"
	AccessTokenEnvVar    = "CHUSHI_ACCESS_TOKEN"
	UrlEnvVar            = "CHUSHI_URL"
	OrganizationIdEnvVar = "CHUSHI_ORGANIZATION_ID"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateRunnerTokenParams

type CreateRunnerTokenParams struct {
	WorkspaceId string `json:"workspace_id"`
	RunId       string `json:"run_id"`
	AgentId     string `json:"-"`
}

type CreateRunnerTokenResponse

type CreateRunnerTokenResponse struct {
	Token string `json:"token"`
}

type Credentials added in v1.3.0

type Credentials struct {
	Token string `json:"token"`
}

type CredentialsResponse added in v1.3.0

type CredentialsResponse struct {
	Credentials Credentials `json:"credentials"`
}

type GeneratePresignedUrlParams

type GeneratePresignedUrlParams struct {
	RunId string
}

type GeneratePresignedUrlResponse

type GeneratePresignedUrlResponse struct {
	Url string `json:"url"`
}

type GetRunRequest added in v1.5.0

type GetRunRequest struct {
	RunId string
}

type GetRunResponse added in v1.5.0

type GetRunResponse struct {
	Run *Run `json:"run"`
}

type ListRunsParams

type ListRunsParams struct {
	AgentId     string     `json:"agent_id,omitempty" url:"-"`
	Status      string     `json:"status,omitempty" url:"status,omitempty"`
	WorkspaceId *uuid.UUID `json:"workspace_id,omitempty" url:"-"`
}

type ListRunsResponse

type ListRunsResponse struct {
	Runs []Run `json:"runs"`
}

type Run

type Run struct {
	Id               string     `json:"id"`
	Status           string     `json:"status"`
	WorkspaceId      string     `json:"workspace_id"`
	OrganizationId   string     `json:"organization_id"`
	Operation        string     `json:"operation"`
	Add              int        `json:"add"`
	Change           int        `json:"change"`
	Destroy          int        `json:"destroy"`
	ManagedResources int        `json:"managed_resources"`
	CreatedAt        time.Time  `json:"created_at"`
	UpdatedAt        time.Time  `json:"updated_at"`
	CompletedAt      *time.Time `json:"completed_at"`
	AgentId          *uuid.UUID `json:"agent_id,omitempty"`
}

type Runs

type Runs struct {
	// contains filtered or unexported fields
}

func (*Runs) Get added in v1.5.0

func (r *Runs) Get(params *GetRunRequest) (*GetRunResponse, error)

func (*Runs) List

func (r *Runs) List(params *ListRunsParams) (*ListRunsResponse, error)

func (*Runs) PresignedUrl

func (*Runs) Update

func (r *Runs) Update(params *UpdateRunParams) (*UpdateRunResponse, error)

func (*Runs) UploadLogs

func (r *Runs) UploadLogs(runId string, logs string) error

func (*Runs) UploadPlan

func (r *Runs) UploadPlan(params *UploadPlanParams) (*UploadPlanResponse, error)

type Sdk

type Sdk struct {
	Client         *sling.Sling
	TokenUrl       string
	OrganizationId uuid.UUID
	// contains filtered or unexported fields
}

func New

func New() *Sdk

func (*Sdk) GetOrganizationUrl added in v1.2.2

func (s *Sdk) GetOrganizationUrl(path string) string

func (*Sdk) GetWorkspace

func (s *Sdk) GetWorkspace(workspaceId string) (*WorkspaceResponse, error)

func (*Sdk) Runs

func (s *Sdk) Runs() *Runs

func (*Sdk) Tokens

func (s *Sdk) Tokens() *Tokens

func (*Sdk) WithAccessToken added in v1.2.2

func (s *Sdk) WithAccessToken(accessToken string) *Sdk

func (*Sdk) WithBaseUrl added in v1.2.2

func (s *Sdk) WithBaseUrl(baseUrl string) *Sdk

func (*Sdk) WithClient added in v1.2.2

func (s *Sdk) WithClient(client *http.Client) *Sdk

func (*Sdk) WithClientCredentials added in v1.2.2

func (s *Sdk) WithClientCredentials(clientId string, clientSecret string, tokenUrl string) *Sdk

func (*Sdk) WithOrganizationId added in v1.2.2

func (s *Sdk) WithOrganizationId(organizationId uuid.UUID) *Sdk

func (*Sdk) Workspaces added in v1.2.2

func (s *Sdk) Workspaces() *Workspaces

type Tokens

type Tokens struct {
	// contains filtered or unexported fields
}

func (*Tokens) CreateRunnerToken

func (t *Tokens) CreateRunnerToken(params *CreateRunnerTokenParams) (*CreateRunnerTokenResponse, error)

type UpdateRunParams

type UpdateRunParams struct {
	RunId            string
	Status           string `json:"status,omitempty"`
	Add              int    `json:"add,omitempty"`
	Change           int    `json:"change,omitempty"`
	Destroy          int    `json:"destroy,omitempty"`
	ManagedResources int    `json:"managed_resources,omitempty"`
}

type UpdateRunResponse

type UpdateRunResponse struct {
	Run Run `json:"run"`
}

type UploadPlanParams

type UploadPlanParams struct {
	RunId string
	Plan  []byte
}

type UploadPlanResponse

type UploadPlanResponse struct {
	Run Run `json:"run"`
}

type Variable added in v1.3.0

type Variable struct {
	Type  string `json:"type"`
	Name  string `json:"name"`
	Value string `json:"value"`
}

type Workspace

type Workspace struct {
	Id     string       `json:"id"`
	Name   string       `json:"name"`
	Locked bool         `json:"locked"`
	Vcs    WorkspaceVcs `json:"vcs"`
}

type WorkspaceResponse

type WorkspaceResponse struct {
	Workspace Workspace `json:"workspace"`
}

type WorkspaceVariablesResponse added in v1.3.0

type WorkspaceVariablesResponse struct {
	Variables []Variable `json:"variables"`
}

type WorkspaceVcs added in v1.2.1

type WorkspaceVcs struct {
	Source           string    `json:"source"`
	Branch           string    `json:"branch"`
	Patterns         []string  `json:"patterns,omitempty"`
	Prefixes         []string  `json:"prefixes,omitempty"`
	WorkingDirectory string    `json:"working_directory,omitempty"`
	ConnectionId     uuid.UUID `json:"connection_id,omitempty"`
}

type Workspaces added in v1.2.2

type Workspaces struct {
	// contains filtered or unexported fields
}

func (*Workspaces) GetConnectionCredentials added in v1.3.0

func (w *Workspaces) GetConnectionCredentials(connectionId uuid.UUID) (*CredentialsResponse, error)

func (*Workspaces) GetVariables added in v1.3.0

func (w *Workspaces) GetVariables(workspaceId string) ([]Variable, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL