mccpv2

package
v0.0.0-...-9e96525 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 19 Imported by: 102

Documentation

Index

Constants

View Source
const (
	//ErrCodeAppDoesnotExist ...
	ErrCodeAppDoesnotExist = "AppADoesnotExist"

	//AppRunningState ...
	AppRunningState = "RUNNING"

	//AppStartedState ...
	AppStartedState = "STARTED"

	//AppStagedState ...
	AppStagedState = "STAGED"

	//AppPendingState ...
	AppPendingState = "PENDING"

	//AppStoppedState ...
	AppStoppedState = "STOPPED"

	//AppFailedState ...
	AppFailedState = "FAILED"

	//AppUnKnownState ...
	AppUnKnownState = "UNKNOWN"

	//DefaultRetryDelayForStatusCheck ...
	DefaultRetryDelayForStatusCheck = 10 * time.Second
)
View Source
const ErrCodeAPICreation = "APICreationError"

ErrCodeAPICreation ...

View Source
const ErrCodeOrgQuotaDoesnotExist = "OrgQuotaDoesnotExist"

ErrCodeOrgQuotaDoesnotExist ...

View Source
const ErrCodeServiceDoesnotExist = "ServiceDoesnotExist"

ErrCodeServiceDoesnotExist ...

View Source
const ErrCodeServiceKeyDoesNotExist = "erviceKeyDoesNotExist"

ErrCodeServiceKeyDoesNotExist ...

View Source
const ErrCodeServicePlanDoesNotExist = "ServicePlanDoesNotExist"

ErrCodeServicePlanDoesNotExist ...

View Source
const ErrCodeSpaceDoesnotExist = "SpaceDoesnotExist"

ErrCodeSpaceDoesnotExist ...

View Source
const ErrCodeSpaceQuotaDoesnotExist = "SpaceQuotaDoesnotExist"

ErrCodeSpaceQuotaDoesnotExist ...

Variables

View Source
var (
	//ErrFilterNameMissing ...
	ErrFilterNameMissing = errors.New("Filter must have a name")

	//ErrFilterMissingOp ..
	ErrFilterMissingOp = errors.New("Filter must have an operator")
)
View Source
var ErrCodeOrgDoesnotExist = "OrgDoesnotExist"

ErrCodeOrgDoesnotExist ...

View Source
var ErrCodePrivateDomainDoesnotExist = "PrivateDomainDoesnotExist"

ErrCodePrivateDomainDoesnotExist ...

View Source
var ErrCodeRouteDoesnotExist = "RouteDoesnotExist"

ErrCodeRouteDoesnotExist ...

View Source
var ErrCodeSharedDomainDoesnotExist = "SharedDomainDoesnotExist"

ErrCodeSharedDomainDoesnotExist ...

Functions

func NumberToInt

func NumberToInt(number json.Number, defaultValue int) int

Types

type App

type App struct {
	Name                    string
	SpaceGUID               string
	GUID                    string
	StackGUID               string
	State                   string
	PackageState            string
	Memory                  int
	Instances               int
	DiskQuota               int
	Version                 string
	BuildPack               *string
	Command                 *string
	Console                 bool
	Debug                   *string
	StagingTaskID           string
	HealthCheckType         string
	HealthCheckTimeout      *int
	HealthCheckHTTPEndpoint string
	Diego                   bool
	DockerImage             *string
	EnableSSH               bool
	Ports                   []int
	DockerCredentialsJSON   map[string]interface{}
	EnvironmentJSON         map[string]interface{}
}

App model

type AppEntity

type AppEntity struct {
	Name                     string                 `json:"name"`
	SpaceGUID                string                 `json:"space_guid"`
	StackGUID                string                 `json:"stack_guid"`
	State                    string                 `json:"state"`
	PackageState             string                 `json:"package_state"`
	Memory                   int                    `json:"memory"`
	Instances                int                    `json:"instances"`
	DiskQuota                int                    `json:"disk_quota"`
	Version                  string                 `json:"version"`
	BuildPack                *string                `json:"buildpack"`
	Command                  *string                `json:"command"`
	Console                  bool                   `json:"console"`
	Debug                    *string                `json:"debug"`
	StagingTaskID            string                 `json:"staging_task_id"`
	HealthCheckType          string                 `json:"health_check_type"`
	HealthCheckTimeout       *int                   `json:"health_check_timeout"`
	HealthCheckHTTPEndpoint  string                 `json:"health_check_http_endpoint"`
	StagingFailedReason      string                 `json:"staging_failed_reason"`
	StagingFailedDescription string                 `json:"staging_failed_description"`
	Diego                    bool                   `json:"diego"`
	DockerImage              *string                `json:"docker_image"`
	EnableSSH                bool                   `json:"enable_ssh"`
	Ports                    []int                  `json:"ports"`
	DockerCredentialsJSON    map[string]interface{} `json:"docker_credentials_json"`
	EnvironmentJSON          map[string]interface{} `json:"environment_json"`
}

AppEntity ...

type AppFields

type AppFields struct {
	Metadata Metadata
	Entity   AppEntity
}

AppFields ...

type AppRequest

