arrayfreenas

package
v3.0.0-rc48 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Head                  = "/api/v2.0"
	DatasetTypeVolume     = "VOLUME"
	DatasetTypeFilesystem = "FILESYSTEM"
	RequestTimeout        = 10 * time.Second
)

Functions

func NewDriver

func NewDriver() array.Driver

Types

type AddDiskOptions

type AddDiskOptions struct {
	AddZvolOptions

	// ExtentName is the name of the iscsi extent exporting the zvol.
	// Left empty, the extent is named as the zvol is.
	ExtentName  string
	InsecureTPC bool
	Mappings    []string
	LunId       *int
}

type AddDiskReport

type AddDiskReport struct {
	DriverData    ISCSIExtent        `json:"driver_data"`
	DiskID        string             `json:"disk_id"`
	DiskDevID     int                `json:"disk_devid"`
	Mappings      []DiskMapping      `json:"mappings"`
	Warnings      []string           `json:"warnings,omitempty"`
	Dataset       *Dataset           `json:"dataset,omitempty"`
	TargetExtents ISCSITargetExtents `json:"targetextents"`
}

AddDiskReport is what an add reports, in the keys v2 reports it with: the collector stores it as the result of its disk form. The dataset and the targetextents are reported too, for a reader of the command line.

type AddISCSIExtentOptions

type AddISCSIExtentOptions struct {
	Name        string
	Disk        string
	Blocksize   string
	InsecureTPC bool
}

type AddISCSITargetGroupOptions

type AddISCSITargetGroupOptions struct {
	PortalId      int
	Target        string
	InitiatorName string
	InitiatorId   int
	AuthMethod    string
	Auth          string
}

type AddZvolOptions

type AddZvolOptions struct {
	Name          string
	Size          string
	Blocksize     string
	Sparse        bool
	Deduplication string
	Compression   string
}

AddZvolOptions receives "add zvol" and "add disk" command line flags values

func (AddZvolOptions) Params

type Array

type Array struct {
	*array.Array
	// contains filtered or unexported fields
}

func New

func New() *Array

func (*Array) Actions

func (t *Array) Actions() []array.Action

Actions returns what this array answers to.

func (Array) AddDisk

func (t Array) AddDisk(ctx context.Context, opt AddDiskOptions) (*Disk, error)

AddDisk creates a zvol, the extent exporting it and the targetextents mapping it.

What can be refused without writing is checked before the first write: the size, the targets of the mappings, and that neither the zvol nor its extent exist. A failure after a write returns an error naming what was made.

func (Array) AddISCSIExtent

func (t Array) AddISCSIExtent(ctx context.Context, opt AddISCSIExtentOptions) (*ISCSIExtent, error)

AddISCSIExtent creates an extent. An extent of that name, or exporting that disk, is refused rather than returned: it may be another client's, and the caller is about to map it.

func (Array) AddZvol

func (t Array) AddZvol(ctx context.Context, opt AddZvolOptions) (*Dataset, error)

AddZvol creates a zvol. A dataset of that name is refused rather than returned: it holds data of its own, maybe another client's, and is not of the size asked for.

func (Array) CreateDataset

func (t Array) CreateDataset(ctx context.Context, params CreateDatasetParams) (*Dataset, error)

func (Array) DelDisk

func (t Array) DelDisk(ctx context.Context, name string) (*Disk, error)

DelDisk unexports a zvol and deletes it, in the order v2 does: the targetextents, the extent, then the zvol. Each step deletes only what the one before left unreachable, so a failure midway leaves no exported disk without storage behind it.

func (Array) DelISCSIExtent

func (t Array) DelISCSIExtent(ctx context.Context, opt DelISCSIExtentOptions) (*ISCSIExtent, error)

func (Array) DelZvol

func (t Array) DelZvol(ctx context.Context, name string) (*Dataset, error)

DelZvol deletes a zvol no extent exports. A zvol an extent exports is a disk, which "del disk" deletes with its extent and its mappings: deleting the zvol alone pulls the storage from under initiators still reaching it.

func (Array) DeleteDataset

func (t Array) DeleteDataset(ctx context.Context, name string) (*Dataset, error)

func (Array) DiskId

