k8ci

package
v1.6.7 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

API to manage K8CI instances

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateRequest

type CreateRequest struct {
	// Name of catalog item
	// Required: true
	Name string `url:"name" json:"name" validate:"required"`

	// Version tag
	// Required: true
	Version string `url:"version" json:"version" validate:"required"`

	// Optional description
	// Required: false
	Description string `url:"description,omitempty" json:"description,omitempty"`

	// Image ID for master K8S node
	// Required: true
	MasterImageID uint64 `url:"masterImageId" json:"masterImageId" validate:"required"`

	// Compute driver
	// Should be one of:
	//	- KVM_X86
	//	- KVM_PPC
	//	- etc
	// Required: true
	MasterDriver string `url:"masterDriver" json:"masterDriver" validate:"driver"`

	// Image ID for worker K8S node
	// Required: true
	WorkerImageID uint64 `url:"workerImageId" json:"workerImageId" validate:"required"`

	// Compute driver
	// Should be one of
	//	- KVM_X86
	//	- KVM_PPC
	//	- etc
	// Required: true
	WorkerDriver string `url:"workerDriver" json:"workerDriver" validate:"driver"`

	// List of account IDs, which have access to this item.
	// If empty, any account has access
	// Required: false
	SharedWith []uint64 `url:"sharedWith,omitempty" json:"sharedWith,omitempty"`

	// Policy limit on maximum number of master nodes
	// Required: true
	MaxMasterCount uint64 `url:"maxMasterCount" json:"maxMasterCount" validate:"required"`

	// Policy limit on maximum number of worker nodes
	// Required: true
	MaxWorkerCount uint64 `url:"maxWorkerCount" json:"maxWorkerCount" validate:"required"`

	// Network plugins
	// Values of slice must be flannel, weawenet or calico
	//Required: true
	NetworkPlugins []string `url:"networkPlugins" json:"networkPlugins" validate:"required,networkPlugins"`
}

CreateRequest struct to create K8CI instance

type DeleteRequest

type DeleteRequest struct {
	// K8CI ID
	// Required: true
	K8CIID uint64 `url:"k8ciId" json:"k8ciId" validate:"required"`

	// Delete permanently or not
	// Required: false
	Permanently bool `url:"permanently,omitempty" json:"permanently,omitempty"`
}

DeleteRequest struct to delete K8CI

type DisableRequest

type DisableRequest struct {
	// K8CI ID
	// Required: true
	K8CIID uint64 `url:"k8ciId" json:"k8ciId" validate:"required"`
}

DisableRequest struct to disable K8CI

type EnableRequest

type EnableRequest struct {
	// K8CI ID
	// Required: true
	K8CIID uint64 `url:"k8ciId" json:"k8ciId" validate:"required"`
}

EnableRequest struct to enable K8CI

type GetRequest

type GetRequest struct {
	// ID of the K8 catalog item to get
	// Required: true
	K8CIID uint64 `url:"k8ciId" json:"k8ciId" validate:"required"`
}

GetRequest struct to get information about K8CI

type ItemK8CI

type ItemK8CI struct {
	// Created time
	CreatedTime uint64 `json:"createdTime"`
	// Detailed information about K8CI
	RecordK8CIList
}

Main information about K8CI in List

func (ItemK8CI) Serialize

func (ikc ItemK8CI) 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 K8CI

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

Structure for creating request to K8CI

func New

func New(client interfaces.Caller) *K8CI

Builder for K8CI endpoints

func (K8CI) Create

func (k K8CI) Create(ctx context.Context, req CreateRequest) (uint64, error)

Create creates a new K8CI instance

func (K8CI) Delete

func (k K8CI) Delete(ctx context.Context, req DeleteRequest) (bool, error)

Delete deletes K8CI by ID

func (K8CI) Disable

func (k K8CI) Disable(ctx context.Context, req DisableRequest) (bool, error)

Disable disables K8CI

func (K8CI) Enable

func (k K8CI) Enable(ctx context.Context, req EnableRequest) (bool, error)

Enable enables K8CI

func (K8CI) Get

func (k K8CI) Get(ctx context.Context, req GetRequest) (*RecordK8CI, error)

Get gets details of the specified K8 catalog item as a RecordK8CI struct

func (K8CI) GetRaw added in v1.6.6

func (k K8CI) GetRaw(ctx context.Context, req GetRequest) ([]byte, error)

GetRaw gets details of the specified K8 catalog item as an array of bytes

func (K8CI) List

func (k K8CI) List(ctx context.Context, req ListRequest) (*ListK8CI, error)

List gets list of all k8ci catalog items available to the current user as a ListK8CI struct

func (K8CI) ListDeleted

func (k K8CI) ListDeleted(ctx context.Context, req ListDeletedRequest) (*ListK8CI, error)

ListDeleted gets list all deleted k8ci catalog items available to the current user

func (K8CI) ListRaw added in v1.6.6

func (k K8CI) ListRaw(ctx context.Context, req ListRequest) ([]byte, error)

ListRaw gets list of all k8ci catalog items available to the current user as an array of bytes

func (K8CI) Restore

func (k K8CI) Restore(ctx context.Context, req RestoreRequest) (bool, error)

Restore restores K8CI

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 worker driver
	// Required: false
	WorkerDriver string `url:"workerDriver,omitempty" json:"workerDriver,omitempty"`

	// Find by master driver
	// Required: false
	MasterDriver string `url:"masterDriver,omitempty" json:"masterDriver,omitempty"`

	// Find by network plugin
	// Required: false
	NetworkPlugins string `url:"netPlugins,omitempty" json:"masterDrnetPluginsiver,omitempty"`

	// Page number
	// Required: false
	Page uint64 `url:"page,omitempty" json:"page,omitempty"`

	// Page size
	// Required: false
	Size uint64 `url:"size,omitempty" json:"size,omitempty"`
}

