Documentation ¶
Index ¶
- Constants
- Variables
- type APIClient
- type BasicAuthentication
- type Client
- type Config
- type ConfigBuilder
- func (cb *ConfigBuilder) BasicAuthentication(usrn, passd string) *ConfigBuilder
- func (cb *ConfigBuilder) Create() *Config
- func (cb *ConfigBuilder) SetClientId(clientId string) *ConfigBuilder
- func (cb *ConfigBuilder) SetClientSecret(clientSecret string) *ConfigBuilder
- func (cb *ConfigBuilder) SetProxy(proxy string) *ConfigBuilder
- type HTTPClient
- type HydraTokenBody
- type RESTClient
- type Request
- func (r *Request) BasicAuthentication(basicAuth *BasicAuthentication) *Request
- func (r *Request) BufferData(data *bytes.Buffer) *Request
- func (r *Request) Data(data []byte) *Request
- func (r *Request) Do() (Result, error)
- func (r *Request) Header(key, value string) *Request
- func (r *Request) Name(resourceName string) *Request
- func (r *Request) Param(paramName, value string) *Request
- func (r *Request) Resource(resource api.ResourceType) *Request
- func (r *Request) String() string
- func (r *Request) URL() *url.URL
- type Result
- type TPClient
- type TurboClient
- func (turboClient *TurboClient) AddTarget(target *api.Target, service string) error
- func (turboClient *TurboClient) DiscoverTarget(uuid, service string) (*Result, error)
- func (turboClient *TurboClient) GetHydraAccessToken() (string, error)
- func (turboClient *TurboClient) GetJwtToken(hydraToken string) (string, error)
Constants ¶
View Source
const (
SessionCookie string = "JSESSIONID"
)
Variables ¶
View Source
var ( API = "api" TopologyProcessor = "topology-processor" HYDRA = "hydra" AUTH = "auth" APIPath = "/vmturbo/rest/" TopologyProcessorPath = "/" HydraPath = "/oauth2/" AuthPath = "/vmturbo/auth/" )
Functions ¶
This section is empty.
Types ¶
type APIClient ¶
type APIClient struct { *RESTClient SessionCookie *http.Cookie ClientId string ClientSecret string }
APIClient connects to api service through ingress
func (*APIClient) DiscoverTarget ¶
Discover a target using API This function is called by turboctl which is not being maintained
func (*APIClient) GetHydraAccessToken ¶
type BasicAuthentication ¶
type BasicAuthentication 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) SetClientId ¶
func (cb *ConfigBuilder) SetClientId(clientId string) *ConfigBuilder
func (*ConfigBuilder) SetClientSecret ¶
func (cb *ConfigBuilder) SetClientSecret(clientSecret string) *ConfigBuilder
func (*ConfigBuilder) SetProxy ¶
func (cb *ConfigBuilder) SetProxy(proxy string) *ConfigBuilder
type HydraTokenBody ¶
type RESTClient ¶
type RESTClient struct {
// contains filtered or unexported fields
}
func NewRESTClient ¶
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 (*Request) BasicAuthentication ¶
func (r *Request) BasicAuthentication(basicAuth *BasicAuthentication) *Request
type TPClient ¶
type TPClient struct {
*RESTClient
}
TPClient connects to topology processor service
func (*TPClient) DiscoverTarget ¶
DiscoverTarget adds a target via Topology Processor service
func (*TPClient) GetHydraAccessToken ¶
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
func (*TurboClient) GetHydraAccessToken ¶
func (turboClient *TurboClient) GetHydraAccessToken() (string, error)
GetHydraAccessToken gets the access token from Hydra service
func (*TurboClient) GetJwtToken ¶
func (turboClient *TurboClient) GetJwtToken(hydraToken string) (string, error)
GetJwtToken gets the JwtToken from Hydra access token
Click to show internal directories.
Click to hide internal directories.