client

package
v0.0.0-...-e7551f2 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	BaseURL *url.URL
	// contains filtered or unexported fields
}

Client holds all config and the http.Client needed to talk to the Kubermatic API

func NewClient

func NewClient(baseurl string, token string) (*Client, error)

NewClient creates a new Client for the Kubermatic API

func (*Client) CreateProject

func (c *Client) CreateProject(name string, labels map[string]string) (models.Project, error)

CreateProject creates a new project with the given name and labels

func (*Client) DeleteCluster

func (c *Client) DeleteCluster(projectID string, seed string, clusterID string) error

DeleteCluster deletes a given cluster

func (*Client) DeleteProject

func (c *Client) DeleteProject(projectID string) error

DeleteProject deletes a project identified by id

func (*Client) GetCluster

func (c *Client) GetCluster(projectID string, seed string, clusterID string) (models.Cluster, error)

GetCluster fetches cluster

func (*Client) GetClusterKubeconfig

func (c *Client) GetClusterKubeconfig(projectID string, seed string, clusterID string) (clientcmdapi.Config, error)

GetClusterKubeconfig fetches kubeconfig for a given cluster

func (*Client) ListClustersForProject

func (c *Client) ListClustersForProject(projectID string) ([]models.Cluster, error)

ListClustersForProject lists all clusters for a given Project (identified by ID)

func (*Client) ListClustersForProjectAndDatacenter

func (c *Client) ListClustersForProjectAndDatacenter(projectID string, seed string) ([]models.Cluster, error)

ListClustersForProjectAndDatacenter lists all clusters for a given Project (identified by ID) and Seed (identified by name)

func (*Client) ListDatacenters

func (c *Client) ListDatacenters() ([]models.Datacenter, error)

ListDatacenters lists all datacenters that are available

func (*Client) ListProjects

func (c *Client) ListProjects(listall bool) ([]models.Project, error)

ListProjects lists all projects a user has permission to see if listall is true, all projects the user has access to, will be listed if listall is false (default), only clusters owned by the user will be listed

Jump to

Keyboard shortcuts

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