Documentation ¶
Index ¶
- Constants
- type ActiveSchedule
- type AppEntity
- type AppInstanceMetric
- type AppMetric
- type AppMetricResponse
- type AppMonitor
- type AppNotFoundErr
- type AppPolicy
- type AppScalingHistory
- type AppScalingHistoryResponse
- type AppScalingResult
- type BindingRequestBody
- type BrokerCommonRequestBody
- type BrokerContext
- type CFErrorResponse
- type Credential
- type CredentialResponse
- type Credentials
- type CredentialsOptions
- type CustomMetric
- type CustomMetricsCredentials
- type ErrorResponse
- type HealthConfig
- type InstanceCreationRequestBody
- type InstanceMetricResponse
- type InstanceParameters
- type InstanceUpdateRequestBody
- type Lock
- type MetricsConsumer
- type PolicyJson
- type PublicApiResponseBase
- type RateLimitConfig
- type RecurringSchedule
- type ScalingPolicy
- type ScalingRule
- type ScalingSchedules
- type ScalingStatus
- type ScalingType
- type ServiceInstance
- type SpecificDateSchedule
- type StoredProcedureConfig
- type TLSCerts
- type Trigger
Constants ¶
View Source
const ( AppStatusStopped = "STOPPED" AppStatusStarted = "STARTED" )
View Source
const ( UnitPercentage = "%" UnitMegaBytes = "MB" UnitNum = "" UnitMilliseconds = "ms" UnitRPS = "rps" MetricNameMemoryUtil = "memoryutil" MetricNameMemoryUsed = "memoryused" MetricNameCPUUtil = "cpu" MetricNameThroughput = "throughput" MetricNameResponseTime = "responsetime" MetricLabelAppID = "app_id" MetricLabelInstanceIndex = "instance_index" MetricLabelName = "name" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActiveSchedule ¶
type AppInstanceMetric ¶
type AppInstanceMetric struct { AppId string `json:"app_id"` InstanceIndex uint32 `json:"instance_index"` CollectedAt int64 `json:"collected_at"` Name string `json:"name"` Unit string `json:"unit"` Value string `json:"value"` Timestamp int64 `json:"timestamp"` }
func (*AppInstanceMetric) GetTimestamp ¶
func (m *AppInstanceMetric) GetTimestamp() int64
type AppMetric ¶
type AppMetric struct { AppId string `json:"app_id"` MetricType string `json:"name"` Value string `json:"value"` Unit string `json:"unit"` Timestamp int64 `json:"timestamp"` }
func (*AppMetric) GetTimestamp ¶
type AppMetricResponse ¶
type AppMetricResponse struct { PublicApiResponseBase Resources []AppMetric `json:"resources"` }
type AppMonitor ¶
type AppNotFoundErr ¶
type AppNotFoundErr struct {
// contains filtered or unexported fields
}
func NewAppNotFoundErr ¶
func NewAppNotFoundErr(message string) *AppNotFoundErr
func (*AppNotFoundErr) Error ¶
func (e *AppNotFoundErr) Error() string
type AppPolicy ¶
type AppPolicy struct { AppId string ScalingPolicy *ScalingPolicy }
type AppScalingHistory ¶
type AppScalingHistory struct { AppId string `json:"app_id"` Timestamp int64 `json:"timestamp"` ScalingType ScalingType `json:"scaling_type"` Status ScalingStatus `json:"status"` OldInstances int `json:"old_instances"` NewInstances int `json:"new_instances"` Reason string `json:"reason"` Message string `json:"message"` Error string `json:"error"` }
type AppScalingHistoryResponse ¶
type AppScalingHistoryResponse struct { PublicApiResponseBase Resources []AppScalingHistory `json:"resources"` }
type AppScalingResult ¶
type AppScalingResult struct { AppId string `json:"app_id"` Status ScalingStatus `json:"status"` Adjustment int `json:"adjustment"` CooldownExpiredAt int64 `json:"cool_down_expired_at"` }
type BindingRequestBody ¶
type BindingRequestBody struct { BrokerCommonRequestBody AppID string `json:"app_guid"` Policy json.RawMessage `json:"parameters,omitempty"` }
type BrokerCommonRequestBody ¶
type BrokerCommonRequestBody struct { ServiceID string `json:"service_id"` PlanID string `json:"plan_id"` BrokerContext BrokerContext `json:"context"` }
type BrokerContext ¶
type CFErrorResponse ¶
type Credential ¶
type CredentialResponse ¶
type CredentialResponse struct {
Credentials Credentials `json:"credentials"`
}
type Credentials ¶
type Credentials struct {
CustomMetrics CustomMetricsCredentials `json:"custom_metrics"`
}
type CredentialsOptions ¶
type CustomMetric ¶
type CustomMetricsCredentials ¶
type CustomMetricsCredentials struct { *Credential URL string `json:"url"` MtlsUrl string `json:"mtls_url"` }
type ErrorResponse ¶
type HealthConfig ¶
type HealthConfig struct { Port int `yaml:"port"` HealthCheckUsername string `yaml:"username"` HealthCheckUsernameHash string `yaml:"username_hash"` HealthCheckPassword string `yaml:"password"` HealthCheckPasswordHash string `yaml:"password_hash"` }
func (*HealthConfig) Validate ¶
func (c *HealthConfig) Validate(component string) error
type InstanceCreationRequestBody ¶
type InstanceCreationRequestBody struct { BrokerCommonRequestBody OrgGUID string `json:"organization_guid"` SpaceGUID string `json:"space_guid"` Parameters InstanceParameters `json:"parameters,omitempty"` }
type InstanceMetricResponse ¶
type InstanceMetricResponse struct { PublicApiResponseBase Resources []AppInstanceMetric `json:"resources"` }
type InstanceParameters ¶
type InstanceParameters struct {
DefaultPolicy *json.RawMessage `json:"default_policy,omitempty"`
}
type InstanceUpdateRequestBody ¶
type InstanceUpdateRequestBody struct { BrokerCommonRequestBody Parameters *InstanceParameters `json:"parameters,omitempty"` }
type MetricsConsumer ¶
type MetricsConsumer struct { InstanceIndex uint32 `json:"instance_index"` CustomMetrics []*CustomMetric `json:"metrics"` }
type PolicyJson ¶
func (*PolicyJson) Equals ¶
func (p *PolicyJson) Equals(p2 *PolicyJson) bool
func (*PolicyJson) GetAppPolicy ¶
func (p *PolicyJson) GetAppPolicy() (*AppPolicy, error)
type PublicApiResponseBase ¶
type RateLimitConfig ¶
type RecurringSchedule ¶
type RecurringSchedule struct { StartTime string `json:"start_time"` EndTime string `json:"end_time"` DaysOfWeek []int `json:"days_of_week,omitempty"` DaysOfMonth []int `json:"days_of_month,omitempty"` StartDate string `json:"start_date,omitempty"` EndDate string `json:"end_date,omitempty"` ScheduledInstanceMin int `json:"instance_min_count"` ScheduledInstanceMax int `json:"instance_max_count"` ScheduledInstanceInit int `json:"initial_min_instance_count,omitempty"` }
type ScalingPolicy ¶
type ScalingPolicy struct { InstanceMin int `json:"instance_min_count"` InstanceMax int `json:"instance_max_count"` ScalingRules []*ScalingRule `json:"scaling_rules,omitempty"` Schedules *ScalingSchedules `json:"schedules,omitempty"` }
type ScalingRule ¶
type ScalingRule struct { MetricType string `json:"metric_type"` BreachDurationSeconds int `json:"breach_duration_secs,omitempty"` Threshold int64 `json:"threshold"` Operator string `json:"operator"` CoolDownSeconds int `json:"cool_down_secs,omitempty"` Adjustment string `json:"adjustment"` }
func (*ScalingRule) BreachDuration ¶
func (r *ScalingRule) BreachDuration(defaultBreachDurationSecs int) time.Duration
type ScalingSchedules ¶
type ScalingSchedules struct { Timezone string `json:"timezone"` RecurringSchedules []*RecurringSchedule `json:"recurring_schedule,omitempty"` SpecificDateSchedules []*SpecificDateSchedule `json:"specific_date,omitempty"` }
type ScalingStatus ¶
type ScalingStatus int
const ( ScalingStatusSucceeded ScalingStatus = iota ScalingStatusFailed ScalingStatusIgnored )
type ScalingType ¶
type ScalingType int
const ( ScalingTypeDynamic ScalingType = iota ScalingTypeSchedule )
type ServiceInstance ¶
type SpecificDateSchedule ¶
type SpecificDateSchedule struct { StartDateTime string `json:"start_date_time"` EndDateTime string `json:"end_date_time"` ScheduledInstanceMin int `json:"instance_min_count"` ScheduledInstanceMax int `json:"instance_max_count"` ScheduledInstanceInit int `json:"initial_min_instance_count,omitempty"` }
type StoredProcedureConfig ¶
type StoredProcedureConfig struct { SchemaName string `yaml:"schema_name"` CreateBindingCredentialProcedureName string `yaml:"create_binding_credential_procedure_name"` DropBindingCredentialProcedureName string `yaml:"drop_binding_credential_procedure_name"` DropAllBindingCredentialProcedureName string `yaml:"drop_all_binding_credential_procedure_name"` ValidateBindingCredentialProcedureName string `yaml:"validate_binding_credential_procedure_name"` }
type Trigger ¶
type Trigger struct { AppId string `json:"app_id"` MetricType string `json:"metric_type"` MetricUnit string `json:"metric_unit"` BreachDurationSeconds int `json:"breach_duration_secs"` Threshold int64 `json:"threshold"` Operator string `json:"operator"` CoolDownSeconds int `json:"cool_down_secs"` Adjustment string `json:"adjustment"` }
func (Trigger) BreachDuration ¶
Click to show internal directories.
Click to hide internal directories.