OpenTAP 9.27
API Reference
Public Member Functions | Static Public Member Functions | Properties | List of all members
OpenTap.Package.ImageSpecifier Class Reference

An ImageSpecifier defines an OpenTAP installation. The specifier can be resolved to an ImageIdentifier which can be deployed to an actual OpenTAP installation. More...

Public Member Functions

 ImageSpecifier (List< PackageSpecifier > packages, string name="")
 Creates a new instance.
 
 ImageSpecifier ()
 Creates a new instance.
 
ImageIdentifier Resolve (CancellationToken cancellationToken)
 Resolve the desired packages from the specified repositories. This will check if the packages are available, compatible and can successfully be deployed as an OpenTAP installation More...
 
Installation MergeAndDeploy (Installation deploymentInstallation, CancellationToken cancellationToken)
 Resolve specified packages in the ImageSpecifier with respect to the target installation. Specified packages will take precedence over already installed packages Already installed packages, which are not specified in the imagespecifier, will remain installed. More...
 
override string ToString ()
 Turns an image into a readable string. More...
 

Static Public Member Functions

static ImageIdentifier MergeAndResolve (IEnumerable< ImageSpecifier > images, CancellationToken cancellationToken)
 Merges and resolves the packages for a number of images. May throw an exception if the packages cannot be resolved. More...
 
static ImageSpecifier FromString (string value)
 Create an ImageSpecifier from JSON or XML value. Throws InvalidOperationException if value is not valid JSON or XML More...
 

Properties

string Name = "" [getset]
 Optional name of the ImageSpecifier. Used for debugging purposes.
 
List< PackageSpecifierPackages = new List<PackageSpecifier>() [getset]
 Desired packages in the installation
 
List< string > Repositories = new List<string>() [getset]
 OpenTAP repositories to fetch the desired packages from These should be well formed URIs and will be interpreted relative to the BaseAddress set in AuthenticationSettings.
 
string OS = Installation.Current.OS [getset]
 The OS this image specifier targets.
 
CpuArchitecture Architecture = Installation.Current.Architecture [getset]
 The CPU architecture that this image specifier targets.
 

Detailed Description

An ImageSpecifier defines an OpenTAP installation. The specifier can be resolved to an ImageIdentifier which can be deployed to an actual OpenTAP installation.

Member Function Documentation

◆ FromString()

static ImageSpecifier OpenTap.Package.ImageSpecifier.FromString ( string  value)
inlinestatic

Create an ImageSpecifier from JSON or XML value. Throws InvalidOperationException if value is not valid JSON or XML

Parameters
valueJSON or XML formatted ImageSpecifier
Returns
An ImageSpecifier

◆ MergeAndDeploy()

Installation OpenTap.Package.ImageSpecifier.MergeAndDeploy ( Installation  deploymentInstallation,
CancellationToken  cancellationToken 
)
inline

Resolve specified packages in the ImageSpecifier with respect to the target installation. Specified packages will take precedence over already installed packages Already installed packages, which are not specified in the imagespecifier, will remain installed.

Parameters
deploymentInstallationOpenTAP installation to merge with and deploy to.
cancellationTokenStandard CancellationToken
Returns
A new Installation
Exceptions
ImageResolveExceptionIn case of resolve errors, this method will throw ImageResolveExceptions.

◆ MergeAndResolve()

static ImageIdentifier OpenTap.Package.ImageSpecifier.MergeAndResolve ( IEnumerable< ImageSpecifier images,
CancellationToken  cancellationToken 
)
inlinestatic

Merges and resolves the packages for a number of images. May throw an exception if the packages cannot be resolved.

Parameters
imagesThe images to merge.
cancellationTokenA cancellation token to cancel the operation before time. This will cause an OperationCancelledException to be thrown.
Returns
Exceptions
ImageResolveExceptionThe exception thrown if the image could not be resolved

◆ Resolve()

ImageIdentifier OpenTap.Package.ImageSpecifier.Resolve ( CancellationToken  cancellationToken)
inline

Resolve the desired packages from the specified repositories. This will check if the packages are available, compatible and can successfully be deployed as an OpenTAP installation

Parameters
cancellationTokenCancellation token
Exceptions
ImageResolveExceptionThe exception thrown if the image could not be resolved

◆ ToString()

override string OpenTap.Package.ImageSpecifier.ToString ( )

Turns an image into a readable string.

Returns

OpenTAP 9.27 API built Wed Nov 27 2024 13:14:46