sdk

package
v0.0.0-...-b8d72a6 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version = "dev"
)

Functions

This section is empty.

Types

type AuthenticationError

type AuthenticationError interface {
	AuthenticationError() error
}

type Client

type Client struct {
	*stdsdk.Client
	Debug   bool
	Rack    string
	Session SessionFunc
}

func New

func New(endpoint string) (*Client, error)

func NewFromEnv

func NewFromEnv() (*Client, error)

func (*Client) AppCancel

func (c *Client) AppCancel(name string) error

func (*Client) AppCreate

func (c *Client) AppCreate(name string, opts structs.AppCreateOptions) (*structs.App, error)

func (*Client) AppDelete

func (c *Client) AppDelete(name string) error

func (*Client) AppGet

func (c *Client) AppGet(name string) (*structs.App, error)

func (*Client) AppList

func (c *Client) AppList() (structs.Apps, error)

func (*Client) AppLogs

func (c *Client) AppLogs(name string, opts structs.LogsOptions) (io.ReadCloser, error)

func (*Client) AppMetrics

func (c *Client) AppMetrics(name string, opts structs.MetricsOptions) (structs.Metrics, error)

func (*Client) AppParametersGet

func (c *Client) AppParametersGet(name string) (map[string]string, error)

func (*Client) AppParametersSet

func (c *Client) AppParametersSet(name string, params map[string]string) error

func (*Client) AppUpdate

func (c *Client) AppUpdate(name string, opts structs.AppUpdateOptions) error

func (*Client) Auth

func (c *Client) Auth() (string, error)

func (*Client) BuildCreate

func (c *Client) BuildCreate(app string, url string, opts structs.BuildCreateOptions) (*structs.Build, error)

func (*Client) BuildCreateUpload

func (c *Client) BuildCreateUpload(app string, r io.Reader, opts structs.BuildCreateOptions) (*structs.Build, error)

func (*Client) BuildExport

func (c *Client) BuildExport(app string, id string, w io.Writer) error

func (*Client) BuildGet

func (c *Client) BuildGet(app string, id string) (*structs.Build, error)

func (*Client) BuildImport

func (c *Client) BuildImport(app string, r io.Reader) (*structs.Build, error)

func (*Client) BuildImportMultipart

func (c *Client) BuildImportMultipart(app string, r io.Reader) (*structs.Build, error)

func (*Client) BuildImportUrl

func (c *Client) BuildImportUrl(app string, r io.Reader) (*structs.Build, error)

func (*Client) BuildList

func (c *Client) BuildList(app string, opts structs.BuildListOptions) (structs.Builds, error)

func (*Client) BuildLogs

func (c *Client) BuildLogs(app string, id string, opts structs.LogsOptions) (io.ReadCloser, error)

func (*Client) BuildUpdate

func (c *Client) BuildUpdate(app string, id string, opts structs.BuildUpdateOptions) (*structs.Build, error)

func (*Client) CapacityGet

func (c *Client) CapacityGet() (*structs.Capacity, error)

func (*Client) CertificateApply

func (c *Client) CertificateApply(app string, service string, port int, id string) error

func (*Client) CertificateCreate

func (c *Client) CertificateCreate(pub string, key string, opts structs.CertificateCreateOptions) (*structs.Certificate, error)

func (*Client) CertificateCreateClassic

func (c *Client) CertificateCreateClassic(pub string, key string, opts structs.CertificateCreateOptions) (*structs.Certificate, error)

func (*Client) CertificateDelete

func (c *Client) CertificateDelete(id string) error

func (*Client) CertificateGenerate

func (c *Client) CertificateGenerate(domains []string) (*structs.Certificate, error)

func (*Client) CertificateList

func (c *Client) CertificateList() (structs.Certificates, error)

func (*Client) DeleteDB

func (c *Client) DeleteDB(resource string) error

func (*Client) EnvironmentSet

func (c *Client) EnvironmentSet(app string, env []byte) (*structs.Release, error)

func (*Client) EnvironmentUnset

func (c *Client) EnvironmentUnset(app string, key string) (*structs.Release, error)

func (*Client) EventSend

