kc

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ListNodesPath = "/api/core.kubeclipper.io/v1/nodes"
)

Variables

View Source
var (
	JSONContentTypeHeader = map[string][]string{
		"Content-Type": {"application/json"},
	}
)

Functions

This section is empty.

Types

type BackupList added in v1.2.0

type BackupList struct {
	Items      []v1.Backup `json:"items" description:"paging data"`
	TotalCount int         `json:"totalCount,omitempty" description:"total count"`
}

type BackupPointList added in v1.2.0

type BackupPointList struct {
	Items      []v1.BackupPoint `json:"items" description:"paging data"`
	TotalCount int              `json:"totalCount,omitempty" description:"total count"`
}

type Client

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

func FromConfig added in v1.2.0

func FromConfig(c config.Config) (*Client, error)

func NewClientWithOpts

func NewClientWithOpts(opts ...Opt) (*Client, error)

func (*Client) AddOrRemoveNode added in v1.2.0

func (cli *Client) AddOrRemoveNode(ctx context.Context, patchNode *clusteroperation.PatchNodes, clusterName string) (*ClustersList, error)

func (*Client) CreateBackup added in v1.2.0

func (cli *Client) CreateBackup(ctx context.Context, cluName string, backup *v1.Backup) (*BackupList, error)

func (*Client) CreateBackupPoint added in v1.2.0

func (cli *Client) CreateBackupPoint(ctx context.Context, point *v1.BackupPoint) (*BackupPointList, error)

func (*Client) CreateCluster

func (cli *Client) CreateCluster(ctx context.Context, cluster *v1.Cluster) (*ClustersList, error)

func (*Client) CreateConfigMap added in v1.2.0

func (cli *Client) CreateConfigMap(ctx context.Context, cm *v1.ConfigMap) (*ConfigMapList, error)

func (*Client) CreateRecovery added in v1.2.0

func (cli *Client) CreateRecovery(ctx context.Context, cluName string, recovery *v1.Recovery) (*v1.Recovery, error)

func (*Client) CreateRegistry added in v1.3.1

func (cli *Client) CreateRegistry(ctx context.Context, registry *v1.Registry) (*v1.RegistryList, error)

func (*Client) CreateRole

func (cli *Client) CreateRole(ctx context.Context, role *iamv1.GlobalRole) (*RoleList, error)

func (*Client) CreateTemplate added in v1.3.1

func (cli *Client) CreateTemplate(ctx context.Context, template *v1.Template) (*TemplateList, error)

func (*Client) CreateUser

func (cli *Client) CreateUser(ctx context.Context, user *iamv1.User) (*UsersList, error)

func (*Client) DeleteBackup added in v1.2.0

func (cli *Client) DeleteBackup(ctx context.Context, cluName, backupName string) error

func (*Client) DeleteBackupPoint added in v1.2.0

func (cli *Client) DeleteBackupPoint(ctx context.Context, name string) error

func (*Client) DeleteCluster

func (cli *Client) DeleteCluster(ctx context.Context, name string) error

DeleteCluster Delete Cluster with name Deprecated. Use DeleteClusterWithQuery instead

func (*Client) DeleteClusterWithQuery added in v1.3.1

func (cli *Client) DeleteClusterWithQuery(ctx context.Context, name string, queryString url.Values) error

DeleteClusterWithQuery Delete Cluster with name and custom query parameter

func (*Client) DeleteConfigMap added in v1.2.0

func (cli *Client) DeleteConfigMap(ctx context.Context, name string) error

func (*Client) DeleteNode

func (cli *Client) DeleteNode(ctx context.Context, name string) error

func (*Client) DeleteRegistry added in v1.3.1

func (cli *Client) DeleteRegistry(ctx context.Context, name string) error

func (*Client) DeleteRole

func (cli *Client) DeleteRole(ctx context.Context, name string) error

func (*Client) DeleteTemplate added in v1.3.1

func (cli *Client) DeleteTemplate(ctx context.Context, name string) error

func (*Client) DeleteUser

func (cli *Client) DeleteUser(ctx context.Context, name string) error

func (*Client) DescribeBackup added in v1.2.0

func (cli *Client) DescribeBackup(ctx context.Context, backupName string) (*BackupList, error)

func (*Client) DescribeCluster

func (cli *Client) DescribeCluster(ctx context.Context, name string) (*ClustersList, error)

func (*Client) DescribeConfigMap added in v1.2.0

func (cli *Client) DescribeConfigMap(ctx context.Context, name string) (*ConfigMapList, error)

func (*Client) DescribeNode

func (cli *Client) DescribeNode(ctx context.Context, name string) (*NodesList, error)

func (*Client) DescribeRole

func (cli *Client) DescribeRole(ctx context.Context, name string) (*RoleList, error)

func (*Client) DescribeTemplate added in v1.3.1

