client

package
v0.0.0-...-0e31e19 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2021 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SessionCookie string = "JSESSIONID"
)

Variables

View Source
var (
	API                   = "api"
	TopologyProcessor     = "topology-processor"
	APIPath               = "/vmturbo/rest/"
	TopologyProcessorPath = "/"
)

Functions

This section is empty.

Types

type APIClient

type APIClient struct {
	*RESTClient
	SessionCookie *http.Cookie
}

APIClient connects to api service through ingress

func (*APIClient) AddTarget

func (c *APIClient) AddTarget(target *api.Target) error

AddTarget adds a target via api service

func (*APIClient) DiscoverTarget

func (c *APIClient) DiscoverTarget(uuid string) (*Result, error)

Discover a target using API This function is called by turboctl which is not being maintained

type BasicAuthentication

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

type Client

type Client interface {
	AddTarget(target *api.Target) error
	DiscoverTarget(uuid string) (*Result, error)
}

type Config

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

type ConfigBuilder

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

func NewConfigBuilder

func NewConfigBuilder(serverAddress *url.URL) *ConfigBuilder

func (*ConfigBuilder) BasicAuthentication

func (cb *ConfigBuilder) BasicAuthentication(usrn, passd string) *ConfigBuilder

func (*ConfigBuilder) Create

func (cb *ConfigBuilder) Create() *Config

func (*ConfigBuilder) SetProxy

func (cb *ConfigBuilder) SetProxy(proxy string) *ConfigBuilder

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

type RESTClient

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

func NewRESTClient

func NewRESTClient(client *http.Client, baseURL *url.URL, apiPath string) *RESTClient

func (*RESTClient) BasicAuthentication

func (c *RESTClient) BasicAuthentication(ba *BasicAuthentication) *RESTClient

func (*RESTClient) Delete

func (c *RESTClient) Delete() *Request

func (*RESTClient) Get

func (c *RESTClient) Get() *Request

func (*RESTClient) Post

func (c *RESTClient) Post() *Request

func (*RESTClient) Put

func (c *RESTClient) Put() *Request

func (*RESTClient) Verb

func (c *RESTClient) Verb(verb string) *Request

Built request based on http verb and authentication.

type Request

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

func NewRequest

func NewRequest(client HTTPClient, verb string, baseURL *url.URL, apiPath string) *Request

func (*Request) BasicAuthentication

func (r *Request) BasicAuthentication(basicAuth *BasicAuthentication) *Request

func (*Request) Data

func (r *Request) Data(data []byte) *Request

func (*Request) Do

func (r *Request) Do() (Result, error)

func (*Request) Header

func (r *Request) Header(key, value string) *Request

func (*Request) Name

func (r *Request) Name(resourceName string) *Request

func (*Request) Param

func (r *Request) Param(paramName, value string) *Request

Set parameters for the request.

func (*Request) Resource

func (r *Request) Resource(resource api.ResourceType) *Request

Set the kind of the api resource that the request is made to.

func (*Request) String

func (r *Request) String() string

func (*Request) URL

func (r *Request) URL() *url.URL

URL returns the current working URL.

type Result

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

type TPClient

type TPClient struct {
	*RESTClient
}

TPClient connects to topology processor service

func (*TPClient) AddTarget

func (c *TPClient) AddTarget(target *api.Target) error

AddTarget adds a target via topology processor service

func (*TPClient) DiscoverTarget

func (c *TPClient) DiscoverTarget(uuid string) (*Result, error)

DiscoverTarget adds a target via Topology Processor service

type TurboClient

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

TurboClient manages REST clients to Turbonomic services

func NewTurboClient

func NewTurboClient(c *Config) (*TurboClient, error)

func (*TurboClient) AddTarget

func (turboClient *TurboClient) AddTarget(target *api.Target, service string) error

AddTarget adds a target via a given service

func (*TurboClient) DiscoverTarget

func (turboClient *TurboClient) DiscoverTarget(uuid, service string) (*Result, error)

AddTarget discovers a target via a given service

Jump to

Keyboard shortcuts

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