func (t Array) DiskId(disk Disk) string

DiskId return the NAA from the created disk dataset

func (Array) DiskPaths

func (t Array) DiskPaths(ctx context.Context, disk Disk) (san.Paths, error)

DiskPaths return the san paths list from the created disk dataset and api query responses

func (*Array) Do

func (t *Array) Do(req *http.Request, v interface{}) (*http.Response, error)

func (Array) GetDataset

func (t Array) GetDataset(ctx context.Context, name string) (*Dataset, error)

func (Array) GetDatasets

func (t Array) GetDatasets(ctx context.Context) (Datasets, error)

func (Array) GetDisk

func (t Array) GetDisk(ctx context.Context, name string) (*Disk, error)

GetDisk returns the zvol a command line names, the extent exporting it and the targetextents mapping it. See resolveZvol for how a name is read.

A zvol exported by more than one extent is an error: which one a command is about is a guess, and a delete deleting the one guessed leaves the others exporting a zvol gone.

func (Array) GetISCSIExtent

func (t Array) GetISCSIExtent(ctx context.Context, name string) (*ISCSIExtent, error)

func (Array) GetISCSIExtents

func (t Array) GetISCSIExtents(ctx context.Context) (ISCSIExtents, error)

func (Array) GetISCSIInitiators

func (t Array) GetISCSIInitiators(ctx context.Context) (ISCSIInitiators, error)

func (Array) GetISCSIPortals

func (t Array) GetISCSIPortals(ctx context.Context) ([]any, error)

func (Array) GetISCSITargetExtents

func (t Array) GetISCSITargetExtents(ctx context.Context) (ISCSITargetExtents, error)

func (Array) GetISCSITargets

func (t Array) GetISCSITargets(ctx context.Context) (ISCSITargets, error)

func (Array) GetPoolByName

func (t Array) GetPoolByName(ctx context.Context, name string) (Pool, error)

func (Array) GetPools

func (t Array) GetPools(ctx context.Context) ([]Pool, error)

func (Array) GetSystemInfo

func (t Array) GetSystemInfo(ctx context.Context) (*SystemInfo, error)

func (Array) MapDisk

MapDisk attaches the extent of a disk to the targets of the mappings it is not attached to yet, and returns the targetextents of these targets. Every target is found before the first is attached.

func (*Array) Reports

func (t *Array) Reports() []array.Report

Reports returns the sections of its configuration this array pushes to the collector.

The section names are the ones v2 pushes for a freenas array, because the collector reads them to know what it was handed.

func (*Array) Run

func (t *Array) Run(args []string) error

Run builds the command tree of this array and runs the arguments through it. What the tree holds is declared in Actions.

func (Array) UnmapDisk

func (t Array) UnmapDisk(ctx context.Context, opt UnmapDiskOptions) (ISCSITargetExtents, error)

UnmapDisk detaches the extent of a disk from the targets of the mappings, and returns the targetextents it deleted.

A targetextent is the disk on a target for every initiator the target admits, not for the initiator of a mapping alone: a mapping naming an initiator the target does not admit is refused, as deleting the targetextent would cut the disk from the hosts that do reach it there. A target unknown to the array is refused too, rather than skipped as done. Every mapping is checked before the first targetextent is deleted.

func (Array) UpdateDataset

func (t Array) UpdateDataset(ctx context.Context, id string, params UpdateDatasetParams) (*Dataset, error)

type CompositeValue

type CompositeValue struct {
	Rawvalue string  `json:"rawvalue"`
	Source   *string `json:"source,omitempty"`
	Value    *string `json:"value,omitempty"`
}

CompositeValue defines model for CompositeValue.

type CreateDatasetParams