type AppRequest struct {
	Name                     *string                 `json:"name,omitempty"`
	Memory                   int                     `json:"memory,omitempty"`
	Instances                int                     `json:"instances,omitempty"`
	DiskQuota                int                     `json:"disk_quota,omitempty"`
	SpaceGUID                *string                 `json:"space_guid,omitempty"`
	StackGUID                *string                 `json:"stack_guid,omitempty"`
	State                    *string                 `json:"state,omitempty"`
	DetectedStartCommand     *string                 `json:"detected_start_command,omitempty"`
	Command                  *string                 `json:"command,omitempty"`
	BuildPack                *string                 `json:"buildpack,omitempty"`
	HealthCheckType          *string                 `json:"health_check_type,omitempty"`
	HealthCheckTimeout       int                     `json:"health_check_timeout,omitempty"`
	HealthCheckHTTPEndpoint  *string                 `json:"health_check_http_endpoint,omitempty"`
	Diego                    bool                    `json:"diego,omitempty"`
	EnableSSH                bool                    `json:"enable_ssh,omitempty"`
	DockerImage              *string                 `json:"docker_image,omitempty"`
	StagingFailedReason      *string                 `json:"staging_failed_reason,omitempty"`
	StagingFailedDescription *string                 `json:"staging_failed_description,omitempty"`
	Ports                    []int                   `json:"ports,omitempty"`
	DockerCredentialsJSON    *map[string]interface{} `json:"docker_credentials_json,omitempty"`
	EnvironmentJSON          *map[string]interface{} `json:"environment_json,omitempty"`
}

AppRequest ...

type AppResource

type AppResource struct {
	Resource
	Entity AppEntity
}

AppResource ...

func (AppResource) ToFields

func (resource AppResource) ToFields() App

ToFields ..

type AppState

type AppState struct {
	PackageState  string
	InstanceState string
}

AppState ...

type AppStats

type AppStats struct {
	State string `json:"state"`
}

AppStats ...

type AppSummaryFields

type AppSummaryFields struct {
	GUID             string `json:"guid"`
	Name             string `json:"name"`
	State            string `json:"state"`
	PackageState     string `json:"package_state"`
	RunningInstances int    `json:"running_instances"`
}

AppSummaryFields ...

type Apps

type Apps interface {
	Create(appPayload AppRequest, opts ...bool) (*AppFields, error)
	List() ([]App, error)
	Get(appGUID string) (*AppFields, error)
	Update(appGUID string, appPayload AppRequest, opts ...bool) (*AppFields, error)
	Delete(appGUID string, opts ...bool) error
	FindByName(spaceGUID, name string) (*App, error)
	Start(appGUID string, timeout time.Duration) (*AppState, error)
	Upload(path string, name string, opts ...bool) (*UploadBitFields, error)
	Summary(appGUID string) (*AppSummaryFields, error)
	Stat(appGUID string) (map[string]AppStats, error)
	WaitForAppStatus(waitForThisState, appGUID string, timeout time.Duration) (string, error)
	WaitForInstanceStatus(waitForThisState, appGUID string, timeout time.Duration) (string, error)
	Instances(appGUID string) (map[string]AppStats, error)
	Restage(appGUID string, timeout time.Duration) (*AppState, error)
	WaitForStatus(appGUID string, maxWaitTime time.Duration) (*AppState, error)

	//Routes related
	BindRoute(appGUID, routeGUID string) (*AppFields, error)
	ListRoutes(appGUID string) ([]Route, error)
	UnBindRoute(appGUID, routeGUID string) error

	//Service bindings
	ListServiceBindings(appGUID string) ([]ServiceBinding, error)
	DeleteServiceBindings(appGUID string, bindingGUIDs ...string) error
}

Apps ...

type Filter

type Filter struct {
	// contains filtered or unexported fields
}

Filter ...

func (Filter) Build

func (f Filter) Build() (string, error)

Build ...

func (Filter) Eq

func (f Filter) Eq(target string) Filter

Eq ...

func (Filter) Ge

func (f Filter) Ge(target string) Filter

Ge ...

func (Filter) Gt

func (f Filter) Gt(target string) Filter

Gt ...

func (Filter) In

func (f Filter) In(targets ...string) Filter

In ...

func (Filter) Le

func (f Filter) Le(target string) Filter

Le ...

func (Filter) Lt

func (f Filter) Lt(target string) Filter

Lt ...

func (Filter) Name

func (f Filter) Name(name string) Filter

Name ...

type GenericPaginatedResourcesHandler

type GenericPaginatedResourcesHandler struct {
	// contains filtered or unexported fields
}

func NewCCPaginatedResources

func NewCCPaginatedResources(resource interface{}) GenericPaginatedResourcesHandler

func (GenericPaginatedResourcesHandler) Resources

func (pr GenericPaginatedResourcesHandler) Resources(bytes []byte, curURL string) ([]interface{}, string, error)

type LastOperationFields

type LastOperationFields struct {
	Type        string `json:"type"`
	State       string `json:"state"`
	Description string `json:"description"`
	CreatedAt   string `json:"created_at"`
	UpdatedAt   string `json:"updated_at"`
}

LastOperationFields ...

type MccpServiceAPI

type MccpServiceAPI interface {
	Organizations() Organizations
	Spaces() Spaces
	ServiceInstances() ServiceInstances
	ServiceKeys() ServiceKeys
	ServicePlans() ServicePlans
	ServiceOfferings() ServiceOfferings
	SpaceQuotas() SpaceQuotas
	OrgQuotas() OrgQuotas
	Apps() Apps
	Routes() Routes
	SharedDomains() SharedDomains
	PrivateDomains() PrivateDomains
	ServiceBindings() ServiceBindings
	Regions() RegionRepository
}

MccpServiceAPI is the mccpv2 client ...

func New

