handlers

package
v1.15.5 Latest Latest
Warning

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

Go to latest
Published: May 26, 2020 License: Apache-2.0 Imports: 66 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAPIEndpoint = "https://replicated.app"
)

Variables

This section is empty.

Functions

func AppUpdateCheck added in v1.13.0

func AppUpdateCheck(w http.ResponseWriter, r *http.Request)

func CORS

func CORS(w http.ResponseWriter, r *http.Request)

func CreateBackup added in v1.15.0

func CreateBackup(w http.ResponseWriter, r *http.Request)

func CreateRestore added in v1.15.0

func CreateRestore(w http.ResponseWriter, r *http.Request)

func DownloadApp added in v1.14.0

func DownloadApp(w http.ResponseWriter, r *http.Request)

func DownloadSnapshotLogs added in v1.14.0

func DownloadSnapshotLogs(w http.ResponseWriter, r *http.Request)

func ExchangePlatformLicense added in v1.15.0

func ExchangePlatformLicense(w http.ResponseWriter, r *http.Request)

func GenerateNodeJoinCommandMaster added in v1.13.0

func GenerateNodeJoinCommandMaster(w http.ResponseWriter, r *http.Request)

func GenerateNodeJoinCommandWorker added in v1.13.0

func GenerateNodeJoinCommandWorker(w http.ResponseWriter, r *http.Request)

func GetAppRegistry added in v1.13.0

func GetAppRegistry(w http.ResponseWriter, r *http.Request)

func GetAppRenderedContents added in v1.15.0

func GetAppRenderedContents(w http.ResponseWriter, r *http.Request)

func GetDefaultTroubleshoot added in v1.15.0

func GetDefaultTroubleshoot(w http.ResponseWriter, r *http.Request)

func GetGlobalSnapshotSettings added in v1.15.0

func GetGlobalSnapshotSettings(w http.ResponseWriter, r *http.Request)

func GetRedact added in v1.15.0

func GetRedact(w http.ResponseWriter, r *http.Request)

func GetRestoreStatus added in v1.15.0

func GetRestoreStatus(w http.ResponseWriter, r *http.Request)

func GetTroubleshoot added in v1.15.0

func GetTroubleshoot(w http.ResponseWriter, r *http.Request)

func Healthz

func Healthz(w http.ResponseWriter, r *http.Request)

func IgnorePreflightRBACErrors added in v1.14.0

func IgnorePreflightRBACErrors(w http.ResponseWriter, r *http.Request)

func JSON

func JSON(w http.ResponseWriter, code int, payload interface{})

func ListBackups added in v1.15.0

func ListBackups(w http.ResponseWriter, r *http.Request)

func Login

func Login(w http.ResponseWriter, r *http.Request)

func Metadata

func Metadata(w http.ResponseWriter, r *http.Request)

func NodeProxy

func NodeProxy(upstream *httputil.ReverseProxy) func(http.ResponseWriter, *http.Request)

func NotImplemented

func NotImplemented(w http.ResponseWriter, r *http.Request)

func ResumeInstallOnline added in v1.15.0

func ResumeInstallOnline(w http.ResponseWriter, r *http.Request)

func Root

func Root(w http.ResponseWriter, r *http.Request)

func StartPreflightChecks added in v1.14.0

func StartPreflightChecks(w http.ResponseWriter, r *http.Request)

func StreamJSON

func StreamJSON(c *websocket.Conn, payload interface{})

func SyncLicense added in v1.13.0

func SyncLicense(w http.ResponseWriter, r *http.Request)

func UpdateAppConfig added in v1.13.0

func UpdateAppConfig(w http.ResponseWriter, r *http.Request)

func UpdateAppRegistry added in v1.13.0

func UpdateAppRegistry(w http.ResponseWriter, r *http.Request)

func UpdateGlobalSnapshotSettings added in v1.15.0

func UpdateGlobalSnapshotSettings(w http.ResponseWriter, r *http.Request)

func UpdateRedact added in v1.15.0

func UpdateRedact(w http.ResponseWriter, r *http.Request)

func UploadAirgapBundle added in v1.14.0

func UploadAirgapBundle(w http.ResponseWriter, r *http.Request)

func UploadExistingApp added in v1.14.0

func UploadExistingApp(w http.ResponseWriter, r *http.Request)

UploadExistingApp can be used to upload a multipart form file to the existing app This is used in the KOTS CLI when calling kots upload ...

func UploadNewLicense added in v1.15.0

