types

package
v0.0.0-...-d6856c1 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2020 License: Apache-2.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// VirtualNetworkIDPoolKey identifies the int pool of virtual network IDs.
	VirtualNetworkIDPoolKey = "virtual_network_id"
	// SecurityGroupIDPoolKey identifies the int pool of security group IDs.
	SecurityGroupIDPoolKey = "security_group_id"
)

Variables

This section is empty.

Functions

func CheckServiceProperties

func CheckServiceProperties(
	fr *models.FirewallRule, databaseFR *models.FirewallRule, fm *types.FieldMask,
) error

CheckServiceProperties checks for existence of service and serviceGroupRefs property

func SetProtocolID

func SetProtocolID(fr *models.FirewallRule, fm *types.FieldMask) error

SetProtocolID sets protocolID based on protocol property

Types

type ContrailTypeLogicService

type ContrailTypeLogicService struct {
	services.BaseService
	ReadService       services.ReadService
	InTransactionDoer InTransactionDoer
	AddressManager    ipam.AddressManager
	IntPoolAllocator  IntPoolAllocator
	MetadataGetter    asfservices.MetadataGetter
	WriteService      services.WriteService
	// contains filtered or unexported fields
}

ContrailTypeLogicService is a service for implementing type specific logic

func (*ContrailTypeLogicService) CreateAlarm

func (sv *ContrailTypeLogicService) CreateAlarm(
	ctx context.Context,
	request *services.CreateAlarmRequest) (response *services.CreateAlarmResponse, err error)

CreateAlarm does pre check for alarm.

func (*ContrailTypeLogicService) CreateAliasIP

func (sv *ContrailTypeLogicService) CreateAliasIP(
	ctx context.Context,
	request *services.CreateAliasIPRequest,
) (response *services.CreateAliasIPResponse, err error)

CreateAliasIP allocates ip in address manager for alias-ip

func (*ContrailTypeLogicService) CreateBGPAsAService

func (sv *ContrailTypeLogicService) CreateBGPAsAService(
	ctx context.Context, request *services.CreateBGPAsAServiceRequest,
) (response *services.CreateBGPAsAServiceResponse, err error)

CreateBGPAsAService creates BGP as a service instance and ensures that shared one have IP address

func (*ContrailTypeLogicService) CreateBGPRouter

CreateBGPRouter creates BGP Router and checks if provided asn is equal to asn in linked SubCluster.

func (*ContrailTypeLogicService) CreateDomain

func (sv *ContrailTypeLogicService) CreateDomain(
	ctx context.Context,
	request *services.CreateDomainRequest,
) (response *services.CreateDomainResponse, err error)

CreateDomain does pre-check for create domain

func (*ContrailTypeLogicService) CreateFirewallPolicy

func (sv *ContrailTypeLogicService) CreateFirewallPolicy(
	ctx context.Context,
	request *services.CreateFirewallPolicyRequest,
) (response *services.CreateFirewallPolicyResponse, err error)

CreateFirewallPolicy performs pre create type specific validation.

func (*ContrailTypeLogicService) CreateFirewallRule

CreateFirewallRule performs types specific validation, also sets protocolID, default MatchTag, tagRefs and addressGroupRefs

func (*ContrailTypeLogicService) CreateFloatingIP

CreateFloatingIP checks parent type and if parent type isn't instance-ip then this method tries to allocate IP using AddressManager in subnets from floating-ip-pool(parent).

func (*ContrailTypeLogicService) CreateFloatingIPPool

CreateFloatingIPPool validates if subnets in the floating-ip-pool object exist in the virtual-network. If subnet info is not specified, there is nothing to validate

func (*ContrailTypeLogicService) CreateForwardingClass

CreateForwardingClass performs type specific validation.

func (*ContrailTypeLogicService) CreateGlobalSystemConfig

CreateGlobalSystemConfig by design should never be called. GlobalSystemConfig can only be created by DBInit, never by user request

func (*ContrailTypeLogicService) CreateInstanceIP

CreateInstanceIP does pre-check for instance-ip

func (*ContrailTypeLogicService) CreateLogicalInterface

CreateLogicalInterface does pre-check for create logical_interface

func (*ContrailTypeLogicService) CreateLogicalRouter

CreateLogicalRouter creates a logical router and if vxlan routing is enabled also creates internal virtual network connected to this logical router

func (*ContrailTypeLogicService) CreateNetworkIpam

func (sv *ContrailTypeLogicService) CreateNetworkIpam(
	ctx context.Context,
	request *services.CreateNetworkIpamRequest,
) (response *services.CreateNetworkIpamResponse, err error)

CreateNetworkIpam do pre check for network ipam

