api

package
v0.0.0-...-9525e81 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CTX_CC_RANGE           = "cc-range"
	CTX_CC_CLUSTER         = "cc-cluster"
	CTX_CC_BOX             = "cc-box"
	CTX_CC_BOX_SERVICE     = "cc-box-service"
	CTX_CC_SERVER          = "cc-server"
	CTX_CC_SERVER_SERVICE  = "cc-server-service"
	CTX_CC_CLUSTER_SERVICE = "cc-cluster-service"
	CTX_CC_SHARED_SERVICE  = "cc-shared-service"
)
View Source
const (
	CTX_FW_SHARED      = "fw-shared"
	CTX_FW_SHARED_TYPE = "fw-shared-type"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Api

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

func NewClient

func NewClient(url, key string) *Api

func NewClientCC

func NewClientCC(url, key string) *Api

func (*Api) AddNetworkObjectExcludedEntry

func (api *Api) AddNetworkObjectExcludedEntry(ctx context.Context, objectName string, object cuda.NetworkObjectExcludedEntry) error

func (*Api) AddNetworkObjectIncludedEntry

func (api *Api) AddNetworkObjectIncludedEntry(ctx context.Context, objectName string, object cuda.NetworkObjectIncludedEntry) error

func (*Api) BlockService

func (api *Api) BlockService(ctx context.Context, service string) error

func (*Api) ChangeNetworkObjectExcluded

func (api *Api) ChangeNetworkObjectExcluded(ctx context.Context, objectName string, object cuda.NetworkObjectExcludedChange) error

func (*Api) ChangeNetworkObjectIncluded

func (api *Api) ChangeNetworkObjectIncluded(ctx context.Context, objectName string, object cuda.NetworkObjectIncludedChange) error

func (*Api) ContextCC

func (api *Api) ContextCC(ctx context.Context, ctxInfo ContextInfoCC) context.Context

Create a context for control center. Global is default.

func (*Api) ContextFW

func (api *Api) ContextFW(ctx context.Context, ctxInfo ContextInfoFW) context.Context

func (*Api) Delete

func (api *Api) Delete(ctx context.Context, endpoint string) error

func (*Api) DeleteNetworkObject

func (api *Api) DeleteNetworkObject(ctx context.Context, objectName string) error

delete a network object by name

func (*Api) DeleteNetworkObjectExcludedEntry

func (api *Api) DeleteNetworkObjectExcludedEntry(ctx context.Context, objectName string, entry string) error

func (*Api) DeleteNetworkObjectIncludedEntry

func (api *Api) DeleteNetworkObjectIncludedEntry(ctx context.Context, objectName string, entry string) error

func (*Api) EndpointRestBase

func (api *Api) EndpointRestBase() string

Base of the REST API

func (*Api) EndpointRestConfigBase

func (api *Api) EndpointRestConfigBase() string

func (*Api) EndpointRestConfigCtx

func (api *Api) EndpointRestConfigCtx(ctx context.Context) (string, error)

func (*Api) EndpointRestConfigFirewall

func (api *Api) EndpointRestConfigFirewall(ctx context.Context) (string, error)

func (*Api) EndpointRestConfigFirewallObjects

func (api *Api) EndpointRestConfigFirewallObjects(ctx context.Context) (string, error)

func (*Api) EndpointRestConfigFirewallObjectsNetworks

func (api *Api) EndpointRestConfigFirewallObjectsNetworks(ctx context.Context) (string, error)

func (*Api) EndpointRestConfigFirewallObjectsNetworksByName

func (api *Api) EndpointRestConfigFirewallObjectsNetworksByName(ctx context.Context, objectName string) (string, error)

func (*Api) EndpointRestControlBase

func (api *Api) EndpointRestControlBase() string

func (*Api) Get

func (api *Api) Get(ctx context.Context, endpoint string, target interface{}) error

func (*Api) GetNetworkObject

func (api *Api) GetNetworkObject(ctx context.Context, objectName string) (*cuda.NetworkObject, error)

get a network object by name

func (*Api) GetService

func (api *Api) GetService(ctx context.Context, service string) (*cuda.Service, error)

func (*Api) ListAdmins

func (api *Api) ListAdmins(ctx context.Context) ([]cuda.Admin, error)

func (*Api) ListAdminsSimple

func (api *Api) ListAdminsSimple(ctx context.Context) ([]string, error)

func (*Api) ListBoxes

func (api *Api) ListBoxes(ctx context.Context, rangeID string, clusterName string) ([]cuda.Box, error)

func (*Api) ListBoxesSimple

func (api *Api) ListBoxesSimple(ctx context.Context, rangeID string, clusterName string) ([]string, error)

func (*Api) ListClusters

func (api *Api) ListClusters(ctx context.Context, rangeID string) ([]cuda.Cluster, error)

func (*Api) ListClustersSimple

func (api *Api) ListClustersSimple(ctx context.Context, rangeID string) ([]string, error)

func (*Api) ListNetworkObjects

func (api *Api) ListNetworkObjects(ctx context.Context) ([]cuda.NetworkObject, error)

list all network objects

func (*Api) ListNetworkObjectsSimple

func (api *Api) ListNetworkObjectsSimple(ctx context.Context) ([]string, error)

let all names of network objects

func (*Api) ListRanges

func (api *Api) ListRanges(ctx context.Context) ([]cuda.Range, error)

func (*Api) ListRangesSimple

func (api *Api) ListRangesSimple(ctx context.Context) ([]string, error)

func (*Api) ListServices

func (api *Api) ListServices(ctx context.Context) ([]cuda.Service, error)

func (*Api) ListServicesSimple

func (api *Api) ListServicesSimple(ctx context.Context) ([]string, error)

func (*Api) ListSessions

func (api *Api) ListSessions(ctx context.Context) ([]cuda.Session, error)

func (*Api) MakeNetworkObject

func (api *Api) MakeNetworkObject(ctx context.Context, object *cuda.NetworkObject) error

create a new network object

func (*Api) Patch

func (api *Api) Patch(ctx context.Context, endpoint string, body interface{}, target interface{}) error

func (*Api) Post

func (api *Api) Post(ctx context.Context, endpoint string, body interface{}, target interface{}) error

func (*Api) Put

func (api *Api) Put(ctx context.Context, endpoint string, body interface{}, target interface{}) error

func (*Api) ReplaceNetworkObject

func (api *Api) ReplaceNetworkObject(ctx context.Context, object *cuda.NetworkObject) error

replace a network object with a completely new value

func (*Api) RestartService

func (api *Api) RestartService(ctx context.Context, service string) error

func (*Api) StartService

func (api *Api) StartService(ctx context.Context, service string) error

func (*Api) StopService

func (api *Api) StopService(ctx context.Context, service string) error

func (*Api) UpdateNetworkObject

func (api *Api) UpdateNetworkObject(ctx context.Context, object cuda.NetworkObjectUpdate) error

update a network object with a differential value change

type ApiErr

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

func (*ApiErr) Error

func (apiErr *ApiErr) Error() string

type ContextInfoCC

type ContextInfoCC struct {
	// if empty, is global
	Range   string
	Cluster string
	// either:
	Box        string
	BoxService string
	// or...
	Server        string
	ServerService string
	// or...
	ClusterService string
	// or...
	SharedService string
}

Context information passed

type ContextInfoFW

type ContextInfoFW struct {
	Shared     bool
	SharedType FirewallSharedType
}

type FirewallSharedType

type FirewallSharedType string
const (
	FirewallSharedLocal   FirewallSharedType = "local"
	FirewallSharedSpecial FirewallSharedType = "special"
)

Jump to

Keyboard shortcuts

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