api

package
v0.0.0-...-51b6845 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: BSD-2-Clause-Patent Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MissingPoolLabel defines a default label set when a pool connection was made by UUID.
	MissingPoolLabel = "<no pool label supplied>"
	// MissingContainerLabel defines a default label set when a container connection was made by UUID.
	MissingContainerLabel = "<no container label supplied>"
)

Variables

View Source
var (
	ErrNoSystemRanks          = errors.New("no ranks in system")
	ErrContextHandleConflict  = errors.New("context already contains a handle for a different pool or container")
	ErrInvalidPoolHandle      = errors.New("pool handle is nil or invalid")
	ErrInvalidContainerHandle = errors.New("container handle is nil or invalid")
)

Functions

func ContainerDeleteAttributes

func ContainerDeleteAttributes(ctx context.Context, sysName, poolID, contID string, attrNames ...string) error

ContainerDeleteAttributes deletes the specified pool attributes.

func ContainerDestroy

func ContainerDestroy(ctx context.Context, sysName, poolID, contID string, force bool) error

ContainerDestroy destroys the specified container. Setting the force flag to true will destroy the container even if it has open handles.

func ContainerGetAttributes

func ContainerGetAttributes(ctx context.Context, sysName, poolID, contID string, names ...string) (daos.AttributeList, error)

ContainerGetAttributes fetches the specified container attributes. If no attribute names are provided, all attributes are fetched.

func ContainerGetProperties

func ContainerGetProperties(ctx context.Context, sysName, poolID, contID string, propNames ...string) (*daos.ContainerPropertyList, error)

ContainerGetProperties fetches the specified container properties. If no property names are provided, all properties are fetched.

func ContainerListAttributes

func ContainerListAttributes(ctx context.Context, sysName, poolID, contID string) ([]string, error)

ContainerListAttributes returns a list of user-definable container attribute names.

func ContainerQuery

func ContainerQuery(ctx context.Context, sysName, poolID, contID string) (*daos.ContainerInfo, error)

ContainerQuery queries the specified container and returns its information.

func ContainerSetAttributes

func ContainerSetAttributes(ctx context.Context, sysName, poolID, contID string, attrs ...*daos.Attribute) error

ContainerSetAttributes sets the specified container attributes.

func ContainerSetProperties

func ContainerSetProperties(ctx context.Context, sysName, poolID, contID string, propList *daos.ContainerPropertyList) error

ContainerSetProperties sets the specified container properties.

func FaultLocationFromString

func FaultLocationFromString(str string) (uint64, error)

FaultLocationFromString converts a string to a fault injection location value.

func GetPoolList

func GetPoolList(ctx context.Context, req GetPoolListReq) ([]*daos.PoolInfo, error)

GetPoolList returns a list of DAOS pools in the system.

func ObjectClassFromName

func ObjectClassFromName(name string) (daos.ObjectClass, error)

ObjectClassFromName returns a new ObjectClass for the given name.

func ObjectClassName

func ObjectClassName(class daos.ObjectClass) string

ObjectClassNameFromID returns a new ObjectClass for the given ID.

func PoolDeleteAttributes

func PoolDeleteAttributes(ctx context.Context, sysName, poolID string, attrNames ...string) error

PoolDeleteAttributes deletes the specified pool attributes.

func PoolGetAttributes

func PoolGetAttributes(ctx context.Context, sysName, poolID string, names ...string) (daos.AttributeList, error)

PoolGetAttributes fetches the specified pool attributes. If no attribute names are provided, all attributes are fetched.

func PoolListAttributes

func PoolListAttributes(ctx context.Context, sysName, poolID string) ([]string, error)

PoolListAttributes returns a list of user-definable pool attribute names.

func PoolListContainers

func PoolListContainers(ctx context.Context, sysName, poolID string, query bool) ([]*daos.ContainerInfo, error)

PoolListContainers returns a list of information about containers in the pool.

func PoolQuery

func PoolQuery(ctx context.Context, sysName, poolID string, queryMask daos.PoolQueryMask) (*daos.PoolInfo, error)

PoolQuery retrieves information about the DAOS Pool, including health and rebuild status, storage usage, and other details.

func PoolQueryTargets

func PoolQueryTargets(ctx context.Context, sysName, poolID string, rank ranklist.Rank, reqTargets *ranklist.RankSet) ([]*daos.PoolQueryTargetInfo, error)