type CreateDatasetParams struct {
	Aclmode           *string                               `json:"aclmode,omitempty"`
	Atime             *string                               `json:"atime,omitempty"`
	Casesensitivity   *string                               `json:"casesensitivity,omitempty"`
	Comments          *string                               `json:"comments,omitempty"`
	Compression       *string                               `json:"compression,omitempty"`
	Copies            *int                                  `json:"copies,omitempty"`
	Deduplication     *string                               `json:"deduplication,omitempty"`
	Encryption        *bool                                 `json:"encryption,omitempty"`
	EncryptionOptions *CreateDatasetParamsEncryptionOptions `json:"encryption_options,omitempty"`
	Exec              *string                               `json:"exec,omitempty"`
	ForceSize         *bool                                 `json:"force_size,omitempty"`
	InheritEncryption *bool                                 `json:"inherit_encryption,omitempty"`
	Sparse            *bool                                 `json:"sparse,omitempty"`
	Name              string                                `json:"name"`
	Quota             *int64                                `json:"quota,omitempty"`
	QuotaCritical     *int64                                `json:"quota_critical,omitempty"`
	QuotaWarning      *int64                                `json:"quota_warning,omitempty"`
	Readonly          *string                               `json:"readonly,omitempty"`
	Recordsize        *string                               `json:"recordsize,omitempty"`
	Refquota          *int64                                `json:"refquota,omitempty"`
	RefquotaCritical  *int64                                `json:"refquota_critical,omitempty"`
	RefquotaWarning   *int64                                `json:"refquota_warning,omitempty"`
	Refreservation    *int64                                `json:"refreservation,omitempty"`
	Reservation       *int64                                `json:"reservation,omitempty"`
	ShareType         *string                               `json:"share_type,omitempty"`
	Snapdir           *string                               `json:"snapdir,omitempty"`
	Sync              *string                               `json:"sync,omitempty"`
	Type              *string                               `json:"type,omitempty"`
	Volblocksize      *string                               `json:"volblocksize,omitempty"`
	Volsize           *int64                                `json:"volsize,omitempty"`
}

CreateDatasetParams defines model for CreateDatasetParams.

type CreateDatasetParamsEncryptionOptions

type CreateDatasetParamsEncryptionOptions struct {
	Algorithm   *string `json:"algorithm,omitempty"`
	GenerateKey *bool   `json:"generate_key,omitempty"`
	Key         *string `json:"key,omitempty"`
	Passphrase  *string `json:"passphrase,omitempty"`
}

CreateDatasetParamsEncryptionOptions defines model for CreateDatasetParams_encryption_options.

type CreateISCSIExtentParams

type CreateISCSIExtentParams struct {
	Name        string `json:"name"`
	Type        string `json:"type"`
	InsecureTPC bool   `json:"insecure_tpc"`
	Blocksize   int    `json:"blocksize"`
	Disk        string `json:"disk"`
}

CreateISCSIExtentParams defines model for CreateISCSIExtentParams.

type CreateISCSIInitiatorParams

type CreateISCSIInitiatorParams struct {
	Initiators  []string `json:"initiators"`
	AuthNetwork []string `json:"auth_network,omitempty"`
	Comment     string   `json:"comment,omitempty"`
}

CreateISCSIInitiatorParams defines model for CreateISCSIInitiatorParams.

type CreateISCSIPortalParams

type CreateISCSIPortalParams struct {
	Comment             string                `json:"comment,omitempty"`
	DiscoveryAuthMethod string                `json:"discovery_authmethod,omitempty"`
	DiscoveryAuthGroup  int                   `json:"discovery_authgroup,omitempty"`
	Listen              []ISCSIPortalListenIp `json:"listen"`
}

type CreateISCSITargetExtentParams

type CreateISCSITargetExtentParams struct {
	Target int  `json:"target"`
	Extent int  `json:"extent"`
	LunId  *int `json:"lunid"`
}

CreateISCSITargetExtentParams defines model for CreateISCSITargetExtentParams.

type CreateISCSITargetParams

type CreateISCSITargetParams struct {
	Name  string `json:"name"`
	Alias string `json:"alias,omitempty"`
}

CreateISCSITargetParams defines model for CreateISCSITargetParams.

type Dataset

