operations

package
v4.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2021 License: Apache-2.0 Imports: 14 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetInstanceID

func GetInstanceID(instanceName string) string

GetInstanceID returns the instance ID from an instance name

func GetInstanceName

func GetInstanceName(nodeName, instanceID string) string

GetInstanceName returns the built instance name from nodeName and instanceID

func GetOperation

func GetOperation(ctx context.Context, deploymentID, nodeName, operationName, requirementName, operationHost string,
	inputs map[string]tosca.ParameterDefinition) (prov.Operation, error)

GetOperation returns a Prov.Operation structure describing precisely operation in order to execute it

func GetOverlayPath

func GetOverlayPath(cfg config.Configuration, taskID, deploymentID string) (string, error)

GetOverlayPath returns the overlay path In case of taskTypeRemoveNodes, it refers the backup overlay

func GetTargetCapabilityPropertiesAndAttributesValues

func GetTargetCapabilityPropertiesAndAttributesValues(ctx context.Context, deploymentID, nodeName string, op prov.Operation) (map[string]*deployments.TOSCAValue, error)

GetTargetCapabilityPropertiesAndAttributesValues retrieves properties and attributes of the target capability of the relationship (if this operation is related to a relationship)

It may happen in rare cases that several capabilities match the same requirement. Values are stored in this way:

  • TARGET_CAPABILITY_NAMES: comma-separated list of matching capabilities names. It could be use to loop over the injected variables
  • TARGET_CAPABILITY_<capabilityName>_TYPE: actual type of the capability
  • TARGET_CAPABILITY_TYPE: actual type of the capability of the first matching capability
  • TARGET_CAPABILITY_<capabilityName>_PROPERTY_<propertyName>: value of a property
  • TARGET_CAPABILITY_PROPERTY_<propertyName>: value of a property for the first matching capability
  • TARGET_CAPABILITY_<capabilityName>_<instanceName>_ATTRIBUTE_<attributeName>: value of an attribute of a given instance
  • TARGET_CAPABILITY_<instanceName>_ATTRIBUTE_<attributeName>: value of an attribute of a given instance for the first matching capability

func IsOrchestratorHostOperation

func IsOrchestratorHostOperation(op prov.Operation) bool

IsOrchestratorHostOperation checks if the operation should be executed on orchestrator host

func IsRelationshipOperation

func IsRelationshipOperation(op prov.Operation) bool

IsRelationshipOperation checks if an operation is part of a relationship

func IsRelationshipTargetNodeOperation

func IsRelationshipTargetNodeOperation(op prov.Operation) bool

IsRelationshipTargetNodeOperation checks if an operation is part of a relationship and should be executed on the target node

func SetOperationLogFields

func SetOperationLogFields(ctx context.Context, op prov.Operation) context.Context

SetOperationLogFields set logs optionals fields related to the given action

Types

type EnvInput

type EnvInput struct {
	Name         string
	Value        string
	InstanceName string
	IsSecret     bool
}

An EnvInput represent a TOSCA operation input

func ResolveInputs

func ResolveInputs(ctx context.Context, deploymentID, nodeName, taskID string, operation prov.Operation) ([]*EnvInput, []string, error)

ResolveInputs allows to resolve inputs for an operation

func ResolveInputsWithInstances

func ResolveInputsWithInstances(ctx context.Context, deploymentID, nodeName, taskID string, operation prov.Operation, sourceNodeInstances, targetNodeInstances []string) ([]*EnvInput, []string, error)

ResolveInputsWithInstances used to resolve inputs for an operation

func (EnvInput) String

func (ei EnvInput) String() string

Jump to

Keyboard shortcuts

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