func (c *Client) EventSend(action string, opts structs.EventSendOptions) error

func (*Client) FilesDelete

func (c *Client) FilesDelete(app string, pid string, files []string) error

func (*Client) FilesDownload

func (c *Client) FilesDownload(app string, pid string, file string) (io.Reader, error)

func (*Client) FilesUpload

func (c *Client) FilesUpload(app string, pid string, r io.Reader) error

func (*Client) FormationGet

func (c *Client) FormationGet(app string) (structs.Services, error)

func (*Client) FormationUpdate

func (c *Client) FormationUpdate(app string, service string, opts structs.ServiceUpdateOptions) error

func (*Client) Headers

func (c *Client) Headers() http.Header

func (*Client) Initialize

func (c *Client) Initialize(opts structs.ProviderOptions) error

func (*Client) InstanceKeyroll

func (c *Client) InstanceKeyroll() error

func (*Client) InstanceList

func (c *Client) InstanceList() (structs.Instances, error)

func (*Client) InstanceShell

func (c *Client) InstanceShell(id string, rw io.ReadWriter, opts structs.InstanceShellOptions) (int, error)

func (*Client) InstanceShellClassic

func (c *Client) InstanceShellClassic(id string, rw io.ReadWriter, opts structs.InstanceShellOptions) (int, error)

func (*Client) InstanceTerminate

func (c *Client) InstanceTerminate(id string) error

func (*Client) IsDBSnapshotComplete

func (c *Client) IsDBSnapshotComplete(snapshot string) (bool, error)

func (*Client) ObjectDelete

func (c *Client) ObjectDelete(app string, key string) error

func (*Client) ObjectExists

func (c *Client) ObjectExists(app string, key string) (bool, error)

func (*Client) ObjectFetch

func (c *Client) ObjectFetch(app string, key string) (io.ReadCloser, error)

func (*Client) ObjectList

func (c *Client) ObjectList(app string, prefix string) ([]string, error)

func (*Client) ObjectStore

func (c *Client) ObjectStore(app string, key string, r io.Reader, opts structs.ObjectStoreOptions) (*structs.Object, error)

func (*Client) ProcessExec

func (c *Client) ProcessExec(app string, pid string, command string, rw io.ReadWriter, opts structs.ProcessExecOptions) (int, error)

func (*Client) ProcessGet

func (c *Client) ProcessGet(app string, pid string) (*structs.Process, error)

func (*Client) ProcessList

func (c *Client) ProcessList(app string, opts structs.ProcessListOptions) (structs.Processes, error)

func (*Client) ProcessLogs

func (c *Client) ProcessLogs(app string, pid string, opts structs.LogsOptions) (io.ReadCloser, error)

func (*Client) ProcessRun

func (c *Client) ProcessRun(app string, service string, opts structs.ProcessRunOptions) (*structs.Process, error)

func (*Client) ProcessRunAttached

func (c *Client) ProcessRunAttached(app, service string, rw io.ReadWriter, timeout int, opts structs.ProcessRunOptions) (int, error)

func (*Client) ProcessRunDetached

func (c *Client) ProcessRunDetached(app, service string, opts structs.ProcessRunOptions) (string, error)

func (*Client) ProcessStop

func (c *Client) ProcessStop(app string, pid string) error

func (*Client) Proxy

func (c *Client) Proxy(host string, port int, rw io.ReadWriter, opts structs.ProxyOptions) error

func (*Client) RackHost

func (c *Client) RackHost(rackOrgSlug string) (structs.RackData, error)

func (*Client) RegistryAdd

func (c *Client) RegistryAdd(server string, username string, password string) (*structs.Registry, error)

func (*Client) RegistryList

func (c *Client) RegistryList() (structs.Registries, error)

func (*Client) RegistryRemove

func (c *Client) RegistryRemove(server string) error

func (*Client) RegistryRemoveClassic

func (c *Client) RegistryRemoveClassic(server string) error

func (*Client) ReleaseCreate

func (c *Client) ReleaseCreate(app string, opts structs.ReleaseCreateOptions) (*structs.Release, error)

func (*Client) ReleaseGet

func (c *Client) ReleaseGet(app string, id string) (*structs.Release, error)