func (cli *Client) DescribeTemplate(ctx context.Context, name string) (*TemplateList, error)

func (*Client) DescribeUser

func (cli *Client) DescribeUser(ctx context.Context, name string) (*UsersList, error)

func (*Client) DisableNode added in v1.2.0

func (cli *Client) DisableNode(ctx context.Context, name string) error

func (*Client) EnableNode added in v1.2.0

func (cli *Client) EnableNode(ctx context.Context, name string) error

func (*Client) GetComponentMeta

func (cli *Client) GetComponentMeta(ctx context.Context, query url.Values) (*ComponentMeta, error)

func (*Client) GetPlatformSetting

func (cli *Client) GetPlatformSetting(ctx context.Context) (*v1.DockerRegistry, error)

func (*Client) GetPublicKey added in v1.2.0

func (cli *Client) GetPublicKey(ctx context.Context) (*v1.WebTerminal, error)

func (*Client) HTTPClient

func (cli *Client) HTTPClient() *http.Client

HTTPClient returns a copy of the HTTP client bound to the server

func (*Client) Host

func (cli *Client) Host() string

func (*Client) InstallOrUninstallComponent added in v1.2.0

func (cli *Client) InstallOrUninstallComponent(ctx context.Context, cluName string, component *corev1.PatchComponents) (*ClustersList, error)

func (*Client) ListBackupsWithCluster added in v1.2.0

func (cli *Client) ListBackupsWithCluster(ctx context.Context, clusterName string) (*BackupList, error)

func (*Client) ListClusters

func (cli *Client) ListClusters(ctx context.Context, query Queries) (*ClustersList, error)

func (*Client) ListConfigMaps added in v1.2.0

func (cli *Client) ListConfigMaps(ctx context.Context, query Queries) (*ConfigMapList, error)

func (*Client) ListNodes

func (cli *Client) ListNodes(ctx context.Context, query Queries) (*NodesList, error)

func (*Client) ListOperation added in v1.4.0

func (cli *Client) ListOperation(ctx context.Context, query Queries) (*OperationList, error)

func (*Client) ListRegion added in v1.3.1

func (cli *Client) ListRegion(ctx context.Context, query Queries) (*v1.RegionList, error)

func (*Client) ListRegistries added in v1.3.1

func (cli *Client) ListRegistries(ctx context.Context, query Queries) (*v1.RegistryList, error)

func (*Client) ListRoles

func (cli *Client) ListRoles(ctx context.Context, query Queries) (*RoleList, error)

func (*Client) ListTemplate added in v1.3.1

func (cli *Client) ListTemplate(ctx context.Context, query Queries) (*TemplateList, error)

func (*Client) ListUsers

func (cli *Client) ListUsers(ctx context.Context, query Queries) (*UsersList, error)

func (*Client) Login

func (cli *Client) Login(ctx context.Context, body LoginRequest) (*oauth.Token, error)

func (*Client) PrintLogs added in v1.4.0

func (cli *Client) PrintLogs(ctx context.Context, operation v1.Operation) error

func (*Client) Scheme

func (cli *Client) Scheme() string

func (*Client) Token added in v1.2.0

func (cli *Client) Token() string

func (*Client) UpdateCert added in v1.3.1

func (cli *Client) UpdateCert(ctx context.Context, cluName string) (*ClustersList, error)

func (*Client) UpdateCluster added in v1.3.1

func (cli *Client) UpdateCluster(ctx context.Context, cluster *v1.Cluster) error

func (*Client) UpdateConfigMap added in v1.2.0

func (cli *Client) UpdateConfigMap(ctx context.Context, cm *v1.ConfigMap) (*ConfigMapList, error)

func (*Client) UpdateTemplate added in v1.3.1

func (cli *Client) UpdateTemplate(ctx context.Context, template *v1.Template) (*TemplateList, error)

func (*Client) UpgradeCluster added in v1.2.0

func (cli *Client) UpgradeCluster(ctx context.Context, cluName string, upgradeCluster *corev1.ClusterUpgrade) error

func (*Client) Validate

func (cli *Client) Validate() error

func (*Client) Version

func (cli *Client) Version(ctx context.Context) (*apimachineryversion.Info, error)

type ClustersList

type ClustersList struct {
	Items      []v1.Cluster `json:"items" description:"paging data"`
	TotalCount int          `json:"totalCount,omitempty" description:"total count"`
}

func (*ClustersList) JSONPrint

func (n *ClustersList) JSONPrint() ([]byte, error)

func (*ClustersList) TablePrint

func (n *ClustersList) TablePrint() ([]string, [][]string)

func (*ClustersList) YAMLPrint

func (n *ClustersList) YAMLPrint() ([]byte, error)

type ComponentMeta

type ComponentMeta struct {
	Rules  []map[string]interface{} `json:"rules"`
	Addons []scheme.MetaResource    `json:"addons"`
}

type ComponentMetas

