Documentation
¶
Overview ¶
API to manage load balancer instance
Index ¶
- type BackendCreateRequest
- type BackendDeleteRequest
- type BackendServerAddRequest
- type BackendServerDeleteRequest
- type BackendServerUpdateRequest
- type BackendUpdateRequest
- type ConfigResetRequest
- type CreateRequest
- type DeleteRequest
- type DisableEnableRequest
- type FrontendBindDeleteRequest
- type FrontendBindRequest
- type FrontendBindUpdateRequest
- type FrontendCreateRequest
- type FrontendDeleteRequest
- type GetRequest
- type HighlyAvailableRequest
- type ItemBackend
- type ItemBinding
- type ItemFrontend
- type ItemLoadBalancer
- type ItemServer
- type LB
- func (l LB) BackendCreate(ctx context.Context, req BackendCreateRequest) (bool, error)
- func (l LB) BackendDelete(ctx context.Context, req BackendDeleteRequest) (bool, error)
- func (l LB) BackendServerAdd(ctx context.Context, req BackendServerAddRequest) (bool, error)
- func (l LB) BackendServerDelete(ctx context.Context, req BackendServerDeleteRequest) (bool, error)
- func (l LB) BackendServerUpdate(ctx context.Context, req BackendServerUpdateRequest) (bool, error)
- func (l LB) BackendUpdate(ctx context.Context, req BackendUpdateRequest) (bool, error)
- func (l LB) ConfigReset(ctx context.Context, req ConfigResetRequest) (bool, error)
- func (l LB) Create(ctx context.Context, req CreateRequest) (uint64, error)
- func (l LB) Delete(ctx context.Context, req DeleteRequest) (bool, error)
- func (l LB) Disable(ctx context.Context, req DisableEnableRequest) (bool, error)
- func (l LB) Enable(ctx context.Context, req DisableEnableRequest) (bool, error)
- func (l LB) FrontendBind(ctx context.Context, req FrontendBindRequest) (string, error)
- func (l LB) FrontendBindDelete(ctx context.Context, req FrontendBindDeleteRequest) (string, error)
- func (l LB) FrontendBindUpdate(ctx context.Context, req FrontendBindUpdateRequest) (string, error)
- func (l LB) FrontendCreate(ctx context.Context, req FrontendCreateRequest) (bool, error)
- func (l LB) FrontendDelete(ctx context.Context, req FrontendDeleteRequest) (bool, error)
- func (l LB) Get(ctx context.Context, req GetRequest) (*RecordLB, error)
- func (l LB) GetRaw(ctx context.Context, req GetRequest) ([]byte, error)
- func (l LB) HighlyAvailable(ctx context.Context, req HighlyAvailableRequest) (uint64, error)
- func (l LB) List(ctx context.Context, req ListRequest) (*ListLB, error)
- func (l LB) ListDeleted(ctx context.Context, req ListDeletedRequest) (*ListLB, error)
- func (l LB) ListRaw(ctx context.Context, req ListRequest) ([]byte, error)
- func (l LB) Restart(ctx context.Context, req RestartRequest) (bool, error)
- func (l LB) Restore(ctx context.Context, req RestoreRequest) (bool, error)
- func (l LB) Start(ctx context.Context, req StartRequest) (bool, error)
- func (l LB) Stop(ctx context.Context, req StopRequest) (bool, error)
- func (l LB) Update(ctx context.Context, req UpdateRequest) (bool, error)
- func (l LB) UpdateSysctlParams(ctx context.Context, req UpdateSysctParamsRequest) (bool, error)
- type ListBackends
- type ListBindings
- type ListDeletedRequest
- type ListFrontends
- type ListLB
- func (ll ListLB) FilterByExtNetID(extNetID int64) ListLB
- func (ll ListLB) FilterByID(id uint64) ListLB
- func (ll ListLB) FilterByImageID(imageID uint64) ListLB
- func (ll ListLB) FilterByK8SID(ctx context.Context, k8sID uint64, decortClient interfaces.Caller) (*ListLB, error)
- func (ll ListLB) FilterByName(name string) ListLB
- func (ll ListLB) FilterFunc(predicate func(ItemLoadBalancer) bool) ListLB
- func (ll ListLB) FindOne() ItemLoadBalancer
- func (llb ListLB) IDs() []uint64
- func (ll ListLB) Serialize(params ...string) (serialization.Serialized, error)
- func (ll ListLB) SortByCreatedTime(inverse bool) ListLB
- func (ll ListLB) SortByDeletedTime(inverse bool) ListLB
- func (ll ListLB) SortByUpdatedTime(inverse bool) ListLB
- type ListRequest
- type ListServers
- type RecordLB
- type RecordNode
- type RecordServerSettings
- type RestartRequest
- type RestoreRequest
- type StartRequest
- type StopRequest
- type UpdateRequest
- type UpdateSysctParamsRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackendCreateRequest ¶
type BackendCreateRequest struct { // ID of the load balancer instance to backendCreate // Required: true LBID uint64 `url:"lbId" json:"lbId" validate:"required"` // Must be unique among all backends of this load balancer - name of the new backend to create // Required: true BackendName string `url:"backendName" json:"backendName" validate:"required"` // Algorithm // Should be one of: // - roundrobin // - static-rr // - leastconn // Required: false Algorithm string `url:"algorithm,omitempty" json:"algorithm,omitempty" validate:"omitempty,lbAlgorithm"` // Interval in milliseconds between two consecutive availability // checks of the server that is considered available // Required: false Inter uint64 `url:"inter,omitempty" json:"inter,omitempty"` // Interval in milliseconds between two consecutive checks to // restore the availability of a server that is currently considered unavailable // Required: false DownInter uint64 `url:"downinter,omitempty" json:"downinter,omitempty"` // Number of checks that the server must pass in order to get the available status // and be included in the balancing scheme again // Required: false Rise uint64 `url:"rise,omitempty" json:"rise,omitempty"` // Number of consecutive failed availability checks, // after which the previously considered available server receives the status of // unavailable and is temporarily excluded from the balancing scheme // Required: false Fall uint64 `url:"fall,omitempty" json:"fall,omitempty"` // Interval in milliseconds from the moment the server receives the available status, // after which the number of actually allowed connections to this server will be returned to 100% of the set limit // Required: false SlowStart uint64 `url:"slowstart,omitempty" json:"slowstart,omitempty"` // Limit of simultaneous connections to the server. When this limit is reached, // the server is temporarily excluded from the balancing scheme // Required: false MaxConn uint64 `url:"maxconn,omitempty" json:"maxconn,omitempty"` // Limit of connections waiting in the queue. // When this limit is reached, all subsequent connections will be forwarded to other servers // Required: false MaxQueue uint64 `url:"maxqueue,omitempty" json:"maxqueue,omitempty"` // Server weight for use in weight balancing algorithms // Required: false Weight uint64 `url:"weight,omitempty" json:"weight,omitempty"` }
BackendCreateRequest struct to create backend
type BackendDeleteRequest ¶
type BackendDeleteRequest struct { // ID of the load balancer instance to BackendDelete // Required: true LBID uint64 `url:"lbId" json:"lbId" validate:"required"` // Cannot be emtpy string - name of the backend to delete // Required: true BackendName string `url:"backendName" json:"backendName" validate:"required"` }
BackendDeleteRequest struct to delete backend
type BackendServerAddRequest ¶
type BackendServerAddRequest struct { // ID of the load balancer instance to BackendServerAdd // Required: true LBID uint64 `url:"lbId" json:"lbId" validate:"required"` // Must match one of the existing backens - name of the backend to add servers to // Required: true BackendName string `url:"backendName" json:"backendName" validate:"required"` // Must be unique among all servers defined for this backend - name of the server definition to add // Required: true ServerName string `url:"serverName" json:"serverName" validate:"required"` // IP address of the server // Required: true Address string `url:"address" json:"address" validate:"required"` // Port number on the server // Required: true Port uint64 `url:"port" json:"port" validate:"required"` // Set to disabled if this server should be used regardless of its state // Required: false Check string `url:"check,omitempty" json:"check,omitempty"` // Interval in milliseconds between two consecutive availability checks of the server that is considered available // Required: false Inter uint64 `url:"inter,omitempty" json:"inter,omitempty"` // Interval in milliseconds between two consecutive checks to restore // the availability of a server that is currently considered unavailable // Required: false DownInter uint64 `url:"downinter,omitempty" json:"downinter,omitempty"` // Number of checks that the server must pass in order to get // the available status and be included in the balancing scheme again // Required: false Rise uint64 `url:"rise,omitempty" json:"rise,omitempty"` // Number of consecutive failed availability checks, // after which the previously considered available server receives the status of unavailable and // is temporarily excluded from the balancing scheme // Required: false Fall uint64 `url:"fall,omitempty" json:"fall,omitempty"` // Interval in milliseconds from the moment the server receives the available status, // after which the number of actually allowed connections to this server will be returned to 100% of the set limit // Required: false SlowStart uint64 `url:"slowstart,omitempty" json:"slowstart,omitempty"` // Limit of simultaneous connections to the server. When this limit is reached, the server is temporarily excluded from the balancing scheme // Required: false MaxConn uint64 `url:"maxconn,omitempty" json:"maxconn,omitempty"` // Limit of connections waiting in the queue. When this limit is reached, all subsequent connections will be forwarded to other servers // Required: false MaxQueue uint64 `url:"maxqueue,omitempty" json:"maxqueue,omitempty"` // Server weight for use in weight balancing algorithms // Required: false Weight uint64 `url:"weight,omitempty" json:"weight,omitempty"` }
BackendServerAddRequest struct to add server definition to the backend
type BackendServerDeleteRequest ¶
type BackendServerDeleteRequest struct { // ID of the load balancer instance to BackendServerDelete // Required: true LBID uint64 `url:"lbId" json:"lbId" validate:"required"` // Must match one of the existing backends - name of the backend to add servers to // Required: true BackendName string `url:"backendName" json:"backendName" validate:"required"` // Must be unique among all servers defined for this backend - name of the server definition to add // Required: true ServerName string `url:"serverName" json:"serverName" validate:"required"` }
BackendServerDeleteRequest struct to delete server definition
type BackendServerUpdateRequest ¶
type BackendServerUpdateRequest struct { // ID of the load balancer instance to BackendServerAdd // Required: true LBID uint64 `url:"lbId" json:"lbId" validate:"required"` // Must match one of the existing backends - name of the backend to add servers to // Required: true BackendName string `url:"backendName" json:"backendName" validate:"required"` // Must be unique among all servers defined for this backend - name of the server definition to add // Required: true ServerName string `url:"serverName" json:"serverName" validate:"required"` // IP address of the server // Required: true Address string `url:"address" json:"address" validate:"required"` // Port number on the server // Required: true Port uint64 `url:"port" json:"port" validate:"required"` // Set to disabled if this server should be used regardless of its state // Required: false Check string `url:"check,omitempty" json:"check,omitempty"` // Interval in milliseconds between two consecutive availability checks of the server that is considered available // Required: false Inter uint64 `url:"inter,omitempty" json:"inter,omitempty"` // Interval in milliseconds between two consecutive checks to restore // the availability of a server that is currently considered unavailable // Required: false DownInter uint64 `url:"downinter,omitempty" json:"downinter,omitempty"` // Number of checks that the server must pass in order to get // the available status and be included in the balancing scheme again // Required: false Rise uint64 `url:"rise,omitempty" json:"rise,omitempty"` // Number of consecutive failed availability checks, // after which the previously considered available server receives the status of unavailable and // is temporarily excluded from the balancing scheme // Required: false Fall uint64 `url:"fall,omitempty" json:"fall,omitempty"` // Interval in milliseconds from the moment the server receives the available status, // after which the number of actually allowed connections to this server will be returned to 100% of the set limit // Required: false SlowStart uint64 `url:"slowstart,omitempty" json:"slowstart,omitempty"` // Limit of simultaneous connections to the server. When this limit is reached, the server is temporarily excluded from the balancing scheme // Required: false MaxConn uint64 `url:"maxconn,omitempty" json:"maxconn,omitempty"` // Limit of connections waiting in the queue. When this limit is reached, all subsequent connections will be forwarded to other servers // Required: false MaxQueue uint64 `url:"maxqueue,omitempty" json:"maxqueue,omitempty"` // Server weight for use in weight balancing algorithms // Required: false Weight uint64 `url:"weight,omitempty" json:"weight,omitempty"` }
BackendServerUpdateRequest struct to update server
type BackendUpdateRequest ¶
type BackendUpdateRequest struct { // ID of the load balancer instance to backendCreate // Required: true LBID uint64 `url:"lbId" json:"lbId" validate:"required"` // Must be unique among all backends of this load balancer - name of the new backend to create // Required: true BackendName string `url:"backendName" json:"backendName" validate:"required"` // Algorithm // Should be one of: // - roundrobin // - static-rr // - leastconn // Required: false Algorithm string `url:"algorithm,omitempty" json:"algorithm,omitempty" validate:"omitempty,lbAlgorithm"` // Interval in milliseconds between two consecutive availability // checks of the server that is considered available // Required: false Inter uint64 `url:"inter,omitempty" json:"inter,omitempty"` // Interval in milliseconds between two consecutive checks to // restore the availability of a server that is currently considered unavailable // Required: false DownInter uint64 `url:"downinter,omitempty" json:"downinter,omitempty"` // Number of checks that the server must pass in order to get the available status // and be included in the balancing scheme again // Required: false Rise uint64 `url:"rise,omitempty" json:"rise,omitempty"` // Number of consecutive failed availability checks, // after which the previously considered available server receives the status of // unavailable and is temporarily excluded from the balancing scheme // Required: false Fall uint64 `url:"fall,omitempty" json:"fall,omitempty"` // Interval in milliseconds from the moment the server receives the available status, // after which the number of actually allowed connections to this server will be returned to 100% of the set limit // Required: false SlowStart uint64 `url:"slowstart,omitempty" json:"slowstart,omitempty"` // Limit of simultaneous connections to the server. When this limit is reached, // the server is temporarily excluded from the balancing scheme // Required: false MaxConn uint64 `url:"maxconn,omitempty" json:"maxconn,omitempty"` // Limit of connections waiting in the queue. // When this limit is reached, all subsequent connections will be forwarded to other servers // Required: false MaxQueue uint64 `url:"maxqueue,omitempty" json:"maxqueue,omitempty"` // Server weight for use in weight balancing algorithms // Required: false Weight uint64 `url:"weight,omitempty" json:"weight,omitempty"` }
BackendUpdateRequest struct to update backend
type ConfigResetRequest ¶
type ConfigResetRequest struct { // ID of the load balancer instance to ConfigReset // Required: true LBID uint64 `url:"lbId" json:"lbId" validate:"required"` }
ConfigResetRequest struct for reset config
type CreateRequest ¶
type CreateRequest struct { // ID of the resource group where this load balancer instance will be located // Required: true RGID uint64 `url:"rgId" json:"rgId" validate:"required"` // Name of the load balancer. // Must be unique among all load balancers in this Resource Group // Required: true Name string `url:"name" json:"name" validate:"required"` // External network to connect this load balancer to // Required: true, can be 0 ExtNetID uint64 `url:"extnetId" json:"extnetId"` // Internal network (VINS) to connect this load balancer to // Required: true, can be 0 VINSID uint64 `url:"vinsId" json:"vinsId"` // Custom sysctl values for Load Balancer instance. Applied on boot // Required: false SysctlParams []map[string]interface{} `url:"-" json:"sysctlParams,omitempty" validate:"omitempty,dive"` // Use Highly Available schema for LB deploy // Required: false HighlyAvailable bool `url:"highlyAvailable,omitempty" json:"highlyAvailable,omitempty"` // Start now Load balancer // Required: false Start bool `url:"start" json:"start"` // Text description of this load balancer // Required: false Description string `url:"desc,omitempty" json:"desc,omitempty"` }
CreateRequest struct to create load balancer
type DeleteRequest ¶
type DeleteRequest struct { // ID of the load balancer instance to delete // Required: true LBID uint64 `url:"lbId" json:"lbId" validate:"required"` // Set to true to delete load balancer immediately bypassing recycle bin // Required: false Permanently bool `url:"permanently,omitempty" json:"permanently,omitempty"` }
DeleteRequest struct to delete load balancer
type DisableEnableRequest ¶
type DisableEnableRequest struct { // ID of the load balancer instance to disable/enable // Required: true LBID uint64 `url:"lbId" json:"lbId" validate:"required"` }
DisableEnableRequest struct for disable/enable load balancer
type FrontendBindDeleteRequest ¶
type FrontendBindDeleteRequest struct { // ID of the load balancer instance to FrontendBindDelete // Required: true LBID uint64 `url:"lbId" json:"lbId" validate:"required"` // Name of the frontend to delete // Required: true FrontendName string `url:"frontendName" json:"frontendName" validate:"required"` // Name of the binding to delete // Required: true BindingName string `url:"bindingName" json:"bindingName" validate:"required"` }
FrontendBindDeleteRequest struct to delete bind
type FrontendBindRequest ¶
type FrontendBindRequest struct { // ID of the load balancer instance to FrontendBind // Required: true LBID uint64 `url:"lbId" json:"lbId" validate:"required"` // Name of the frontend to update // Required: true FrontendName string `url:"frontendName" json:"frontendName" validate:"required"` // Name of the binding to update // Required: true BindingName string `url:"bindingName" json:"bindingName" validate:"required"` // If specified must be within the IP range of either Ext Net or ViNS, // where this load balancer is connected - new IP address to use for this binding. // If omitted, current IP address is retained // Required: true BindingAddress string `url:"bindingAddress" json:"bindingAddress" validate:"required"` // New port number to use for this binding. // If omitted, current port number is retained // Required: true BindingPort uint64 `url:"bindingPort" json:"bindingPort" validate:"required"` }
FrontendBindRequest struct for frontend bind
type FrontendBindUpdateRequest ¶
type FrontendBindUpdateRequest struct { // ID of the load balancer instance to FrontendBindUpdate // Required: true LBID uint64 `url:"lbId" json:"lbId" validate:"required"` // Name of the frontend to update // Required: true FrontendName string `url:"frontendName" json:"frontendName" validate:"required"` // Name of the binding to update // Required: true BindingName string `url:"bindingName" json:"bindingName" validate:"required"` // If specified must be within the IP range of either Ext Net or ViNS, // where this load balancer is connected - new IP address to use for this binding. // If omitted, current IP address is retained // Required: true BindingAddress string `url:"bindingAddress" json:"bindingAddress" validate:"required"` // New port number to use for this binding. // If omitted, current port number is retained // Required: true BindingPort uint64 `url:"bindingPort" json:"bindingPort" validate:"required"` }
FrontendBindUpdateRequest struct to update binding
type FrontendCreateRequest ¶
type FrontendCreateRequest struct { // ID of the load balancer instance to FrontendCreate // Required: true LBID uint64 `url:"lbId" json:"lbId" validate:"required"` // Must be unique among all frontends of // this load balancer - name of the new frontend to create // Required: true FrontendName string `url:"frontendName" json:"frontendName" validate:"required"` // Should be one of the backends existing on // this load balancer - name of the backend to use // Required: true BackendName string `url:"backendName" json:"backendName" validate:"required"` }
FrontendCreateRequest struct to create frontend
type FrontendDeleteRequest ¶
type FrontendDeleteRequest struct { // ID of the load balancer instance to FrontendDelete // Required: true LBID uint64 `url:"lbId" json:"lbId" validate:"required"` // Name of the frontend to delete // Required: true FrontendName string `url:"frontendName" json:"frontendName" validate:"required"` }
FrontendDeleteRequest struct to delete frontend
type GetRequest ¶
type GetRequest struct { // ID of the load balancer to get details for // Required: true LBID uint64 `url:"lbId" json:"lbId" validate:"required"` }
GetRequest struct to get detailed information about load balancer
type HighlyAvailableRequest ¶ added in v1.6.0
type HighlyAvailableRequest struct { // ID of the LB instance // Required: true LBID uint64 `url:"lbId" json:"lbId" validate:"required"` }
HighlyAvailableRequest struct to make Load Balancer Highly available
type ItemBackend ¶
type ItemBackend struct { // Algorithm Algorithm string `json:"algorithm"` // GUID GUID string `json:"guid"` // Name Name string `json:"name"` // Server settings ServerDefaultSettings RecordServerSettings `json:"serverDefaultSettings"` // List of servers Servers ListServers `json:"servers"` }
Main information about backend
type ItemBinding ¶
type ItemBinding struct { // Address Address string `json:"address"` // GUID GUID string `json:"guid"` // Name Name string `json:"name"` // Port Port uint64 `json:"port"` }
Main information about bindings
type ItemFrontend ¶
type ItemFrontend struct { // Backend Backend string `json:"backend"` // List of bindings Bindings ListBindings `json:"bindings"` // GUID GUID string `json:"guid"` // Name Name string `json:"name"` }
Main information about frontend
type ItemLoadBalancer ¶
type ItemLoadBalancer struct { // DPAPIPassword DPAPIPassword string `json:"dpApiPassword"` // Detailed information about load balancer RecordLB }
Main information about load balancer
func (ItemLoadBalancer) Serialize ¶
func (ill ItemLoadBalancer) Serialize(params ...string) (serialization.Serialized, error)
Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.
In order to serialize with indent make sure to follow these guidelines:
- First argument -> prefix
- Second argument -> indent
type ItemServer ¶
type ItemServer struct { // Address Address string `json:"address"` // Check Check string `json:"check"` // GUID GUID string `json:"guid"` // Name Name string `json:"name"` // Port Port uint64 `json:"port"` // Server settings ServerSettings RecordServerSettings `json:"serverSettings"` }
Main information about server
type LB ¶
type LB struct {
// contains filtered or unexported fields
}
Structure for creating request to load balancer
func (LB) BackendCreate ¶
BackendCreate creates new backend on the specified load balancer
func (LB) BackendDelete ¶
BackendDelete deletes backend from the specified load balancer. Warning: you cannot undo this action!
func (LB) BackendServerAdd ¶
BackendServerAdd adds server definition to the backend on the specified load balancer
func (LB) BackendServerDelete ¶
BackendServerDelete deletes server definition from the backend on the specified load balancer. Warning: you cannot undo this action!
func (LB) BackendServerUpdate ¶
BackendServerUpdate updates server definition on the backend of load balancer
func (LB) BackendUpdate ¶
BackendUpdate updates existing backend on the specified load balancer. Note that backend name cannot be changed
func (LB) ConfigReset ¶
ConfigReset reset current software configuration of the specified load balancer. Warning: this action cannot be undone!
func (LB) FrontendBind ¶
FrontendBind bind frontend from specified load balancer instance
func (LB) FrontendBindDelete ¶
FrontendBindDelete deletes binding from the specified load balancer frontend
func (LB) FrontendBindUpdate ¶
FrontendBindUpdate updates binding for the specified load balancer frontend
func (LB) FrontendCreate ¶
FrontendCreate creates new frontend on the specified load balancer
func (LB) FrontendDelete ¶
FrontendDelete deletes frontend from the specified load balancer. Warning: you cannot undo this action!
func (LB) GetRaw ¶ added in v1.6.6
GetRaw gets detailed information about load balancer as an array of bytes
func (LB) HighlyAvailable ¶ added in v1.6.0
HighlyAvailable makes load balancer highly available
func (LB) ListDeleted ¶
ListDeleted gets list of deleted load balancers
func (LB) UpdateSysctlParams ¶ added in v1.8.0
UpdateSysctParams updates sysct paarams for lb
type ListDeletedRequest ¶
type ListDeletedRequest struct { // Find by ID // Required: false ByID uint64 `url:"by_id,omitempty" json:"by_id,omitempty"` // Find by name // Required: false Name string `url:"name,omitempty" json:"name,omitempty"` // Find by account ID // Required: false AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"` // Find by resource group ID // Required: false RGID uint64 `url:"rgId,omitempty" json:"rgId,omitempty"` // Find by tech status // Required: false TechStatus string `url:"techStatus,omitempty" json:"techStatus,omitempty"` // Find by frontend Ip // Required: false FrontIP string `url:"frontIp,omitempty" json:"frontIp,omitempty"` // Find by backend Ip // Required: false BackIP string `url:"backIp,omitempty" json:"backIp,omitempty"` // Sort by one of supported fields, format +|-(field) // Required: false SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty" validate:"omitempty,sortBy"` // Page number // Required: false Page uint64 `url:"page,omitempty" json:"page,omitempty"` // Page size // Required: true Size uint64 `url:"size,omitempty" json:"size,omitempty"` }
ListDeletedRequest struct to get list of deleted load balancers
type ListLB ¶
type ListLB struct { // Data Data []ItemLoadBalancer `json:"data"` // EntryCount EntryCount uint64 `json:"entryCount"` }
List of load balancers
func (ListLB) FilterByExtNetID ¶
FilterByExtNetID returns ListLB with specified ExtNetID.
func (ListLB) FilterByID ¶
FilterByID returns ListLB with specified ID.
func (ListLB) FilterByImageID ¶
FilterByImageID returns ListLB with specified ImageID.
func (ListLB) FilterByK8SID ¶ added in v1.3.0
func (ll ListLB) FilterByK8SID(ctx context.Context, k8sID uint64, decortClient interfaces.Caller) (*ListLB, error)
FilterByK8SID returns ListLB used by specified K8S cluster.
func (ListLB) FilterByName ¶
FilterByName returns ListLB with specified Name.
func (ListLB) FilterFunc ¶
func (ll ListLB) FilterFunc(predicate func(ItemLoadBalancer) bool) ListLB
FilterFunc allows filtering ListLB based on a user-specified predicate.
func (ListLB) FindOne ¶
func (ll ListLB) FindOne() ItemLoadBalancer
FindOne returns first found ItemLoadBalancer If none was found, returns an empty struct.
func (ListLB) Serialize ¶
func (ll ListLB) Serialize(params ...string) (serialization.Serialized, error)
Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.
In order to serialize with indent make sure to follow these guidelines:
- First argument -> prefix
- Second argument -> indent
func (ListLB) SortByCreatedTime ¶
SortByCreatedTime sorts ListLB by the CreatedTime field in ascending order.
If inverse param is set to true, the order is reversed.
func (ListLB) SortByDeletedTime ¶
SortByDeletedTime sorts ListLB by the DeletedTime field in ascending order.
If inverse param is set to true, the order is reversed.
func (ListLB) SortByUpdatedTime ¶
SortByUpdatedTime sorts ListLB by the UpdatedTime field in ascending order.
If inverse param is set to true, the order is reversed.
type ListRequest ¶
type ListRequest struct { // Find by ID // Required: false ByID uint64 `url:"by_id,omitempty" json:"by_id,omitempty"` // Find by name // Required: false Name string `url:"name,omitempty" json:"name,omitempty"` // Find by account ID // Required: false AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"` // Find by resource group ID // Required: false RGID uint64 `url:"rgId,omitempty" json:"rgId,omitempty"` // Find by tech status // Required: false TechStatus string `url:"techStatus,omitempty" json:"techStatus,omitempty"` // Find by status // Required: false Status string `url:"status,omitempty" json:"status,omitempty"` // Find by frontend Ip // Required: false FrontIP string `url:"frontIp,omitempty" json:"frontIp,omitempty"` // Find by backend Ip // Required: false BackIP string `url:"backIp,omitempty" json:"backIp,omitempty"` // Included deleted load balancers // Required: false IncludeDeleted bool `url:"includedeleted,omitempty" json:"includedeleted,omitempty"` // Sort by one of supported fields, format +|-(field) // Required: false SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty" validate:"omitempty,sortBy"` // Page number // Required: false Page uint64 `url:"page,omitempty" json:"page,omitempty"` // Page size // Required: false Size uint64 `url:"size,omitempty" json:"size,omitempty"` }
ListRequest struct to get list of load balancers
type RecordLB ¶
type RecordLB struct { //HAMode HAMode bool `json:"HAmode"` // Access Control List ACL interface{} `json:"acl"` // BackendHAIP BackendHAIP string `json:"backendHAIP"` // List of load balancer backends Backends ListBackends `json:"backends"` // Created by CreatedBy string `json:"createdBy"` // Created time CreatedTime uint64 `json:"createdTime"` // Deleted by DeletedBy string `json:"deletedBy"` // Deleted time DeletedTime uint64 `json:"deletedTime"` // Description Description string `json:"desc"` // DPAPIUser DPAPIUser string `json:"dpApiUser"` // External network ID ExtNetID int64 `json:"extnetId"` // FrontendHAIP FrontendHAIP string `json:"frontendHAIP"` // List of load balancer frontends Frontends ListFrontends `json:"frontends"` // Grid ID GID uint64 `json:"gid"` // GUID GUID uint64 `json:"guid"` // ID ID uint64 `json:"id"` // ManagerId ManagerId uint64 `json:"managerId"` // ManagerType ManagerType string `json:"managerType"` // Image ID ImageID uint64 `json:"imageId"` // Milestones Milestones uint64 `json:"milestones"` // Name Name string `json:"name"` // Part K8s PartK8s bool `json:"partK8s"` // Primary node PrimaryNode RecordNode `json:"primaryNode"` // Resource group ID RGID uint64 `json:"rgId"` // Resource group name RGName string `json:"rgName"` // Secondary node SecondaryNode RecordNode `json:"secondaryNode"` // Status Status string `json:"status"` // Sysctl Params SysctlParams interface{} `json:"sysctlParams"` // Tech status TechStatus string `json:"techStatus"` // Updated by UpdatedBy string `json:"updatedBy"` // Updated time UpdatedTime uint64 `json:"updatedTime"` // UserManaged UserManaged bool `json:"userManaged"` // VINS ID VINSID uint64 `json:"vinsId"` }
Detailed information about load balancer
type RecordNode ¶
type RecordNode struct { // Backend IP BackendIP string `json:"backendIp"` // Compute ID ComputeID uint64 `json:"computeId"` // Frontend IP FrontendIP string `json:"frontendIp"` // GUID GUID string `json:"guid"` // MGMTIP MGMTIP string `json:"mgmtIp"` // Network ID NetworkID uint64 `json:"networkId"` }
Main information about node
type RecordServerSettings ¶
type RecordServerSettings struct { // Inter Inter uint64 `json:"inter"` // GUID GUID string `json:"guid"` // DownInter DownInter uint64 `json:"downinter"` // Rise Rise uint64 `json:"rise"` // Fall Fall uint64 `json:"fall"` // SlowStart SlowStart uint64 `json:"slowstart"` // Max connections MaxConn uint64 `json:"maxconn"` // Max queue MaxQueue uint64 `json:"maxqueue"` // Weight Weight uint64 `json:"weight"` }
Server settings
type RestartRequest ¶
type RestartRequest struct { // ID of the load balancer instance to restart // Required: true LBID uint64 `url:"lbId" json:"lbId" validate:"required"` // restart secondary and primary nodes sequentially in HA mode // Default is true // Required: false Safe bool `url:"safe" json:"safe"` }
RestartRequest struct to restart load balancer
type RestoreRequest ¶
type RestoreRequest struct { // ID of the load balancer instance to restore // Required: true LBID uint64 `url:"lbId" json:"lbId" validate:"required"` }
RestoreRequest struct to restore load balancer
type StartRequest ¶
type StartRequest struct { // ID of the load balancer instance to start // Required: true LBID uint64 `url:"lbId" json:"lbId" validate:"required"` }
StartRequest struct to start load balancer
type StopRequest ¶
type StopRequest struct { // ID of the load balancer instance to stop // Required: true LBID uint64 `url:"lbId" json:"lbId" validate:"required"` }
StopRequest struct to stop load balancer
type UpdateRequest ¶
type UpdateRequest struct { // ID of the load balancer to update // Required: true LBID uint64 `url:"lbId" json:"lbId" validate:"required"` // New description of this load balancer. // If omitted, current description is retained // Required: true Description string `url:"desc" json:"desc" validate:"required"` }
UpdateRequest struct to update load balancer
type UpdateSysctParamsRequest ¶ added in v1.6.0
type UpdateSysctParamsRequest struct { // ID of the LB instance // Required: true LBID uint64 `url:"lbId" json:"lbId" validate:"required"` // Custom sysctl values for Load Balancer instance. Applied on boot // Required: true SysctlParams []map[string]interface{} `url:"-" json:"sysctlParams" validate:"required,dive"` }
UpdateSysctParamsRequest struct to update sysct params for lb
Source Files
¶
- backend_create.go
- backend_delete.go
- backend_server_add.go
- backend_server_delete.go
- backend_server_update.go
- backend_update.go
- config_reset.go
- create.go
- delete.go
- disable_enable.go
- filter.go
- frontend_bind.go
- frontend_bind_delete.go
- frontend_bind_update.go
- frontend_create.go
- frontend_delete.go
- get.go
- ids.go
- lb.go
- list.go
- list_deleted.go
- make_highly_available.go
- models.go
- restart.go
- restore.go
- serialize.go
- sorting.go
- start.go
- stop.go
- update.go
- update_sysctl_params.go