func (*Client) ReleaseList

func (c *Client) ReleaseList(app string, opts structs.ReleaseListOptions) (structs.Releases, error)

func (*Client) ReleasePromote

func (c *Client) ReleasePromote(app string, id string, opts structs.ReleasePromoteOptions) error

func (*Client) ResourceCreateClassic

func (c *Client) ResourceCreateClassic(kind string, opts structs.ResourceCreateOptions) (*structs.Resource, error)

func (*Client) ResourceGet

func (c *Client) ResourceGet(app string, name string) (*structs.Resource, error)

func (*Client) ResourceList

func (c *Client) ResourceList(app string) (structs.Resources, error)

func (*Client) ResourceUpdateClassic

func (c *Client) ResourceUpdateClassic(name string, opts structs.ResourceUpdateOptions) (*structs.Resource, error)

func (*Client) RuntimeAttach

func (c *Client) RuntimeAttach(rackOrgSlug string, opts structs.RuntimeAttachOptions) error

func (*Client) Runtimes

func (c *Client) Runtimes(rackOrgSlug string) (structs.Runtimes, error)

func (*Client) ServiceList

func (c *Client) ServiceList(app string) (structs.Services, error)

func (*Client) ServiceMetrics

func (c *Client) ServiceMetrics(app string, name string, opts structs.MetricsOptions) (structs.Metrics, error)

func (*Client) ServiceRestart

func (c *Client) ServiceRestart(app string, name string) error

func (*Client) ServiceUpdate

func (c *Client) ServiceUpdate(app string, name string, opts structs.ServiceUpdateOptions) error

func (*Client) SetDBDeletionProtectionAndCreateSnapShot

func (c *Client) SetDBDeletionProtectionAndCreateSnapShot(app, resource, snapshot string) (string, error)

func (*Client) Sync

func (c *Client) Sync(name string) error

func (*Client) SyncInstancesIpInSecurityGroup

func (c *Client) SyncInstancesIpInSecurityGroup() error

func (*Client) SystemGet

func (c *Client) SystemGet() (*structs.System, error)

func (*Client) SystemInstall

func (c *Client) SystemInstall(w io.Writer, opts structs.SystemInstallOptions) (string, error)

func (*Client) SystemJwtSignKey

func (*Client) SystemJwtSignKey() (string, error)

func (*Client) SystemJwtSignKeyRotate

func (c *Client) SystemJwtSignKeyRotate() (string, error)

func (*Client) SystemJwtToken

func (c *Client) SystemJwtToken(opts structs.SystemJwtOptions) (*structs.SystemJwt, error)

func (*Client) SystemLogs

func (c *Client) SystemLogs(opts structs.LogsOptions) (io.ReadCloser, error)

func (*Client) SystemMetrics

func (c *Client) SystemMetrics(opts structs.MetricsOptions) (structs.Metrics, error)

func (*Client) SystemProcesses

func (c *Client) SystemProcesses(opts structs.SystemProcessesOptions) (structs.Processes, error)

func (*Client) SystemReleases

func (c *Client) SystemReleases() (structs.Releases, error)

func (*Client) SystemResourceCreate

func (c *Client) SystemResourceCreate(kind string, opts structs.ResourceCreateOptions) (*structs.Resource, error)

func (*Client) SystemResourceCreateClassic

func (c *Client) SystemResourceCreateClassic(kind string, opts structs.ResourceCreateOptions) (*structs.Resource, error)

func (*Client) SystemResourceDelete

func (c *Client) SystemResourceDelete(name string) error

func (*Client) SystemResourceDeleteClassic

func (c *Client) SystemResourceDeleteClassic(name string) error

func (*Client) SystemResourceGet

func (c *Client) SystemResourceGet(name string) (*structs.Resource, error)

func (*Client) SystemResourceGetClassic

func (c *Client) SystemResourceGetClassic(name string) (*structs.Resource, error)
func (c *Client) SystemResourceLink(name string, app string) (*structs.Resource, error)

func (*Client) SystemResourceLinkClassic

func (c *Client) SystemResourceLinkClassic(name string, app string) (*structs.Resource, error)

