client

package
v0.0.40 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultHost is the default Host
	// found in Meta (info) section of spec file
	DefaultHost string = "localhost"
	// DefaultBasePath is the default BasePath
	// found in Meta (info) section of spec file
	DefaultBasePath string = "/"
)

Variables

View Source
var Default = NewHTTPClient(nil)

Default pg edge API HTTP client.

View Source
var DefaultSchemes = []string{"http"}

DefaultSchemes are the default schemes found in Meta (info) section of spec file

Functions

This section is empty.

Types

type APIError added in v0.0.26

type APIError struct {
	StatusCode int
	Message    string
}

func (*APIError) Error added in v0.0.26

func (e *APIError) Error() string

type Client

type Client struct {
	AuthHeader      string
	HTTPClient      *http.Client
	PgEdgeAPIClient *PgEdgeAPI
}

func NewClient

func NewClient(baseUrl, authHeader string) *Client

func (*Client) CreateBackupStore added in v0.0.7

func (c *Client) CreateBackupStore(ctx context.Context, input *models.CreateBackupStoreInput) (*models.BackupStore, error)

func (*Client) CreateCloudAccount added in v0.0.7

func (c *Client) CreateCloudAccount(ctx context.Context, account *models.CreateCloudAccountInput) (*models.CloudAccount, error)

func (*Client) CreateCluster

func (c *Client) CreateCluster(ctx context.Context, cluster *models.CreateClusterInput) (*models.Cluster, error)

func (*Client) CreateDatabase

func (c *Client) CreateDatabase(ctx context.Context, database *models.CreateDatabaseInput) (*models.Database, error)

func (*Client) CreateSSHKey added in v0.0.7

func (c *Client) CreateSSHKey(ctx context.Context, sshKey *models.CreateSSHKeyInput) (*models.SSHKey, error)

func (*Client) DeleteBackupStore added in v0.0.7

func (c *Client) DeleteBackupStore(ctx context.Context, id strfmt.UUID) error

func (*Client) DeleteCloudAccount added in v0.0.7

func (c *Client) DeleteCloudAccount(ctx context.Context, id strfmt.UUID) error

func (*Client) DeleteCluster

func (c *Client) DeleteCluster(ctx context.Context, id strfmt.UUID) error

func (*Client) DeleteDatabase

func (c *Client) DeleteDatabase(ctx context.Context, id strfmt.UUID) error

func (*Client) DeleteSSHKey added in v0.0.7

func (c *Client) DeleteSSHKey(ctx context.Context, id strfmt.UUID) error

func (*Client) GetAllClusters

func (c *Client) GetAllClusters(ctx context.Context) ([]*models.Cluster, error)

func (*Client) GetBackupStore added in v0.0.7

func (c *Client) GetBackupStore(ctx context.Context, id strfmt.UUID) (*models.BackupStore, error)

func (*Client) GetBackupStores added in v0.0.7

func (c *Client) GetBackupStores(ctx context.Context, createdAfter, createdBefore *string, limit, offset *int64, descending *bool) ([]*models.BackupStore, error)

func (*Client) GetCloudAccount added in v0.0.7

func (c *Client) GetCloudAccount(ctx context.Context, id strfmt.UUID) (*models.CloudAccount, error)

func (*Client) GetCloudAccounts added in v0.0.7

func (c *Client) GetCloudAccounts(ctx context.Context) ([]*models.CloudAccount, error)

func (*Client) GetCluster

func (c *Client) GetCluster(ctx context.Context, id strfmt.UUID) (*models.Cluster, error)

func (*Client) GetClusterNodeLogs added in v0.0.7

func (c *Client) GetClusterNodeLogs(ctx context.Context, clusterID, nodeID strfmt.UUID, logName string, params *operations.GetClustersIDNodesNodeIDLogsLogNameParams) ([]*models.ClusterNodeLogMessage, error)

func (*Client) GetClusterNodes added in v0.0.7

func (c *Client) GetClusterNodes(ctx context.Context, id strfmt.UUID, nearLat, nearLon, orderBy *string) ([]*models.ClusterNode, error)

func (*Client) GetDatabase

func (c *Client) GetDatabase(ctx context.Context, id strfmt.UUID) (*models.Database, error)

func (*Client) GetDatabases

func (c *Client) GetDatabases(ctx context.Context) ([]*models.Database, error)

func (*Client) GetSSHKey added in v0.0.7

func (c *Client) GetSSHKey(ctx context.Context, id strfmt.UUID) (*models.SSHKey, error)

func (*Client) GetSSHKeys added in v0.0.7

func (c *Client) GetSSHKeys(ctx context.Context) ([]*models.SSHKey, error)

func (*Client) GetTasks added in v0.0.26

func (c *Client) GetTasks(ctx context.Context, subjectID, subjectKind string, id, name *string, status *string, limit, offset *int64) ([]*models.Task, error)

func (*Client) OAuthToken

func (c *Client) OAuthToken(ctx context.Context, clientId, clientSecret, grantType string) (*operations.PostOauthTokenOKBody, error)

func (*Client) PollTaskStatus added in v0.0.26

func (c *Client) PollTaskStatus(ctx context.Context, config TaskPollingConfig) error

func (*Client) UpdateCluster added in v0.0.6

func (c *Client) UpdateCluster(ctx context.Context, id strfmt.UUID, body *models.UpdateClusterInput) (*models.Cluster, error)

func (*Client) UpdateDatabase added in v0.0.6

func (c *Client) UpdateDatabase(ctx context.Context, id strfmt.UUID, body *models.UpdateDatabaseInput) (*models.Database, error)

type GeneratedAPIError added in v0.0.26

type GeneratedAPIError interface {
	Code() int
	Message() string
}

type KnownError added in v0.0.26

type KnownError interface {
	GetPayload() *models.Error
}

type PgEdgeAPI

type PgEdgeAPI struct {
	Operations operations.ClientService

	Transport runtime.ClientTransport
}

PgEdgeAPI is a client for pg edge API

func New

func New(transport runtime.ClientTransport, formats strfmt.Registry) *PgEdgeAPI

New creates a new pg edge API client

func NewHTTPClient

func NewHTTPClient(formats strfmt.Registry) *PgEdgeAPI

NewHTTPClient creates a new pg edge API HTTP client.

func NewHTTPClientWithConfig

func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PgEdgeAPI

NewHTTPClientWithConfig creates a new pg edge API HTTP client, using a customizable transport config.

func (*PgEdgeAPI) SetTransport

func (c *PgEdgeAPI) SetTransport(transport runtime.ClientTransport)

SetTransport changes the transport on the client and all its subresources

type TaskPollingConfig added in v0.0.26

type TaskPollingConfig struct {
	SubjectID   string
	SubjectKind string
	MaxAttempts int
	Interval    time.Duration
}

type TransportConfig

type TransportConfig struct {
	Host     string
	BasePath string
	Schemes  []string
}

TransportConfig contains the transport related info, found in the meta section of the spec file.

func DefaultTransportConfig

func DefaultTransportConfig() *TransportConfig

DefaultTransportConfig creates a TransportConfig with the default settings taken from the meta section of the spec file.

func (*TransportConfig) WithBasePath

func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig

WithBasePath overrides the default basePath, provided by the meta section of the spec file.

func (*TransportConfig) WithHost

func (cfg *TransportConfig) WithHost(host string) *TransportConfig

WithHost overrides the default host, provided by the meta section of the spec file.

func (*TransportConfig) WithSchemes

func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig

WithSchemes overrides the default schemes, provided by the meta section of the spec file.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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