Documentation ¶
Index ¶
- func GetInstanceID(instanceName string) string
- func GetInstanceName(nodeName, instanceID string) string
- func GetOperation(ctx context.Context, kv *api.KV, ...) (prov.Operation, error)
- func GetTargetCapabilityPropertiesAndAttributes(ctx context.Context, kv *api.KV, deploymentID, nodeName string, ...) (map[string]string, error)deprecated
- func GetTargetCapabilityPropertiesAndAttributesValues(ctx context.Context, kv *api.KV, deploymentID, nodeName string, ...) (map[string]*deployments.TOSCAValue, error)
- func IsOrchestratorHostOperation(op prov.Operation) bool
- func IsRelationshipOperation(op prov.Operation) bool
- func IsRelationshipTargetNodeOperation(op prov.Operation) bool
- func SetOperationLogFields(ctx context.Context, op prov.Operation) context.Context
- type EnvInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetInstanceID ¶
GetInstanceID returns the instance ID from an instance name
func GetInstanceName ¶
GetInstanceName returns the built instance name from nodeName and instanceID
func GetOperation ¶
func GetOperation(ctx context.Context, kv *api.KV, deploymentID, nodeName, operationName, requirementName, operationHost string) (prov.Operation, error)
GetOperation returns a Prov.Operation structure describing precisely operation in order to execute it
func GetTargetCapabilityPropertiesAndAttributes
deprecated
func GetTargetCapabilityPropertiesAndAttributes(ctx context.Context, kv *api.KV, deploymentID, nodeName string, op prov.Operation) (map[string]string, error)
GetTargetCapabilityPropertiesAndAttributes 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
Deprecated: use GetTargetCapabilityPropertiesAndAttributesValues instead
will be removed in Yorc 4.0 This function is unsafe as it loose the context of the value to know if it is a secret or not.
func GetTargetCapabilityPropertiesAndAttributesValues ¶
func GetTargetCapabilityPropertiesAndAttributesValues(ctx context.Context, kv *api.KV, 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 ¶
IsOrchestratorHostOperation checks if the operation should be executed on orchestrator host
func IsRelationshipOperation ¶
IsRelationshipOperation checks if an operation is part of a relationship
func IsRelationshipTargetNodeOperation ¶
IsRelationshipTargetNodeOperation checks if an operation is part of a relationship and should be executed on the target node
Types ¶
type EnvInput ¶
An EnvInput represent a TOSCA operation input
func ResolveInputs ¶
func ResolveInputs(kv *api.KV, deploymentID, nodeName, taskID string, operation prov.Operation) ([]*EnvInput, []string, error)
ResolveInputs allows to resolve inputs for an operation