skysql

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorServiceNotFound = errors.New("service not found")
View Source
var ErrorUnauthorized = errors.New("skysql returns unauthorized error")

Functions

func WithPageSize

func WithPageSize(value uint) func(url.Values)

Types

type Client

type Client struct {
	HTTPClient *resty.Client
}

func New

func New(baseURL string, AccessToken string) *Client

func (*Client) CreateService

func (*Client) DeleteAutonomousAction added in v1.2.0

func (c *Client) DeleteAutonomousAction(ctx context.Context, actionID string) error

func (*Client) DeleteServiceByID

func (c *Client) DeleteServiceByID(ctx context.Context, serviceID string) error

func (*Client) GetAutonomousActions added in v1.2.0

func (c *Client) GetAutonomousActions(ctx context.Context, serviceID string) ([]autonomous.ActionResponse, error)

func (*Client) GetAvailabilityZones added in v1.2.0

func (c *Client) GetAvailabilityZones(ctx context.Context, region string, options ...func(url.Values)) ([]provisioning.AvailabilityZone, error)

func (*Client) GetProjects

func (c *Client) GetProjects(ctx context.Context) ([]organization.Project, error)

func (*Client) GetServiceByID

func (c *Client) GetServiceByID(ctx context.Context, serviceID string) (*provisioning.Service, error)

func (*Client) GetServiceCredentialsByID

func (c *Client) GetServiceCredentialsByID(ctx context.Context, serviceID string) (*provisioning.Credentials, error)

func (*Client) GetVersions

func (c *Client) GetVersions(ctx context.Context, options ...func(url.Values)) ([]provisioning.Version, error)

func (*Client) ModifyServiceEndpoints

func (c *Client) ModifyServiceEndpoints(
	ctx context.Context,
	serviceID string,
	mechanism string,
	allowedAccounts []string,
	visibility string,
) (*provisioning.ServiceEndpoint, error)

func (*Client) ModifyServiceNodeNumber

func (c *Client) ModifyServiceNodeNumber(ctx context.Context, serviceID string, nodes int64) error

func (*Client) ModifyServiceSize

func (c *Client) ModifyServiceSize(ctx context.Context, serviceID string, size string) error

func (*Client) ModifyServiceStorage

func (c *Client) ModifyServiceStorage(ctx context.Context, serviceID string, size int64, iops int64) error

func (*Client) ReadServiceAllowListByID

func (c *Client) ReadServiceAllowListByID(ctx context.Context, serviceID string) (provisioning.ReadAllowListResponse, error)

func (*Client) SetAutonomousActions added in v1.2.0

func (c *Client) SetAutonomousActions(
	ctx context.Context,
	value autonomous.SetAutonomousActionsRequest,
) ([]autonomous.ActionResponse, error)

func (*Client) SetServicePowerState

func (c *Client) SetServicePowerState(ctx context.Context, serviceID string, isActive bool) error

func (*Client) UpdateServiceAllowListByID

func (c *Client) UpdateServiceAllowListByID(ctx context.Context, serviceID string, allowlist []provisioning.AllowListItem) ([]provisioning.AllowListItem, error)

type ErrorDetails

type ErrorDetails struct {
	Error    string `json:"error"`
	Message  string `json:"message"`
	Solution string `json:"solution,omitempty"`
	Type     string `json:"type,omitempty"`
	Location string `json:"location,omitempty"`
}

ErrorDetails for detailed error and message

type ErrorResponse

type ErrorResponse struct {
	Errors    []ErrorDetails `json:"errors"`
	Exception string         `json:"exception"`
	Path      string         `json:"path"`
	Code      int            `json:"code"`
	Timestamp FlexInt        `json:"timestamp"`
	TraceID   string         `json:"trace_id"`
}

ErrorResponse struct

type FlexInt

type FlexInt int

func (*FlexInt) UnmarshalJSON

func (fi *FlexInt) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaler interface, which allows us to ingest values of any json type as an int and run our custom conversion

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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