client

package
v0.0.0-...-c6cf6ad Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUpdatingApplication = errors.New("spot: unable to update application")

Functions

func ApiTransport

func ApiTransport(roundTripper http.RoundTripper, baseURL *url.URL, creds config.Credentials) http.RoundTripper

func DecodeBody

func DecodeBody(resp *http.Response, out interface{}) error

DecodeBody is used to JSON decode a body

func RequireOK

func RequireOK(resp *http.Response, err error) (*http.Response, error)

RequireOK is used to verify response status code is a successful one (200 OK)

Types

type AWSClient

type AWSClient interface {
	InstanceTypesGetter
}

type ApplicationGetter

type ApplicationGetter interface {
	GetSparkApplication(ctx context.Context, ID string) (string, error)
}

type ApplicationSaver

type ApplicationSaver interface {
	SaveSparkApplication(app *v1alpha1.SparkApplication) error
}

type Client

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

func NewClient

func NewClient(kc kubernetes.Interface, logger logr.Logger) (*Client, error)

func (*Client) GetAllOceanClusters

func (c *Client) GetAllOceanClusters() ([]*OceanCluster, error)

func (*Client) GetAvailableInstanceTypesInRegion

func (c *Client) GetAvailableInstanceTypesInRegion(region string) ([]*InstanceType, error)

func (*Client) GetSparkApplication

func (c *Client) GetSparkApplication(ctx context.Context, ID string) (string, error)

func (*Client) SaveSparkApplication

func (c *Client) SaveSparkApplication(app *v1alpha1.SparkApplication) error

type Error

type Error struct {
	Response  *http.Response `json:"-"`
	Code      string         `json:"code"`
	Message   string         `json:"message"`
	Field     string         `json:"field"`
	RequestID string         `json:"requestId"`
}

func (Error) Error

func (e Error) Error() string

type Errors

type Errors []Error

func (Errors) Error

func (es Errors) Error() string

type InstanceType

type InstanceType struct {
	InstanceType string `json:"instanceType"`
}

type InstanceTypesGetter

type InstanceTypesGetter interface {
	GetAvailableInstanceTypesInRegion(region string) ([]*InstanceType, error)
}

type OceanClient

type OceanClient interface {
	OceanClusterGetter
}

type OceanCluster

type OceanCluster struct {
	ID                  string              `json:"id"`
	Name                string              `json:"name"`
	ControllerClusterId string              `json:"controllerClusterId"`
	Region              string              `json:"region"`
	Compute             OceanClusterCompute `json:"compute"`
}

type OceanClusterCompute

type OceanClusterCompute struct {
	InstanceTypes OceanClusterInstanceTypes `json:"instanceTypes"`
}

type OceanClusterGetter

type OceanClusterGetter interface {
	GetAllOceanClusters() ([]*OceanCluster, error)
}

type OceanClusterInstanceTypes

type OceanClusterInstanceTypes struct {
	Whitelist []string `json:"whitelist"`
	Blacklist []string `json:"blacklist"`
}

type Response

type Response struct {
	Request struct {
		ID string `json:"id"`
	} `json:"request"`
	Response struct {
		Errors []responseError   `json:"errors"`
		Items  []json.RawMessage `json:"items"`
	} `json:"response"`
}

type WaveClient

type WaveClient interface {
	ApplicationGetter
	ApplicationSaver
}

Directories

Path Synopsis
Package mock_client is a generated GoMock package.
Package mock_client is a generated GoMock package.

Jump to

Keyboard shortcuts

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