type Dataset struct {
	Aclmode             *CompositeValue `json:"aclmode,omitempty"`
	Acltype             *CompositeValue `json:"acltype,omitempty"`
	Atime               *CompositeValue `json:"atime,omitempty"`
	Available           *CompositeValue `json:"available,omitempty"`
	Casesensitivity     *CompositeValue `json:"casesensitivity,omitempty"`
	Comments            *CompositeValue `json:"comments,omitempty"`
	Compression         *CompositeValue `json:"compression,omitempty"`
	Copies              *CompositeValue `json:"copies,omitempty"`
	Deduplication       *CompositeValue `json:"deduplication,omitempty"`
	Encrypted           *bool           `json:"encrypted,omitempty"`
	EncryptionAlgorithm *CompositeValue `json:"encryption_algorithm,omitempty"`
	EncryptionRoot      *string         `json:"encryption_root,omitempty"`
	Exec                *CompositeValue `json:"exec,omitempty"`
	Id                  string          `json:"id"`
	KeyFormat           *CompositeValue `json:"key_format,omitempty"`
	KeyLoaded           *bool           `json:"key_loaded,omitempty"`
	Locked              *bool           `json:"locked,omitempty"`
	Managedby           *CompositeValue `json:"managedby,omitempty"`
	Mountpoint          *string         `json:"mountpoint,omitempty"`
	Name                string          `json:"name"`
	Origin              *CompositeValue `json:"origin,omitempty"`
	Pbkdf2iters         *CompositeValue `json:"pbkdf2iters,omitempty"`
	Pool                string          `json:"pool"`
	Quota               *CompositeValue `json:"quota,omitempty"`
	QuotaCritical       *CompositeValue `json:"quota_critical,omitempty"`
	QuotaWarning        *CompositeValue `json:"quota_warning,omitempty"`
	Readonly            *CompositeValue `json:"readonly,omitempty"`
	Recordsize          *CompositeValue `json:"recordsize,omitempty"`
	Refquota            *CompositeValue `json:"refquota,omitempty"`
	RefquotaCritical    *CompositeValue `json:"refquota_critical,omitempty"`
	RefquotaWarning     *CompositeValue `json:"refquota_warning,omitempty"`
	Refreservation      *CompositeValue `json:"refreservation,omitempty"`
	Reservation         *CompositeValue `json:"reservation,omitempty"`
	Snapdir             *CompositeValue `json:"snapdir,omitempty"`
	Sync                *CompositeValue `json:"sync,omitempty"`
	Type                string          `json:"type"`
	Used                *CompositeValue `json:"used,omitempty"`
	Volblocksize        *CompositeValue `json:"volblocksize,omitempty"`
	Volsize             *CompositeValue `json:"volsize,omitempty"`
	Xattr               *CompositeValue `json:"xattr,omitempty"`
}

Dataset defines model for Dataset.

type Datasets

type Datasets []Dataset

func (Datasets) GetByName

func (t Datasets) GetByName(name string) (*Dataset, bool)

type DelISCSIExtentOptions

type DelISCSIExtentOptions struct {
	Id   int
	Name string
}

type Disk

type Disk struct {
	Dataset *Dataset   `json:"dataset"`
	ISCSI   *DiskISCSI `json:"iscsi,omitempty"`
}

type DiskISCSI

type DiskISCSI struct {
	Extent        *ISCSIExtent       `json:"extent,omitempty"`
	TargetExtents ISCSITargetExtents `json:"targetextents,omitempty"`
}

type DiskMapping

type DiskMapping struct {
	TargetGroup ISCSITargetGroup  `json:"targetgroup"`
	Extent      ISCSITargetExtent `json:"extent"`
	DiskID      string            `json:"disk_id"`
	TgtID       string            `json:"tgt_id"`
	HBAID       string            `json:"hba_id"`
}

DiskMapping is an initiator reaching a disk through a target, as v2's list_mappings reports it.

type GetDatasetParams

type GetDatasetParams struct {
	Limit  *int    `form:"limit,omitempty" json:"limit,omitempty"`
	Offset *int    `form:"offset,omitempty" json:"offset,omitempty"`
	Count  *bool   `form:"count,omitempty" json:"count,omitempty"`
	Sort   *string `form:"sort,omitempty" json:"sort,omitempty"`
}

GetDatasetParams defines parameters for GetDataset.

type GetDatasetsParams

type GetDatasetsParams struct {
	Limit  *int    `form:"limit,omitempty" json:"limit,omitempty"`
	Offset *int    `form:"offset,omitempty" json:"offset,omitempty"`
	Count  *bool   `form:"count,omitempty" json:"count,omitempty"`
	Sort   *string `form:"sort,omitempty" json:"sort,omitempty"`
}

