Documentation ¶
Index ¶
- Constants
- Variables
- func SetEndpoint(cfclient *CFClient, url string, skipSSLValidation bool) error
- func UnsetEndpoint() error
- type APIEndpoint
- type APIHelper
- func (helper *APIHelper) CheckHealth() error
- func (helper *APIHelper) CreateCredential(data interface{}) ([]byte, error)
- func (helper *APIHelper) CreatePolicy(data interface{}) error
- func (helper *APIHelper) DeleteCredential() error
- func (helper *APIHelper) DeletePolicy() error
- func (helper *APIHelper) DoRequest(req *http.Request) (*http.Response, error)
- func (helper *APIHelper) GetAggregatedMetrics(metricName string, startTime, endTime int64, asc bool, page uint64) (bool, [][]string, error)
- func (helper *APIHelper) GetHistory(startTime, endTime int64, asc bool, page uint64) (bool, [][]string, error)
- func (helper *APIHelper) GetPolicy() ([]byte, error)
- type CFClient
- type Connection
Constants ¶
View Source
const ( HealthPath = "/health" PolicyPath = "/v1/apps/{appId}/policy" CredentialPath = "/v1/apps/{appId}/credential" AggregatedMetricPath = "/v1/apps/{appId}/aggregated_metric_histories/{metric_type}" HistoryPath = "/v1/apps/{appId}/scaling_histories" )
Variables ¶
View Source
var ConfigFile = func() string { defaultCFConfigPath, _ := confighelpers.DefaultFilePath() targetsPath := filepath.Join(filepath.Dir(defaultCFConfigPath), "plugins", "autoscaler_config") os.MkdirAll(targetsPath, 0700) defaultConfigFileName := "config.json" if os.Getenv("AUTOSCALER_CONFIG_FILE") != "" { defaultConfigFileName = os.Getenv("AUTOSCALER_CONFIG_FILE") } return filepath.Join(targetsPath, defaultConfigFileName) }
Functions ¶
func UnsetEndpoint ¶
func UnsetEndpoint() error
Types ¶
type APIEndpoint ¶
func GetEndpoint ¶
func GetEndpoint(cfclient *CFClient) (*APIEndpoint, error)
type APIHelper ¶
type APIHelper struct { Endpoint *APIEndpoint Client *CFClient Logger trace.Printer }
func NewAPIHelper ¶
func NewAPIHelper(endpoint *APIEndpoint, cfclient *CFClient, traceEnabled string) *APIHelper
func (*APIHelper) CheckHealth ¶
func (*APIHelper) CreateCredential ¶
func (*APIHelper) CreatePolicy ¶
func (*APIHelper) DeleteCredential ¶
func (*APIHelper) DeletePolicy ¶
func (*APIHelper) GetAggregatedMetrics ¶ added in v1.1.0
func (*APIHelper) GetHistory ¶
Click to show internal directories.
Click to hide internal directories.