func New(sess *session.Session) (MccpServiceAPI, error)

New ...

type Metadata

type Metadata struct {
	GUID string `json:"guid"`
	URL  string `json:"url"`
}

Metadata ...

type OrgCreateRequest

type OrgCreateRequest struct {
	Name                   string `json:"name"`
	OrgQuotaDefinitionGUID string `json:"quota_definition_guid,omitempty"`
	Status                 string `json:"status,omitempty"`
}

OrgCreateRequest ...

type OrgEntity

type OrgEntity struct {
	Name                   string `json:"name"`
	Region                 string `json:"region"`
	BillingEnabled         bool   `json:"billing_enabled"`
	Status                 string `json:"status"`
	OrgQuotaDefinitionGUID string `json:"quota_definition_guid"`
}

OrgEntity ...

type OrgQuota

type OrgQuota struct {
	GUID                    string
	Name                    string
	NonBasicServicesAllowed bool
	ServicesLimit           int
	RoutesLimit             int
	MemoryLimitInMB         int64
	InstanceMemoryLimitInMB int64
	TrialDBAllowed          bool
	AppInstanceLimit        int
	PrivateDomainsLimit     int
	AppTasksLimit           int
	ServiceKeysLimit        int
	RoutePortsLimit         int
}

OrgQuota ...

type OrgQuotaEntity

type OrgQuotaEntity struct {
	Name                    string      `json:"name"`
	NonBasicServicesAllowed bool        `json:"non_basic_services_allowed"`
	ServicesLimit           int         `json:"total_services"`
	RoutesLimit             int         `json:"total_routes"`
	MemoryLimitInMB         int64       `json:"memory_limit"`
	InstanceMemoryLimitInMB int64       `json:"instance_memory_limit"`
	TrialDBAllowed          bool        `json:"trial_db_allowed"`
	AppInstanceLimit        json.Number `json:"app_instance_limit"`
	PrivateDomainsLimit     json.Number `json:"total_private_domains"`
	AppTasksLimit           json.Number `json:"app_tasks_limit"`
	ServiceKeysLimit        json.Number `json:"total_service_keys"`
	RoutePortsLimit         int         `json:"total_reserved_route_ports"`
}

OrgQuotaEntity ...

type OrgQuotaFields

type OrgQuotaFields struct {
	Metadata OrgQuotaMetadata
	Entity   OrgQuotaEntity
}

OrgQuotaFields ...

type OrgQuotaMetadata

type OrgQuotaMetadata struct {
	GUID string `json:"guid"`
	URL  string `json:"url"`
}

OrgQuotaMetadata ...

type OrgQuotaResource

type OrgQuotaResource struct {
	Resource
	Entity OrgQuotaEntity
}

OrgQuotaResource ...

func (OrgQuotaResource) ToFields

func (resource OrgQuotaResource) ToFields() OrgQuota

ToFields ...

type OrgQuotas

type OrgQuotas interface {
	FindByName(name string) (*OrgQuota, error)
	Get(orgQuotaGUID string) (*OrgQuotaFields, error)
	List() ([]OrgQuota, error)
}

OrgQuotas ...

type OrgRegionInformation

type OrgRegionInformation struct {
	ID          string `json:"id"`
	Domain      string `json:"domain"`
	Name        string `json:"name"`
	Region      string `json:"region"`
	DisplayName string `json:"display_name"`
	Customer    struct {
		Name        string `json:"name"`
		DisplayName string `json:"display_name"`
	} `json:"customer"`
	Deployment struct {
		Name        string `json:"name"`
		DisplayName string `json:"display_name"`
	} `json:"deployment"`
	Geo struct {
		Name        string `json:"name"`
		DisplayName string `json:"display_name"`
	} `json:"geo"`
	Account struct {
		GUID       string   `json:"guid"`
		OwnerGUIDs []string `json:"owner_guids"`
	} `json:"account"`
	PublicRegionsByProximity []string `json:"public_regions_by_proximity"`
	ConsoleURL               string   `json:"console_url"`
	CFAPI                    string   `json:"cf_api"`
	MCCPAPI                  string   `json:"mccp_api"`
	Type                     string   `json:"type"`
	Home                     bool     `json:"home"`
	Stealth                  string   `json:"stealth"`
	Aliases                  []string `json:"aliases"`
	Settings                 struct {
		Devops struct {
			Enabled bool `json:"enabled"`
		} `json:"devops"`
		EnhancedAutoFix bool `json:"enhancedAutofix"`
	} `json:"settings"`
	OrgName string `json:"org_name"`
	OrgGUID string `json:"org_guid"`
}

OrgRegionInformation is the region information associated with an org

type OrgResource

type OrgResource struct {
	Resource
	Entity OrgEntity
}

OrgResource ...

func (OrgResource) ToFields

func (resource OrgResource) ToFields() Organization

ToFields ..

type OrgRole

type OrgRole struct {
	UserGUID string
	Admin    bool
	UserName string
}

OrgRole ...

type OrgRoleEntity

type OrgRoleEntity struct {
	UserGUID string `json:"guid"`
	Admin    bool   `json:"bool"`
	UserName string `json:"username"`
}

OrgRoleEntity ...

type OrgRoleResource

type OrgRoleResource struct {
	Resource
	Entity OrgRoleEntity
}

OrgRoleResource ...

func (*OrgRoleResource) ToFields

func (resource *OrgRoleResource) ToFields() OrgRole

ToFields ...

type OrgUpdateRequest

