client

package
v0.0.0-...-3bfe646 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: Apache-2.0 Imports: 20 Imported by: 4

Documentation

Index

Constants

View Source
const CurrentVersion = "app/v1"

CurrentVersion is the current version of the API to use with the client

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	roundtrip.Client
	// contains filtered or unexported fields
}

Client implements the application management interface

func NewAuthenticatedClient

func NewAuthenticatedClient(addr, username, password string, params ...Param) (*Client, error)

NewAuthenticatedClient returns a new client with the specified user security context

func NewBearerClient

func NewBearerClient(addr, token string, params ...Param) (*Client, error)

NewBearerClient returns a new client that user bearer token for authentication

func NewClient

func NewClient(addr string, params ...Param) (*Client, error)

NewClient returns a new client

func (*Client) CreateApp

func (c *Client) CreateApp(locator loc.Locator, reader io.Reader, labels map[string]string) (*app.Application, error)

CreateApp creates a new application. POST app/v1/applications/:repository_id

func (*Client) CreateAppWithManifest

func (c *Client) CreateAppWithManifest(locator loc.Locator, manifest []byte, reader io.Reader, labels map[string]string) (*app.Application, error)

CreateAppWithManifest creates a new application with the specified manifest.

func (*Client) CreateImportOperation

func (c *Client) CreateImportOperation(req *app.ImportRequest) (*storage.AppOperation, error)

CreateImportOperation creates a new import operation. POST app/v1/operations/import/

func (*Client) Delete

func (c *Client) Delete(endpoint string, params url.Values) (*roundtrip.Response, error)

Delete issues HTTP DELETE request to the server

func (*Client) DeleteApp

func (c *Client) DeleteApp(req app.DeleteRequest) error

DeleteApp deletes the application described with req. DELETE app/v1/:repository_id/:package_id/:version?force=true

func (*Client) DeleteAppHookJob

func (c *Client) DeleteAppHookJob(ctx context.Context, req app.DeleteAppHookJobRequest) error

DeleteAppHookJob deletes the application hook job specified with req. DELETE app/v1/applications/:repository_id/:package_id/:version/hook/:namespace/:name

func (*Client) ExportApp

func (c *Client) ExportApp(req app.ExportAppRequest) error

ExportApp exports the application described with req. POST app/v1/operations/export/:repository_id/:package_id/:version

func (*Client) FetchChart

func (c *Client) FetchChart(locator loc.Locator) (io.ReadCloser, error)

FetchChart returns Helm chart package with the specified application.

GET charts/:name

func (*Client) FetchIndexFile

func (c *Client) FetchIndexFile() (io.Reader, error)

FetchIndexFile returns Helm chart repository index file data.

GET charts/index.yaml

func (*Client) Get

func (c *Client) Get(endpoint string, params url.Values) (*roundtrip.Response, error)

Get issues HTTP GET request to the server

func (*Client) GetApp

func (c *Client) GetApp(locator loc.Locator) (*app.Application, error)

GetApp returns the application descriptor for application specified with locator. GET app/v1/applications/:repository_id/:package_id/:version

func (*Client) GetAppInstaller

func (c *Client) GetAppInstaller(req app.InstallerRequest) (io.ReadCloser, error)

GetAppInstaller returns the Reader to the application installer tarball. GET app/v1/applications/:repository_id/:package_id/:version/standalone-installer

func (*Client) GetAppManifest

func (c *Client) GetAppManifest(locator loc.Locator) (io.ReadCloser, error)

GetAppManifest returns the manifest for the application specified with locator. GET app/v1/applications/:repository_name/:package_name/:version/manifest

func (*Client) GetAppResources

func (c *Client) GetAppResources(locator loc.Locator) (io.ReadCloser, error)

GetAppResources returns the Reader to the application resources tarball. GET app/v1/applications/:repository_name/:package_name/:version/resources

func (*Client) GetImportedApplication

func (c *Client) GetImportedApplication(op storage.AppOperation) (*app.Application, error)

GetImportedApplication returns the application descriptor for the specified import operation. GET app/v1/operations/import/:operation_id

func (*Client) GetOperationCrashReport

func (c *Client) GetOperationCrashReport(op storage.AppOperation) (io.ReadCloser, error)

GetOperationCrashReport returns the crash report. GET app/v1/operations/import/:operation_id/crash-report

func (*Client) GetOperationLogs

func (c *Client) GetOperationLogs(op storage.AppOperation) (io.ReadCloser, error)

GetOperationLogs returns the operation logs. GET app/v1/operations/import/:operation_id/logs

func (*Client) GetOperationProgress

func (c *Client) GetOperationProgress(op storage.AppOperation) (*app.ProgressEntry, error)

GetOperationProgress queries the operation progress. GET app/v1/operations/import/:operation_id/progress

func (*Client) ListApps

func (c *Client) ListApps(req app.ListAppsRequest) (apps []app.Application, err error)

ListApps returns the list of applications as requested in req. GET app/v1/applications/:repository_id/

func (*Client) PostForm

func (c *Client) PostForm(
	endpoint string,
	values url.Values,
	files ...roundtrip.File) (*roundtrip.Response, error)

PostForm is a generic method that issues http POST request to the server

func (*Client) PostJSON

func (c *Client) PostJSON(endpoint string, data interface{}) (*roundtrip.Response, error)

PostJSON posts data as JSON to the server

func (*Client) StartAppHook

func (c *Client) StartAppHook(ctx context.Context, req app.HookRunRequest) (*app.HookRef, error)

StartAppHook starts a new application hook job specified with req. The operation is asynchronous - use WaitAppHook to wait for completion. POST app/v1/applications/:repository_id/:package_id/:version/hook/start

func (*Client) StatusApp

func (c *Client) StatusApp(locator loc.Locator) (*app.Status, error)

StatusApp runs the application status hook and returns the results. GET app/v1/applications/:repository_id/:package_id/:version/status

func (*Client) StreamAppHookLogs

func (c *Client) StreamAppHookLogs(ctx context.Context, ref app.HookRef, out io.Writer) error

StreamAppHookLogs streams the application hook logs into the specified writer out.

func (*Client) UninstallApp

func (c *Client) UninstallApp(locator loc.Locator) (*app.Application, error)

UninstallApp uninstalls for the application specified with locator. POST app/v1/operations/uninstall/:repository_id/:package_id/:version

func (*Client) UpsertApp

func (c *Client) UpsertApp(locator loc.Locator, reader io.Reader, labels map[string]string) (*app.Application, error)

UpsertApp creates a new or updates an existing application. POST app/v1/applications/:repository_id

func (*Client) WaitAppHook

func (c *Client) WaitAppHook(ctx context.Context, ref app.HookRef) error

WaitAppHook blocks until the application hook either completes or exceeds the deadline. GET app/v1/applications/:repository_id/:package_id/:version/hook/:namespace/:name/wait

type Param

type Param func(c *Client) error

Param defines the API to override configuration on client c

func BasicAuth

func BasicAuth(username, password string) Param

BasicAuth sets username and password for HTTP client

func BearerAuth

func BearerAuth(password string) Param

BearerAuth sets token for HTTP client

func HTTPClient

func HTTPClient(h *http.Client) Param

HTTPClient is a functional parameter that sets the internal HTTP client

func WithLocalDialer

func WithLocalDialer(dialer httplib.Dialer) Param

WithLocalDialer specifies the dialer to use for connecting to an endpoint if standard dialing fails

Jump to

Keyboard shortcuts

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