func UploadNewLicense(w http.ResponseWriter, r *http.Request)

Types

type AppUpdateCheckRequest added in v1.13.0

type AppUpdateCheckRequest struct {
}

type AppUpdateCheckResponse added in v1.13.0

type AppUpdateCheckResponse struct {
	AvailableUpdates int64 `json:"availableUpdates"`
}

type CreateAppFromAirgapRequest added in v1.13.0

type CreateAppFromAirgapRequest struct {
}

type CreateAppFromAirgapResponse added in v1.13.0

type CreateAppFromAirgapResponse struct {
}

type CreateBackupRequest added in v1.15.0

type CreateBackupRequest struct {
}

type CreateBackupResponse added in v1.15.0

type CreateBackupResponse struct {
	Success bool   `json:"success"`
	Error   string `json:"error,omitempty"`
}

type CreateRestoreRequest added in v1.15.0

type CreateRestoreRequest struct {
}

type CreateRestoreResponse added in v1.15.0

type CreateRestoreResponse struct {
	Success bool   `json:"success"`
	Error   string `json:"error,omitempty"`
}

type DatabaseResponse

type DatabaseResponse struct {
	Connected bool `json:"connected"`
}

type EntitlementResponse added in v1.13.0

type EntitlementResponse struct {
	Title string      `json:"title"`
	Value interface{} `json:"value"`
	Label string      `json:"label"`
}

type ExchangePlatformLicenseRequest added in v1.15.0

type ExchangePlatformLicenseRequest struct {
	LicenseData string `json:"licenseData"`
}

type ExchangePlatformLicenseResponse added in v1.15.0

type ExchangePlatformLicenseResponse struct {
	LicenseData string `json:"licenseData"`
}

type GenerateNodeJoinCommandResponse added in v1.13.0

type GenerateNodeJoinCommandResponse struct {
	Command []string `json:"command"`
	Expiry  string   `json:"expiry"`
}

type GetRedactResponse added in v1.15.0

type GetRedactResponse struct {
	Success     bool   `json:"success"`
	Error       string `json:"error,omitempty"`
	UpdatedSpec string `json:"updatedSpec"`
}

type GetRestoreStatusResponse added in v1.15.0

type GetRestoreStatusResponse struct {
	Status      string `json:"status,omitempty"`
	RestoreName string `json:"restore_name,omitempty"`
	Error       string `json:"error,omitempty"`
}

type GlobalSnapshotSettingsResponse added in v1.15.0

type GlobalSnapshotSettingsResponse struct {
	VeleroVersion   string   `json:"veleroVersion"`
	VeleroPlugins   []string `json:"veleroPlugins"`
	IsVeleroRunning bool     `json:"isVeleroRunning"`
	ResticVersion   string   `json:"resticVersion"`
	IsResticRunning bool     `json:"isResticRunning"`

	Store   *snapshottypes.Store `json:"store,omitempty"`
	Success bool                 `json:"success"`
	Error   string               `json:"error,omitempty"`
}

type Handlers

type Handlers struct {
}

type HealthzResponse

type HealthzResponse struct {
	Version string         `json:"version"`
	GitSHA  string         `json:"gitSha"`
	Status  StatusResponse `json:"status"`
}

type ListBackupsResponse added in v1.15.0

type ListBackupsResponse struct {
	Error   string                  `json:"error,omitempty"`
	Backups []*snapshottypes.Backup `json:"backups"`
}

type LoginRequest

type LoginRequest struct {
	Password string `json:"password"`
}

type LoginResponse

type LoginResponse struct {
	Token string `json:"token"`
}

type MetadataResponse

type MetadataResponse struct {
	IconURI       string `json:"iconUri"`
	Name          string `json:"name"`
	Namespace     string `json:"namespace"`
	IsKurlEnabled bool   `json:"isKurlEnabled"`
}

type ResumeInstallOnlineRequest added in v1.15.0

type ResumeInstallOnlineRequest struct {
	Slug string `json:"slug"`
}

type ResumeInstallOnlineResponse added in v1.15.0

type ResumeInstallOnlineResponse struct {
	Success        bool   `json:"success"`
	Error          string `json:"error,omitempty"`
	HasPreflight   bool   `json:"hasPreflight"`
	Slug           string `json:"slug"`
	IsConfigurable bool   `json:"isConfigurable"`
}

type SPAHandler

type SPAHandler struct {
	StaticPath string
	IndexPath  string
}

