api

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2019 License: Apache-2.0 Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	TokenGenerator token.Generator
	// contains filtered or unexported fields
}

Client is a struct containing information for an api client.

func ClientFromConfig

func ClientFromConfig(configFile string) (*Client, error)

ClientFromConfig creates a new Client with its own http.Client using the config file provided and a new token generator that uses AWS's stsAPI.

func NewClient

func NewClient(config *config.Config, generator token.Generator) *Client

NewClient creates a new Client with its own http.Client.

func (*Client) CreateCluster

func (c *Client) CreateCluster(newCluster Cluster) (model.Cluster, error)

CreateCluster sends a POST request to the clusters endpoint of the Pharos API and returns the Cluster that was created.

func (*Client) DeleteCluster

func (c *Client) DeleteCluster(clusterID string) (model.Cluster, error)

DeleteCluster sends a DELETE request to the clusters endpoint of the Pharos API and returns a Cluster containing the deleted cluster.

func (*Client) GetCluster

func (c *Client) GetCluster(clusterID string) (model.Cluster, error)

GetCluster sends a GET request to the clusters/id endpoint of the Pharos API and returns a Cluster.

func (*Client) ListClusters

func (c *Client) ListClusters(query map[string]string) ([]model.Cluster, error)

ListClusters sends a GET request to the clusters endpoint of the Pharos API and returns an array of Clusters. Can also be called with query to retrieve a certain subset of clusters.

func (*Client) UpdateCluster

func (c *Client) UpdateCluster(clusterID string, active bool) (model.Cluster, error)

UpdateCluster sends a POST request to the clusters/id endpoint of the Pharos API and returns a Cluster containing the updated cluster.

type Cluster

type Cluster struct {
	ID                   string `json:"id"`
	Environment          string `json:"environment"`
	ServerURL            string `json:"server_url"`
	ClusterAuthorityData string `json:"cluster_authority_data"`
}

Cluster describes a new cluster to be created in Pharos.

Jump to

Keyboard shortcuts

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