models

package
v6.47.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2019 License: Apache-2.0 Imports: 11 Imported by: 1,903

Documentation

Index

Constants

View Source
const (
	ApplicationStateStopped  = "stopped"
	ApplicationStateStarted  = "started"
	ApplicationStateRunning  = "running"
	ApplicationStateCrashed  = "crashed"
	ApplicationStateFlapping = "flapping"
	ApplicationStateDown     = "down"
	ApplicationStateStarting = "starting"
)
View Source
const UnlimitedDisplay = "unlimited"

Variables

View Source
var ErrUnknownRole = errors.New("Unknown Role")

Functions

This section is empty.

Types

type AppFileFields

type AppFileFields struct {
	Path string
	Sha1 string
	Size int64
	Mode string
}

type AppInstanceFields

type AppInstanceFields struct {
	State     InstanceState
	Details   string
	Since     time.Time
	CPUUsage  float64 // percentage
	DiskQuota int64   // in bytes
	DiskUsage int64
	MemQuota  int64
	MemUsage  int64
}

type AppParams

type AppParams struct {
	BuildpackURL            *string
	Buildpacks              []string
	Command                 *string
	DiskQuota               *int64
	Domains                 []string
	EnvironmentVars         *map[string]interface{}
	GUID                    *string
	HealthCheckType         *string
	HealthCheckHTTPEndpoint *string
	HealthCheckTimeout      *int
	DockerImage             *string
	DockerUsername          *string
	DockerPassword          *string
	EnableSSH               *bool
	Hosts                   []string
	RoutePath               *string
	InstanceCount           *int
	Memory                  *int64
	Name                    *string
	NoHostname              *bool
	NoRoute                 bool
	UseRandomRoute          bool
	UseRandomPort           bool
	Path                    *string
	ServicesToBind          []string
	SpaceGUID               *string
	StackGUID               *string
	StackName               *string
	State                   *string
	PackageUpdatedAt        *time.Time
	Routes                  []ManifestRoute
}

func (*AppParams) IsEmpty

func (app *AppParams) IsEmpty() bool

func (*AppParams) IsHostEmpty

func (app *AppParams) IsHostEmpty() bool

func (*AppParams) IsNoHostnameTrue

func (app *AppParams) IsNoHostnameTrue() bool

func (*AppParams) Merge

func (app *AppParams) Merge(flagContext *AppParams)

type Application

type Application struct {
	ApplicationFields
	Stack    *Stack
	Routes   []RouteSummary
	Services []ServicePlanSummary
}

func (Application) HasRoute

func (model Application) HasRoute(route Route) bool

func (Application) ToParams

func (model Application) ToParams() AppParams

type ApplicationFields

type ApplicationFields struct {
	GUID                    string
	Name                    string
	BuildpackURL            string
	Command                 string
	Diego                   bool
	DetectedStartCommand    string
	DiskQuota               int64 // in Megabytes
	EnvironmentVars         map[string]interface{}
	InstanceCount           int
	Memory                  int64 // in Megabytes
	RunningInstances        int
	HealthCheckType         string
	HealthCheckHTTPEndpoint string
	HealthCheckTimeout      int
	State                   string
	SpaceGUID               string
	StackGUID               string
	PackageUpdatedAt        *time.Time
	PackageState            string
	StagingFailedReason     string
	Buildpack               string
	DetectedBuildpack       string
	DockerImage             string
	EnableSSH               bool
}

type Buildpack

type Buildpack struct {
	GUID     string
	Name     string
	Stack    string
	Position *int
	Enabled  *bool
	Key      string
	Filename string
	Locked   *bool
}

type DomainFields

type DomainFields struct {
	GUID                   string
	Name                   string
	OwningOrganizationGUID string
	RouterGroupGUID        string
	RouterGroupType        string
	Shared                 bool
}

func (DomainFields) URLForHostAndPath

func (model DomainFields) URLForHostAndPath(host, path string, port int) string

type Environment

type Environment struct {
	System      map[string]interface{} `json:"system_env_json,omitempty"`
	Environment map[string]interface{} `json:"environment_json,omitempty"`
	Running     map[string]interface{} `json:"running_env_json,omitempty"`
	Staging     map[string]interface{} `json:"staging_env_json,omitempty"`
	Application map[string]interface{} `json:"application_env_json,omitempty"`
}