GetDatasetsParams defines parameters for GetDatasets.

type GetISCSIExtentsParams

type GetISCSIExtentsParams struct {
	Limit  *int    `form:"limit,omitempty" json:"limit,omitempty"`
	Offset *int    `form:"offset,omitempty" json:"offset,omitempty"`
	Count  *bool   `form:"count,omitempty" json:"count,omitempty"`
	Sort   *string `form:"sort,omitempty" json:"sort,omitempty"`
}

GetISCSIExtentsParams defines parameters for GetISCSIExtents.

type GetISCSIInitiatorsParams

type GetISCSIInitiatorsParams struct {
	Limit  *int    `form:"limit,omitempty" json:"limit,omitempty"`
	Offset *int    `form:"offset,omitempty" json:"offset,omitempty"`
	Count  *bool   `form:"count,omitempty" json:"count,omitempty"`
	Sort   *string `form:"sort,omitempty" json:"sort,omitempty"`
}

GetISCSIInitiatorsParams defines parameters for GetISCSIInitiators.

type GetISCSITargetExtentsParams

type GetISCSITargetExtentsParams struct {
	Limit  *int    `form:"limit,omitempty" json:"limit,omitempty"`
	Offset *int    `form:"offset,omitempty" json:"offset,omitempty"`
	Count  *bool   `form:"count,omitempty" json:"count,omitempty"`
	Sort   *string `form:"sort,omitempty" json:"sort,omitempty"`
}

GetISCSITargetExtentsParams defines parameters for GetISCSITargetExtents.

type GetISCSITargetsParams

type GetISCSITargetsParams struct {
	Limit  *int    `form:"limit,omitempty" json:"limit,omitempty"`
	Offset *int    `form:"offset,omitempty" json:"offset,omitempty"`
	Count  *bool   `form:"count,omitempty" json:"count,omitempty"`
	Sort   *string `form:"sort,omitempty" json:"sort,omitempty"`
}

GetISCSITargetsParams defines parameters for GetISCSITargets.

type GetPoolsParams

type GetPoolsParams struct {
	Limit  *int    `form:"limit,omitempty" json:"limit,omitempty"`
	Offset *int    `form:"offset,omitempty" json:"offset,omitempty"`
	Count  *bool   `form:"count,omitempty" json:"count,omitempty"`
	Sort   *string `form:"sort,omitempty" json:"sort,omitempty"`
}

GetPoolsParams defines parameters for GetPools.

type ISCSIExtent

type ISCSIExtent struct {
	Id             int     `json:"id"`
	Name           string  `json:"name"`
	Serial         string  `json:"serial"`
	Type           string  `json:"type"`
	Path           string  `json:"path"`
	Filesize       any     `json:"filesize"`
	Blocksize      uint64  `json:"blocksize"`
	PBlocksize     bool    `json:"pblocksize"`
	AvailThreshold *uint64 `json:"avail_threshold"`
	Comment        string  `json:"comment"`
	NAA            string  `json:"naa"`
	InsecureTPC    bool    `json:"insecure_tpc"`
	Xen            bool    `json:"xen"`
	RPM            string  `json:"rpm"`
	RO             bool    `json:"ro"`
	Enabled        bool    `json:"enabled"`
	Vendor         string  `json:"vendor"`
	Disk           string  `json:"disk"`
	Locked         bool    `json:"locked"`
}

ISCSIExtent defines model for ISCSIExtent.

{
  "id": 218,
  "name": "c28_disk_md4",
  "serial": "08002734c651217",
  "type": "DISK",
  "path": "zvol/osvcdata/c28_disk_md4",
  "filesize": "0",
  "blocksize": 512,
  "pblocksize": false,
  "avail_threshold": null,
  "comment": "",
  "naa": "0x6589cfc000000f487531b4688113d131",
  "insecure_tpc": true,
  "xen": false,
  "rpm": "SSD",
  "ro": false,
  "enabled": true,
  "vendor": "TrueNAS",
  "disk": "zvol/osvcdata/c28_disk_md4",
  "locked": false
}

type ISCSIExtents

type ISCSIExtents []ISCSIExtent

func (ISCSIExtents) GetById

