Supported Intel AMT Features > Storage > Using the Storage API
CollapseAll image

Using the Storage API

The HLAPI implements the Storage feature in the Storage API.

The available methods are described in these interfaces:

•   IStorage interface - Provide access to storage features. Usually requires a different set of permissions than the Storage Admin features.

•   IStorageAdmin interface - Provides access to Intel AMT Storage Administration features.  Requires permission for Storage Administration realm.

•   IStorageApplication interface - A storage application. Describe a public application object which enable access other partner or non-partner applications to get\read\write their blocks.

•   IFullApplication interface - Information about registered applications, including how many bytes have been allocated to them and how many bytes are in use.

•   IVendorApplication interface - Represents an applications with the same vendor name.

•   IApplicationInfo interface - Information about a storage application.  No storage operations can be performed with this object.

•   IBlock interface - Describes a block of storage as owned by an application. Used by an active IStorageApplication object for operations on blocks that it owns.

•   IAccessableBlock interface - Describes a block of storage as owned by an application.  Used mainly for accessing blocks that belong to other applications, not the current registered application.

•   IBlockPermissions interface - Describes the permissions group that applies to a block of storage.

Examples

 

Add an application to the storage

 

Adding the desired enterprise

boolisDuplicate;

StorageAdmin.AddEnterprise(enterpriseName, out isDuplicate);

 

Adding a partner application

bool appAlreadyExists;

StorageAdmin.AddPartnerApplication("vendorName", "appName", 4096,out appAlreadyExists);

 

Register the application

bool appAlreadyExists;

IstorageApplication application

application = Storage.RegisterApplication("Entreprise1", "vendor1", "app1", newGuid("E766102B-C5CA-467A-99C9-9E7406A98B8E);

The registration operation returns IstorageApplication , which will be used for any future operation of this application. The IStorageApplication is the interface through which you can do operations related to the application.

 

Allocate a block in an application

 

Register the application

bool appAlreadyExists;

IBlock accessableBlock = application.CreateBlock("block1",4096,true/*the block is hidden*/);

Returns Iblock interface. An IBlock interface is globally unique- the user can perform operations related to the application of this block.

Size of blocks can vary, but must be a multiple of 4KB, i.e., the minimum size for a block is 4096B.

If isHidden is true, when other applications request to list this application’s blocks, this block is not listed.

Write to a block

uint dataLenght;

dataLenght = accessableBlock.WriteToBlock(0*/offset*/, (uint)data.Length, data);

Returns the number of bytes that was actually written.

note-icon Note:

The data should be converting to byte array.

 

Read from a block

byte[] bytesRead;

uint byteToRead=10;

dataLenght = accessableBlock.WriteToBlock(0*/offset*/, byteToRead ,        (out) bytesRead);

Returns the number of bytes that was actually read.

Remove a block

application.RemoveBlock(accessableBlock);

Removes the given block

AccessableBlock is from IBlock interface.

note-icon Note:

The given block object should not be used further after this operation.

 

 

 

See Also:

•   Connecting to an Intel AMT Device

 

Copyright © 2006-2022, Intel Corporation. All rights reserved.