type OrgUpdateRequest struct {
	Name                   *string `json:"name,omitempty"`
	OrgQuotaDefinitionGUID string  `json:"quota_definition_guid,omitempty"`
}

OrgUpdateRequest ...

type Organization

type Organization struct {
	GUID                   string
	Name                   string
	Region                 string
	BillingEnabled         bool
	Status                 string
	OrgQuotaDefinitionGUID string
}

Organization model

type OrganizationFields

type OrganizationFields struct {
	Metadata Metadata
	Entity   OrgEntity
}

OrganizationFields ...

type Organizations

type Organizations interface {
	Create(req OrgCreateRequest, opts ...bool) (*OrganizationFields, error)
	Get(orgGUID string) (*OrganizationFields, error)
	List(region string) ([]Organization, error)
	FindByName(orgName, region string) (*Organization, error)
	DeleteByRegion(guid string, region string, opts ...bool) error
	Delete(guid string, opts ...bool) error
	Update(guid string, req OrgUpdateRequest, opts ...bool) (*OrganizationFields, error)
	GetRegionInformation(orgGUID string) ([]OrgRegionInformation, error)

	AssociateBillingManager(orgGUID string, userMail string) (*OrganizationFields, error)
	AssociateAuditor(orgGUID string, userMail string) (*OrganizationFields, error)
	AssociateManager(orgGUID string, userMail string) (*OrganizationFields, error)
	AssociateUser(orgGUID string, userMail string) (*OrganizationFields, error)

	ListBillingManager(orgGUID string, filters ...string) ([]OrgRole, error)
	ListAuditors(orgGUID string, filters ...string) ([]OrgRole, error)
	ListManager(orgGUID string, filters ...string) ([]OrgRole, error)
	ListUsers(orgGUID string, filters ...string) ([]OrgRole, error)

	DisassociateBillingManager(orgGUID string, userMail string) error
	DisassociateManager(orgGUID string, userMail string) error
	DisassociateAuditor(orgGUID string, userMail string) error
	DisassociateUser(orgGUID string, userMail string) error
}

Organizations ...

type PrivateDomain

type PrivateDomain struct {
	GUID                   string
	Name                   string
	OwningOrganizationGUID string
	OwningOrganizationURL  string
	SharedOrganizationURL  string
}

PrivateDomain model

type PrivateDomainEntity

type PrivateDomainEntity struct {
	Name                   string `json:"name"`
	OwningOrganizationGUID string `json:"owning_organization_guid"`
	OwningOrganizationURL  string `json:"owning_organization_url"`
	SharedOrganizationURL  string `json:"shared_organizations_url"`
}

PrivateDomainEntity ...

type PrivateDomainFields

type PrivateDomainFields struct {
	Metadata PrivateDomainMetadata
	Entity   PrivateDomainEntity
}

PrivateDomainFields ...

type PrivateDomainMetadata

type PrivateDomainMetadata struct {
	GUID string `json:"guid"`
	URL  string `json:"url"`
}

PrivateDomaineMetadata ...

type PrivateDomainRequest

type PrivateDomainRequest struct {
	Name    string `json:"name,omitempty"`
	OrgGUID string `json:"owning_organization_guid,omitempty"`
}

PrivateDomainRequest ...

type PrivateDomainResource

type PrivateDomainResource struct {
	Resource
	Entity PrivateDomainEntity
}

PrivateDomainResource ...

func (PrivateDomainResource) ToFields

func (resource PrivateDomainResource) ToFields() PrivateDomain

ToFields ..

type PrivateDomains

type PrivateDomains interface {
	FindByNameInOrg(orgGUID, domainName string) (*PrivateDomain, error)
	FindByName(domainName string) (*PrivateDomain, error)
	Create(req PrivateDomainRequest, opts ...bool) (*PrivateDomainFields, error)
	Get(privateDomainGUID string) (*PrivateDomainFields, error)
	Delete(privateDomainGUID string, opts ...bool) error
}

PrivateDomains ...

type RegionRepository

type RegionRepository interface {
	PublicRegions() ([]models.Region, error)
	Regions() ([]models.Region, error)
	FindRegionByName(name string) (*models.Region, error)
	FindRegionById(id string) (*models.Region, error)
}

type Resource

type Resource struct {
	Metadata Metadata
}

Resource ...

type Route

type Route struct {
	GUID                string
	Host                string
	Path                string
	DomainGUID          string
	SpaceGUID           string
	ServiceInstanceGUID string
	Port                *int
	DomainURL           string
	SpaceURL            string
	AppsURL             string
	RouteMappingURL     string
}

Route model

type RouteEntity

type RouteEntity struct {
	Host                string `json:"host"`
	Path                string `json:"path"`
	DomainGUID          string `json:"domain_guid"`
	SpaceGUID           string `json:"space_guid"`
	ServiceInstanceGUID string `json:"service_instance_guid"`
	Port                *int   `json:"port"`
	DomainURL           string `json:"domain_url"`
	SpaceURL            string `json:"space_url"`
	AppsURL             string `json:"apps_url"`
	RouteMappingURL     string `json:"route_mapping_url"`
}

RouteEntity ...

type RouteFields

type RouteFields struct {
	Metadata RouteMetadata
	Entity   RouteEntity
}

RouteFields ...

type RouteFilter

type RouteFilter struct {
	DomainGUID string
	Host       *string
	Path       *string
	Port       *int
}

RouteFilter ...

type RouteMetadata

