Documentation ¶
Overview ¶
Currently added in this package to be able to access plans schemas. In future we need to refactor that approach and in one single place have Plan Schemas, Plan Schemas Validator, Plan Schemas Defaults Currently it is shared between `broker`, `provider` and `proces/provisioning/input` packages.
Index ¶
- Constants
- Variables
- func AWSRegions() []string
- func AWSSchema(machineTypes []string) []byte
- func AttachRoutes(router *mux.Router, serviceBroker domain.ServiceBroker, logger lager.Logger) *mux.Router
- func AzureRegions() []string
- func AzureSchema(machineTypes []string) []byte
- func DefaultControlsOrder() []string
- func GCPRegions() []string
- func GCPSchema(machineTypes []string) []byte
- func IsAzurePlan(planID string) bool
- func IsTrialPlan(planID string) bool
- func OpenStackRegions() []string
- func OpenStackSchema(machineTypes []string) []byte
- func Plans(plans PlansConfig) map[string]Plan
- func ToInterfaceSlice(input []string) []interface{}
- func TrialSchema() []byte
- type BindEndpoint
- type Client
- type ClientConfig
- type Config
- type ContextUpdateHandler
- type DeprovisionEndpoint
- type EnablePlans
- type GetBindingEndpoint
- type GetInstanceEndpoint
- type JSONSchemaValidator
- type KymaEnvironmentBroker
- type LastBindingOperationEndpoint
- type LastOperationEndpoint
- type Plan
- type PlanData
- type PlanMetadata
- type PlanValidator
- type PlansConfig
- type PlansSchemaValidator
- type ProvisionEndpoint
- type ProvisioningProperties
- type Queue
- type RootSchema
- type Service
- type ServiceMetadata
- type ServicesConfig
- type ServicesEndpoint
- type TrialCloudRegion
- type Type
- type UnbindEndpoint
- type UpdateEndpoint
Constants ¶
const ( KymaServiceID = "47c9dcbf-ff30-448e-ab36-d3bad66ba281" KymaServiceName = "kymaruntime" )
const ( AllPlansSelector = "all_plans" GCPPlanID = "ca6e5357-707f-4565-bbbd-b3ab732597c6" GCPPlanName = "gcp" AWSPlanID = "361c511f-f939-4621-b228-d0fb79a1fe15" AWSPlanName = "aws" AzurePlanID = "4deee563-e5ec-4731-b9b1-53b42d855f0c" AzurePlanName = "azure" AzureLitePlanID = "8cb22518-aa26-44c5-91a0-e669ec9bf443" AzureLitePlanName = "azure_lite" TrialPlanID = "7d55d31d-35ae-4438-bf13-6ffdfa107d9f" TrialPlanName = "trial" OpenStackPlanID = "03b812ac-c991-4528-b5bd-08b303523a63" OpenStackPlanName = "openstack" )
Variables ¶
var PlanIDsMapping = map[string]string{ AzurePlanName: AzurePlanID, AWSPlanName: AWSPlanID, AzureLitePlanName: AzureLitePlanID, GCPPlanName: GCPPlanID, TrialPlanName: TrialPlanID, OpenStackPlanName: OpenStackPlanID, }
var PlanNamesMapping = map[string]string{ GCPPlanID: GCPPlanName, AWSPlanID: AWSPlanName, AzurePlanID: AzurePlanName, AzureLitePlanID: AzureLitePlanName, TrialPlanID: TrialPlanName, OpenStackPlanID: OpenStackPlanName, }
Functions ¶
func AWSRegions ¶
func AWSRegions() []string
func AttachRoutes ¶
func AttachRoutes(router *mux.Router, serviceBroker domain.ServiceBroker, logger lager.Logger) *mux.Router
copied from github.com/pivotal-cf/brokerapi/api.go
func AzureRegions ¶
func AzureRegions() []string
func AzureSchema ¶
func DefaultControlsOrder ¶
func DefaultControlsOrder() []string
func GCPRegions ¶
func GCPRegions() []string
func IsAzurePlan ¶
func IsTrialPlan ¶
func OpenStackRegions ¶
func OpenStackRegions() []string
func OpenStackSchema ¶
func Plans ¶
func Plans(plans PlansConfig) map[string]Plan
plans is designed to hold plan defaulting logic keep internal/hyperscaler/azure/config.go in sync with any changes to available zones
func ToInterfaceSlice ¶
func ToInterfaceSlice(input []string) []interface{}
func TrialSchema ¶
func TrialSchema() []byte
Types ¶
type BindEndpoint ¶
type BindEndpoint struct {
// contains filtered or unexported fields
}
func NewBind ¶
func NewBind(log logrus.FieldLogger) *BindEndpoint
type ClientConfig ¶
type Config ¶
type Config struct { EnablePlans EnablePlans `envconfig:"default=azure"` OnlySingleTrialPerGA bool `envconfig:"default=true"` }
Config represents configuration for broker
type ContextUpdateHandler ¶
type ContextUpdateHandler interface {
Handle(instance *internal.Instance, newCtx internal.ERSContext) error
}
type DeprovisionEndpoint ¶
type DeprovisionEndpoint struct {
// contains filtered or unexported fields
}
func NewDeprovision ¶
func NewDeprovision(instancesStorage storage.Instances, operationsStorage storage.Operations, q Queue, log logrus.FieldLogger) *DeprovisionEndpoint
func (*DeprovisionEndpoint) Deprovision ¶
func (b *DeprovisionEndpoint) Deprovision(ctx context.Context, instanceID string, details domain.DeprovisionDetails, asyncAllowed bool) (domain.DeprovisionServiceSpec, error)
Deprovision deletes an existing service instance
DELETE /v2/service_instances/{instance_id}
type EnablePlans ¶
type EnablePlans []string
EnablePlans defines the plans that should be available for provisioning
func (*EnablePlans) Unmarshal ¶
func (m *EnablePlans) Unmarshal(in string) error
Unmarshal provides custom parsing of enabled plans. Implements envconfig.Unmarshal interface.
type GetBindingEndpoint ¶
type GetBindingEndpoint struct {
// contains filtered or unexported fields
}
func NewGetBinding ¶
func NewGetBinding(log logrus.FieldLogger) *GetBindingEndpoint
func (*GetBindingEndpoint) GetBinding ¶
func (b *GetBindingEndpoint) GetBinding(ctx context.Context, instanceID, bindingID string) (domain.GetBindingSpec, error)
GetBinding fetches an existing service binding
GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}
type GetInstanceEndpoint ¶
type GetInstanceEndpoint struct {
// contains filtered or unexported fields
}
func NewGetInstance ¶
func NewGetInstance(instancesStorage storage.Instances, log logrus.FieldLogger) *GetInstanceEndpoint
func (*GetInstanceEndpoint) GetInstance ¶
func (b *GetInstanceEndpoint) GetInstance(ctx context.Context, instanceID string) (domain.GetInstanceDetailsSpec, error)
GetInstance fetches information about a service instance
GET /v2/service_instances/{instance_id}
type JSONSchemaValidator ¶
type JSONSchemaValidator interface {
ValidateString(json string) (jsonschema.ValidationResult, error)
}
type KymaEnvironmentBroker ¶
type KymaEnvironmentBroker struct { *ServicesEndpoint *ProvisionEndpoint *DeprovisionEndpoint *UpdateEndpoint *GetInstanceEndpoint *LastOperationEndpoint *BindEndpoint *UnbindEndpoint *GetBindingEndpoint *LastBindingOperationEndpoint }
type LastBindingOperationEndpoint ¶
type LastBindingOperationEndpoint struct {
// contains filtered or unexported fields
}
func NewLastBindingOperation ¶
func NewLastBindingOperation(log logrus.FieldLogger) *LastBindingOperationEndpoint
func (*LastBindingOperationEndpoint) LastBindingOperation ¶
func (b *LastBindingOperationEndpoint) LastBindingOperation(ctx context.Context, instanceID, bindingID string, details domain.PollDetails) (domain.LastOperation, error)
LastBindingOperation fetches last operation state for a service binding
GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}/last_operation
type LastOperationEndpoint ¶
type LastOperationEndpoint struct {
// contains filtered or unexported fields
}
func NewLastOperation ¶
func NewLastOperation(os storage.Operations, is storage.Instances, log logrus.FieldLogger) *LastOperationEndpoint
func (*LastOperationEndpoint) LastOperation ¶
func (b *LastOperationEndpoint) LastOperation(ctx context.Context, instanceID string, details domain.PollDetails) (domain.LastOperation, error)
LastOperation fetches last operation state for a service instance
GET /v2/service_instances/{instance_id}/last_operation
type Plan ¶
type Plan struct { PlanDefinition domain.ServicePlan // contains filtered or unexported fields }
type PlanData ¶
type PlanData struct { Description string `yaml:"description"` Metadata PlanMetadata `yaml:"metadata"` }
type PlanMetadata ¶
type PlanMetadata struct {
DisplayName string `yaml:"displayName"`
}
type PlanValidator ¶
type PlansConfig ¶
type PlansSchemaValidator ¶
type PlansSchemaValidator map[string]JSONSchemaValidator
func NewPlansSchemaValidator ¶
func NewPlansSchemaValidator(plansConfig PlansConfig) (PlansSchemaValidator, error)
type ProvisionEndpoint ¶
type ProvisionEndpoint struct {
// contains filtered or unexported fields
}
func NewProvision ¶
func NewProvision(cfg Config, gardenerConfig gardener.Config, operationsStorage storage.Operations, instanceStorage storage.Instances, queue Queue, builderFactory PlanValidator, validator PlansSchemaValidator, plansConfig PlansConfig, kvod bool, log logrus.FieldLogger) *ProvisionEndpoint
func (*ProvisionEndpoint) Provision ¶
func (b *ProvisionEndpoint) Provision(ctx context.Context, instanceID string, details domain.ProvisionDetails, asyncAllowed bool) (domain.ProvisionedServiceSpec, error)
Provision creates a new service instance
PUT /v2/service_instances/{instance_id}
type ProvisioningProperties ¶
type ProvisioningProperties struct { Name Type `json:"name"` Region *Type `json:"region,omitempty"` MachineType *Type `json:"machineType,omitempty"` AutoScalerMin *Type `json:"autoScalerMin,omitempty"` AutoScalerMax *Type `json:"autoScalerMax,omitempty"` }
func NewProvisioningProperties ¶
func NewProvisioningProperties(machineTypes []string, regions []string) ProvisioningProperties
NewProvisioningProperties creates a new properties for different plans Note that the order of properties will be the same in the form on the website
type RootSchema ¶
type RootSchema struct { Schema string `json:"$schema"` Type Properties interface{} `json:"properties"` Required []string `json:"required"` // Specified to true enables form view on website ShowFormView bool `json:"_show_form_view"` // Specifies in what order properties will be displayed on the form ControlsOrder []string `json:"_controlsOrder"` }
func NewSchema ¶
func NewSchema(properties ProvisioningProperties, controlsOrder []string) RootSchema
type Service ¶
type Service struct { Description string `yaml:"description"` Metadata ServiceMetadata `yaml:"metadata"` Plans PlansConfig `yaml:"plans"` }
type ServiceMetadata ¶
type ServicesConfig ¶
func NewServicesConfigFromFile ¶
func NewServicesConfigFromFile(path string) (ServicesConfig, error)
func (ServicesConfig) DefaultPlansConfig ¶
func (s ServicesConfig) DefaultPlansConfig() (PlansConfig, error)
type ServicesEndpoint ¶
type ServicesEndpoint struct {
// contains filtered or unexported fields
}
func NewServices ¶
func NewServices(cfg Config, servicesConfig ServicesConfig, log logrus.FieldLogger) *ServicesEndpoint
type TrialCloudRegion ¶
type TrialCloudRegion string
const ( Europe TrialCloudRegion = "europe" Us TrialCloudRegion = "us" Asia TrialCloudRegion = "asia" )
type Type ¶
type Type struct { Type string `json:"type"` Title string `json:"title,omitempty"` Description string `json:"description,omitempty"` Minimum int `json:"minimum,omitempty"` Maximum int `json:"maximum,omitempty"` MinLength int `json:"minLength,omitempty"` MaxLength int `json:"maxLength,omitempty"` // Regex pattern to match against string type of fields. // If not specified for strings user can pass empty string with whitespaces only. Pattern string `json:"pattern,omitempty"` Default interface{} `json:"default,omitempty"` Example interface{} `json:"example,omitempty"` Enum []interface{} `json:"enum,omitempty"` Items []Type `json:"items,omitempty"` AdditionalItems *bool `json:"additionalItems,omitempty"` UniqueItems *bool `json:"uniqueItems,omitempty"` }
func NameProperty ¶
func NameProperty() Type
type UnbindEndpoint ¶
type UnbindEndpoint struct {
// contains filtered or unexported fields
}
func NewUnbind ¶
func NewUnbind(log logrus.FieldLogger) *UnbindEndpoint
func (*UnbindEndpoint) Unbind ¶
func (b *UnbindEndpoint) Unbind(ctx context.Context, instanceID, bindingID string, details domain.UnbindDetails, asyncAllowed bool) (domain.UnbindSpec, error)
Unbind deletes an existing service binding
DELETE /v2/service_instances/{instance_id}/service_bindings/{binding_id}
type UpdateEndpoint ¶
type UpdateEndpoint struct {
// contains filtered or unexported fields
}
func NewUpdate ¶
func NewUpdate(instanceStorage storage.Instances, operationStorage storage.Operations, ctxUpdateHandler ContextUpdateHandler, processingEnabled bool, log logrus.FieldLogger) *UpdateEndpoint
func (*UpdateEndpoint) Update ¶
func (b *UpdateEndpoint) Update(ctx context.Context, instanceID string, details domain.UpdateDetails, asyncAllowed bool) (domain.UpdateServiceSpec, error)
Update modifies an existing service instance
PATCH /v2/service_instances/{instance_id}