Documentation ¶
Index ¶
- Constants
- Variables
- func AddBlockingOperationOnDeploymentFlag(ctx context.Context, deploymentID string) error
- func CleanupPurgedDeployments(ctx context.Context, cc *api.Client, evictionTimeout time.Duration, ...) error
- func CreateNewNodeStackInstances(ctx context.Context, deploymentID, nodeName string, instances int) (map[string]string, error)
- func DeleteAllInstances(ctx context.Context, deploymentID, nodeName string) error
- func DeleteDeployment(ctx context.Context, deploymentID string) error
- func DeleteInstance(ctx context.Context, deploymentID, nodeName, instanceName string) error
- func DeleteNode(ctx context.Context, deploymentID, nodeName string) error
- func DeleteRelationshipInstance(ctx context.Context, deploymentID, nodeName, instanceName string) error
- func DeleteWorkflow(ctx context.Context, deploymentID, workflowName string) error
- func DoesDeploymentExists(ctx context.Context, deploymentID string) (bool, error)
- func DoesNodeExist(ctx context.Context, deploymentID, nodeName string) (bool, error)
- func GetArtifactTypeExtensions(ctx context.Context, deploymentID, artifactTypeName string) ([]string, error)
- func GetBooleanNodeProperty(ctx context.Context, deploymentID, nodeName, propertyName string) (bool, error)
- func GetCapabilitiesOfType(ctx context.Context, deploymentID, typeName, capabilityTypeName string) ([]string, error)
- func GetCapabilityForRequirement(ctx context.Context, deploymentID, nodeName, requirementIndex string) (string, error)
- func GetCapabilityPropertyType(ctx context.Context, ...) (bool, string, error)
- func GetDefaultNbInstancesForNode(ctx context.Context, deploymentID, nodeName string) (uint32, error)
- func GetDeploymentTaskList(ctx context.Context, deploymentID string) ([]string, error)
- func GetDeploymentsIDs(ctx context.Context) ([]string, error)
- func GetFileArtifactsForNode(ctx context.Context, deploymentID, nodeName string) (map[string]string, error)
- func GetFileArtifactsForType(ctx context.Context, deploymentID, typeName string) (map[string]string, error)
- func GetHostedOnNode(ctx context.Context, deploymentID, nodeName string) (string, error)
- func GetHostedOnNodeInstance(ctx context.Context, deploymentID, nodeName, instanceName string) (string, string, error)
- func GetImplementationArtifactForExtension(ctx context.Context, deploymentID, extension string) (string, error)
- func GetImplementationArtifactForOperation(ctx context.Context, deploymentID, nodeName, operationName string, ...) (string, error)
- func GetInputValue(ctx context.Context, inputs map[string]tosca.ParameterDefinition, ...) (string, error)
- func GetInstanceState(ctx context.Context, deploymentID, nodeName, instanceName string) (tosca.NodeState, error)
- func GetInstanceStateString(ctx context.Context, deploymentID, nodeName, instanceName string) (string, error)
- func GetKeyValuePairsNodeProperty(ctx context.Context, deploymentID, nodeName, propertyName string) (map[string]string, error)
- func GetMaxNbInstancesForNode(ctx context.Context, deploymentID, nodeName string) (uint32, error)
- func GetMinNbInstancesForNode(ctx context.Context, deploymentID, nodeName string) (uint32, error)
- func GetNbInstancesForNode(ctx context.Context, deploymentID, nodeName string) (uint32, error)
- func GetNbRequirementsForNode(ctx context.Context, deploymentID, nodeName string) (int, error)
- func GetNestedDataType(ctx context.Context, deploymentID, baseType string, nestedKeys ...string) (string, error)
- func GetNodeAttributesNames(ctx context.Context, deploymentID, nodeName string) ([]string, error)
- func GetNodeAttributesValues(ctx context.Context, deploymentID, nodeName, attributeName string, ...) (map[string]*TOSCAValue, error)
- func GetNodeCapabilityAttributeNames(ctx context.Context, deploymentID, nodeName, capabilityName string, ...) ([]string, error)
- func GetNodeCapabilityType(ctx context.Context, deploymentID, nodeName, capabilityName string) (string, error)
- func GetNodeInstancesIds(ctx context.Context, deploymentID, nodeName string) ([]string, error)
- func GetNodeMetadata(ctx context.Context, deploymentID, nodeName, key string) (bool, string, error)
- func GetNodeType(ctx context.Context, deploymentID, nodeName string) (string, error)
- func GetNodeTypeCapabilityPropertyValueAssignment(ctx context.Context, ...) (*tosca.ValueAssignment, error)
- func GetNodeTypeCapabilityType(ctx context.Context, deploymentID, nodeType, capabilityName string) (string, error)
- func GetNodeTypeImplementingAnOperation(ctx context.Context, deploymentID, nodeName, operationName string) (string, error)
- func GetNodes(ctx context.Context, deploymentID string) ([]string, error)
- func GetNodesHostedOn(ctx context.Context, deploymentID, hostNode string) ([]string, error)
- func GetOperationHostFromTypeOperation(ctx context.Context, ...) (string, error)
- func GetOperationHostFromTypeOperationByName(ctx context.Context, deploymentID, typeName, operationName string) (string, error)
- func GetOperationImplementation(ctx context.Context, ...) (*tosca.Implementation, error)
- func GetOperationImplementationFile(ctx context.Context, ...) (string, error)
- func GetOperationImplementationFileWithRelativePath(ctx context.Context, ...) (string, error)
- func GetOperationImplementationRepository(ctx context.Context, ...) (string, error)
- func GetOperationImplementationType(ctx context.Context, ...) (string, error)
- func GetOperationInputs(ctx context.Context, ...) ([]string, error)
- func GetOperationOutputForNode(ctx context.Context, ...) (string, error)
- func GetOperationOutputForRelationship(ctx context.Context, ...) (string, error)
- func GetOperationOutputs(ctx context.Context, ...) (map[string]tosca.Output, error)
- func GetParentType(ctx context.Context, deploymentID, typeName string) (string, error)
- func GetPoliciesForType(ctx context.Context, deploymentID, policyTypeName string) ([]string, error)
- func GetPoliciesForTypeAndNode(ctx context.Context, deploymentID, policyTypeName, nodeName string) ([]string, error)
- func GetPolicyTargets(ctx context.Context, deploymentID, policyName string) ([]string, error)
- func GetPolicyTargetsForType(ctx context.Context, deploymentID, policyTypeName string) ([]string, error)
- func GetPolicyType(ctx context.Context, deploymentID, policyName string) (string, error)
- func GetRelationshipForRequirement(ctx context.Context, deploymentID, nodeName, requirementIndex string) (string, error)
- func GetRelationshipTypeImplementingAnOperation(ctx context.Context, ...) (string, error)
- func GetRepositoryTokenTypeFromName(ctx context.Context, deploymentID, repoName string) (string, error)
- func GetRepositoryTokenUserFromName(ctx context.Context, deploymentID, repoName string) (string, string, error)
- func GetRepositoryURLFromName(ctx context.Context, deploymentID, repoName string) (string, error)
- func GetRequirementIndexByNameForNode(ctx context.Context, deploymentID, nodeName, requirementName string) (string, error)
- func GetRequirementNameByIndexForNode(ctx context.Context, deploymentID, nodeName, requirementIndex string) (string, error)
- func GetRequirementsIndexes(ctx context.Context, deploymentID, nodeName string) ([]string, error)
- func GetStringArrayNodeProperty(ctx context.Context, deploymentID, nodeName, propertyName string) ([]string, error)
- func GetStringNodeProperty(ctx context.Context, deploymentID, nodeName, propertyName string, ...) (string, error)
- func GetStringNodePropertyValue(ctx context.Context, deploymentID, nodeName, propertyName string, ...) (string, error)
- func GetTargetInstanceForRequirement(ctx context.Context, ...) (string, []string, error)
- func GetTargetNodeForRequirement(ctx context.Context, deploymentID, nodeName, requirementIndex string) (string, error)
- func GetTargetNodeForRequirementByName(ctx context.Context, deploymentID, nodeName, requirementName string) (string, error)
- func GetTopologyInputParameter(ctx context.Context, deploymentID, parameterName string) (bool, *tosca.ParameterDefinition, error)
- func GetTopologyInputType(ctx context.Context, deploymentID, inputName string) (string, error)
- func GetTopologyInputsNames(ctx context.Context, deploymentID string) ([]string, error)
- func GetTopologyOutputType(ctx context.Context, deploymentID, outputName string) (string, error)
- func GetTopologyOutputsNames(ctx context.Context, deploymentID string) ([]string, error)
- func GetTypeAttributeDataType(ctx context.Context, deploymentID, typeName, propertyName string) (string, error)
- func GetTypeAttributes(ctx context.Context, deploymentID, typeName string, exploreParents bool) ([]string, error)
- func GetTypeAttributesNames(ctx context.Context, deploymentID, typeName string) ([]string, error)
- func GetTypeImplementingAnOperation(ctx context.Context, deploymentID, typeName, operationName string) (string, error)
- func GetTypeImportPath(ctx context.Context, deploymentID, typeName string) (string, error)
- func GetTypeProperties(ctx context.Context, deploymentID, typeName string, exploreParents bool) ([]string, error)
- func GetTypePropertyDataType(ctx context.Context, deploymentID, typeName, propertyName string) (string, error)
- func GetTypesNames(ctx context.Context, deploymentID string) ([]string, error)
- func GetWorkflow(ctx context.Context, deploymentID, workflowName string) (*tosca.Workflow, error)
- func GetWorkflows(ctx context.Context, deploymentID string) ([]string, error)
- func HasAnyRequirementCapability(ctx context.Context, ...) (bool, string, error)
- func HasAnyRequirementFromNodeType(ctx context.Context, deploymentID, nodeName, requirement, nodeType string) (bool, string, error)
- func HasBlockingOperationOnDeploymentFlag(ctx context.Context, deploymentID string) (bool, error)
- func HasScalableCapability(ctx context.Context, deploymentID, nodeName string) (bool, error)
- func IsDeploymentNotFoundError(err error) bool
- func IsHostedOn(ctx context.Context, deploymentID, nodeName, hostedOn string) (bool, error)
- func IsInconsistentDeploymentError(err error) bool
- func IsInputNotFound(err error) bool
- func IsNodeDerivedFrom(ctx context.Context, deploymentID, nodeName, derives string) (bool, error)
- func IsNodeNotFoundError(err error) bool
- func IsNodeTemplateImplementingOperation(ctx context.Context, deploymentID, nodeName, operationName string) (bool, error)
- func IsOperationImplemented(ctx context.Context, deploymentID, nodeName, operationName string) (bool, error)
- func IsOperationInputAPropertyDefinition(ctx context.Context, ...) (bool, error)
- func IsOperationNotImplemented(err error) bool
- func IsTargetForPolicy(ctx context.Context, deploymentID, policyName, nodeName string, recursive bool) (bool, error)
- func IsTypeDerivedFrom(ctx context.Context, deploymentID, nodeType, derives string) (bool, error)
- func IsTypeMissingError(err error) bool
- func IsTypePropertyRequired(ctx context.Context, deploymentID, typeName, propertyName string) (bool, error)
- func LookupInstanceAttributeValue(ctx context.Context, deploymentID, nodeName, instanceName, attribute string, ...) (string, error)
- func LookupInstanceCapabilityAttributeValue(ctx context.Context, ...) (string, error)
- func NewInconsistentDeploymentError(deploymentID string) error
- func NodeHasAttribute(ctx context.Context, deploymentID, nodeName, attributeName string, ...) (bool, error)
- func NodeHasProperty(ctx context.Context, deploymentID, nodeName, propertyName string, ...) (bool, error)
- func PostDeploymentDefinitionStorageProcess(ctx context.Context, deploymentID string, nodes []string) error
- func RemoveBlockingOperationOnDeploymentFlag(ctx context.Context, deploymentID string) error
- func ResolveAttributeMapping(ctx context.Context, ...) error
- func ResolveWorkflowOutputs(ctx context.Context, deploymentID, workflowName string) (map[string]*TOSCAValue, error)
- func SelectNodeStackInstances(ctx context.Context, deploymentID, nodeName string, instancesDelta int) (map[string]string, error)
- func SetAttributeComplexForAllInstances(ctx context.Context, deploymentID, nodeName, attributeName string, ...) error
- func SetAttributeForAllInstances(ctx context.Context, ...) error
- func SetCapabilityAttributeComplexForAllInstances(ctx context.Context, ...) error
- func SetCapabilityAttributeForAllInstances(ctx context.Context, ...) error
- func SetDeploymentStatus(ctx context.Context, deploymentID string, status DeploymentStatus) error
- func SetInstanceAttribute(ctx context.Context, ...) error
- func SetInstanceAttributeComplex(ctx context.Context, ...) error
- func SetInstanceCapabilityAttribute(ctx context.Context, ...) error
- func SetInstanceCapabilityAttributeComplex(ctx context.Context, ...) error
- func SetInstanceListAttributes(ctx context.Context, attributes []*AttributeData) error
- func SetInstanceListAttributesComplex(ctx context.Context, attributes []*AttributeData) error
- func SetInstanceRelationshipAttribute(ctx context.Context, ...) error
- func SetInstanceRelationshipAttributeComplex(ctx context.Context, ...) error
- func SetInstanceStateStringWithContextualLogs(ctx context.Context, deploymentID, nodeName, instanceName, state string) error
- func SetInstanceStateWithContextualLogs(ctx context.Context, deploymentID, nodeName, instanceName string, ...) error
- func SetRelationshipAttributeComplexForAllInstances(ctx context.Context, ...) error
- func SetRelationshipAttributeForAllInstances(ctx context.Context, ...) error
- func StoreDeploymentDefinition(ctx context.Context, deploymentID string, defPath string) error
- func TagDeploymentAsPurged(ctx context.Context, cc *api.Client, deploymentID string) error
- func TypeHasAttribute(ctx context.Context, deploymentID, typeName, attributeName string, ...) (bool, error)
- func TypeHasCapability(ctx context.Context, deploymentID, typeName, capabilityTypeName string) (bool, error)
- func TypeHasProperty(ctx context.Context, deploymentID, typeName, propertyName string, ...) (bool, error)
- type AttributeData
- type AttributeNotifier
- type DeploymentStatus
- type Notifier
- type OperationInputResult
- func GetOperationInput(ctx context.Context, deploymentID, nodeName string, operation prov.Operation, ...) ([]OperationInputResult, error)
- func GetOperationInputPropertyDefinitionDefault(ctx context.Context, deploymentID, nodeName string, operation prov.Operation, ...) ([]OperationInputResult, error)
- type OperationOutputNotifier
- type Requirement
- type TOSCAValue
- func GetCapabilityPropertyValue(ctx context.Context, ...) (*TOSCAValue, error)
- func GetInstanceAttributeValue(ctx context.Context, ...) (*TOSCAValue, error)
- func GetInstanceCapabilityAttributeValue(ctx context.Context, ...) (*TOSCAValue, error)
- func GetNodePropertyValue(ctx context.Context, deploymentID, nodeName, propertyName string, ...) (*TOSCAValue, error)
- func GetPolicyPropertyValue(ctx context.Context, deploymentID, policyName, propertyName string, ...) (*TOSCAValue, error)
- func GetRelationshipAttributeValueFromRequirement(ctx context.Context, ...) (*TOSCAValue, error)
- func GetRelationshipPropertyValueFromRequirement(ctx context.Context, ...) (*TOSCAValue, error)
- func GetTopologyOutputValue(ctx context.Context, deploymentID, outputName string, nestedKeys ...string) (*TOSCAValue, error)
Constants ¶
const DefaultInstanceName = "0"
DefaultInstanceName is the default instance name for non scalable or single instance nodes.
const DockerHubURL = "https://hub.docker.com/"
DockerHubURL is the official URL for the docker hub
const SingularityHubURL = "https://singularity-hub.org/"
SingularityHubURL is the official URL for the docker hub
Variables ¶
var DefaultVaultClient vault.Client
DefaultVaultClient is the default Vault Client used to resolve get_secret functions it is nil by default and should be set by the one who created the client
Functions ¶
func AddBlockingOperationOnDeploymentFlag ¶
AddBlockingOperationOnDeploymentFlag set a flag on a given deployment to specify that an operation is ongoing and no other tasks should be run on this deployment
func CleanupPurgedDeployments ¶
func CleanupPurgedDeployments(ctx context.Context, cc *api.Client, evictionTimeout time.Duration, extraDeployments ...string) error
CleanupPurgedDeployments definitively removes purged deployments
Deployment are cleaned-up if they have been purged for at least evictionTimeout or if the are in the extraDeployments list
func CreateNewNodeStackInstances ¶
func CreateNewNodeStackInstances(ctx context.Context, deploymentID, nodeName string, instances int) (map[string]string, error)
CreateNewNodeStackInstances create the given number of new instances of the given node and all other nodes hosted on this one and all linked nodes
CreateNewNodeStackInstances returns a map of newly created instances IDs indexed by node name
func DeleteAllInstances ¶
DeleteAllInstances deletes all instances of the given node from the Consul store
func DeleteDeployment ¶
DeleteDeployment deletes a given deploymentID from the deployments path
func DeleteInstance ¶
DeleteInstance deletes the given instance of the given node from the Consul store
func DeleteNode ¶
DeleteNode deletes the given node from the Consul store
func DeleteRelationshipInstance ¶
func DeleteRelationshipInstance(ctx context.Context, deploymentID, nodeName, instanceName string) error
DeleteRelationshipInstance deletes the instance from relationship instances stored in consul
func DeleteWorkflow ¶
DeleteWorkflow deletes the given workflow from the Consul store
func DoesDeploymentExists ¶
DoesDeploymentExists checks if a given deploymentId refer to an existing deployment
func DoesNodeExist ¶
DoesNodeExist checks if a given node exist in a deployment
func GetArtifactTypeExtensions ¶
func GetArtifactTypeExtensions(ctx context.Context, deploymentID, artifactTypeName string) ([]string, error)
GetArtifactTypeExtensions returns the extensions defined in this artifact type. If the artifact doesn't define any extension then a nil slice is returned
func GetBooleanNodeProperty ¶
func GetBooleanNodeProperty(ctx context.Context, deploymentID, nodeName, propertyName string) (bool, error)
GetBooleanNodeProperty returns the boolean value of a property (default: false)
func GetCapabilitiesOfType ¶
func GetCapabilitiesOfType(ctx context.Context, deploymentID, typeName, capabilityTypeName string) ([]string, error)
GetCapabilitiesOfType returns names of all capabilities for a given node type hierarchy that derives from a given capability type
func GetCapabilityForRequirement ¶
func GetCapabilityForRequirement(ctx context.Context, deploymentID, nodeName, requirementIndex string) (string, error)
GetCapabilityForRequirement returns the capability associated with a given requirementIndex for the given nodeName.
If there is no capability defined for this requirement then an empty string is returned.
func GetCapabilityPropertyType ¶
func GetCapabilityPropertyType(ctx context.Context, deploymentID, nodeName, capabilityName, propertyName string) (bool, string, error)
GetCapabilityPropertyType retrieves the type for a given property in a given node capability It returns false if there is no such property
func GetDefaultNbInstancesForNode ¶
func GetDefaultNbInstancesForNode(ctx context.Context, deploymentID, nodeName string) (uint32, error)
GetDefaultNbInstancesForNode retrieves the default number of instances for a given node nodeName in deployment deploymentId.
If the node has a capability that is or is derived from 'tosca.capabilities.Scalable' it will look for a property 'default_instances' in this capability of this node. Otherwise it will search for any relationship derived from 'tosca.relationships.HostedOn' in node requirements and reiterate the process. If a scalable node is finally found it returns the instances number. If there is no node with the Scalable capability at the end of the hosted on chain then assume that there is only one instance
func GetDeploymentTaskList ¶ added in v4.0.3
GetDeploymentTaskList returns the list of tasks ids associated with the given deployment
func GetDeploymentsIDs ¶ added in v4.0.3
GetDeploymentsIDs returns the list of deployments IDs
func GetFileArtifactsForNode ¶
func GetFileArtifactsForNode(ctx context.Context, deploymentID, nodeName string) (map[string]string, error)
GetFileArtifactsForNode returns a map of artifact name / artifact file for the given node.
The returned artifacts paths are relative to root of the deployment archive. It will first fetch artifacts from it node type and its parents and fetch artifacts for the node template itself. This way artifacts from a parent type may be overridden by child types and artifacts from node type may be overridden by the node template
func GetFileArtifactsForType ¶
func GetFileArtifactsForType(ctx context.Context, deploymentID, typeName string) (map[string]string, error)
GetFileArtifactsForType returns a map of artifact name / artifact file for the given type of type tType
The returned artifacts paths are relative to root of the deployment archive. It traverse the 'derived_from' relations to support inheritance of artifacts. Parent artifacts are fetched first and may be overridden by child types
func GetHostedOnNode ¶
GetHostedOnNode returns the node name of the node defined in the first found relationship derived from "tosca.relationships.HostedOn"
If there is no HostedOn relationship for this node then it returns an empty string
func GetHostedOnNodeInstance ¶
func GetHostedOnNodeInstance(ctx context.Context, deploymentID, nodeName, instanceName string) (string, string, error)
GetHostedOnNodeInstance returns the node name and instance name of the instance defined in the first found relationship derived from "tosca.relationships.HostedOn"
If there is no HostedOn relationship for this node then it returns an empty string
func GetImplementationArtifactForExtension ¶
func GetImplementationArtifactForExtension(ctx context.Context, deploymentID, extension string) (string, error)
GetImplementationArtifactForExtension returns the implementation artifact type for a given extension.
If the extension is unknown then an empty string is returned
func GetImplementationArtifactForOperation ¶
func GetImplementationArtifactForOperation(ctx context.Context, deploymentID, nodeName, operationName string, isNodeTemplateOperation, isRelationshipOp bool, requirementIndex string) (string, error)
GetImplementationArtifactForOperation returns the implementation artifact type for a given operation. operationName, isRelationshipOp and requirementIndex are typically the result of the DecodeOperation function that should generally call prior to call this function.
func GetInputValue ¶
func GetInputValue(ctx context.Context, inputs map[string]tosca.ParameterDefinition, deploymentID, inputName string, nestedKeys ...string) (string, error)
GetInputValue tries to retrieve the value of the given input name.
GetInputValue first checks if a non-empty field value exists for this input, if it doesn't then it checks for a non-empty field default. If none of them exists then it returns an empty string.
func GetInstanceState ¶
func GetInstanceState(ctx context.Context, deploymentID, nodeName, instanceName string) (tosca.NodeState, error)
GetInstanceState retrieves the state of a given node instance
func GetInstanceStateString ¶
func GetInstanceStateString(ctx context.Context, deploymentID, nodeName, instanceName string) (string, error)
GetInstanceStateString retrieves the string value of the state attribute of a given node instance
func GetKeyValuePairsNodeProperty ¶
func GetKeyValuePairsNodeProperty(ctx context.Context, deploymentID, nodeName, propertyName string) (map[string]string, error)
GetKeyValuePairsNodeProperty returns a key/value string map value of a node property (default: false)
func GetMaxNbInstancesForNode ¶
GetMaxNbInstancesForNode retrieves the maximum number of instances for a given node nodeName in deployment deploymentId.
If the node has a capability that is or is derived from 'tosca.capabilities.Scalable' it will look for a property 'max_instances' in this capability of this node. Otherwise it will search for any relationship derived from 'tosca.relationships.HostedOn' in node requirements and reiterate the process. If a scalable node is finally found it returns the instances number. If there is no node with the Scalable capability at the end of the hosted on chain then assume that there is only one instance$
func GetMinNbInstancesForNode ¶
GetMinNbInstancesForNode retrieves the minimum number of instances for a given node nodeName in deployment deploymentId.
If the node has a capability that is or is derived from 'tosca.capabilities.Scalable' it will look for a property 'min_instances' in this capability of this node. Otherwise it will search for any relationship derived from 'tosca.relationships.HostedOn' in node requirements and reiterate the process. If a scalable node is finally found it returns the instances number.œ If there is no node with the Scalable capability at the end of the hosted on chain then assume that there is only one instance
func GetNbInstancesForNode ¶
GetNbInstancesForNode retrieves the number of instances for a given node nodeName in deployment deploymentID.
func GetNbRequirementsForNode ¶
GetNbRequirementsForNode returns the number of requirements declared for the given node
func GetNestedDataType ¶
func GetNestedDataType(ctx context.Context, deploymentID, baseType string, nestedKeys ...string) (string, error)
GetNestedDataType return the type of a nested datatype
func GetNodeAttributesNames ¶
GetNodeAttributesNames retrieves the list of existing attributes for a given node.
func GetNodeAttributesValues ¶
func GetNodeAttributesValues(ctx context.Context, deploymentID, nodeName, attributeName string, nestedKeys ...string) (map[string]*TOSCAValue, error)
GetNodeAttributesValues retrieves the values for a given attribute in a given node.
As a node may have multiple instances and attributes may be instance-scoped, then returned result is a map with the instance name as key and the retrieved attributes as values.
If the property is not found in the node then the type hierarchy is explored to find a default value. If the property is still not found then it will explore the HostedOn hierarchy.
func GetNodeCapabilityAttributeNames ¶
func GetNodeCapabilityAttributeNames(ctx context.Context, deploymentID, nodeName, capabilityName string, exploreParents bool) ([]string, error)
GetNodeCapabilityAttributeNames retrieves the names for all capability attributes of a capability on a given node name
func GetNodeCapabilityType ¶
func GetNodeCapabilityType(ctx context.Context, deploymentID, nodeName, capabilityName string) (string, error)
GetNodeCapabilityType retrieves the type of a node template capability identified by its name
This is a shorthand for GetNodeTypeCapabilityType
func GetNodeInstancesIds ¶
GetNodeInstancesIds returns the names of the different instances for a given node.
It may be an empty array if the given node is not HostedOn a scalable node.
func GetNodeMetadata ¶
GetNodeMetadata retrieves the related node metadata key if exists
func GetNodeType ¶
GetNodeType returns the type of a given node identified by its name
func GetNodeTypeCapabilityPropertyValueAssignment ¶
func GetNodeTypeCapabilityPropertyValueAssignment(ctx context.Context, deploymentID, nodeType, capabilityName, propertyName string) (*tosca.ValueAssignment, error)
GetNodeTypeCapabilityPropertyValueAssignment returns a Tosca value assignment related to the capability property default value for the defined node type. Its descends hierarchy and returns nil if no default value is found
func GetNodeTypeCapabilityType ¶
func GetNodeTypeCapabilityType(ctx context.Context, deploymentID, nodeType, capabilityName string) (string, error)
GetNodeTypeCapabilityType retrieves the type of a node type capability identified by its name
It explores the type hierarchy (derived_from) to found the given capability. It may return an empty string if the capability is not found in the type hierarchy
func GetNodeTypeImplementingAnOperation ¶
func GetNodeTypeImplementingAnOperation(ctx context.Context, deploymentID, nodeName, operationName string) (string, error)
GetNodeTypeImplementingAnOperation returns the first (bottom-up) type in the type hierarchy of a given node that implements a given operation
This is a shortcut for retrieving the node type and calling the GetTypeImplementingAnOperation() function
func GetNodesHostedOn ¶
GetNodesHostedOn returns the list of nodes that are hosted on a given node
func GetOperationHostFromTypeOperation ¶
func GetOperationHostFromTypeOperation(ctx context.Context, deploymentID, typeName, interfaceName, operationName string) (string, error)
GetOperationHostFromTypeOperation return the operation_host declared for this operation if any.
The returned value may be an empty string. This function doesn't explore the type heirarchy to find the operation or declared value for operation_host.
func GetOperationHostFromTypeOperationByName ¶
func GetOperationHostFromTypeOperationByName(ctx context.Context, deploymentID, typeName, operationName string) (string, error)
GetOperationHostFromTypeOperationByName return the operation_host declared for this operation if any.
The given operation name should be in format <interface_name>.<operation_name> The returned value may be an empty string. This function doesn't explore the type hierarchy to find the operation or declared value for operation_host.
func GetOperationImplementation ¶
func GetOperationImplementation(ctx context.Context, deploymentID, nodeTemplateImpl, nodeTypeImpl, operationName string) (*tosca.Implementation, error)
GetOperationImplementation traverses the type hierarchy to find an operation matching the given operationName.
First, it checks the node template if operation implementation is present Next it gets down to types hierarchy Once found it returns the path to the operation and the value of its primary implementation. If the operation is not found in the node template or in the type hierarchy then empty strings are returned. For coherence with Tosca specification, if primary is not set, we set it with implementation file
func GetOperationImplementationFile ¶
func GetOperationImplementationFile(ctx context.Context, deploymentID, nodeTemplateImpl, nodeTypeImpl, operationName string) (string, error)
GetOperationImplementationFile allows you when the implementation of an operation is an artifact to retrieve the file of this artifact
The returned file is the raw value. To have a file with a path relative to the root of the deployment use GetOperationImplementationFileWithRelativePath()
func GetOperationImplementationFileWithRelativePath ¶
func GetOperationImplementationFileWithRelativePath(ctx context.Context, deploymentID, nodeTemplateImpl, nodeTypeImpl, operationName string) (string, error)
GetOperationImplementationFileWithRelativePath allows you when the implementation of an operation is an artifact to retrieve the file of this artifact
The returned file is relative to the root of the deployment. To have the raw value use GetOperationImplementationFile()
func GetOperationImplementationRepository ¶
func GetOperationImplementationRepository(ctx context.Context, deploymentID, nodeTemplateImpl, nodeTypeImpl, operationName string) (string, error)
GetOperationImplementationRepository allows you when the implementation of an operation is an artifact to retrieve the repository of this artifact
func GetOperationImplementationType ¶
func GetOperationImplementationType(ctx context.Context, deploymentID, nodeTemplateImpl, nodeTypeImpl, operationName string) (string, error)
GetOperationImplementationType allows you when the implementation of an operation is an artifact to retrieve the type of this artifact
func GetOperationInputs ¶
func GetOperationInputs(ctx context.Context, deploymentID, nodeTemplateImpl, typeNameImpl, operationName string) ([]string, error)
GetOperationInputs returns the list of inputs names for a given operation
func GetOperationOutputForNode ¶
func GetOperationOutputForNode(ctx context.Context, deploymentID, nodeName, instanceName, interfaceName, operationName, outputName string) (string, error)
GetOperationOutputForNode return a map with in index the instance number and in value the result of the output The "params" parameter is necessary to pass the path of the output
func GetOperationOutputForRelationship ¶
func GetOperationOutputForRelationship(ctx context.Context, deploymentID, nodeName, instanceName, requirementIndex, interfaceName, operationName, outputName string) (string, error)
GetOperationOutputForRelationship retrieves an operation output for a relationship The returned value may be empty if the operation output could not be retrieved
func GetOperationOutputs ¶
func GetOperationOutputs(ctx context.Context, deploymentID, nodeTemplateImpl, typeNameImpl, operationName string) (map[string]tosca.Output, error)
GetOperationOutputs returns the list of outputs value assignments for a given operation
func GetParentType ¶
GetParentType returns the direct parent type of a given type using the 'derived_from' attributes
An empty string denotes a root type
func GetPoliciesForType ¶
GetPoliciesForType retrieves all policies with or derived from policyTypeName
func GetPoliciesForTypeAndNode ¶
func GetPoliciesForTypeAndNode(ctx context.Context, deploymentID, policyTypeName, nodeName string) ([]string, error)
GetPoliciesForTypeAndNode retrieves all policies with or derived from policyTypeName and with nodeName as target
func GetPolicyTargets ¶
GetPolicyTargets retrieves the policy template targets these targets are node names
func GetPolicyTargetsForType ¶
func GetPolicyTargetsForType(ctx context.Context, deploymentID, policyTypeName string) ([]string, error)
GetPolicyTargetsForType retrieves the policy type targets this targets are node types
func GetPolicyType ¶
GetPolicyType returns the type of the policy
func GetRelationshipForRequirement ¶
func GetRelationshipForRequirement(ctx context.Context, deploymentID, nodeName, requirementIndex string) (string, error)
GetRelationshipForRequirement returns the relationship associated with a given requirementIndex for the given nodeName.
If there is no relationship defined for this requirement then an empty string is returned.
func GetRelationshipTypeImplementingAnOperation ¶
func GetRelationshipTypeImplementingAnOperation(ctx context.Context, deploymentID, nodeName, operationName, requirementIndex string) (string, error)
GetRelationshipTypeImplementingAnOperation returns the first (bottom-up) type in the type hierarchy of a given relationship that implements a given operation
An error is returned if the operation is not found in the type hierarchy
func GetRepositoryTokenTypeFromName ¶
func GetRepositoryTokenTypeFromName(ctx context.Context, deploymentID, repoName string) (string, error)
GetRepositoryTokenTypeFromName retrieves the token_type of credential for a given repoName
func GetRepositoryTokenUserFromName ¶
func GetRepositoryTokenUserFromName(ctx context.Context, deploymentID, repoName string) (string, string, error)
GetRepositoryTokenUserFromName This function get the credentials (user/token) for a given repoName
func GetRepositoryURLFromName ¶
GetRepositoryURLFromName allow you to retrieve the url of a repo from is name
func GetRequirementIndexByNameForNode ¶
func GetRequirementIndexByNameForNode(ctx context.Context, deploymentID, nodeName, requirementName string) (string, error)
GetRequirementIndexByNameForNode returns the requirement index which name match with defined requirementName for a given node name
func GetRequirementNameByIndexForNode ¶
func GetRequirementNameByIndexForNode(ctx context.Context, deploymentID, nodeName, requirementIndex string) (string, error)
GetRequirementNameByIndexForNode returns the requirement name for a given node and requirement index
func GetRequirementsIndexes ¶
GetRequirementsIndexes returns the list of requirements indexes for a given node
func GetStringArrayNodeProperty ¶
func GetStringArrayNodeProperty(ctx context.Context, deploymentID, nodeName, propertyName string) ([]string, error)
GetStringArrayNodeProperty returns the string Array value of a node property (default: false) This function returns a nil array for an empty string property value
func GetStringNodeProperty ¶
func GetStringNodeProperty(ctx context.Context, deploymentID, nodeName, propertyName string, mandatory bool) (string, error)
GetStringNodeProperty returns the string value of a property. If this value is empty and the argument mandatory is true, an error is returned
func GetStringNodePropertyValue ¶
func GetStringNodePropertyValue(ctx context.Context, deploymentID, nodeName, propertyName string, nestedKeys ...string) (string, error)
GetStringNodePropertyValue returns the string value of a property. If there is no such property defined, an empty string is returned
func GetTargetInstanceForRequirement ¶
func GetTargetInstanceForRequirement(ctx context.Context, deploymentID, nodeName, requirementIndex, instanceName string) (string, []string, error)
GetTargetInstanceForRequirement returns the target node and instances associated with a given requirementIndex of the given nodeName/instanceName.
func GetTargetNodeForRequirement ¶
func GetTargetNodeForRequirement(ctx context.Context, deploymentID, nodeName, requirementIndex string) (string, error)
GetTargetNodeForRequirement returns the target node associated with a given requirementIndex for the given nodeName.
If there is no node defined for this requirement then an empty string is returned.
func GetTargetNodeForRequirementByName ¶
func GetTargetNodeForRequirementByName(ctx context.Context, deploymentID, nodeName, requirementName string) (string, error)
GetTargetNodeForRequirementByName returns the target node associated with a given requirementName for the given nodeName.
If there is no node defined for this requirement then an empty string is returned.
func GetTopologyInputParameter ¶
func GetTopologyInputParameter(ctx context.Context, deploymentID, parameterName string) (bool, *tosca.ParameterDefinition, error)
GetTopologyInputParameter returns the definition of a topology input parameter
func GetTopologyInputType ¶
GetTopologyInputType retrieves the optional data type of the parameter.
As this keyname is required for a TOSCA Property definition, but is not for a TOSCA Parameter definition it may be empty. If the input type is list or map and an entry_schema is provided a semicolon and the entry_schema value are appended to the type (ie list:integer) otherwise string is assumed for then entry_schema.
func GetTopologyInputsNames ¶
GetTopologyInputsNames returns the list of inputs for the deployment
func GetTopologyOutputType ¶
GetTopologyOutputType retrieves the optional data type of the parameter.
As this keyname is required for a TOSCA Property definition, but is not for a TOSCA Parameter definition it may be empty. If the input type is list or map and an entry_schema is provided a semicolon and the entry_schema value are appended to the type (ie list:integer) otherwise string is assumed for then entry_schema.
func GetTopologyOutputsNames ¶
GetTopologyOutputsNames returns the list of outputs for the deployment
func GetTypeAttributeDataType ¶
func GetTypeAttributeDataType(ctx context.Context, deploymentID, typeName, propertyName string) (string, error)
GetTypeAttributeDataType returns the type of a attribute as defined in its attribute definition
Default value is "string" if not specified. Lists and Maps types have their entry_schema value append separated by a semicolon (ex "map:string") again if there is specified entry_schema "string" is assumed.
func GetTypeAttributes ¶
func GetTypeAttributes(ctx context.Context, deploymentID, typeName string, exploreParents bool) ([]string, error)
GetTypeAttributes returns the list of attributes defined for a given type name of the specified type tType tType can be "node", "relationship", "capability" It lists only attributes defined in the given type not in its parent types.
func GetTypeAttributesNames ¶
GetTypeAttributesNames returns the list of attributes names found in the type hierarchy
func GetTypeImplementingAnOperation ¶
func GetTypeImplementingAnOperation(ctx context.Context, deploymentID, typeName, operationName string) (string, error)
GetTypeImplementingAnOperation returns the first (bottom-up) type in the type hierarchy that implements a given operation
An error is returned if the operation is not found in the type hierarchy
func GetTypeImportPath ¶
GetTypeImportPath returns the import path relative to the root of a CSAR of a given TOSCA type.
This is particularly useful for resolving artifacts and implementation
func GetTypeProperties ¶
func GetTypeProperties(ctx context.Context, deploymentID, typeName string, exploreParents bool) ([]string, error)
GetTypeProperties returns the list of properties defined for a given type nam of the specified type tType tType can be "node", "relationship", "capability", "artifact", "data", policy" It lists only properties defined in the given type not in its parent types.
func GetTypePropertyDataType ¶
func GetTypePropertyDataType(ctx context.Context, deploymentID, typeName, propertyName string) (string, error)
GetTypePropertyDataType returns the type of a property as defined in its property definition
Default value is "string" if not specified. Lists and Maps types have their entry_schema value append separated by a semicolon (ex "map:string") again if there is specified entry_schema "string" is assumed.
func GetTypesNames ¶
GetTypesNames returns the names of the different types for a given deployment.
func GetWorkflow ¶
GetWorkflow reads a workflow definition from Consul and built its TOSCA representation
func GetWorkflows ¶
GetWorkflows returns the list of workflows names for a given deployment
func HasAnyRequirementCapability ¶
func HasAnyRequirementCapability(ctx context.Context, deploymentID, nodeName, requirement, capabilityType string) (bool, string, error)
HasAnyRequirementCapability returns true and the related target node name addressing the capability if node with name nodeName has the requirement requirement with the capability type equal or derived from the provided type otherwise it returns false and empty string
func HasAnyRequirementFromNodeType ¶
func HasAnyRequirementFromNodeType(ctx context.Context, deploymentID, nodeName, requirement, nodeType string) (bool, string, error)
HasAnyRequirementFromNodeType returns true and the related node name addressing the capability if node with name nodeName has the requirement with the node type equal or derived from the provided type otherwise it returns false and empty string
func HasBlockingOperationOnDeploymentFlag ¶
HasBlockingOperationOnDeploymentFlag checks if there is a flag on a given deployment to specify that an operation is ongoing and no other tasks should be run on this deployment
func HasScalableCapability ¶
HasScalableCapability check if the given nodeName in the specified deployment, has in this capabilities a Key named scalable
func IsDeploymentNotFoundError ¶
IsDeploymentNotFoundError checks if an error is a deployment not found error
func IsHostedOn ¶
IsHostedOn checks if a given nodeName is hosted on another given node hostedOn by traversing the hostedOn hierarchy
func IsInconsistentDeploymentError ¶
IsInconsistentDeploymentError checks if an error is an inconsistent deployment error
func IsInputNotFound ¶
IsInputNotFound checks if a given error is an error indicating that an input was not found in an operation
func IsNodeDerivedFrom ¶
IsNodeDerivedFrom check if the node's type is derived from another type.
Basically this function is a shorthand for GetNodeType and IsNodeTypeDerivedFrom.
func IsNodeNotFoundError ¶
IsNodeNotFoundError checks if the given error is a nodeNotFoundError error
func IsNodeTemplateImplementingOperation ¶
func IsNodeTemplateImplementingOperation(ctx context.Context, deploymentID, nodeName, operationName string) (bool, error)
IsNodeTemplateImplementingOperation returns true if the node implements the defined operation
func IsOperationImplemented ¶
func IsOperationImplemented(ctx context.Context, deploymentID, nodeName, operationName string) (bool, error)
IsOperationImplemented checks if a given operation is implemented either in the node template or in the node type hierarchy
An implemented operation means that it has a non empty primary implementation or file for an implementation artifact
func IsOperationInputAPropertyDefinition ¶
func IsOperationInputAPropertyDefinition(ctx context.Context, deploymentID, nodeTemplateImpl, typeNameImpl, operationName, inputName string) (bool, error)
IsOperationInputAPropertyDefinition checks if a given operation input is a property definition
func IsOperationNotImplemented ¶
IsOperationNotImplemented checks if a given error is an error indicating that an operation is not implemented
func IsTargetForPolicy ¶
func IsTargetForPolicy(ctx context.Context, deploymentID, policyName, nodeName string, recursive bool) (bool, error)
IsTargetForPolicy returns true if the node name is a policy target
func IsTypeDerivedFrom ¶
IsTypeDerivedFrom traverses 'derived_from' to check if type derives from another type
func IsTypeMissingError ¶
IsTypeMissingError checks if the given error is a TypeMissing error
func IsTypePropertyRequired ¶
func IsTypePropertyRequired(ctx context.Context, deploymentID, typeName, propertyName string) (bool, error)
IsTypePropertyRequired checks if a property defined in a given type is required.
As per the TOSCA specification a property is considered as required by default. An error is returned if the given type doesn't define the given property.
func LookupInstanceAttributeValue ¶
func LookupInstanceAttributeValue(ctx context.Context, deploymentID, nodeName, instanceName, attribute string, nestedKeys ...string) (string, error)
LookupInstanceAttributeValue executes a lookup to retrieve instance attribute value when attribute can be long to retrieve
func LookupInstanceCapabilityAttributeValue ¶
func LookupInstanceCapabilityAttributeValue(ctx context.Context, deploymentID, nodeName, instanceName, capabilityName, attributeName string, nestedKeys ...string) (string, error)
LookupInstanceCapabilityAttributeValue executes a lookup to retrieve instance capability attribute value when attribute can be long to retrieve
func NewInconsistentDeploymentError ¶
NewInconsistentDeploymentError allows to create a new inconsistentDeploymentError error
func NodeHasAttribute ¶
func NodeHasAttribute(ctx context.Context, deploymentID, nodeName, attributeName string, exploreParents bool) (bool, error)
NodeHasAttribute returns true if the node type has an attribute named attributeName defined
exploreParents switch enable attribute check on parent types
This is basically a shorthand for GetNodeType then TypeHasAttribute
func NodeHasProperty ¶
func NodeHasProperty(ctx context.Context, deploymentID, nodeName, propertyName string, exploreParents bool) (bool, error)
NodeHasProperty returns true if the node type has a property named propertyName defined
exploreParents switch enable property check on parent types
This is basically a shorthand for GetNodeType then TypeHasProperty
func PostDeploymentDefinitionStorageProcess ¶
func PostDeploymentDefinitionStorageProcess(ctx context.Context, deploymentID string, nodes []string) error
PostDeploymentDefinitionStorageProcess allows to execute Post deployment storage process It concerns deployment store only (not instances) and can be run separately (upgrade)
func RemoveBlockingOperationOnDeploymentFlag ¶
RemoveBlockingOperationOnDeploymentFlag removes a flag on a given deployment to specify that an operation is ongoing and no other tasks should be run on this deployment
func ResolveAttributeMapping ¶
func ResolveAttributeMapping(ctx context.Context, deploymentID, nodeName, instanceName, capabilityOrAttributeName string, attributeValue interface{}, parameters ...string) error
ResolveAttributeMapping allows to resolve an attribute mapping i.e update the corresponding attribute with the defined value parameters can be nested keys and/or attribute name in case of capability 2 cases: - capabilityOrAttributeName is an attribute name : parameters are nested keys - capabilityOrAttributeName is a capability name: the first parameter is the attribute name
func ResolveWorkflowOutputs ¶
func ResolveWorkflowOutputs(ctx context.Context, deploymentID, workflowName string) (map[string]*TOSCAValue, error)
ResolveWorkflowOutputs allows to resolve workflow outputs
func SelectNodeStackInstances ¶
func SelectNodeStackInstances(ctx context.Context, deploymentID, nodeName string, instancesDelta int) (map[string]string, error)
SelectNodeStackInstances selects a given number of instances of the given node, all the nodes hosted on this one and all nodes linked to it.
For each node it returns a coma separated list of selected instances
func SetAttributeComplexForAllInstances ¶
func SetAttributeComplexForAllInstances(ctx context.Context, deploymentID, nodeName, attributeName string, attributeValue interface{}) error
SetAttributeComplexForAllInstances sets the same attribute value to all instances of a given node.
It does the same thing than iterating over instances ids and calling SetInstanceAttributeComplex but use a consulutil.ConsulStore to do it in parallel. We can expect better performances with a large number of instances
func SetAttributeForAllInstances ¶
func SetAttributeForAllInstances(ctx context.Context, deploymentID, nodeName, attributeName, attributeValue string) error
SetAttributeForAllInstances sets the same attribute value to all instances of a given node.
It does the same thing than iterating over instances ids and calling SetInstanceAttribute but use a consulutil.ConsulStore to do it in parallel. We can expect better performances with a large number of instances
func SetCapabilityAttributeComplexForAllInstances ¶
func SetCapabilityAttributeComplexForAllInstances(ctx context.Context, deploymentID, nodeName, capabilityName, attributeName string, attributeValue interface{}) error
SetCapabilityAttributeComplexForAllInstances sets the same capability attribute value that may be a literal or a complex data type to all instances of a given node.
It does the same thing than iterating over instances ids and calling SetInstanceCapabilityAttributeComplex but use a consulutil.ConsulStore to do it in parallel. We can expect better performances with a large number of instances
func SetCapabilityAttributeForAllInstances ¶
func SetCapabilityAttributeForAllInstances(ctx context.Context, deploymentID, nodeName, capabilityName, attributeName, attributeValue string) error
SetCapabilityAttributeForAllInstances sets the same capability attribute value to all instances of a given node.
It does the same thing than iterating over instances ids and calling SetInstanceCapabilityAttribute but use a consulutil.ConsulStore to do it in parallel. We can expect better performances with a large number of instances
func SetDeploymentStatus ¶
func SetDeploymentStatus(ctx context.Context, deploymentID string, status DeploymentStatus) error
SetDeploymentStatus sets the deployment status to the given status.
This function will first check for an update of the current status and do it only if necessary. It will also emit a proper event to notify of status change. It is safe for concurrent use by using a CAS mechanism.
func SetInstanceAttribute ¶
func SetInstanceAttribute(ctx context.Context, deploymentID, nodeName, instanceName, attributeName, attributeValue string) error
SetInstanceAttribute sets an instance attribute
func SetInstanceAttributeComplex ¶
func SetInstanceAttributeComplex(ctx context.Context, deploymentID, nodeName, instanceName, attributeName string, attributeValue interface{}) error
SetInstanceAttributeComplex sets an instance attribute that may be a literal or a complex data type
func SetInstanceCapabilityAttribute ¶
func SetInstanceCapabilityAttribute(ctx context.Context, deploymentID, nodeName, instanceName, capabilityName, attributeName, value string) error
SetInstanceCapabilityAttribute sets a capability attribute for a given node instance
func SetInstanceCapabilityAttributeComplex ¶
func SetInstanceCapabilityAttributeComplex(ctx context.Context, deploymentID, nodeName, instanceName, capabilityName, attributeName string, attributeValue interface{}) error
SetInstanceCapabilityAttributeComplex sets an instance capability attribute that may be a literal or a complex data type
func SetInstanceListAttributes ¶
func SetInstanceListAttributes(ctx context.Context, attributes []*AttributeData) error
SetInstanceListAttributes sets a list of instance attributes in order to store all attributes together then publish. This is done for avoiding inconsistency at publish time
func SetInstanceListAttributesComplex ¶
func SetInstanceListAttributesComplex(ctx context.Context, attributes []*AttributeData) error
SetInstanceListAttributesComplex sets an instance list of attributes that may be a literal or a complex data type All attributes are stored together Then all notifications are published
func SetInstanceRelationshipAttribute ¶
func SetInstanceRelationshipAttribute(ctx context.Context, deploymentID, nodeName, instanceName, requirementIndex, attributeName, value string) error
SetInstanceRelationshipAttribute sets a relationship attribute for a given node instance
func SetInstanceRelationshipAttributeComplex ¶
func SetInstanceRelationshipAttributeComplex(ctx context.Context, deploymentID, nodeName, instanceName, requirementIndex, attributeName string, attributeValue interface{}) error
SetInstanceRelationshipAttributeComplex sets an instance relationship attribute that may be a literal or a complex data type
func SetInstanceStateStringWithContextualLogs ¶
func SetInstanceStateStringWithContextualLogs(ctx context.Context, deploymentID, nodeName, instanceName, state string) error
SetInstanceStateStringWithContextualLogs stores the state of a given node instance and publishes a status change event context is used to carry contextual information for logging (see events package)
func SetInstanceStateWithContextualLogs ¶
func SetInstanceStateWithContextualLogs(ctx context.Context, deploymentID, nodeName, instanceName string, state tosca.NodeState) error
SetInstanceStateWithContextualLogs stores the state of a given node instance and publishes a status change event context is used to carry contextual information for logging (see events package)
func SetRelationshipAttributeComplexForAllInstances ¶
func SetRelationshipAttributeComplexForAllInstances(ctx context.Context, deploymentID, nodeName, requirementIndex, attributeName string, attributeValue interface{}) error
SetRelationshipAttributeComplexForAllInstances sets the same relationship attribute value that may be a literal or a complex data type to all instances of a given node.
It does the same thing than iterating over instances ids and calling SetInstanceRelationshipAttributeComplex but use a consulutil.ConsulStore to do it in parallel. We can expect better performances with a large number of instances
func SetRelationshipAttributeForAllInstances ¶
func SetRelationshipAttributeForAllInstances(ctx context.Context, deploymentID, nodeName, requirementIndex, attributeName, attributeValue string) error
SetRelationshipAttributeForAllInstances sets the same relationship attribute value to all instances of a given node.
It does the same thing than iterating over instances ids and calling SetInstanceRelationshipAttribute but use a consulutil.ConsulStore to do it in parallel. We can expect better performances with a large number of instances
func StoreDeploymentDefinition ¶
StoreDeploymentDefinition takes a defPath and parse it as a tosca.Topology then it store it in consul under consulutil.DeploymentKVPrefix/deploymentID
func TagDeploymentAsPurged ¶
TagDeploymentAsPurged registers current purge time and emit a deployment status change event and a log for the given deployment
The timestamp will be used to evict purged deployments after an given delay.
func TypeHasAttribute ¶
func TypeHasAttribute(ctx context.Context, deploymentID, typeName, attributeName string, exploreParents bool) (bool, error)
TypeHasAttribute returns true if the type has a attribute named attributeName defined exploreParents switch enable attribute check on parent types
Types ¶
type AttributeData ¶
type AttributeData struct { DeploymentID string NodeName string InstanceName string Name string Value string CapabilityName string RequirementIndex string }
AttributeData represents the related attribute data
func BuildAttributeDataFromPath ¶
func BuildAttributeDataFromPath(ctx context.Context, aPath string) (*AttributeData, error)
BuildAttributeDataFromPath allows to return attribute data from path as below: - instance attribute: _yorc/deployments/<DEPLOYMENT_ID>/topology/instances/<NODE_NAME>/<INSTANCE_NAME>/attributes/<ATTRIBUTE_NAME> - capability attribute: _yorc/deployments/<DEPLOYMENT_ID>/topology/instances/<NODE_NAME>/<INSTANCE_NAME>/capabilities/(/*)*/attributes/<ATTRIBUTE_NAME> - relationship attribute: _yorc/deployments/<DEPLOYMENT_ID>/topology/relationship_instances/<NODE_NAME>/<REQUIREMENT_INDEX>/<INSTANCE_NAME>/attributes/<ATTRIBUTE_NAME>
type AttributeNotifier ¶
type AttributeNotifier struct { NodeName string InstanceName string AttributeName string CapabilityName string }
AttributeNotifier is an attribute notifying its value changes
func (*AttributeNotifier) NotifyValueChange ¶
func (an *AttributeNotifier) NotifyValueChange(ctx context.Context, deploymentID string) error
NotifyValueChange allows to notify attribute value change
type DeploymentStatus ¶
type DeploymentStatus int
DeploymentStatus is an enumerated type for deployments statuses
ENUM( INITIAL DEPLOYMENT_IN_PROGRESS DEPLOYED UNDEPLOYMENT_IN_PROGRESS PURGE_IN_PROGRESS UNDEPLOYED DEPLOYMENT_FAILED UNDEPLOYMENT_FAILED SCALING_IN_PROGRESS UPDATE_IN_PROGRESS UPDATED UPDATE_FAILURE PURGED )
const ( // INITIAL is a DeploymentStatus of type INITIAL INITIAL DeploymentStatus = iota // DEPLOYMENT_IN_PROGRESS is a DeploymentStatus of type DEPLOYMENT_IN_PROGRESS DEPLOYMENT_IN_PROGRESS // DEPLOYED is a DeploymentStatus of type DEPLOYED DEPLOYED // UNDEPLOYMENT_IN_PROGRESS is a DeploymentStatus of type UNDEPLOYMENT_IN_PROGRESS UNDEPLOYMENT_IN_PROGRESS // PURGE_IN_PROGRESS is a DeploymentStatus of type PURGE_IN_PROGRESS PURGE_IN_PROGRESS // UNDEPLOYED is a DeploymentStatus of type UNDEPLOYED UNDEPLOYED // DEPLOYMENT_FAILED is a DeploymentStatus of type DEPLOYMENT_FAILED DEPLOYMENT_FAILED // UNDEPLOYMENT_FAILED is a DeploymentStatus of type UNDEPLOYMENT_FAILED UNDEPLOYMENT_FAILED // SCALING_IN_PROGRESS is a DeploymentStatus of type SCALING_IN_PROGRESS SCALING_IN_PROGRESS // UPDATE_IN_PROGRESS is a DeploymentStatus of type UPDATE_IN_PROGRESS UPDATE_IN_PROGRESS // UPDATED is a DeploymentStatus of type UPDATED UPDATED // UPDATE_FAILURE is a DeploymentStatus of type UPDATE_FAILURE UPDATE_FAILURE // PURGED is a DeploymentStatus of type PURGED PURGED )
func DeploymentStatusFromString ¶
func DeploymentStatusFromString(status string, ignoreCase bool) (DeploymentStatus, error)
DeploymentStatusFromString returns a DeploymentStatus from its textual representation.
If ignoreCase is 'true' the given status is upper cased to match the generated status strings. If the given status does not match any known status an error is returned
func GetDeploymentStatus ¶
func GetDeploymentStatus(ctx context.Context, deploymentID string) (DeploymentStatus, error)
GetDeploymentStatus returns a DeploymentStatus for a given deploymentId
If the given deploymentId doesn't refer to an existing deployment an error is returned. This error could be checked with
IsDeploymentNotFoundError(err error) bool
For example:
if status, err := GetDeploymentStatus(kv, deploymentId); err != nil { if IsDeploymentNotFoundError(err) { // Do something in case of deployment not found } }
func ParseDeploymentStatus ¶
func ParseDeploymentStatus(name string) (DeploymentStatus, error)
ParseDeploymentStatus attempts to convert a string to a DeploymentStatus
func (DeploymentStatus) String ¶
func (x DeploymentStatus) String() string
String implements the Stringer interface.
type OperationInputResult ¶
An OperationInputResult represents a result of retrieving an operation input
As in case of attributes it may have different values based on the instance name this struct contains the necessary information to identify the result context
func GetOperationInput ¶
func GetOperationInput(ctx context.Context, deploymentID, nodeName string, operation prov.Operation, inputName string) ([]OperationInputResult, error)
GetOperationInput retrieves the value of an input for a given operation
func GetOperationInputPropertyDefinitionDefault ¶
func GetOperationInputPropertyDefinitionDefault(ctx context.Context, deploymentID, nodeName string, operation prov.Operation, inputName string) ([]OperationInputResult, error)
GetOperationInputPropertyDefinitionDefault retrieves the default value of an input of type property definition for a given operation
type OperationOutputNotifier ¶
type OperationOutputNotifier struct { NodeName string InstanceName string InterfaceName string OperationName string OutputName string }
OperationOutputNotifier is an operation output notifying its value changes
func (*OperationOutputNotifier) NotifyValueChange ¶
func (oon *OperationOutputNotifier) NotifyValueChange(ctx context.Context, deploymentID string) error
NotifyValueChange allows to notify output value change
type Requirement ¶
type Requirement struct { tosca.RequirementAssignment Name string Index string }
Requirement describes a requirement assignment with its name and index
func GetRequirementsByTypeForNode ¶
func GetRequirementsByTypeForNode(ctx context.Context, deploymentID, nodeName, requirementType string) ([]Requirement, error)
GetRequirementsByTypeForNode returns requirements for a defined type for a defined node.
type TOSCAValue ¶
type TOSCAValue struct { Value interface{} IsSecret bool }
A TOSCAValue is the result of a resolved property or attribute
func GetCapabilityPropertyValue ¶
func GetCapabilityPropertyValue(ctx context.Context, deploymentID, nodeName, capabilityName, propertyName string, nestedKeys ...string) (*TOSCAValue, error)
GetCapabilityPropertyValue retrieves the value for a given property in a given node capability
It returns true if a value is found false otherwise as first return parameter. If the property is not found in the node then the type hierarchy is explored to find a default value.
func GetInstanceAttributeValue ¶
func GetInstanceAttributeValue(ctx context.Context, deploymentID, nodeName, instanceName, attributeName string, nestedKeys ...string) (*TOSCAValue, error)
GetInstanceAttributeValue retrieves the given attribute for a node instance
It returns true if a value is found false otherwise as first return parameter. If the attribute is not found in the node then the type hierarchy is explored to find a default value. If the attribute is still not found then it will explore the HostedOn hierarchy. If still not found then it will check node properties as the spec states "TOSCA orchestrators will automatically reflect (i.e., make available) any property defined on an entity making it available as an attribute of the entity with the same name as the property."
func GetInstanceCapabilityAttributeValue ¶
func GetInstanceCapabilityAttributeValue(ctx context.Context, deploymentID, nodeName, instanceName, capabilityName, attributeName string, nestedKeys ...string) (*TOSCAValue, error)
GetInstanceCapabilityAttributeValue retrieves the value for a given attribute in a given node instance capability
It returns true if a value is found false otherwise as first return parameter. If the attribute is not found in the node then the type hierarchy is explored to find a default value. If still not found check properties as the spec states "TOSCA orchestrators will automatically reflect (i.e., make available) any property defined on an entity making it available as an attribute of the entity with the same name as the property."
func GetNodePropertyValue ¶
func GetNodePropertyValue(ctx context.Context, deploymentID, nodeName, propertyName string, nestedKeys ...string) (*TOSCAValue, error)
GetNodePropertyValue retrieves the value for a given property in a given node
It returns true if a value is found false otherwise as first return parameter. If the property is not found in the node then the type hierarchy is explored to find a default value. If the property is still not found then it will explore the HostedOn hierarchy
func GetPolicyPropertyValue ¶
func GetPolicyPropertyValue(ctx context.Context, deploymentID, policyName, propertyName string, nestedKeys ...string) (*TOSCAValue, error)
GetPolicyPropertyValue retrieves the value for a given property in a given policy
It returns true if a value is found false otherwise as first return parameter. If the property is not found in the policy then the type hierarchy is explored to find a default value.
func GetRelationshipAttributeValueFromRequirement ¶
func GetRelationshipAttributeValueFromRequirement(ctx context.Context, deploymentID, nodeName, instanceName, requirementIndex, attributeName string, nestedKeys ...string) (*TOSCAValue, error)
GetRelationshipAttributeValueFromRequirement retrieves the value for a given attribute in a given node instance requirement
It returns true if a value is found false otherwise as first return parameter. If the attribute is not found in the node then the type hierarchy is explored to find a default value. If still not found check properties as the spec states "TOSCA orchestrators will automatically reflect (i.e., make available) any property defined on an entity making it available as an attribute of the entity with the same name as the property."
func GetRelationshipPropertyValueFromRequirement ¶
func GetRelationshipPropertyValueFromRequirement(ctx context.Context, deploymentID, nodeName, requirementIndex, propertyName string, nestedKeys ...string) (*TOSCAValue, error)
GetRelationshipPropertyValueFromRequirement returns the value of a relationship's property identified by a requirement index on a node
func GetTopologyOutputValue ¶
func GetTopologyOutputValue(ctx context.Context, deploymentID, outputName string, nestedKeys ...string) (*TOSCAValue, error)
GetTopologyOutputValue returns the value of a given topology output
func (*TOSCAValue) RawString ¶
func (v *TOSCAValue) RawString() string
RawString returns the native format of the value. If value is a literal then it will be a string. If value is a complex value it will be its JSON representation.
func (*TOSCAValue) String ¶
func (v *TOSCAValue) String() string
String allows to not print secrets in case of involontary usage.
If you want to allways have the actual string representation of the value then use RawString instead.
Source Files ¶
- artifacts.go
- attribute_mappings.go
- attribute_notifications.go
- capabilities.go
- commons.go
- datatypes.go
- definition_store.go
- deployments.go
- inputs.go
- instances.go
- nodes.go
- operations.go
- policies.go
- relationships.go
- repositories.go
- requirements.go
- resolver.go
- structs.go
- structs_enum.go
- substitution_mappings.go
- topo_output.go
- types.go
- workflows.go