type RouteMetadata struct {
	GUID string `json:"guid"`
	URL  string `json:"url"`
}

RouteMetadata ...

type RouteRequest

type RouteRequest struct {
	Host       string `json:"host,omitempty"`
	SpaceGUID  string `json:"space_guid"`
	DomainGUID string `json:"domain_guid,omitempty"`
	Path       string `json:"path,omitempty"`
	Port       *int   `json:"port,omitempty"`
}

RouteRequest ...

type RouteResource

type RouteResource struct {
	Resource
	Entity RouteEntity
}

RouteResource ...

func (RouteResource) ToFields

func (resource RouteResource) ToFields() Route

ToFields ..

type RouteUpdateRequest

type RouteUpdateRequest struct {
	Host *string `json:"host,omitempty"`
	Path *string `json:"path,omitempty"`
	Port *int    `json:"port,omitempty"`
}

RouteUpdateRequest ...

type Routes

type Routes interface {
	Find(hostname, domainGUID string) ([]Route, error)
	Create(req RouteRequest, opts ...bool) (*RouteFields, error)
	Get(routeGUID string) (*RouteFields, error)
	Update(routeGUID string, req RouteUpdateRequest, opts ...bool) (*RouteFields, error)
	Delete(routeGUID string, opts ...bool) error
}

Routes ...

type ServiceBinding

type ServiceBinding struct {
	GUID                string
	ServiceInstanceGUID string
	AppGUID             string
	Credentials         map[string]interface{}
}

ServiceBinding model

type ServiceBindingEntity

type ServiceBindingEntity struct {
	ServiceInstanceGUID string                 `json:"service_instance_guid"`
	AppGUID             string                 `json:"app_guid"`
	Credentials         map[string]interface{} `json:"credentials"`
}

ServiceBindingEntity ...

type ServiceBindingFields

type ServiceBindingFields struct {
	Metadata ServiceBindingMetadata
	Entity   ServiceBindingEntity
}

ServiceBindingFields ...

type ServiceBindingMetadata

type ServiceBindingMetadata struct {
	GUID string `json:"guid"`
	URL  string `json:"url"`
}

ServiceBindingMetadata ...

type ServiceBindingRequest

type ServiceBindingRequest struct {
	ServiceInstanceGUID string `json:"service_instance_guid"`
	AppGUID             string `json:"app_guid"`
	Parameters          string `json:"parameters,omitempty"`
}

ServiceBindingRequest ...

type ServiceBindingResource

type ServiceBindingResource struct {
	Resource
	Entity ServiceBindingEntity
}

ServiceBindingResource ...

func (ServiceBindingResource) ToFields

func (resource ServiceBindingResource) ToFields() ServiceBinding

ToFields ..

type ServiceBindings

type ServiceBindings interface {
	Create(req ServiceBindingRequest) (*ServiceBindingFields, error)
	Get(guid string) (*ServiceBindingFields, error)
	Delete(guid string, opts ...bool) error
	List(filters ...string) ([]ServiceBinding, error)
}

ServiceBindings ...

type ServiceInstance

type ServiceInstance struct {
	GUID              string
	Name              string                 `json:"name"`
	Credentials       map[string]interface{} `json:"credentials"`
	ServicePlanGUID   string                 `json:"service_plan_guid"`
	SpaceGUID         string                 `json:"space_guid"`
	GatewayData       string                 `json:"gateway_data"`
	Type              string                 `json:"type"`
	DashboardURL      string                 `json:"dashboard_url"`
	LastOperation     LastOperationFields    `json:"last_operation"`
	RouteServiceURL   string                 `json:"routes_url"`
	Tags              []string               `json:"tags"`
	SpaceURL          string                 `json:"space_url"`
	ServicePlanURL    string                 `json:"service_plan_url"`
	ServiceBindingURL string                 `json:"service_bindings_url"`
	ServiceKeysURL    string                 `json:"service_keys_url"`
	ServiceKeys       []ServiceKeyFields     `json:"service_keys"`
	ServicePlan       ServicePlanFields      `json:"service_plan"`
}

ServiceInstance ...

type ServiceInstanceCreateRequest

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

ServiceInstanceCreateRequest ...

type ServiceInstanceEntity

type ServiceInstanceEntity struct {
	Name              string                 `json:"name"`
	Credentials       map[string]interface{} `json:"credentials"`
	ServicePlanGUID   string                 `json:"service_plan_guid"`
	SpaceGUID         string                 `json:"space_guid"`
	GatewayData       string                 `json:"gateway_data"`
	Type              string                 `json:"type"`
	DashboardURL      string                 `json:"dashboard_url"`
	LastOperation     LastOperationFields    `json:"last_operation"`
	RouteServiceURL   string                 `json:"routes_url"`
	Tags              []string               `json:"tags"`
	SpaceURL          string                 `json:"space_url"`
	ServicePlanURL    string                 `json:"service_plan_url"`
	ServiceBindingURL string                 `json:"service_bindings_url"`
	ServiceKeysURL    string                 `json:"service_keys_url"`
	ServiceKeys       []ServiceKeyFields     `json:"service_keys"`
	ServicePlan       ServicePlanFields      `json:"service_plan"`
}

ServiceInstanceEntity ...

type ServiceInstanceFields

type ServiceInstanceFields struct {
	Metadata ServiceInstanceMetadata
	Entity   ServiceInstance
}

ServiceInstanceFields ...

type ServiceInstanceMetadata