func NewEnvironment

func NewEnvironment() *Environment

type EnvironmentVariable

type EnvironmentVariable struct {
	Name  string
	Value string
}

type EnvironmentVariableList

type EnvironmentVariableList []EnvironmentVariable

func (EnvironmentVariableList) Len

func (evl EnvironmentVariableList) Len() int

func (EnvironmentVariableList) Less

func (evl EnvironmentVariableList) Less(i, j int) bool

func (EnvironmentVariableList) Swap

func (evl EnvironmentVariableList) Swap(i, j int)

type EventFields

type EventFields struct {
	GUID        string
	Name        string
	Timestamp   time.Time
	Description string
	Actor       string
	ActorName   string
}

type FeatureFlag

type FeatureFlag struct {
	Name         string `json:"name"`
	Enabled      bool   `json:"enabled"`
	ErrorMessage string `json:"error_message"`
}

type InstanceState

type InstanceState string
const (
	InstanceStarting InstanceState = "starting"
	InstanceRunning  InstanceState = "running"
	InstanceFlapping InstanceState = "flapping"
	InstanceDown     InstanceState = "down"
	InstanceCrashed  InstanceState = "crashed"
)

type LastOperationFields

type LastOperationFields struct {
	Type        string
	State       string
	Description string
	CreatedAt   string
	UpdatedAt   string
}

type ManifestDocker

type ManifestDocker struct {
	Image    string
	Username string
}

type ManifestRoute

type ManifestRoute struct {
	Route string
}

type Organization

type Organization struct {
	OrganizationFields
	Spaces      []SpaceFields
	Domains     []DomainFields
	SpaceQuotas []SpaceQuota
}

type OrganizationFields

type OrganizationFields struct {
	GUID            string
	Name            string
	QuotaDefinition QuotaFields
}

type PluginRepo

type PluginRepo struct {
	Name string
	URL  string
}

type QuotaFields

type QuotaFields struct {
	GUID                    string      `json:"guid,omitempty"`
	Name                    string      `json:"name"`
	MemoryLimit             int64       `json:"memory_limit"`          // in Megabytes
	InstanceMemoryLimit     int64       `json:"instance_memory_limit"` // in Megabytes
	RoutesLimit             int         `json:"total_routes"`
	ServicesLimit           int         `json:"total_services"`
	NonBasicServicesAllowed bool        `json:"non_basic_services_allowed"`
	AppInstanceLimit        int         `json:"app_instance_limit"`
	ReservedRoutePorts      json.Number `json:"total_reserved_route_ports,omitempty"`
}

type QuotaResponse

type QuotaResponse struct {
	GUID                    string      `json:"guid,omitempty"`
	Name                    string      `json:"name"`
	MemoryLimit             int64       `json:"memory_limit"`          // in Megabytes
	InstanceMemoryLimit     int64       `json:"instance_memory_limit"` // in Megabytes
	RoutesLimit             int         `json:"total_routes"`
	ServicesLimit           int         `json:"total_services"`
	NonBasicServicesAllowed bool        `json:"non_basic_services_allowed"`
	AppInstanceLimit        json.Number `json:"app_instance_limit"`
	ReservedRoutePorts      json.Number `json:"total_reserved_route_ports"`
}

type Role

type Role int
const (
	RoleUnknown Role = iota - 1
	RoleOrgUser
	RoleOrgManager
	RoleBillingManager
	RoleOrgAuditor
	RoleSpaceManager
	RoleSpaceDeveloper
	RoleSpaceAuditor
)

func RoleFromString

func RoleFromString(roleString string) (Role, error)

func (Role) Display

func (r Role) Display() string

func (Role) ToString

func (r Role) ToString() string

type Route

type Route struct {
	GUID   string
	Host   string
	Domain DomainFields
	Path   string
	Port   int

	Space           SpaceFields
	Apps            []ApplicationFields
	ServiceInstance ServiceInstanceFields
}

func (Route) URL

func (r Route) URL() string

type RoutePresenter

type RoutePresenter struct {
	Host   string
	Domain string
	Path   string
	Port   int
}

func (*RoutePresenter) URL

func (r *RoutePresenter) URL() string

type RouteSummary

type RouteSummary struct {
	GUID   string
	Host   string
	Domain DomainFields
	Path   string
	Port   int
}

func (RouteSummary) URL