func (t ISCSIExtents) GetById(s int) *ISCSIExtent

func (ISCSIExtents) GetByNAA

func (t ISCSIExtents) GetByNAA(naa string) *ISCSIExtent

GetByNAA returns the extent of a naa, written with or without its 0x prefix, as v2 accepts it.

func (ISCSIExtents) GetByName

func (t ISCSIExtents) GetByName(name string) *ISCSIExtent

func (ISCSIExtents) GetByPath

func (t ISCSIExtents) GetByPath(s string) *ISCSIExtent

func (ISCSIExtents) Names

func (t ISCSIExtents) Names() string

Names returns the extents as an error message names them.

func (ISCSIExtents) WithPath

func (t ISCSIExtents) WithPath(s string) ISCSIExtents

func (ISCSIExtents) WithType

func (t ISCSIExtents) WithType(s string) ISCSIExtents

func (ISCSIExtents) WithZvol

func (t ISCSIExtents) WithZvol(name string) ISCSIExtents

WithZvol returns the extents exporting a zvol.

type ISCSIExtentsResponse

type ISCSIExtentsResponse = []ISCSIExtent

ISCSIExtentsResponse defines model for ISCSIExtentsResponse.

type ISCSIInitiator

type ISCSIInitiator struct {
	Id         int      `json:"id"`
	Initiators []string `json:"initiators"`
	Comment    string   `json:"comment"`
}

ISCSIInitiator defines model for ISCSIInitiator.

{
    "id": 40,
    "initiators": [
        "iqn.2009-11.com.opensvc.srv:qau22c13n3.storage.initiator"
    ],
    "auth_network": [],
    "comment": ""
}

type ISCSIInitiators

type ISCSIInitiators []ISCSIInitiator

func (ISCSIInitiators) GetById

func (t ISCSIInitiators) GetById(id int) (ISCSIInitiator, bool)

func (ISCSIInitiators) WithName

func (t ISCSIInitiators) WithName(s string) ISCSIInitiators

type ISCSIPortal

type ISCSIPortal struct {
	Id                  int                   `json:"id,omitempty"`
	Comment             string                `json:"comment,omitempty"`
	DiscoveryAuthMethod string                `json:"discovery_authmethod,omitempty"`
	DiscoveryAuthGroup  int                   `json:"discovery_authgroup,omitempty"`
	Listen              []ISCSIPortalListenIp `json:"listen"`
}

type ISCSIPortalListenIp

type ISCSIPortalListenIp struct {
	Ip   string `json:"ip"`
	Port int    `json:"port"`
}

type ISCSITarget

type ISCSITarget struct {
	Id     int               `json:"id"`
	Name   string            `json:"name"`
	Alias  *string           `json:"alias,omitempty"`
	Mode   string            `json:"mode"`
	Groups ISCSITargetGroups `json:"groups"`
}

ISCSITarget defines model for ISCSITarget.

{
 "id": 79,
 "name": "iqn.2009-11.com.opensvc.srv:qau20c26n3.storage.target.1",
 "alias": null,
 "mode": "ISCSI",
 "groups": [
  {
   "portal": 1,
   "initiator": 43,
   "auth": null,
   "authmethod": "NONE"
  }
 ]
},

type ISCSITargetExtent

type ISCSITargetExtent struct {
	Id       int `json:"id"`
	LunId    int `json:"lunid"`
	ExtentId int `json:"extent"`
	TargetId int `json:"target"`
}

ISCSITargetExtent defines model for ISCSITargetExtent.

 {
    "id": 1463,
    "lunid": 42,
    "extent": 211,
    "target": 76
}

type ISCSITargetExtents

type ISCSITargetExtents []ISCSITargetExtent

func (ISCSITargetExtents) WithExtent

func (t ISCSITargetExtents) WithExtent(extent ISCSIExtent) ISCSITargetExtents

func (ISCSITargetExtents) WithTarget

func (t ISCSITargetExtents) WithTarget(target ISCSITarget) ISCSITargetExtents

type ISCSITargetGroup

type ISCSITargetGroup struct {
	PortalId    int     `json:"portal"`
	InitiatorId int     `json:"initiator"`
	Auth        *string `json:"auth"`
	AuthMethod  string  `json:"authmethod"`
}