type ServiceInstanceMetadata struct {
	GUID string `json:"guid"`
	URL  string `json:"url"`
}

ServiceInstanceMetadata ...

type ServiceInstanceResource

type ServiceInstanceResource struct {
	Resource
	Entity ServiceInstanceEntity
}

ServiceInstanceResource ...

func (ServiceInstanceResource) ToModel

func (resource ServiceInstanceResource) ToModel() ServiceInstance

ToModel ...

type ServiceInstanceUpdateRequest

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

ServiceInstanceUpdateRequest ...

type ServiceInstances

type ServiceInstances interface {
	Create(req ServiceInstanceCreateRequest) (*ServiceInstanceFields, error)
	Update(instanceGUID string, req ServiceInstanceUpdateRequest) (*ServiceInstanceFields, error)
	Delete(instanceGUID string, opts ...bool) error
	FindByName(instanceName string) (*ServiceInstance, error)
	FindByNameInSpace(spaceGUID string, instanceName string) (*ServiceInstance, error)
	Get(instanceGUID string, depth ...int) (*ServiceInstanceFields, error)
	ListServiceBindings(instanceGUID string) ([]ServiceBinding, error)
}

ServiceInstances ...

type ServiceKey

type ServiceKey struct {
	GUID                string
	Name                string                 `json:"name"`
	ServiceInstanceGUID string                 `json:"service_instance_guid"`
	ServiceInstanceURL  string                 `json:"service_instance_url"`
	Credentials         map[string]interface{} `json:"credentials"`
}

ServiceKey model...

type ServiceKeyEntity

type ServiceKeyEntity struct {
	Name                string                 `json:"name"`
	ServiceInstanceGUID string                 `json:"service_instance_guid"`
	ServiceInstanceURL  string                 `json:"service_instance_url"`
	Credentials         map[string]interface{} `json:"credentials"`
}

ServiceKeyEntity ...

type ServiceKeyFields

type ServiceKeyFields struct {
	Metadata ServiceKeyMetadata
	Entity   ServiceKey
}

ServiceKeyFields ...

type ServiceKeyMetadata

type ServiceKeyMetadata struct {
	GUID      string `json:"guid"`
	URL       string `json:"url"`
	CreatedAt string `json:"created_at"`
	UpdatedAt string `json:"updated_at"`
}

ServiceKeyMetadata ...

type ServiceKeyRequest

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

ServiceKeyRequest ...

type ServiceKeyResource

type ServiceKeyResource struct {
	Resource
	Entity ServiceKeyEntity
}

ServiceKeyResource ...

func (ServiceKeyResource) ToModel

func (resource ServiceKeyResource) ToModel() ServiceKey

ToModel ...

type ServiceKeys

type ServiceKeys interface {
	Create(serviceInstanceGUID string, keyName string, params map[string]interface{}) (*ServiceKeyFields, error)
	FindByName(serviceInstanceGUID string, keyName string) (*ServiceKey, error)
	Get(serviceKeyGUID string) (*ServiceKeyFields, error)
	Delete(serviceKeyGUID string) error
	List(filters ...string) ([]ServiceKey, error)
}

ServiceKeys ...

type ServiceOffering

type ServiceOffering struct {
	GUID              string
	Label             string   `json:"label"`
	Provider          string   `json:"provider"`
	Description       string   `json:"description"`
	LongDescription   string   `json:"long_description"`
	Version           string   `json:"version"`
	URL               string   `json:"url"`
	InfoURL           string   `json:"info_url"`
	DocumentURL       string   `json:"documentation_url"`
	Timeout           string   `json:"timeout"`
	UniqueID          string   `json:"unique_id"`
	ServiceBrokerGUID string   `json:"service_broker_guid"`
	ServicePlansURL   string   `json:"service_plans_url"`
	Tags              []string `json:"tags"`
	Requires          []string `json:"requires"`
	IsActive          bool     `json:"active"`
	IsBindable        bool     `json:"bindable"`
	IsPlanUpdateable  bool     `json:"plan_updateable"`
}

ServiceOffering model

type ServiceOfferingEntity

type ServiceOfferingEntity struct {
	Label             string   `json:"label"`
	Provider          string   `json:"provider"`
	Description       string   `json:"description"`
	LongDescription   string   `json:"long_description"`
	Version           string   `json:"version"`
	URL               string   `json:"url"`
	InfoURL           string   `json:"info_url"`
	DocumentURL       string   `json:"documentation_url"`
	Timeout           string   `json:"timeout"`
	UniqueID          string   `json:"unique_id"`
	ServiceBrokerGUID string   `json:"service_broker_guid"`
	ServicePlansURL   string   `json:"service_plans_url"`
	Tags              []string `json:"tags"`
	Requires          []string `json:"requires"`
	IsActive          bool     `json:"active"`
	IsBindable        bool     `json:"bindable"`
	IsPlanUpdateable  bool     `json:"plan_updateable"`
}

ServiceOfferingEntity ...

type ServiceOfferingFields

type ServiceOfferingFields struct {
	Metadata ServiceOfferingMetadata
	Entity   ServiceOffering
}

ServiceOfferingFields ...

type ServiceOfferingMetadata

type ServiceOfferingMetadata struct {
	GUID string `json:"guid"`
	URL  string `json:"url"`
}

ServiceOfferingMetadata ...

type ServiceOfferingResource

type ServiceOfferingResource struct {
	Resource
	Entity ServiceOfferingEntity
}

ServiceOfferingResource ...

func (ServiceOfferingResource) ToFields

