Documentation
¶
Index ¶
- Constants
- Variables
- func ContainerDeleteAttributes(ctx context.Context, sysName, poolID, contID string, attrNames ...string) error
- func ContainerDestroy(ctx context.Context, sysName, poolID, contID string, force bool) error
- func ContainerGetAttributes(ctx context.Context, sysName, poolID, contID string, names ...string) (daos.AttributeList, error)
- func ContainerGetProperties(ctx context.Context, sysName, poolID, contID string, propNames ...string) (*daos.ContainerPropertyList, error)
- func ContainerListAttributes(ctx context.Context, sysName, poolID, contID string) ([]string, error)
- func ContainerQuery(ctx context.Context, sysName, poolID, contID string) (*daos.ContainerInfo, error)
- func ContainerSetAttributes(ctx context.Context, sysName, poolID, contID string, attrs ...*daos.Attribute) error
- func ContainerSetProperties(ctx context.Context, sysName, poolID, contID string, ...) error
- func FaultLocationFromString(str string) (uint64, error)
- func GetPoolList(ctx context.Context, req GetPoolListReq) ([]*daos.PoolInfo, error)
- func ObjectClassFromName(name string) (daos.ObjectClass, error)
- func ObjectClassName(class daos.ObjectClass) string
- func PoolDeleteAttributes(ctx context.Context, sysName, poolID string, attrNames ...string) error
- func PoolGetAttributes(ctx context.Context, sysName, poolID string, names ...string) (daos.AttributeList, error)
- func PoolListAttributes(ctx context.Context, sysName, poolID string) ([]string, error)
- func PoolListContainers(ctx context.Context, sysName, poolID string, query bool) ([]*daos.ContainerInfo, error)
- func PoolQuery(ctx context.Context, sysName, poolID string, queryMask daos.PoolQueryMask) (*daos.PoolInfo, error)
- func PoolQueryTargets(ctx context.Context, sysName, poolID string, rank ranklist.Rank, ...) ([]*daos.PoolQueryTargetInfo, error)
- func PoolSetAttributes(ctx context.Context, sysName, poolID string, attrs ...*daos.Attribute) error
- func RunSelfTest(ctx context.Context, cfg *daos.SelfTestConfig) ([]*daos.SelfTestResult, error)
- type ContainerHandle
- func (ch *ContainerHandle) Close(ctx context.Context) error
- func (ch *ContainerHandle) DeleteAttributes(ctx context.Context, attrNames ...string) error
- func (ch *ContainerHandle) FillHandle(cHandle unsafe.Pointer) error
- func (ch *ContainerHandle) GetAttributes(ctx context.Context, attrNames ...string) (daos.AttributeList, error)
- func (ch *ContainerHandle) GetProperties(ctx context.Context, propNames ...string) (*daos.ContainerPropertyList, error)
- func (ch *ContainerHandle) ID() string
- func (ch *ContainerHandle) IsValid() bool
- func (ch *ContainerHandle) ListAttributes(ctx context.Context) ([]string, error)
- func (ch *ContainerHandle) Query(ctx context.Context) (*daos.ContainerInfo, error)
- func (ch *ContainerHandle) SetAttributes(ctx context.Context, attrs ...*daos.Attribute) error
- func (ch *ContainerHandle) SetProperties(ctx context.Context, propList *daos.ContainerPropertyList) error
- func (ch *ContainerHandle) String() string
- func (ch *ContainerHandle) UUID() uuid.UUID
- type ContainerOpenReq
- type ContainerOpenResp
- type GetPoolListReq
- type PoolConnectReq
- type PoolConnectResp
- type PoolHandle
- func (ph *PoolHandle) DeleteAttributes(ctx context.Context, attrNames ...string) error
- func (ph *PoolHandle) DestroyContainer(ctx context.Context, contID string, force bool) error
- func (ph *PoolHandle) Disconnect(ctx context.Context) error
- func (ch *PoolHandle) FillHandle(cHandle unsafe.Pointer) error
- func (ph *PoolHandle) GetAttributes(ctx context.Context, attrNames ...string) (daos.AttributeList, error)
- func (ch *PoolHandle) ID() string
- func (ph *PoolHandle) IsValid() bool
- func (ph *PoolHandle) ListAttributes(ctx context.Context) ([]string, error)
- func (ph *PoolHandle) ListContainers(ctx context.Context, query bool) ([]*daos.ContainerInfo, error)
- func (ph *PoolHandle) OpenContainer(ctx context.Context, req ContainerOpenReq) (*ContainerOpenResp, error)
- func (ph *PoolHandle) Query(ctx context.Context, mask daos.PoolQueryMask) (*daos.PoolInfo, error)
- func (ph *PoolHandle) QueryContainer(ctx context.Context, contID string) (*daos.ContainerInfo, error)
- func (ph *PoolHandle) QueryTargets(ctx context.Context, rank ranklist.Rank, targets *ranklist.RankSet) ([]*daos.PoolQueryTargetInfo, error)
- func (ph *PoolHandle) SetAttributes(ctx context.Context, attrs ...*daos.Attribute) error
- func (ch *PoolHandle) String() string
- func (ph *PoolHandle) UUID() uuid.UUID
- type Provider
Constants ¶
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 ¶
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 ¶
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 ¶
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 ¶
FaultLocationFromString converts a string to a fault injection location value.
func GetPoolList ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
func (ch *ContainerHandle) Query(ctx context.Context) (*daos.ContainerInfo, error)
Query calls ContainerQuery() for the container in the handle.
func (*ContainerHandle) SetAttributes ¶
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 ¶
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 ¶
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 ¶
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 ¶
SetAttributes is a convenience wrapper around the PoolSetAttributes() function.
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 ¶
NewProvider returns an initialized DAOS API provider.
func (*Provider) Cleanup ¶
func (p *Provider) Cleanup()
Cleanup releases resources obtained during API initialization.
func (*Provider) GetSystemInfo ¶
GetSystemInfo queries for the connected system information.