restAPI

package
v0.5.10 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	/* [impl -> const~use-reserved-schema~1]. */
	EXTENSION_SCHEMA_NAME = "EXA_EXTENSIONS"

	TagExtension    = "Extension"
	TagInstallation = "Installation"
	TagInstance     = "Instance"

	BearerAuth = "DbAccessToken"
	BasicAuth  = "DbUsernamePassword"
)
View Source
const (
	ContentTypeJson   = "application/json"
	HeaderContentType = "Content-Type"
)

Variables

This section is empty.

Functions

func AddPublicEndpoints

func AddPublicEndpoints(api *openapi.API, config extensionController.ExtensionManagerConfig) error

AddPublicEndpoints adds the extension manager endpoints to the API. The config struct contains configuration options for the extension manager.

[impl -> dsn~go-library~1].

func CreateInstance

func CreateInstance(apiContext *ApiContext) *openapi.Post

func CreateOpenApi

func CreateOpenApi() (*openapi.API, error)

func DecodeJSONBody

func DecodeJSONBody(writer http.ResponseWriter, request *http.Request, dst interface{}) error

func DeleteInstance

func DeleteInstance(apiContext *ApiContext) *openapi.Delete

func GetExtensionDetails

func GetExtensionDetails(apiContext *ApiContext) *openapi.Get

[impl -> dsn~parameter-versioning~1].

func GetLogger

func GetLogger(context context.Context) *log.Entry

func InstallExtension

func InstallExtension(apiContext *ApiContext) *openapi.Put

func ListAvailableExtensions

func ListAvailableExtensions(apiContext *ApiContext) *openapi.Get

func ListInstalledExtensions

func ListInstalledExtensions(apiContext *ApiContext) *openapi.Get

func ListInstances

func ListInstances(apiContext *ApiContext) *openapi.Get

func SendJSON

func SendJSON(ctx context.Context, writer http.ResponseWriter, data interface{}) error

SendJSON converts the given data to JSON and sends it to the writer.

func SendJSONWithStatus

func SendJSONWithStatus(ctx context.Context, status int, writer http.ResponseWriter, data interface{}) error

func SendNoContent

func SendNoContent(ctx context.Context, writer http.ResponseWriter) error

func UninstallExtension

func UninstallExtension(apiContext *ApiContext) *openapi.Delete

func UpgradeExtension added in v0.5.0

func UpgradeExtension(apiContext *ApiContext) *openapi.Post

[impl -> dsn~upgrade-extension~1].

Types

type ApiContext

type ApiContext struct {
	Controller extensionController.TransactionController
	// contains filtered or unexported fields
}

func NewApiContext

func NewApiContext(controller extensionController.TransactionController, addCauseToInternalServerError bool) *ApiContext

type CreateInstanceRequest

type CreateInstanceRequest struct {
	ParameterValues []ParameterValue `json:"parameterValues"` // The parameters for the new instance
}

Request data for creating a new instance of an extension.

type CreateInstanceResponse

type CreateInstanceResponse struct {
	InstanceId   string `json:"instanceId"`   // The ID of the newly created instance
	InstanceName string `json:"instanceName"` // The name of the newly created instance
}

Response data for creating a new instance of an extension.

type ExtensionDetailsResponse

type ExtensionDetailsResponse struct {
	Id               string            `json:"id"`                   // ID of this extension
	Version          string            `json:"version"`              // Version of this extension
	ParamDefinitions []ParamDefinition `json:"parameterDefinitions"` // Parameters required for creating an instance of this extension.
}

ExtensionDetailsResponse is the response for the GetExtensionDetails request.

type ExtensionVersion

type ExtensionVersion struct {
	Name       string `json:"name"`
	Latest     bool   `json:"latest"`
	Deprecated bool   `json:"deprecated"`
}

type ExtensionsResponse

type ExtensionsResponse struct {
	Extensions []ExtensionsResponseExtension `json:"extensions"` // All available extensions.
}

ExtensionsResponse contains all available extensions.

type ExtensionsResponseExtension

type ExtensionsResponseExtension struct {
	Id                  string             `json:"id"`                  // ID of the extension. Don't store this as it may change when restarting the server.
	Name                string             `json:"name"`                // The name of the extension to be displayed to the user.
	Category            string             `json:"category"`            // The category of the extension, e.g. "driver" or "virtual-schema".
	Description         string             `json:"description"`         // The description of the extension to be displayed to the user.
	InstallableVersions []ExtensionVersion `json:"installableVersions"` // A list of versions of this extension available for installation.
}

ExtensionsResponseExtension contains information about an available extension that can be installed.

type InstallExtensionRequest

type InstallExtensionRequest struct {
	IgnoredProperty string // Some code generators like swagger-codegen fail when the request body is empty.
}

type InstallationsResponse

type InstallationsResponse struct {
	Installations []InstallationsResponseInstallation `json:"installations"`
}

InstallationsResponse contains all installed extensions.

type InstallationsResponseInstallation

type InstallationsResponseInstallation struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	Version string `json:"version"`
}

InstallationsResponseInstallation contains information about installed extensions.

type Instance

type Instance struct {
	Id   string `json:"id"`   // The ID of the instance
	Name string `json:"name"` // The name of the instance
}

Instance represents an instance of an extension, e.g. a virtual schema.

type ListInstancesResponse

type ListInstancesResponse struct {
	Instances []Instance `json:"instances"` // Instances of the extension.
}

Response data for listing all instances of an extension.

type ParamDefinition

type ParamDefinition struct {
	Id            string      `json:"id"`         // ID of this parameter
	Name          string      `json:"name"`       // Name of this parameter
	RawDefinition interface{} `json:"definition"` // Raw parameter definition to be used as input for the Parameter Validator (https://github.com/exasol/extension-parameter-validator)
}

This represents a parameter required for creating a new instance of an extension.

type ParameterValue

type ParameterValue struct {
	Name  string `json:"name"`  // The name of the parameter
	Value string `json:"value"` // The value of the parameter
}

Parameter values for creating a new instance.

type RestAPI

type RestAPI interface {
	// Serve starts the server. This method blocks until the server is stopped or fails.
	Serve()
	// StartInBackground starts the server in the background and blocks until it is ready, i.e. reacts to HTTP requests.
	StartInBackground()
	// Stop stops the server.
	Stop()
}

RestAPI is the interface that provides the REST API server of the extension-manager.

func Create

func Create(controller extensionController.TransactionController, serverAddress string, addCauseToInternalServerError bool) RestAPI

Create creates a new RestAPI.

type UpgradeExtensionResponse added in v0.5.0

type UpgradeExtensionResponse struct {
	PreviousVersion string `json:"previousVersion"` // Version that was installed before the upgrade.
	NewVersion      string `json:"newVersion"`      // New version that is installed after the upgrade.
}

Response data for upgrading an extension.

Jump to

Keyboard shortcuts

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