func (resource ServiceOfferingResource) ToFields() ServiceOffering

ToFields ...

type ServiceOfferings

type ServiceOfferings interface {
	FindByLabel(serviceName string) (*ServiceOffering, error)
	Get(svcOfferingGUID string) (*ServiceOfferingFields, error)
}

ServiceOfferings ...

type ServicePlan

type ServicePlan struct {
	GUID                string
	Name                string `json:"name"`
	Description         string `json:"description"`
	IsFree              bool   `json:"free"`
	IsPublic            bool   `json:"public"`
	IsActive            bool   `json:"active"`
	ServiceGUID         string `json:"service_guid"`
	UniqueID            string `json:"unique_id"`
	ServiceInstancesURL string `json:"service_instances_url"`
}

ServicePlan ...

type ServicePlanEntity

type ServicePlanEntity struct {
	Name                string `json:"name"`
	Description         string `json:"description"`
	IsFree              bool   `json:"free"`
	IsPublic            bool   `json:"public"`
	IsActive            bool   `json:"active"`
	ServiceGUID         string `json:"service_guid"`
	UniqueID            string `json:"unique_id"`
	ServiceInstancesURL string `json:"service_instances_url"`
}

ServicePlanEntity ...

type ServicePlanFields

type ServicePlanFields struct {
	Metadata ServicePlanMetadata
	Entity   ServicePlan
}

ServicePlanFields ...

type ServicePlanMetadata

type ServicePlanMetadata struct {
	GUID string `json:"guid"`
	URL  string `json:"url"`
}

ServicePlanMetadata ...

type ServicePlanResource

type ServicePlanResource struct {
	Resource
	Entity ServicePlanEntity
}

ServicePlanResource ...

func (ServicePlanResource) ToFields

func (resource ServicePlanResource) ToFields() ServicePlan

ToFields ...

type ServicePlans

type ServicePlans interface {
	FindPlanInServiceOffering(serviceOfferingGUID string, planType string) (*ServicePlan, error)
	Get(planGUID string) (*ServicePlanFields, error)
}

ServicePlans ...

type SharedDomain

type SharedDomain struct {
	GUID            string
	Name            string
	RouterGroupGUID string
	RouterGroupType string
}

SharedDomain model

type SharedDomainEntity

type SharedDomainEntity struct {
	Name            string `json:"name"`
	RouterGroupGUID string `json:"router_group_guid"`
	RouterGroupType string `json:"router_group_type"`
}

SharedDomainEntity ...

type SharedDomainFields

type SharedDomainFields struct {
	Metadata SharedDomainMetadata
	Entity   SharedDomainEntity
}

SharedDomainFields ...

type SharedDomainMetadata

type SharedDomainMetadata struct {
	GUID string `json:"guid"`
	URL  string `json:"url"`
}

SharedDomaineMetadata ...

type SharedDomainRequest

type SharedDomainRequest struct {
	Name            string `json:"name"`
	RouterGroupGUID string `json:"router_group_guid,omitempty"`
}

SharedDomainRequest ...

type SharedDomainResource

type SharedDomainResource struct {
	Resource
	Entity SharedDomainEntity
}

SharedDomainResource ...

func (SharedDomainResource) ToFields

func (resource SharedDomainResource) ToFields() SharedDomain

ToFields ..

type SharedDomains

type SharedDomains interface {
	FindByName(domainName string) (*SharedDomain, error)
	Create(req SharedDomainRequest, opts ...bool) (*SharedDomainFields, error)
	Get(sharedDomainGUID string) (*SharedDomainFields, error)
	Delete(sharedDomainGUID string, opts ...bool) error
}

SharedDomains ...

type Space

type Space struct {
	GUID           string
	Name           string
	OrgGUID        string
	SpaceQuotaGUID string
	AllowSSH       bool
}

Space ...

type SpaceCreateRequest

type SpaceCreateRequest struct {
	Name           string `json:"name"`
	OrgGUID        string `json:"organization_guid"`
	SpaceQuotaGUID string `json:"space_quota_definition_guid,omitempty"`
}

SpaceCreateRequest ...

type SpaceEntity

type SpaceEntity struct {
	Name           string `json:"name"`
	OrgGUID        string `json:"organization_guid"`
	SpaceQuotaGUID string `json:"space_quota_definition_guid"`
	AllowSSH       bool   `json:"allow_ssh"`
}

SpaceEntity ...

type SpaceFields

type SpaceFields struct {
	Metadata SpaceMetadata
	Entity   SpaceEntity
}

SpaceFields ...

type SpaceMetadata

type SpaceMetadata struct {
	GUID string `json:"guid"`
	URL  string `json:"url"`
}

SpaceMetadata ...

type SpaceQuota

type SpaceQuota struct {
	GUID                    string
	Name                    string
	NonBasicServicesAllowed bool
	ServicesLimit           int
	RoutesLimit             int
	MemoryLimitInMB         int64
	InstanceMemoryLimitInMB int64
	TrialDBAllowed          bool
	AppInstanceLimit        int
	PrivateDomainsLimit     int
	AppTaskLimit            int
}

type SpaceQuotaCreateRequest

type SpaceQuotaCreateRequest struct {
	Name                    string `json:"name"`
	OrgGUID                 string `json:"organization_guid"`
	MemoryLimitInMB         int64  `json:"memory_limit,omitempty"`
	InstanceMemoryLimitInMB int64  `json:"instance_memory_limit,omitempty"`
	RoutesLimit             int    `json:"total_routes,omitempty"`
	ServicesLimit           int    `json:"total_services,omitempty"`
	NonBasicServicesAllowed bool   `json:"non_basic_services_allowed"`
}