type ISCSITargetGroups

type ISCSITargetGroups []ISCSITargetGroup

type ISCSITargets

type ISCSITargets []ISCSITarget

func (ISCSITargets) GetById

func (t ISCSITargets) GetById(id int) (ISCSITarget, bool)

func (ISCSITargets) GetByName

func (t ISCSITargets) GetByName(name string) (ISCSITarget, bool)

func (ISCSITargets) WithName

func (t ISCSITargets) WithName(s string) ISCSITargets

type ISCSITargetsResponse

type ISCSITargetsResponse = []ISCSITarget

ISCSITargetsResponse defines model for ISCSITargetsResponse.

type MapDiskOptions

type MapDiskOptions struct {
	Name     string
	Mappings []string
	LunId    *int
}

type Pool

type Pool struct {
	EncryptkeyPath *string `json:"encryptkey_path,omitempty"`
	Guid           *string `json:"guid,omitempty"`
	Healthy        *bool   `json:"healthy,omitempty"`
	Id             int     `json:"id"`
	IsDecrypted    *bool   `json:"is_decrypted,omitempty"`
	Name           string  `json:"name"`
	Path           string  `json:"path"`
	Status         *string `json:"status,omitempty"`
}

Pool defines model for Pool.

type PoolsResponse

type PoolsResponse = []Pool

PoolsResponse defines model for PoolsResponse.

type SystemInfo

type SystemInfo struct {
	Version              string     `json:"version"`                // "TrueNAS-13.0-U2"
	Hostname             string     `json:"hostname"`               //  "truenas.vdc.opensvc.com"
	PhysMem              uint64     `json:"physmem"`                // 4241022976
	Model                string     `json:"model"`                  // "Intel(R) Core(TM) i7-10710U CPU @ 1.10GHz"
	Cores                uint       `json:"cores"`                  // 2
	Uptime               string     `json:"uptime"`                 // "4 days, 4:59:17.134670"
	UptimeSeconds        float64    `json:"uptime_seconds"`         // 363557.134669586
	SystemSerial         string     `json:"system_serial"`          // "0",
	SystemProduct        string     `json:"system_product"`         // "VirtualBox"
	SystemProductVersion string     `json:"system_product_version"` // "1.2"
	Timezone             string     `json:"timezone"`               // "Europe/Paris"
	SystemManufacturer   string     `json:"system_manufacturer"`    // "innotek GmbH"
	LoadAvg              [3]float64 `json:"loadavg"`                // [0.32470703125, 0.39111328125, 0.3564453125]

}

SystemInfo defines model for GetSystemInfo

type UnmapDiskOptions

type UnmapDiskOptions struct {
	Name     string
	Mappings []string
}

type UpdateDatasetParams

type UpdateDatasetParams struct {
	Aclmode        *string `json:"aclmode,omitempty"`
	Atime          *string `json:"atime,omitempty"`
	Comments       *string `json:"comments,omitempty"`
	Compression    *string `json:"compression,omitempty"`
	Copies         *int    `json:"copies,omitempty"`
	Deduplication  *string `json:"deduplication,omitempty"`
	Exec           *string `json:"exec,omitempty"`
	ForceSize      *bool   `json:"force_size,omitempty"`
	Quota          *int64  `json:"quota,omitempty"`
	Readonly       *string `json:"readonly,omitempty"`
	Recordsize     *string `json:"recordsize,omitempty"`
	Refquota       *int64  `json:"refquota,omitempty"`
	Refreservation *int64  `json:"refreservation,omitempty"`
	Snapdir        *string `json:"snapdir,omitempty"`
	Sync           *string `json:"sync,omitempty"`
	Volsize        *int64  `json:"volsize,omitempty"`
}

UpdateDatasetParams defines model for UpdateDatasetParams.

type UpdateISCSITargetParams

type UpdateISCSITargetParams struct {
	Name   string            `json:"name"`
	Alias  string            `json:"alias,omitempty"`
	Mode   string            `json:"mode"`
	Groups ISCSITargetGroups `json:"groups,omitempty"`
}

UpdateISCSITargetParams defines model for UpdateISCSITargetParams.

Jump to

Keyboard shortcuts

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