func (*ContrailTypeLogicService) CreateNetworkPolicy

func (sv *ContrailTypeLogicService) CreateNetworkPolicy(
	ctx context.Context,
	request *services.CreateNetworkPolicyRequest,
) (response *services.CreateNetworkPolicyResponse, err error)

CreateNetworkPolicy does pre-check for network policy create.

func (*ContrailTypeLogicService) CreatePhysicalInterface

CreatePhysicalInterface does pre-check for create physical_interface

func (*ContrailTypeLogicService) CreateProject

func (sv *ContrailTypeLogicService) CreateProject(
	ctx context.Context, request *services.CreateProjectRequest,
) (response *services.CreateProjectResponse, err error)

CreateProject creates a project and ensures a default application policy set for it.

func (*ContrailTypeLogicService) CreateQosConfig

func (sv *ContrailTypeLogicService) CreateQosConfig(
	ctx context.Context,
	request *services.CreateQosConfigRequest,
) (response *services.CreateQosConfigResponse, err error)

CreateQosConfig does pre-check for QoS Config create.

func (*ContrailTypeLogicService) CreateRouteTarget

func (sv *ContrailTypeLogicService) CreateRouteTarget(
	ctx context.Context,
	request *services.CreateRouteTargetRequest,
) (response *services.CreateRouteTargetResponse, err error)

CreateRouteTarget validates Route Target name before creation

func (*ContrailTypeLogicService) CreateSecurityGroup

CreateSecurityGroup performs type specific validation and setup for creating security groups.

func (*ContrailTypeLogicService) CreateServiceTemplate

CreateServiceTemplate validates domain UUID and enables domain sharing for service template.

func (*ContrailTypeLogicService) CreateTag

CreateTag validates if there is no TagID in request and allocates new one, finally creates new Tag.

func (*ContrailTypeLogicService) CreateTagType

CreateTagType validates if TagTypeID is not set, allocates one and creates new Tag Type.

func (*ContrailTypeLogicService) CreateVirtualMachineInterface

CreateVirtualMachineInterface validates if there is at least one virtual-network reference and allocates MAC-address.

func (*ContrailTypeLogicService) CreateVirtualNetwork

CreateVirtualNetwork do pre check and post setup for virtual network.

func (*ContrailTypeLogicService) CreateVirtualRouter

CreateVirtualRouter virtual-router create specific logic.

func (*ContrailTypeLogicService) DeleteAliasIP

func (sv *ContrailTypeLogicService) DeleteAliasIP(
	ctx context.Context,
	request *services.DeleteAliasIPRequest,
) (response *services.DeleteAliasIPResponse, err error)

DeleteAliasIP deletes ip from address manager for alias-ip

func (*ContrailTypeLogicService) DeleteFloatingIP

DeleteFloatingIP checks parent type and if it isn't instance-ip then this method tries to deallocate IP using AddressManager

func (*ContrailTypeLogicService) DeleteInstanceIP

DeleteInstanceIP does post-check for instance-ip

func (*ContrailTypeLogicService) DeleteLogicalRouter

DeleteLogicalRouter deletes internal virtual network associated with this logical router if xvlan is enabled

func (*ContrailTypeLogicService) DeleteProject

DeleteProject deletes the project with its default application policy set.

func (*ContrailTypeLogicService) DeleteSecurityGroup

DeleteSecurityGroup performs type specific validation and teardown for deleting security groups.

func (*ContrailTypeLogicService) DeleteTag

DeleteTag deallocate int from tag_id pool and then deletes Tag.

func (*ContrailTypeLogicService) DeleteTagType

DeleteTagType deallocates TagTypeID and deletes Tag Type.

func (*ContrailTypeLogicService) DeleteVirtualMachineInterface

DeleteVirtualMachineInterface validates delete request of virtual machine interface.

func (*ContrailTypeLogicService) DeleteVirtualNetwork

DeleteVirtualNetwork do pre/post check/teardown for delete network.

func (*ContrailTypeLogicService) FQNameToUUID

func (sv *ContrailTypeLogicService) FQNameToUUID(
	ctx context.Context,
	fqName []string,
	resourceType string,
) (string, error)

FQNameToUUID translates fqName to UUID.

func (*ContrailTypeLogicService) UpdateAlarm

func (sv *ContrailTypeLogicService) UpdateAlarm(
	ctx context.Context,
	request *services.UpdateAlarmRequest) (response *services.UpdateAlarmResponse, err error)

UpdateAlarm does pre check for alarm.

func (*ContrailTypeLogicService) UpdateBGPAsAService