spaHandler implements the http.Handler interface, so we can use it to respond to HTTP requests. The path to the static directory and path to the index file within that static directory are used to serve the SPA in the given static directory.

func (SPAHandler) ServeHTTP

func (h SPAHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP inspects the URL path to locate a file within the static dir on the SPA handler. If a file is found, it will be served. If not, the file located at the index path on the SPA handler will be served. This is suitable behavior for serving an SPA (single page application).

type StatusResponse

type StatusResponse struct {
	Database DatabaseResponse `json:"database"`
	Storage  StorageResponse  `json:"storage"`
}

type StorageResponse

type StorageResponse struct {
	Available bool `json:"available"`
}

type SyncLicenseRequest added in v1.13.0

type SyncLicenseRequest struct {
	LicenseData string `json:"licenseData"`
}

type SyncLicenseResponse added in v1.13.0

type SyncLicenseResponse struct {
	ID              string                `json:"id"`
	ExpiresAt       time.Time             `json:"expiresAt"`
	ChannelName     string                `json:"channelName"`
	LicenseSequence int64                 `json:"licenseSequence"`
	LicenseType     string                `json:"licenseType"`
	Entitlements    []EntitlementResponse `json:"entitlements"`
}

type UpdateAppConfigRequest added in v1.13.0

type UpdateAppConfigRequest struct {
	Sequence         int64                      `json:"sequence"`
	CreateNewVersion bool                       `json:"createNewVersion"`
	ConfigGroups     []*kotsv1beta1.ConfigGroup `json:"configGroups"`
}

type UpdateAppConfigResponse added in v1.13.0

type UpdateAppConfigResponse struct {
	Success       bool     `json:"success"`
	Error         string   `json:"error,omitempty"`
	RequiredItems []string `json:"requiredItems,omitempty"`
}

type UpdateAppFromAirgapResponse added in v1.14.0

type UpdateAppFromAirgapResponse struct {
}

type UpdateAppRegistryRequest added in v1.13.0

type UpdateAppRegistryRequest struct {
	Hostname  string `json:"hostname"`
	Username  string `json:"username"`
	Password  string `json:"password"`
	Namespace string `json:"namespace"`
}

type UpdateAppRegistryResponse added in v1.13.0

type UpdateAppRegistryResponse struct {
	Success   bool   `json:"success"`
	Error     string `json:"error,omitempty"`
	Hostname  string `json:"hostname"`
	Username  string `json:"username"`
	Namespace string `json:"namespace"`
}

type UpdateGlobalSnapshotSettingsRequest added in v1.15.0

type UpdateGlobalSnapshotSettingsRequest struct {
	Provider string `json:"provider"`
	Bucket   string `json:"bucket"`
	Path     string `json:"path"`

	AWS    *snapshottypes.StoreAWS    `json:"aws"`
	Google *snapshottypes.StoreGoogle `json:"gcp"`
	Azure  *snapshottypes.StoreAzure  `json:"azure"`
	Other  *snapshottypes.StoreOther  `json:"other"`
}

type UpdateRedactRequest added in v1.15.0

type UpdateRedactRequest struct {
	RedactSpec    string `json:"redactSpec"`
	RedactSpecURL string `json:"redactSpecUrl"`
}

type UpdateRedactResponse added in v1.15.0

type UpdateRedactResponse struct {
	Success     bool   `json:"success"`
	Error       string `json:"error,omitempty"`
	UpdatedSpec string `json:"updatedSpec"`
}

type UploadExistingAppRequest added in v1.14.0

type UploadExistingAppRequest struct {
	Slug         string `json:"slug"`
	VersionLabel string `json:"versionLabel,omitempty"`
	UpdateCursor string `json:"updateCursor,omitempty"`
}

type UploadLicenseRequest added in v1.15.0

type UploadLicenseRequest struct {
	LicenseData string `json:"licenseData"`
}

type UploadLicenseResponse added in v1.15.0

type UploadLicenseResponse struct {
	Success        bool   `json:"success"`
	Error          string `json:"error,omitempty"`
	HasPreflight   bool   `json:"hasPreflight"`
	Slug           string `json:"slug"`
	IsAirgap       bool   `json:"isAirgap"`
	NeedsRegistry  bool   `json:"needsRegistry"`
	IsConfigurable bool   `json:"isConfigurable"`
}

type UploadResponse added in v1.14.0

type UploadResponse struct {
	Slug string `json:"slug"`
}

Jump to

Keyboard shortcuts

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