func (*Client) SystemResourceList

func (c *Client) SystemResourceList() (structs.Resources, error)

func (*Client) SystemResourceListClassic

func (c *Client) SystemResourceListClassic() (structs.Resources, error)

func (*Client) SystemResourceTypes

func (c *Client) SystemResourceTypes() (structs.ResourceTypes, error)

func (*Client) SystemResourceTypesClassic

func (c *Client) SystemResourceTypesClassic() (structs.ResourceTypes, error)
func (c *Client) SystemResourceUnlink(name string, app string) (*structs.Resource, error)

func (*Client) SystemResourceUnlinkClassic

func (c *Client) SystemResourceUnlinkClassic(name string, app string) (*structs.Resource, error)

func (*Client) SystemResourceUpdate

func (c *Client) SystemResourceUpdate(name string, opts structs.ResourceUpdateOptions) (*structs.Resource, error)

func (*Client) SystemResourceUpdateClassic

func (c *Client) SystemResourceUpdateClassic(name string, opts structs.ResourceUpdateOptions) (*structs.Resource, error)

func (*Client) SystemUninstall

func (c *Client) SystemUninstall(name string, w io.Writer, opts structs.SystemUninstallOptions) error

func (*Client) SystemUpdate

func (c *Client) SystemUpdate(opts structs.SystemUpdateOptions) error

func (*Client) Websocket

func (c *Client) Websocket(path string, opts stdsdk.RequestOptions) (io.ReadCloser, error)

func (*Client) WebsocketExit

func (c *Client) WebsocketExit(path string, ro stdsdk.RequestOptions, rw io.ReadWriter) (int, error)

func (*Client) WithContext

func (c *Client) WithContext(ctx context.Context) structs.Provider

func (*Client) Workers

func (c *Client) Workers() error

type Interface

type Interface interface {
	structs.Provider

	// raw http
	Get(string, stdsdk.RequestOptions, interface{}) error

	// backwards compatibility
	AppParametersGet(string) (map[string]string, error)
	AppParametersSet(string, map[string]string) error
	BuildCreateUpload(string, io.Reader, structs.BuildCreateOptions) (*structs.Build, error)
	BuildImportMultipart(string, io.Reader) (*structs.Build, error)
	BuildImportUrl(string, io.Reader) (*structs.Build, error)
	CertificateCreateClassic(string, string, structs.CertificateCreateOptions) (*structs.Certificate, error)
	EnvironmentSet(string, []byte) (*structs.Release, error)
	EnvironmentUnset(string, string) (*structs.Release, error)
	FormationGet(string) (structs.Services, error)
	FormationUpdate(string, string, structs.ServiceUpdateOptions) error
	InstanceShellClassic(string, io.ReadWriter, structs.InstanceShellOptions) (int, error)
	ProcessRunAttached(string, string, io.ReadWriter, int, structs.ProcessRunOptions) (int, error)
	ProcessRunDetached(string, string, structs.ProcessRunOptions) (string, error)
	RackHost(rackOrgSlug string) (structs.RackData, error)
	RegistryRemoveClassic(string) error
	ResourceCreateClassic(string, structs.ResourceCreateOptions) (*structs.Resource, error)
	ResourceUpdateClassic(string, structs.ResourceUpdateOptions) (*structs.Resource, error)
	SystemJwtToken(opts structs.SystemJwtOptions) (*structs.SystemJwt, error)
	SystemResourceCreateClassic(string, structs.ResourceCreateOptions) (*structs.Resource, error)
	SystemResourceDeleteClassic(string) error
	SystemResourceGetClassic(string) (*structs.Resource, error)
	SystemResourceLinkClassic(string, string) (*structs.Resource, error)
	SystemResourceListClassic() (structs.Resources, error)
	SystemResourceTypesClassic() (structs.ResourceTypes, error)
	SystemResourceUnlinkClassic(string, string) (*structs.Resource, error)
	SystemResourceUpdateClassic(string, structs.ResourceUpdateOptions) (*structs.Resource, error)
}

type SessionFunc

type SessionFunc func(c *Client) string

Jump to

Keyboard shortcuts

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