func (sv *ContrailTypeLogicService) UpdateBGPAsAService(
	ctx context.Context, request *services.UpdateBGPAsAServiceRequest,
) (response *services.UpdateBGPAsAServiceResponse, err error)

UpdateBGPAsAService updates BGP as a service after validation

func (*ContrailTypeLogicService) UpdateFirewallPolicy

func (sv *ContrailTypeLogicService) UpdateFirewallPolicy(
	ctx context.Context,
	request *services.UpdateFirewallPolicyRequest,
) (response *services.UpdateFirewallPolicyResponse, err error)

UpdateFirewallPolicy performs pre update checks for the firewall policy.

func (*ContrailTypeLogicService) UpdateFirewallRule

UpdateFirewallRule performs type specific validation and setup for updating firewallRule

func (*ContrailTypeLogicService) UpdateForwardingClass

UpdateForwardingClass performs type specific validation.

func (*ContrailTypeLogicService) UpdateGlobalSystemConfig

UpdateGlobalSystemConfig performs type specific checks for update.

func (*ContrailTypeLogicService) UpdateInstanceIP

UpdateInstanceIP does pre-check for instance-ip

func (*ContrailTypeLogicService) UpdateLogicalInterface

UpdateLogicalInterface does pre-check for update logical_interface

func (*ContrailTypeLogicService) UpdateLogicalRouter

UpdateLogicalRouter validates logical-router update request and if vxlan routing is enabled also updates internal virtual network associated with this logical router

func (*ContrailTypeLogicService) UpdateNetworkIpam

func (sv *ContrailTypeLogicService) UpdateNetworkIpam(
	ctx context.Context,
	request *services.UpdateNetworkIpamRequest,
) (response *services.UpdateNetworkIpamResponse, err error)

UpdateNetworkIpam do pre check for network ipam update

func (*ContrailTypeLogicService) UpdateNetworkPolicy

func (sv *ContrailTypeLogicService) UpdateNetworkPolicy(
	ctx context.Context,
	request *services.UpdateNetworkPolicyRequest,
) (response *services.UpdateNetworkPolicyResponse, err error)

UpdateNetworkPolicy does pre-check for network policy update.

func (*ContrailTypeLogicService) UpdatePhysicalInterface

UpdatePhysicalInterface does pre-check for update physical_interface

func (*ContrailTypeLogicService) UpdateProject

func (sv *ContrailTypeLogicService) UpdateProject(
	ctx context.Context, request *services.UpdateProjectRequest,
) (response *services.UpdateProjectResponse, err error)

UpdateProject validates the request and updates the project.

func (*ContrailTypeLogicService) UpdateQosConfig

func (sv *ContrailTypeLogicService) UpdateQosConfig(
	ctx context.Context,
	request *services.UpdateQosConfigRequest,
) (response *services.UpdateQosConfigResponse, err error)

UpdateQosConfig does pre-check for QoS Config update.

func (*ContrailTypeLogicService) UpdateSecurityGroup

UpdateSecurityGroup performs type specific validation and setup for updating security groups.

func (*ContrailTypeLogicService) UpdateTagType

UpdateTagType checks if DisplayName or TagTypeID is provided in request.

func (*ContrailTypeLogicService) UpdateVirtualMachineInterface

UpdateVirtualMachineInterface validates update request of virtual machine interface.

func (*ContrailTypeLogicService) UpdateVirtualNetwork

UpdateVirtualNetwork do pre check for virtual network update.

func (*ContrailTypeLogicService) UpdateVirtualRouter

UpdateVirtualRouter virtual-router update specific logic.

type DraftModeStateChecker

type DraftModeStateChecker interface {
	CheckDraftModeState(context.Context, draftModeStateGetter) error
}

DraftModeStateChecker checks if request contains draftModeState property

type InTransactionDoer

type InTransactionDoer interface {
	DoInTransaction(ctx context.Context, do func(context.Context) error) error
}

InTransactionDoer executes do function atomically.

type IntPoolAllocator

type IntPoolAllocator interface {
	CreateIntPool(context.Context, string, int64, int64) error
	GetIntOwner(context.Context, string, int64) (string, error)
	DeleteIntPool(context.Context, string) error
	AllocateInt(context.Context, string, string) (int64, error)
	SetInt(context.Context, string, int64, string) error
	DeallocateInt(context.Context, string, int64) error
}

IntPoolAllocator (de)allocates integers in an integer pool.

type MetadataGetter

type MetadataGetter interface {
	GetMetadata(ctx context.Context, requested models.Metadata) (*models.Metadata, error)
	ListMetadata(ctx context.Context, requested []*models.Metadata) ([]*models.Metadata, error)
}

MetadataGetter provides getter for metadata.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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