SpaceQuotaCreateRequest ...

type SpaceQuotaEntity

type SpaceQuotaEntity struct {
	Name                    string      `json:"name"`
	NonBasicServicesAllowed bool        `json:"non_basic_services_allowed"`
	ServicesLimit           int         `json:"total_services"`
	RoutesLimit             int         `json:"total_routes"`
	MemoryLimitInMB         int64       `json:"memory_limit"`
	InstanceMemoryLimitInMB int64       `json:"instance_memory_limit"`
	TrialDBAllowed          bool        `json:"trial_db_allowed"`
	AppInstanceLimit        json.Number `json:"app_instance_limit"`
	PrivateDomainsLimit     json.Number `json:"total_private_domains"`
	AppTaskLimit            json.Number `json:"app_task_limit"`
}

type SpaceQuotaFields

type SpaceQuotaFields struct {
	Metadata SpaceQuotaMetadata
	Entity   SpaceQuotaEntity
}

SpaceQuotaFields ...

type SpaceQuotaMetadata

type SpaceQuotaMetadata struct {
	GUID string `json:"guid"`
	URL  string `json:"url"`
}

SpaceQuotaMetadata ...

type SpaceQuotaResource

type SpaceQuotaResource struct {
	Resource
	Entity SpaceQuotaEntity
}

func (SpaceQuotaResource) ToFields

func (resource SpaceQuotaResource) ToFields() SpaceQuota

type SpaceQuotaUpdateRequest

type SpaceQuotaUpdateRequest struct {
	Name                    string `json:"name"`
	OrgGUID                 string `json:"organization_guid,omitempty"`
	MemoryLimitInMB         int64  `json:"memory_limit,omitempty"`
	InstanceMemoryLimitInMB int64  `json:"instance_memory_limit,omitempty"`
	RoutesLimit             int    `json:"total_routes,omitempty"`
	ServicesLimit           int    `json:"total_services,omitempty"`
	NonBasicServicesAllowed bool   `json:"non_basic_services_allowed"`
}

SpaceQuotaUpdateRequest ...

type SpaceQuotas

type SpaceQuotas interface {
	FindByName(name, orgGUID string) (*SpaceQuota, error)
	Create(createRequest SpaceQuotaCreateRequest) (*SpaceQuotaFields, error)
	Update(updateRequest SpaceQuotaUpdateRequest, spaceQuotaGUID string) (*SpaceQuotaFields, error)
	Delete(spaceQuotaGUID string, opts ...bool) error
	Get(spaceQuotaGUID string) (*SpaceQuotaFields, error)
}

SpaceQuotas ...

type SpaceResource

type SpaceResource struct {
	Resource
	Entity SpaceEntity
}

SpaceResource ...

func (*SpaceResource) ToFields

func (resource *SpaceResource) ToFields() Space

ToFields ...

type SpaceRole

type SpaceRole struct {
	UserGUID string
	Admin    bool
	UserName string
}

SpaceRole ...

type SpaceRoleEntity

type SpaceRoleEntity struct {
	UserGUID string `json:"guid"`
	Admin    bool   `json:"bool"`
	UserName string `json:"username"`
}

SpaceRoleEntity ...

type SpaceRoleResource

type SpaceRoleResource struct {
	Resource
	Entity SpaceRoleEntity
}

SpaceRoleResource ...

func (*SpaceRoleResource) ToFields

func (resource *SpaceRoleResource) ToFields() SpaceRole

ToFields ...

type SpaceUpdateRequest

type SpaceUpdateRequest struct {
	Name *string `json:"name,omitempty"`
}

SpaceUpdateRequest ...

type Spaces

type Spaces interface {
	ListSpacesInOrg(orgGUID, region string) ([]Space, error)
	FindByNameInOrg(orgGUID, name, region string) (*Space, error)
	Create(req SpaceCreateRequest, opts ...bool) (*SpaceFields, error)
	Update(spaceGUID string, req SpaceUpdateRequest, opts ...bool) (*SpaceFields, error)
	Delete(spaceGUID string, opts ...bool) error
	Get(spaceGUID string) (*SpaceFields, error)
	ListRoutes(spaceGUID string, req RouteFilter) ([]Route, error)
	AssociateAuditor(spaceGUID, userMail string) (*SpaceFields, error)
	AssociateDeveloper(spaceGUID, userMail string) (*SpaceFields, error)
	AssociateManager(spaceGUID, userMail string) (*SpaceFields, error)

	DisassociateAuditor(spaceGUID, userMail string) error
	DisassociateDeveloper(spaceGUID, userMail string) error
	DisassociateManager(spaceGUID, userMail string) error

	ListAuditors(spaceGUID string, filters ...string) ([]SpaceRole, error)
	ListDevelopers(spaceGUID string, filters ...string) ([]SpaceRole, error)
	ListManagers(spaceGUID string, filters ...string) ([]SpaceRole, error)
}

Spaces ...

type UploadBitFields

type UploadBitFields struct {
	Metadata Metadata
	Entity   UploadBitsEntity
}

UploadBitFields ...

type UploadBitsEntity

type UploadBitsEntity struct {
	GUID   string `json:"guid"`
	Status string `json:"status"`
}

UploadBitsEntity ...

Jump to

Keyboard shortcuts

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