PoolQueryTargets retrieves information about storage targets in the DAOS Pool.

func PoolSetAttributes

func PoolSetAttributes(ctx context.Context, sysName, poolID string, attrs ...*daos.Attribute) error

PoolSetAttributes sets the specified pool attributes.

func RunSelfTest

func RunSelfTest(ctx context.Context, cfg *daos.SelfTestConfig) ([]*daos.SelfTestResult, error)

RunSelfTest uses the provided configuration to run the logic behind the self_test tool. Per-size structured test results are returned as a slice.

Types

type ContainerHandle

type ContainerHandle struct {
	PoolHandle *PoolHandle
	// contains filtered or unexported fields
}

ContainerHandle is an opaque type used to represent a DAOS Container connection. NB: A ContainerHandle contains the PoolHandle used to open the container.

func (*ContainerHandle) Close

func (ch *ContainerHandle) Close(ctx context.Context) error

Close performs a container close operation to release resources associated with the container handle.

func (*ContainerHandle) DeleteAttributes

func (ch *ContainerHandle) DeleteAttributes(ctx context.Context, attrNames ...string) error

DeleteAttributes calls ContainerDeleteAttributes() for the container in the handle.

func (*ContainerHandle) FillHandle

func (ch *ContainerHandle) FillHandle(cHandle unsafe.Pointer) error

FillHandle copies the handle to the supplied pointer, which must be a reference to a C.daos_handle_t. NB: Caller is responsible for keeping the copy in sync with this handle -- use of this method should be discouraged as it is provided for compatibility with older code that calls into libdaos directly.

func (*ContainerHandle) GetAttributes

func (ch *ContainerHandle) GetAttributes(ctx context.Context, attrNames ...string) (daos.AttributeList, error)

GetAttributes calls ContainerGetAttributes() for the container in the handle.

func (*ContainerHandle) GetProperties

func (ch *ContainerHandle) GetProperties(ctx context.Context, propNames ...string) (*daos.ContainerPropertyList, error)

GetProperties calls ContainerGetProperties() for the container in the handle.

func (*ContainerHandle) ID

func (ch *ContainerHandle) ID() string

ID returns the label if available, otherwise the UUID.

func (*ContainerHandle) IsValid

func (ch *ContainerHandle) IsValid() bool

IsValid returns true if the handle is valid.

func (*ContainerHandle) ListAttributes

func (ch *ContainerHandle) ListAttributes(ctx context.Context) ([]string, error)

ListAttributes calls ContainerListAttributes() for the container in the handle.

func (*ContainerHandle) Query

Query calls ContainerQuery() for the container in the handle.

func (*ContainerHandle) SetAttributes

func (ch *ContainerHandle) SetAttributes(ctx context.Context, attrs ...*daos.Attribute) error

SetAttributes calls ContainerSetAttributes() for the container in the handle.

func (*ContainerHandle) SetProperties

func (ch *ContainerHandle) SetProperties(ctx context.Context, propList *daos.ContainerPropertyList) error

SetProperties calls ContainerSetProperties() for the container in the handle.

func (*ContainerHandle) String

func (ch *ContainerHandle) String() string

func (*ContainerHandle) UUID

func (ch *ContainerHandle) UUID() uuid.UUID

UUID returns the DAOS container's UUID.

type ContainerOpenReq

type ContainerOpenReq struct {
	ID      string
	Flags   daos.ContainerOpenFlag
	Query   bool
	SysName string
	PoolID  string
}

ContainerOpenReq specifies the container open parameters.

type ContainerOpenResp

type ContainerOpenResp struct {
	Connection *ContainerHandle
	Info       *daos.ContainerInfo
}

ContainerOpenResp contains the handle and optional container information.

func ContainerOpen

func ContainerOpen(ctx context.Context, req ContainerOpenReq) (_ *ContainerOpenResp, exitErr error)

ContainerOpen opens the container specified in the open request.

type GetPoolListReq

type GetPoolListReq struct {
	SysName string
	Query   bool
}

GetPoolListReq defines the parameters for a GetPoolList request.

type PoolConnectReq

type PoolConnectReq struct {
	SysName string
	ID      string
	Flags   daos.PoolConnectFlag
	Query   bool
}

PoolConnectReq defines the parameters for a PoolConnect request.

type PoolConnectResp

type PoolConnectResp struct {
	Connection *PoolHandle
	Info       *daos.PoolInfo
}

PoolConnectResp contains the response to a PoolConnect request.

