common

package
v0.1.4-0...-5fd395e Latest Latest
Warning

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

Go to latest
Published: May 28, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DDIInfrastructureType is the DDI location infrastructure type
	DDIInfrastructureType = "ddi"
	// DatasetInfoCapability is the capability of a component providing info on a dataset
	DatasetInfoCapability = "dataset_info"
	// DatasetInfoLocations is an attribute providing the list of DDI areas where the
	// dataset is available
	DatasetInfoLocations = "locations"
	// DatasetInfoLocations is an attribute providing the number of files in a dataset
	DatasetInfoNumberOfFiles = "number_of_files"
	// DatasetInfoLocations is an attribute providing the number of small files in a dataset (<= 32MB)
	DatasetInfoNumberOfSmallFiles = "number_of_small_files"
	// DatasetInfoLocations is an attribute providing the size in bytes of a dataset
	DatasetInfoSize = "size"
	// AccessTokenConsulAttribute is the access token attribute of a job stored in consul
	AccessTokenConsulAttribute = "access_token"
)

Variables

This section is empty.

Functions

func GetAAIClient

func GetAAIClient(deploymentID string, locationProps config.DynamicMap) yorcoidc.Client

GetAAIClient returns the AAI client for a given location

func GetAccessToken

func GetAccessToken(ctx context.Context, cfg config.Configuration, deploymentID, nodeName string) (string, error)

GetAccessToken returns the access token for this dpeloyment

func GetStoredNodeTemplate

func GetStoredNodeTemplate(ctx context.Context, deploymentID, nodeName string) (*tosca.NodeTemplate, error)

GetStoredNodeTemplate returns the description of a node stored by Yorc

func MatchesFilter

func MatchesFilter(fileName string, filesPatterns []string) (bool, error)

Check if a string matches one of the filters

func RefreshToken

func RefreshToken(ctx context.Context, locationProps config.DynamicMap, deploymentID string) (string, string, error)

RefreshToken refreshes an access token

func StoreNodeTemplate

func StoreNodeTemplate(ctx context.Context, deploymentID, nodeName string, nodeTemplate *tosca.NodeTemplate) error

StoreNodeTemplate stores a node template in Yorc

Types

type ChangedFile

type ChangedFile struct {
	FileName         string
	LastModifiedDate string
}

ChangedFile holds properties of a file created/updated by a job

type DDIExecution

type DDIExecution struct {
	KV             *api.KV
	Cfg            config.Configuration
	DeploymentID   string
	TaskID         string
	NodeName       string
	Operation      prov.Operation
	EnvInputs      []*operations.EnvInput
	VarInputsNames []string
	AAIClient      yorcoidc.Client
}

DDIExecution holds DDI Execution properties

func (*DDIExecution) GetBooleanValueFromEnvInputs

func (e *DDIExecution) GetBooleanValueFromEnvInputs(envVar string) bool

GetBooleanValueFromEnvInputs returns a boolean from environment variables provided in input

func (*DDIExecution) GetDDIClientFromAssociatedComputeLocation

func (e *DDIExecution) GetDDIClientFromAssociatedComputeLocation(ctx context.Context) (ddi.Client, error)

GetDDIClientFromAssociatedComputeLocation gets a DDI client corresponding to the location on which the associated compute instance is running

func (*DDIExecution) GetDDIClientFromHostingComputeLocation

func (e *DDIExecution) GetDDIClientFromHostingComputeLocation(ctx context.Context) (ddi.Client, config.DynamicMap, error)

GetDDIClientFromHostingComputeLocation gets a DDI client corresponding to the location on which the hosting compute instance is running

func (*DDIExecution) GetDDIClientFromRequirement

func (e *DDIExecution) GetDDIClientFromRequirement(ctx context.Context, requirementName string) (ddi.Client, config.DynamicMap, string, error)

GetDDIClientFromRequirement gets a DDI client and location properties corresponding to the location on which the associated compute instance is running

func (*DDIExecution) GetDDILocationFromComputeLocation

func (e *DDIExecution) GetDDILocationFromComputeLocation(ctx context.Context,
	locationMgr locations.Manager, computeLocation string) (config.DynamicMap, error)

GetDDILocationFromComputeLocation gets the DDI location for the location on which the associated compute instance is running

func (*DDIExecution) GetDDILocationNameFromInfrastructureLocation

func (e *DDIExecution) GetDDILocationNameFromInfrastructureLocation(ctx context.Context,
	infraLocation string) (string, error)

GetDDILocationNameFromComputeLocationName gets the DDI location name for the location on which the associated compute instance is running if any

func (*DDIExecution) GetHPCJobChangedFilesSinceStartup

func (e *DDIExecution) GetHPCJobChangedFilesSinceStartup(ctx context.Context) ([]ChangedFile, error)

GetHPCJobChangedFilesSinceStartup gets from evironment the list of files modified by a job since its startup

func (*DDIExecution) GetValueFromEnvInputs

func (e *DDIExecution) GetValueFromEnvInputs(envVar string) string

GetValueFromEnvInputs returns a value from environment variables provided in input

func (*DDIExecution) ResolveExecution

func (e *DDIExecution) ResolveExecution(ctx context.Context) error

ResolveExecution resolves inputs before the execution of an operation

func (*DDIExecution) SetCloudStagingAreaAccessCapabilityAttributes

func (e *DDIExecution) SetCloudStagingAreaAccessCapabilityAttributes(ctx context.Context, ddiClient ddi.Client) error

SetCloudStagingAreaAccessCapabilityAttributes sets the corresponding capability attributes

func (*DDIExecution) SetDDIAccessCapabilityAttributes

func (e *DDIExecution) SetDDIAccessCapabilityAttributes(ctx context.Context, ddiClient ddi.Client) error

func (*DDIExecution) SetDatasetInfoCapabilityLocationsAttribute

func (e *DDIExecution) SetDatasetInfoCapabilityLocationsAttribute(ctx context.Context, locationNames []string) error

func (*DDIExecution) SetDatasetInfoCapabilityNumberOfFilesAttribute

func (e *DDIExecution) SetDatasetInfoCapabilityNumberOfFilesAttribute(ctx context.Context, filesNumber string) error

func (*DDIExecution) SetDatasetInfoCapabilityNumberOfSmallFilesAttribute

func (e *DDIExecution) SetDatasetInfoCapabilityNumberOfSmallFilesAttribute(ctx context.Context, filesNumber string) error

func (*DDIExecution) SetDatasetInfoCapabilitySizeAttribute

func (e *DDIExecution) SetDatasetInfoCapabilitySizeAttribute(ctx context.Context, size string) error

func (*DDIExecution) SetLocationFromAssociatedCloudInstance

func (e *DDIExecution) SetLocationFromAssociatedCloudInstance(ctx context.Context) (string, error)

SetLocationFromAssociatedCloudInstance sets the location of this component according to an associated compute instance location

func (*DDIExecution) SetLocationFromAssociatedHPCJob

func (e *DDIExecution) SetLocationFromAssociatedHPCJob(ctx context.Context) (string, error)

SetLocationFromAssociatedHPCJob sets the location of this component according to an associated HPC location

Jump to

Keyboard shortcuts

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