func (r RouteSummary) URL() string

type RouterGroup

type RouterGroup struct {
	GUID string `json:"guid"`
	Name string `json:"name"`
	Type string `json:"type"`
}

type RouterGroups

type RouterGroups []RouterGroup

type SecurityGroup

type SecurityGroup struct {
	SecurityGroupFields
	Spaces []Space
}

represents a fully instantiated model returned by the CC (e.g.: with its attributes and the fields for its child objects)

type SecurityGroupFields

type SecurityGroupFields struct {
	Name     string
	GUID     string
	SpaceURL string `json:"spaces_url,omitempty"`
	Rules    []map[string]interface{}
}

represents just the attributes for an security group

type SecurityGroupParams

type SecurityGroupParams struct {
	Name  string                   `json:"name,omitempty"`
	GUID  string                   `json:"guid,omitempty"`
	Rules []map[string]interface{} `json:"rules"`
}

represents the JSON that we send up to CC when the user creates / updates a record

type ServiceAuthTokenFields

type ServiceAuthTokenFields struct {
	GUID     string
	Label    string
	Provider string
	Token    string
}

type ServiceBindingFields

type ServiceBindingFields struct {
	GUID    string
	URL     string
	AppGUID string
}

type ServiceBindingRequest

type ServiceBindingRequest struct {
	AppGUID             string                 `json:"app_guid"`
	ServiceInstanceGUID string                 `json:"service_instance_guid"`
	Params              map[string]interface{} `json:"parameters,omitempty"`
}

type ServiceBroker

type ServiceBroker struct {
	GUID     string
	Name     string
	Username string
	Password string
	URL      string
	Services []ServiceOffering
}

type ServiceInstance

type ServiceInstance struct {
	ServiceInstanceFields
	ServiceBindings []ServiceBindingFields
	ServiceKeys     []ServiceKeyFields
	ServicePlan     ServicePlanFields
	ServiceOffering ServiceOfferingFields
}

func (ServiceInstance) IsUserProvided

func (inst ServiceInstance) IsUserProvided() bool

type ServiceInstanceCreateRequest

type ServiceInstanceCreateRequest struct {
	Name      string                 `json:"name"`
	SpaceGUID string                 `json:"space_guid"`
	PlanGUID  string                 `json:"service_plan_guid,omitempty"`
	Params    map[string]interface{} `json:"parameters,omitempty"`
	Tags      []string               `json:"tags,omitempty"`
}

type ServiceInstanceFields

type ServiceInstanceFields struct {
	GUID             string
	Name             string
	LastOperation    LastOperationFields
	SysLogDrainURL   string
	RouteServiceURL  string
	ApplicationNames []string
	Params           map[string]interface{}
	DashboardURL     string
	Type             string
	Tags             []string
}

type ServiceInstanceUpdateRequest

type ServiceInstanceUpdateRequest struct {
	PlanGUID string                 `json:"service_plan_guid,omitempty"`
	Params   map[string]interface{} `json:"parameters,omitempty"`
	Tags     []string               `json:"tags"`
}

type ServiceKey

type ServiceKey struct {
	Fields      ServiceKeyFields
	Credentials map[string]interface{}
}

type ServiceKeyFields

type ServiceKeyFields struct {
	Name                string
	GUID                string
	URL                 string
	ServiceInstanceGUID string
	ServiceInstanceURL  string
}

type ServiceKeyRequest

type ServiceKeyRequest struct {
	Name                string                 `json:"name"`
	ServiceInstanceGUID string                 `json:"service_instance_guid"`
	Params              map[string]interface{} `json:"parameters,omitempty"`
}

type ServiceOffering

type ServiceOffering struct {
	ServiceOfferingFields
	Plans []ServicePlanFields
}

type ServiceOfferingFields

type ServiceOfferingFields struct {
	GUID             string
	BrokerGUID       string
	Label            string
	Provider         string
	Version          string
	Description      string
	DocumentationURL string
	Requires         []string
}

type ServiceOfferings

type ServiceOfferings []ServiceOffering

func (ServiceOfferings) Len

func (s ServiceOfferings) Len() int

func (ServiceOfferings) Less

func (s ServiceOfferings) Less(i, j int) bool

func (ServiceOfferings) Swap

func (s ServiceOfferings) Swap(i, j int)

type ServicePlan

