{"modulePath":"github.com/cloudfoundry/app-autoscaler-cli-plugin","version":"v3.0.0+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package api\n\n## Constants\n\n```go\nconst (\n\tHealthPath           = \"/health\"\n\tPolicyPath           = \"/v1/apps/{appId}/policy\"\n\tCredentialPath       = \"/v1/apps/{appId}/credential\"\n\tAggregatedMetricPath = \"/v1/apps/{appId}/aggregated_metric_histories/{metric_type}\"\n\tHistoryPath          = \"/v1/apps/{appId}/scaling_histories\"\n)\n```\n\n## Variables\n\n```go\nvar ConfigFile = func() string {\n\tdefaultCFConfigPath, _ := confighelpers.DefaultFilePath()\n\ttargetsPath := filepath.Join(filepath.Dir(defaultCFConfigPath), \"plugins\", \"autoscaler_config\")\n\tos.MkdirAll(targetsPath, 0700)\n\n\tdefaultConfigFileName := \"config.json\"\n\tif os.Getenv(\"AUTOSCALER_CONFIG_FILE\") != \"\" {\n\t\tdefaultConfigFileName = os.Getenv(\"AUTOSCALER_CONFIG_FILE\")\n\t}\n\treturn filepath.Join(targetsPath, defaultConfigFileName)\n}\n```\n\n## Functions\n\n```go\nfunc SetEndpoint(cfclient *CFClient, url string, skipSSLValidation bool) error\n```\n\n```go\nfunc UnsetEndpoint() error\n```\n\n## Types\n\n```go\ntype APIEndpoint struct {\n\tURL               string\n\tSkipSSLValidation bool\n}\n```\n\n```go\nfunc GetEndpoint(cfclient *CFClient) (*APIEndpoint, error)\n```\n\n```go\ntype APIHelper struct {\n\tEndpoint *APIEndpoint\n\tClient   *CFClient\n\tLogger   trace.Printer\n}\n```\n\n```go\nfunc NewAPIHelper(endpoint *APIEndpoint, cfclient *CFClient, traceEnabled string) *APIHelper\n```\n\n```go\nfunc (helper *APIHelper) CheckHealth() error\n```\n\n```go\nfunc (helper *APIHelper) CreateCredential(data interface{}) ([]byte, error)\n```\n\n```go\nfunc (helper *APIHelper) CreatePolicy(data interface{}) error\n```\n\n```go\nfunc (helper *APIHelper) DeleteCredential() error\n```\n\n```go\nfunc (helper *APIHelper) DeletePolicy() error\n```\n\n```go\nfunc (helper *APIHelper) DoRequest(req *http.Request) (*http.Response, error)\n```\n\n```go\nfunc (helper *APIHelper) GetAggregatedMetrics(metricName string, startTime, endTime int64, asc bool, page uint64) (bool, [][]string, error)\n```\n\n```go\nfunc (helper *APIHelper) GetHistory(startTime, endTime int64, asc bool, page uint64) (bool, [][]string, error)\n```\n\n```go\nfunc (helper *APIHelper) GetPolicy() ([]byte, error)\n```\n\n```go\ntype CFClient struct {\n\tCCAPIEndpoint string\n\tAuthToken     string\n\tAppId         string\n\tAppName       string\n\tIsSSLDisabled bool\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewCFClient(connection Connection) (*CFClient, error)\n```\n\n```go\nfunc (client *CFClient) Configure(appName string) error\n```\n\n```go\ntype Connection interface {\n\tApiEndpoint() (string, error)\n\tIsLoggedIn() (bool, error)\n\tAccessToken() (string, error)\n\tGetApp(string) (plugin_models.GetAppModel, error)\n\tIsSSLDisabled() (bool, error)\n}\n```\n\n","path":"github.com/cloudfoundry/app-autoscaler-cli-plugin/src/cli/api","name":"api","synopsis":"","isRedistributable":true}