ListDeletedRequest struct to get list information about deleted images

type ListK8CI

type ListK8CI struct {
	//Data
	Data []ItemK8CI `json:"data"`

	// Entry count
	EntryCount uint64 `json:"entryCount"`
}

List K8CI

func (ListK8CI) FilterByID

func (lkc ListK8CI) FilterByID(id uint64) ListK8CI

FilterByID returns ListK8CI with specified ID.

func (ListK8CI) FilterByLBImageID

func (lkc ListK8CI) FilterByLBImageID(lbImageID uint64) ListK8CI

FilterByLBImageID returns ListK8CI with specified LBImageID.

func (ListK8CI) FilterByMasterImageID

func (lkc ListK8CI) FilterByMasterImageID(masterImageID uint64) ListK8CI

FilterByMasterImageID returns ListK8CI with specified MasterImageID.

func (ListK8CI) FilterByName

func (lkc ListK8CI) FilterByName(name string) ListK8CI

FilterByName returns ListK8CI with specified Name.

func (ListK8CI) FilterByStatus

func (lkc ListK8CI) FilterByStatus(status string) ListK8CI

FilterByStatus returns ListK8CI with specified Status.

func (ListK8CI) FilterByWorkerImageID

func (lkc ListK8CI) FilterByWorkerImageID(workerImageID uint64) ListK8CI

FilterByWorkerImageID returns ListK8CI with specified WorkerImageID.

func (ListK8CI) FilterFunc

func (lkc ListK8CI) FilterFunc(predicate func(ItemK8CI) bool) ListK8CI

FilterFunc allows filtering ListK8CI based on a user-specified predicate.

func (ListK8CI) FindOne

func (lkc ListK8CI) FindOne() ItemK8CI

FindOne returns first found ItemK8CI If none was found, returns an empty struct.

func (ListK8CI) Serialize

func (lkc ListK8CI) 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 (ListK8CI) SortByCreatedTime

func (lkc ListK8CI) SortByCreatedTime(inverse bool) ListK8CI

SortByCreatedTime sorts ListK8CI by the CreatedTime 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 status
	// Required: false
	Status string `url:"status,omitempty" json:"status,omitempty"`

	// Find by worker driver
	// Required: false
	WorkerDriver string `url:"workerDriver,omitempty" json:"workerDriver,omitempty"`

	// Find by master driver
	// Required: false
	MasterDriver string `url:"masterDriver,omitempty" json:"masterDriver,omitempty"`

	// Find by network plugin
	// Required: false
	NetworkPlugins string `url:"netPlugins,omitempty" json:"masterDrnetPluginsiver,omitempty"`

	// List disabled items as well
	// Required: false
	IncludeDisabled bool `url:"includeDisabled,omitempty" json:"includeDisabled,omitempty"`

	// 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 information about images

type RecordK8CI

type RecordK8CI struct {
	// Description
	Description string `json:"desc"`

	// Grid ID
	GID uint64 `json:"gid"`

	// GUID
	GUID uint64 `json:"guid"`

	// ID
	ID uint64 `json:"id"`

	// Load balancer image ID
	LBImageID uint64 `json:"lbImageId"`

	// Master driver
	MasterDriver string `json:"masterDriver"`

	// Master image ID
	MasterImageID uint64 `json:"masterImageId"`

	// Max master count
	MaxMasterCount uint64 `json:"maxMasterCount"`

	// Max worker count
	MaxWorkerCount uint64 `json:"maxWorkerCount"`

	// Milestones
	Milestones uint64 `json:"milestones"`

	// Name
	Name string `json:"name"`

	//NetworkPlugins
	NetworkPlugins []string `json:"networkPlugins"`

	// Shared with
	SharedWith []uint64 `json:"sharedWith"`

	// Status
	Status string `json:"status"`

	// Version
	Version string `json:"version"`

	// Worker driver
	WorkerDriver string `json:"workerDriver"`

	// Worker image ID
	WorkerImageID uint64 `json:"workerImageId"`
}

Detailed information about K8CI

type RecordK8CIList added in v1.5.8

type RecordK8CIList struct {
	// Description
	Description string `json:"desc"`

	// Grid ID
	GID uint64 `json:"gid"`

	// GUID
	GUID uint64 `json:"guid"`

	// ID
	ID uint64 `json:"id"`

	// Load balancer image ID
	LBImageID uint64 `json:"lbImageId"`

	// Master driver
	MasterDriver string `json:"masterDriver"`

	// Master image ID
	MasterImageID uint64 `json:"masterImageId"`

	// Max master count
	MaxMasterCount uint64 `json:"maxMasterCount"`

	// Max worker count
	MaxWorkerCount uint64 `json:"maxWorkerCount"`

	// Name
	Name string `json:"name"`

	// Shared with
	SharedWith []uint64 `json:"sharedWith"`

	// Status
	Status string `json:"status"`

	// Version
	Version string `json:"version"`

	// Worker driver
	WorkerDriver string `json:"workerDriver"`

	// Worker image ID
	WorkerImageID uint64 `json:"workerImageId"`
}

Detailed information about K8CI in List

type RestoreRequest

type RestoreRequest struct {
	// K8CI ID
	// Required: true
	K8CIID uint64 `url:"k8ciId" json:"k8ciId" validate:"required"`
}

RestoreRequest struct to restore K8CI

Jump to

Keyboard shortcuts

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