type ServicePlan struct {
	ServicePlanFields
	ServiceOffering ServiceOfferingFields
}

type ServicePlanFields

type ServicePlanFields struct {
	GUID                string
	Name                string
	Free                bool
	Public              bool
	Description         string
	Active              bool
	ServiceOfferingGUID string
	OrgNames            []string
}

func (ServicePlanFields) OrgHasVisibility

func (servicePlanFields ServicePlanFields) OrgHasVisibility(orgName string) bool

type ServicePlanSummary

type ServicePlanSummary struct {
	GUID string
	Name string
}

type ServicePlanVisibilityFields

type ServicePlanVisibilityFields struct {
	GUID             string `json:"guid"`
	ServicePlanGUID  string `json:"service_plan_guid"`
	OrganizationGUID string `json:"organization_guid"`
}

type Space

type Space struct {
	SpaceFields
	Organization     OrganizationFields
	Applications     []ApplicationFields
	ServiceInstances []ServiceInstanceFields
	Domains          []DomainFields
	SecurityGroups   []SecurityGroupFields
	SpaceQuotaGUID   string
}

type SpaceFields

type SpaceFields struct {
	GUID     string
	Name     string
	AllowSSH bool
}

type SpaceQuota

type SpaceQuota struct {
	GUID                    string      `json:"guid,omitempty"`
	Name                    string      `json:"name"`
	MemoryLimit             int64       `json:"memory_limit"`          // in Megabytes
	InstanceMemoryLimit     int64       `json:"instance_memory_limit"` // in Megabytes
	RoutesLimit             int         `json:"total_routes"`
	ServicesLimit           int         `json:"total_services"`
	NonBasicServicesAllowed bool        `json:"non_basic_services_allowed"`
	OrgGUID                 string      `json:"organization_guid"`
	AppInstanceLimit        int         `json:"app_instance_limit"`
	ReservedRoutePortsLimit json.Number `json:"total_reserved_route_ports,omitempty"`
}

func (SpaceQuota) FormattedAppInstanceLimit

func (q SpaceQuota) FormattedAppInstanceLimit() string

func (SpaceQuota) FormattedInstanceMemoryLimit

func (q SpaceQuota) FormattedInstanceMemoryLimit() string

func (SpaceQuota) FormattedMemoryLimit

func (q SpaceQuota) FormattedMemoryLimit() string

func (SpaceQuota) FormattedRoutePortsLimit

func (q SpaceQuota) FormattedRoutePortsLimit() string

func (SpaceQuota) FormattedServicesLimit

func (q SpaceQuota) FormattedServicesLimit() string

type SpaceQuotaResponse

type SpaceQuotaResponse struct {
	GUID                    string      `json:"guid,omitempty"`
	Name                    string      `json:"name"`
	MemoryLimit             int64       `json:"memory_limit"`          // in Megabytes
	InstanceMemoryLimit     int64       `json:"instance_memory_limit"` // in Megabytes
	RoutesLimit             int         `json:"total_routes"`
	ServicesLimit           int         `json:"total_services"`
	NonBasicServicesAllowed bool        `json:"non_basic_services_allowed"`
	OrgGUID                 string      `json:"organization_guid"`
	AppInstanceLimit        json.Number `json:"app_instance_limit"`
	ReservedRoutePortsLimit json.Number `json:"total_reserved_route_ports"`
}

type Stack

type Stack struct {
	GUID        string
	Name        string
	Description string
}

type UserFields

type UserFields struct {
	GUID     string
	Username string
	Password string
	IsAdmin  bool
}

type UserProvidedService

type UserProvidedService struct {
	Name            string                 `json:"name,omitempty"`
	Credentials     map[string]interface{} `json:"credentials"`
	SpaceGUID       string                 `json:"space_guid,omitempty"`
	SysLogDrainURL  string                 `json:"syslog_drain_url"`
	RouteServiceURL string                 `json:"route_service_url"`
	Tags            []string               `json:"tags,omitempty"`
}

type UserProvidedServiceEntity

type UserProvidedServiceEntity struct {
	UserProvidedService `json:"entity"`
}

type UserProvidedServiceSummary

type UserProvidedServiceSummary struct {
	Total     int                         `json:"total_results"`
	Resources []UserProvidedServiceEntity `json:"resources"`
}

Jump to

Keyboard shortcuts

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