func PoolConnect

func PoolConnect(ctx context.Context, req PoolConnectReq) (*PoolConnectResp, error)

PoolConnect establishes a connection to the specified DAOS pool. NB: The caller is responsible for disconnecting from the pool when finished.

type PoolHandle

type PoolHandle struct {
	// contains filtered or unexported fields
}

PoolHandle is an opaque type used to represent a DAOS Pool connection.

func (*PoolHandle) DeleteAttributes

func (ph *PoolHandle) DeleteAttributes(ctx context.Context, attrNames ...string) error

DeleteAttributes is a convenience wrapper around the PoolDeleteAttributes() function.

func (*PoolHandle) DestroyContainer

func (ph *PoolHandle) DestroyContainer(ctx context.Context, contID string, force bool) error

DestroyContainer calls ContainerDestroy() for the specified container, which must be served by the pool opened in the handle.

func (*PoolHandle) Disconnect

func (ph *PoolHandle) Disconnect(ctx context.Context) error

Disconnect signals that the client no longer needs the DAOS pool connection and that it is safe to release resources allocated for the connection.

func (*PoolHandle) FillHandle

func (ch *PoolHandle) FillHandle(cHandle unsafe.Pointer) error

FillHandle copies the handle to the supplied pointer, which must be a reference to a C.daos_handle_t. NB: Caller is responsible for keeping the copy in sync with this handle -- use of this method should be discouraged as it is provided for compatibility with older code that calls into libdaos directly.

func (*PoolHandle) GetAttributes

func (ph *PoolHandle) GetAttributes(ctx context.Context, attrNames ...string) (daos.AttributeList, error)

GetAttributes is a convenience wrapper around the PoolGetAttributes() function.

func (*PoolHandle) ID

func (ch *PoolHandle) ID() string

ID returns the label if available, otherwise the UUID.

func (*PoolHandle) IsValid

func (ph *PoolHandle) IsValid() bool

IsValid returns true if the pool handle is valid.

func (*PoolHandle) ListAttributes

func (ph *PoolHandle) ListAttributes(ctx context.Context) ([]string, error)

ListAttributes is a convenience wrapper around the PoolListAttributes() function.

func (*PoolHandle) ListContainers

func (ph *PoolHandle) ListContainers(ctx context.Context, query bool) ([]*daos.ContainerInfo, error)

func (*PoolHandle) OpenContainer

func (ph *PoolHandle) OpenContainer(ctx context.Context, req ContainerOpenReq) (*ContainerOpenResp, error)

OpenContainer calls ContainerOpen() for the specified container, which must be served by the pool opened in the handle.

func (*PoolHandle) Query

func (ph *PoolHandle) Query(ctx context.Context, mask daos.PoolQueryMask) (*daos.PoolInfo, error)

Query is a convenience wrapper around the PoolQuery() function.

func (*PoolHandle) QueryContainer

func (ph *PoolHandle) QueryContainer(ctx context.Context, contID string) (*daos.ContainerInfo, error)

QueryContainer calls ContainerQuery() for the specified container, which must be served by the pool opened in the handle.

func (*PoolHandle) QueryTargets

func (ph *PoolHandle) QueryTargets(ctx context.Context, rank ranklist.Rank, targets *ranklist.RankSet) ([]*daos.PoolQueryTargetInfo, error)

QueryTargets is a convenience wrapper around the PoolQueryTargets() function.

func (*PoolHandle) SetAttributes

func (ph *PoolHandle) SetAttributes(ctx context.Context, attrs ...*daos.Attribute) error

SetAttributes is a convenience wrapper around the PoolSetAttributes() function.

func (*PoolHandle) String

func (ch *PoolHandle) String() string

func (*PoolHandle) UUID

func (ph *PoolHandle) UUID() uuid.UUID

UUID returns the DAOS pool's UUID.

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider wraps the C DAOS API with methods that accept and return standard Go data types.

func NewProvider

func NewProvider(log debugTraceLogger, initLogging bool) (*Provider, error)

NewProvider returns an initialized DAOS API provider.

func (*Provider) Cleanup

func (p *Provider) Cleanup()

Cleanup releases resources obtained during API initialization.

func (*Provider) GetSystemInfo

func (p *Provider) GetSystemInfo(ctx context.Context) (*daos.SystemInfo, error)

GetSystemInfo queries for the connected system information.

Jump to

Keyboard shortcuts

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