cloud

package
v3.0.0-alpha1+incompat... Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2018 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const DevSpaceCloudConfigPath = ".devspace/clouds.yaml"

DevSpaceCloudConfigPath holds the path to the cloud config file

View Source
const DevSpaceCloudProviderName = "devspace-cloud"

DevSpaceCloudProviderName is the name of the default devspace-cloud provider

View Source
const DevSpaceKubeContextName = "devspace"

DevSpaceKubeContextName is the name for the kube config context

View Source
const GraphqlEndpoint = "/v1alpha1/graphql"

GraphqlEndpoint is the endpoint where to execute graphql requests

View Source
const LoginEndpoint = "/login"

LoginEndpoint is the cloud endpoint that will log you in

View Source
const LoginSuccessEndpoint = "/loginSuccess"

LoginSuccessEndpoint is the url redirected to after successful login

Variables

View Source
var DevSpaceCloudProviderConfig = &Provider{
	Name: DevSpaceCloudProviderName,
	Host: "http://cli.devspace-cloud.com",
}

DevSpaceCloudProviderConfig holds the information for the devspace-cloud

View Source
var DevSpaceNameValidationRegEx = regexp.MustCompile("^[a-zA-Z0-9][a-zA-Z0-9-]{1,32}[a-zA-Z0-9]$")

DevSpaceNameValidationRegEx is the devsapace name validation regex

Functions

func Configure

func Configure(useKubeContext, dry bool, log log.Logger) error

Configure will alter the cluster configuration in the config

func DeleteKubeContext

func DeleteKubeContext(namespace string) error

DeleteKubeContext removes the specified devspace id from the kube context if it exists

func EnsureLoggedIn

func EnsureLoggedIn(providerConfig ProviderConfig, cloudProvider string, log log.Logger) error

EnsureLoggedIn checks if the user is logged into a certain cloud provider and if not loggs the user in

func SaveCloudConfig

func SaveCloudConfig(config ProviderConfig) error

SaveCloudConfig saves the provider configuration to file

Types

type DevSpaceConfig

type DevSpaceConfig struct {
	DevSpaceID int
	Name       string
	Created    string
}

DevSpaceConfig holds the information of a devspace

type Provider

type Provider struct {
	Name  string `yaml:"name,omitempty"`
	Host  string `yaml:"host,omitempty"`
	Token string `yaml:"token,omitempty"`
}

Provider describes the struct to hold the cloud configuration

func GetCurrentProvider

func GetCurrentProvider(log log.Logger) (*Provider, error)

GetCurrentProvider returns the current specified cloud provider

func (*Provider) CreateDevSpace

func (p *Provider) CreateDevSpace(name string) (int, error)

CreateDevSpace creates a new devspace remotely

func (*Provider) CreateDevSpaceTarget

func (p *Provider) CreateDevSpaceTarget(devSpaceID int, target string) error

CreateDevSpaceTarget creates a new target for an existing devspace

func (*Provider) DeleteDevSpace

func (p *Provider) DeleteDevSpace(devSpaceID int) error

DeleteDevSpace deletes the devspace from the cloud provider

func (*Provider) GetDevSpaceTargetConfig

func (p *Provider) GetDevSpaceTargetConfig(devSpaceID int, target string) (*generated.DevSpaceTargetConfig, error)

GetDevSpaceTargetConfig retrieves the cluster configuration via graphql request

func (*Provider) GetDevSpaceTargetConfigs

func (p *Provider) GetDevSpaceTargetConfigs(devSpaceID int) ([]*generated.DevSpaceTargetConfig, error)

GetDevSpaceTargetConfigs retrieves the cluster configurations via graphql request

func (*Provider) GetDevSpaces

func (p *Provider) GetDevSpaces() ([]*DevSpaceConfig, error)

GetDevSpaces returns all devspaces owned by the user

func (*Provider) Login

func (p *Provider) Login(log log.Logger) error

Login logs the user into the devspace cloud

func (*Provider) PrintDevSpaces

func (p *Provider) PrintDevSpaces(name string) error

PrintDevSpaces prints the users devspaces

type ProviderConfig

type ProviderConfig map[string]*Provider

ProviderConfig holds all the different providers and their configuration

func ParseCloudConfig

func ParseCloudConfig() (ProviderConfig, error)

ParseCloudConfig parses the cloud configuration and returns a map containing the configurations

Jump to

Keyboard shortcuts

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