controller

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: 16 Imported by: 17

Documentation

Index

Constants

View Source
const ErrCodeAPICreation = "APICreationError"

ErrCodeAPICreation ...

View Source
const ErrCodeResourceServiceAliasDoesnotExist = "ResourceServiceAliasDoesnotExist"

ErrCodeResourceServiceAliasDoesnotExist ...

View Source
const ErrCodeResourceServiceInstanceDoesnotExist = "ResourceServiceInstanceDoesnotExist"

ErrCodeResourceServiceInstanceDoesnotExist ...

View Source
const ErrCodeResourceServiceKeyDoesnotExist = "ResourceServiceInstanceDoesnotExist"

ErrCodeResourceServiceInstanceDoesnotExist ...

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateServiceAliasParams

type CreateServiceAliasParams struct {
	Name              string                 `json:"name"`
	ServiceInstanceID string                 `json:"resource_instance_id"`
	ScopeCRN          crn.CRN                `json:"scope_crn"`
	Tags              []string               `json:"tags,omitempty"`
	Parameters        map[string]interface{} `json:"parameters,omitempty"`
}

type CreateServiceBindingRequest

type CreateServiceBindingRequest struct {
	SourceCRN  crn.CRN                `json:"source_crn"`
	TargetCRN  crn.CRN                `json:"target_crn"`
	Parameters map[string]interface{} `json:"parameters,omitempty"`
}

type CreateServiceInstanceRequest

type CreateServiceInstanceRequest struct {
	Name            string                 `json:"name"`
	ServicePlanID   string                 `json:"resource_plan_id"`
	ResourceGroupID string                 `json:"resource_group_id"`
	Crn             string                 `json:"crn,omitempty"`
	Tags            []string               `json:"tags,omitempty"`
	Parameters      map[string]interface{} `json:"parameters,omitempty"`
	TargetCrn       string                 `json:"target_crn"`
}

type CreateServiceKeyRequest

type CreateServiceKeyRequest struct {
	Name       string                 `json:"name"`
	SourceCRN  crn.CRN                `json:"source_crn"`
	Parameters map[string]interface{} `json:"parameters,omitempty"`
}

type GenericPaginatedResourcesHandler

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

func NewRCPaginatedResources

func NewRCPaginatedResources(resource interface{}) GenericPaginatedResourcesHandler

func (GenericPaginatedResourcesHandler) Resources

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

type ResourceControllerAPI

type ResourceControllerAPI interface {
	ResourceServiceInstance() ResourceServiceInstanceRepository
	ResourceServiceAlias() ResourceServiceAliasRepository
	ResourceServiceKey() ResourceServiceKeyRepository
}

ResourceControllerAPI is the resource client ...

func New

New ...

type ResourceServiceAliasRepository

type ResourceServiceAliasRepository interface {
	Alias(aliasID string) (models.ServiceAlias, error)
	Aliases(*ServiceAliasQueryFilter) ([]models.ServiceAlias, error)
	AliasesWithCallback(*ServiceAliasQueryFilter, func(models.ServiceAlias) bool) error

	InstanceAliases(serviceInstanceID string) ([]models.ServiceAlias, error)
	InstanceAliasByName(serviceInstanceID string, name string) ([]models.ServiceAlias, error)

	CreateAlias(params CreateServiceAliasParams) (models.ServiceAlias, error)
	UpdateAlias(aliasID string, params UpdateServiceAliasParams) (models.ServiceAlias, error)
	DeleteAlias(aliasID string) error
}

type ResourceServiceBindingRepository

type ResourceServiceBindingRepository interface {
	ListBindings(cb func(models.ServiceBinding) bool) error
	GetBinding(bindingID string) (models.ServiceBinding, error)
	CreateBinding(CreateServiceBindingRequest) (models.ServiceBinding, error)
	DeleteBinding(bindingID string) error
}

type ResourceServiceInstanceRepository

type ResourceServiceInstanceRepository interface {
	ListInstances(query ServiceInstanceQuery) ([]models.ServiceInstance, error)
	GetInstance(serviceInstanceID string) (models.ServiceInstance, error)
	CreateInstance(serviceInstanceRequest CreateServiceInstanceRequest) (models.ServiceInstance, error)
	UpdateInstance(serviceInstanceID string, updateInstanceRequest UpdateServiceInstanceRequest) (models.ServiceInstance, error)
	DeleteInstance(serviceInstanceID string, recursive bool) error
}

ResourceServiceInstanceQuery ...

type ResourceServiceKeyRepository

type ResourceServiceKeyRepository interface {
	GetKey(keyID string) (models.ServiceKey, error)
	GetKeys(keyName string) ([]models.ServiceKey, error)
	CreateKey(CreateServiceKeyRequest) (models.ServiceKey, error)
	DeleteKey(keyID string) error
}

ResourceServiceInstanceQuery ...

type ServiceAliasQueryFilter

type ServiceAliasQueryFilter struct {
	AccountID         string
	ServiceInstanceID string
	Name              string // TODO: RC API currently not support name filtering
}

type ServiceInstanceQuery

type ServiceInstanceQuery struct {
	ResourceGroupID string
	ServiceID       string
	ServicePlanID   string
	Name            string
}

type UpdateServiceAliasParams

type UpdateServiceAliasParams struct {
	Name       string                 `json:"name,omitempty"`
	Tags       []string               `json:"tags,omitempty"`
	Parameters map[string]interface{} `json:"parameters,omitempty"`
}

type UpdateServiceInstanceRequest

type UpdateServiceInstanceRequest struct {
	Name          string                 `json:"name,omitempty"`
	ServicePlanID string                 `json:"resource_plan_id,omitempty"`
	Tags          []string               `json:"tags,omitempty"`
	Parameters    map[string]interface{} `json:"parameters,omitempty"`
	UpdateTime    int64                  `json:"update_time,omitempty"`
}

Jump to

Keyboard shortcuts

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