api

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	REGION_ACTIVE    = "ACTIVE"
	REGION_INACTIVE  = "INACTIVE"
	REGION_SUSPENDED = "SUSPENDED"
)

Variables

View Source
var (
	Error404              = errors.New("resource not found")
	ErrorUnknown          = errors.New("unknown API error")
	ErrorClustersSameName = NewMultipleClustersSameNameError()
)

Functions

func NewMultipleClustersSameNameError added in v0.3.0

func NewMultipleClustersSameNameError() error

Types

type API

type API struct {
	BaseURL    string
	Token      string
	UserAgent  string
	HTTPClient http.Client
}

func BuildAPI

func BuildAPI(meta any) *API

func NewAPI

func NewAPI(ba_bearer_token, ba_api_uri, userAgent string) *API

func (*API) CloudProviderClient added in v0.4.0

func (api *API) CloudProviderClient() *CloudProviderClient

func (*API) ClusterClient

func (api *API) ClusterClient() *ClusterClient

func (*API) ProjectClient added in v0.3.0

func (api *API) ProjectClient() *ProjectClient

func (*API) RegionClient

func (api *API) RegionClient() *RegionClient

type APIError added in v0.1.1

type APIError struct {
	Error struct {
		Status    int            `json:"status"`
		Message   string         `json:"message"`
		Errors    []ErrorMessage `json:"errors"`
		Reference string         `json:"reference"`
		Source    string         `json:"source"`
	} `json:"error"`
}

type BigAnimalError added in v0.1.1

type BigAnimalError struct {
	APIError APIError
}

func (*BigAnimalError) Error added in v0.1.1

func (baerr *BigAnimalError) Error() string

func (*BigAnimalError) GetDetails added in v0.1.1

func (baerr *BigAnimalError) GetDetails() string

type CloudProviderClient added in v0.4.0

type CloudProviderClient struct{ API }

func NewCloudProviderClient added in v0.4.0

func NewCloudProviderClient(api API) *CloudProviderClient

func (CloudProviderClient) CreateAWSConnection added in v0.4.0

func (c CloudProviderClient) CreateAWSConnection(ctx context.Context, projectID string, conn models.AWSConnection) error

func (CloudProviderClient) CreateAzureConnection added in v0.4.0

func (c CloudProviderClient) CreateAzureConnection(ctx context.Context, projectID string, conn models.AzureConnection) error

func (CloudProviderClient) GetAWSConnection added in v0.4.0

func (c CloudProviderClient) GetAWSConnection(ctx context.Context, projectID string) (*models.AWSConnection, error)

type ClusterClient

type ClusterClient struct{ API }

func NewClusterClient

func NewClusterClient(api API) *ClusterClient

func (ClusterClient) ConnectionString

func (c ClusterClient) ConnectionString(ctx context.Context, projectId, id string) (*models.ClusterConnection, error)

func (ClusterClient) Create

func (c ClusterClient) Create(ctx context.Context, projectId string, model any) (string, error)

func (ClusterClient) Delete

func (c ClusterClient) Delete(ctx context.Context, projectId, id string) error

func (ClusterClient) Read

func (c ClusterClient) Read(ctx context.Context, projectId, id string) (*models.Cluster, error)

func (ClusterClient) ReadByName

func (c ClusterClient) ReadByName(ctx context.Context, projectId, name string, most_recent bool) (*models.Cluster, error)

func (ClusterClient) Update

func (c ClusterClient) Update(ctx context.Context, cluster *models.Cluster, projectId, id string) (*models.Cluster, error)

type ClusterResponse

type ClusterResponse struct {
	Data struct {
		ClusterId string `json:"clusterId"`
	} `json:"data"`
}

type ErrorMessage added in v0.1.1

type ErrorMessage struct {
	Message string `json:"message"`
}

type ProjectClient added in v0.3.0

type ProjectClient struct{ API }

func NewProjectClient added in v0.3.0

func NewProjectClient(api API) *ProjectClient

func (ProjectClient) Create added in v0.3.0

func (c ProjectClient) Create(ctx context.Context, projectName string) (string, error)

func (ProjectClient) Delete added in v0.3.0

func (c ProjectClient) Delete(ctx context.Context, projectId string) error

func (ProjectClient) List added in v0.3.0

func (c ProjectClient) List(ctx context.Context, query string) ([]*models.Project, error)

func (ProjectClient) Read added in v0.3.0

func (c ProjectClient) Read(ctx context.Context, id string) (*models.Project, error)

func (ProjectClient) Update added in v0.3.0

func (c ProjectClient) Update(ctx context.Context, projectId, projectName string) (string, error)

type RegionClient

type RegionClient struct{ API }

func NewRegionClient

func NewRegionClient(api API) *RegionClient

func (RegionClient) Create

func (c RegionClient) Create(ctx context.Context, model any) (string, error)

func (RegionClient) List

func (c RegionClient) List(ctx context.Context, project_id, csp_id, query string) ([]*models.Region, error)

func (RegionClient) Read

func (c RegionClient) Read(ctx context.Context, project_id, csp_id, id string) (*models.Region, error)

func (RegionClient) Update

func (c RegionClient) Update(ctx context.Context, action, project_id, csp_id, region_id string) error

Jump to

Keyboard shortcuts

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