type ComponentMetas struct {
	Node                   string `json:"-"`
	scheme.PackageMetadata `json:"items" description:"paging data"`
	TotalCount             int `json:"totalCount,omitempty" description:"total count"`
}

func (*ComponentMetas) JSONPrint

func (n *ComponentMetas) JSONPrint() ([]byte, error)

func (*ComponentMetas) TablePrint

func (n *ComponentMetas) TablePrint() ([]string, [][]string)

func (*ComponentMetas) YAMLPrint

func (n *ComponentMetas) YAMLPrint() ([]byte, error)

type ConfigMapList added in v1.2.0

type ConfigMapList struct {
	Items      []v1.ConfigMap `json:"items" description:"paging data"`
	TotalCount int            `json:"totalCount,omitempty" description:"total count"`
}

func (*ConfigMapList) JSONPrint added in v1.2.0

func (n *ConfigMapList) JSONPrint() ([]byte, error)

func (*ConfigMapList) TablePrint added in v1.2.0

func (n *ConfigMapList) TablePrint() ([]string, [][]string)

func (*ConfigMapList) YAMLPrint added in v1.2.0

func (n *ConfigMapList) YAMLPrint() ([]byte, error)

type LoginRequest

type LoginRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type NodesList

type NodesList struct {
	Items      []v1.Node `json:"items" description:"paging data"`
	TotalCount int       `json:"totalCount,omitempty" description:"total count"`
}

func (*NodesList) JSONPrint

func (n *NodesList) JSONPrint() ([]byte, error)

func (*NodesList) TablePrint

func (n *NodesList) TablePrint() ([]string, [][]string)

func (*NodesList) YAMLPrint

func (n *NodesList) YAMLPrint() ([]byte, error)

type OperationList added in v1.4.0

type OperationList struct {
	Items      []v1.Operation `json:"items" description:"paging data"`
	TotalCount int            `json:"totalCount,omitempty" description:"total count"`
}

func (*OperationList) JSONPrint added in v1.4.0

func (n *OperationList) JSONPrint() ([]byte, error)

func (*OperationList) TablePrint added in v1.4.0

func (n *OperationList) TablePrint() ([]string, [][]string)

func (*OperationList) YAMLPrint added in v1.4.0

func (n *OperationList) YAMLPrint() ([]byte, error)

type Opt

type Opt func(*Client) error

func WithBearerAuth

func WithBearerAuth(token string) Opt

func WithCAData added in v1.4.0

func WithCAData(ca []byte) Opt

func WithCertData added in v1.4.0

func WithCertData(cert, key []byte) Opt

func WithEndpoint added in v1.4.0

func WithEndpoint(endpoint string) Opt

func WithHTTPClient

func WithHTTPClient(client *http.Client) Opt

WithHTTPClient overrides the client http client with the specified one

func WithHost

func WithHost(h string) Opt

func WithInsecureSkipTLSVerify added in v1.4.0

func WithInsecureSkipTLSVerify() Opt

func WithScheme

func WithScheme(scheme string) Opt

WithScheme overrides the client scheme with the specified one

func WithServerName added in v1.4.0

func WithServerName(name string) Opt

type Queries

type Queries query.Query

func (*Queries) ToRawQuery

func (q *Queries) ToRawQuery() url.Values

type RoleList

type RoleList struct {
	Items      []iamv1.GlobalRole `json:"items" description:"paging data"`
	TotalCount int                `json:"totalCount,omitempty" description:"total count"`
}

func (*RoleList) JSONPrint

func (n *RoleList) JSONPrint() ([]byte, error)

func (*RoleList) TablePrint

func (n *RoleList) TablePrint() ([]string, [][]string)

func (*RoleList) YAMLPrint

func (n *RoleList) YAMLPrint() ([]byte, error)

type TemplateList added in v1.3.1

type TemplateList struct {
	Items      []v1.Template `json:"items" description:"paging data"`
	TotalCount int           `json:"totalCount,omitempty" description:"total count"`
}

func (*TemplateList) JSONPrint added in v1.3.1

func (n *TemplateList) JSONPrint() ([]byte, error)

func (*TemplateList) TablePrint added in v1.3.1

func (n *TemplateList) TablePrint() ([]string, [][]string)

func (*TemplateList) YAMLPrint added in v1.3.1

func (n *TemplateList) YAMLPrint() ([]byte, error)

type UsersList

type UsersList struct {
	Items      []iamv1.User `json:"items" description:"paging data"`
	TotalCount int          `json:"totalCount,omitempty" description:"total count"`
}

func (*UsersList) JSONPrint

func (n *UsersList) JSONPrint() ([]byte, error)

func (*UsersList) TablePrint

func (n *UsersList) TablePrint() ([]string, [][]string)

func (*UsersList) YAMLPrint

func (n *UsersList) YAMLPrint() ([]byte, error)

Jump to

Keyboard shortcuts

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