api

package
v0.8.5 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// admin only routes.
	RN_AddNamespace = "addNamespace"

	// misc route for azure.
	RN_Preflight = "preflight"

	// authenticated only routes.
	RN_JQPlayground = "jqPlayground"
	RN_Version      = "version"

	// permission if any other permission is set in namespace.
	RN_ListNamespaces = "listNamespaces"

	// namespace get routes.
	RN_ListNamespaceVariables = "listNamespaceVariables"
	RN_GetNamespaceVariable   = "getNamespaceVariable"

	// namespace variable set routes.
	RN_SetNamespaceVariable = "setNamespaceVariable"

	// explorer routes.
	RN_GetNode              = "getNode"
	RN_CreateDirectory      = "createDirectory"
	RN_DeleteNode           = "deleteNode"
	RN_RenameNode           = "renameNode"
	RN_DeleteNodeAttributes = "deleteNodeAttributes"
	RN_CreateNodeAttributes = "createNodeAttributes"

	// instance routes.
	RN_ListInstances         = "listInstances"
	RN_GetInstance           = "getInstance"
	RN_GetInstanceVariable   = "getInstanceVariable"
	RN_CancelInstance        = "cancelInstance"
	RN_ListInstanceVariables = "listInstanceVariables"
	RN_SetInstanceVariable   = "setInstanceVariable"
	RN_GetNamespaceMetrics   = "getNamespaceMetrics"

	// workflow routes.
	RN_GetWorkflowTags       = "getWorkflowTags"
	RN_GetWorkflowRefs       = "getWorkflowRefs"
	RN_GetWorkflowRouter     = "getWorkflowRouter"
	RN_GetWorkflowMetrics    = "getWorkflowMetrics"
	RN_ListWorkflowVariables = "listWorkflowVariables"
	RN_GetWorkflowVariable   = "getWorkflowVariable"
	RN_ListWorkflowServices  = "listWorkflowServices"

	RN_CreateWorkflow         = "createWorkflow"
	RN_UpdateWorkflow         = "updateWorkflow"
	RN_SaveWorkflow           = "saveWorkflow"
	RN_DiscardWorkflow        = "discardWorkflow"
	RN_DeleteRevision         = "deleteRevision"
	RN_Tag                    = "tag"
	RN_Untag                  = "untag"
	RN_Retag                  = "retag"
	RN_SetWorkflowVariable    = "setWorkflowVariable"
	RN_EditWorkflowRouter     = "editWorkflowRouter"
	RN_ValidateRef            = "validateRef"
	RN_ValidateRouter         = "validateRouter"
	RN_DeleteWorkflowServices = "deleteWorkflowService"

	RN_ExecuteWorkflow = "executeWorkflow"

	// service and workflow service routes.
	RN_WatchPodLogs = "watchLogs"

	// delete namespace route.
	RN_DeleteNamespace = "deleteNamespace"

	// services get routes.
	RN_ListNamespaceServices = "listNamespacesServices"
	RN_ListNamespacePods     = "listNamespacePods"
	RN_GetNamespaceService   = "getNamespaceService"
	RN_WatchServices         = "watchServices"
	RN_WatchRevisions        = "watchRevisions"

	// services set routes.
	RN_CreateNamespaceService         = "createNamespaceService"
	RN_DeleteNamespaceServices        = "deleteNamespaceService"
	RN_UpdateNamespaceService         = "updateNamespaceService"
	RN_DeleteNamespaceServiceRevision = "deleteNamespaceServiceRevision"

	// events routes.
	RN_EventListeners = "eventListeners"
	RN_EventHistory   = "eventHistory"
	RN_NamespaceEvent = "namespaceEvent"

	// secrets get routes.
	RN_ListSecrets  = "listSecrets"
	RN_SearchSecret = "searchSecret"

	// secrets set routes.
	RN_OverwriteSecret     = "overwriteSecret"
	RN_CreateSecret        = "createSecret"
	RN_CreateSecretsFolder = "createSecretsFolder"

	// secrets delete routes.
	RN_DeleteSecret        = "deleteSecret"
	RN_DeleteSecretsFolder = "deleteSecretsFolder"

	// registries get routes.
	RN_ListRegistries = "listRegistries"
	RN_TestRegistry   = "testRegistry"

	// registries set routes.
	RN_CreateRegistry = "createRegistry"

	// registries delete routes.
	RN_DeleteRegistry = "deleteRegistry"

	// git set routes.
	RN_UpdateMirror         = "updateMirror"
	RN_LockMirror           = "lockMirror"
	RN_SyncMirror           = "syncMirror"
	RN_CancelMirrorActivity = "cancelMirrorActivity"

	// git get routes.
	RN_GetMirrorInfo = "getMirrorInfo"
)

RN = Route Name.

View Source
const (
	// GenericErrorCode - Reserved status code for generic non grpc errors.
	GenericErrorCode codes.Code = 50
)

Variables

This section is empty.

Functions

func ConvertGRPCStatusCodeToHTTPCode

func ConvertGRPCStatusCodeToHTTPCode(code codes.Code) int

ConvertGRPCStatusCodeToHTTPCode - Convert Grpc Code errors to http response codes.

func GetInodePath

func GetInodePath(path string) string

GetInodePath returns the path without the first slash.

func RunApplication added in v0.8.1

func RunApplication(config *core.Config) error

func ToGRPCCloudEvents added in v0.6.1

func ToGRPCCloudEvents(r *http.Request) ([]cloudevents.Event, error)

Types

type ErrObject

type ErrObject struct {
	Code    codes.Code
	Message string
}

ErrObject for grpc.

func GenerateErrObject

func GenerateErrObject(err error) *ErrObject

GenerateErrObject - Unwrap grpc errors into ErrorObject.

type ErrorBody added in v0.5.9

type ErrorBody struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

swagger: model ErrorBack

func (*ErrorBody) StatusCode added in v0.5.9

func (e *ErrorBody) StatusCode() int

type ErrorResponse added in v0.5.9

type ErrorResponse interface {
	// swagger:name Message
	Error() string
	// swagger:name StatusCode
	StatusCode() int
}

swagger:model

type OkBody added in v0.5.9

type OkBody map[string]interface{}

OkBody is an arbitrary placeholder response that represents an ok response body

swagger:model

type PaginationQuery added in v0.6.0

type PaginationQuery struct {
	// field to order by
	//
	// in: query
	// name: "order.field"
	// type: string
	// required: false
	// description: "field to order by"
	PageOrderField string `json:"order.field"`

	// order direction
	//
	// in: query
	// name: "order.direction"
	// type: string
	// required: false
	// description: "order direction"
	// enum: DESC, ASC
	PageOrderDirection string `json:"order.direction"`

	// field to filter
	//
	// in: query
	// name: "filter.field"
	// type: string
	// required: false
	// description: "field to filter"
	PageFilterField string `json:"filter.field"`

	// filter behaviour
	//
	// in: query
	// name: "filter.type"
	// type: string
	// required: false
	// description: "filter behaviour"
	PageFilterType string `json:"filter.type"`
}

swagger:parameters getWorkflowLogs getNamespaces serverLogs namespaceLogs instanceLogs getInstanceList getWorkflowLogs

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server struct for API server.

func NewServer

func NewServer(config *core.Config) (*Server, error)

NewServer return new API server.

func (*Server) GetRouter

func (s *Server) GetRouter() *mux.Router

GetRouter is a getter for s.router.

func (*Server) Start

func (s *Server) Start() error

Start starts API server.

Jump to

Keyboard shortcuts

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