ocifilestorage

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 44 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

OCI File Storage

Parity grade: B · SDK github.com/oracle/oci-go-sdk/v65@v65.126.2 · last audited 2026-11-01 (500a2a6aa)

Coverage

Metric Value
PARITY entries audited 74 (69 ok, 5 partial)
Feature families 7 (3 ok, 4 partial)
Known gaps 3
Deferred items 0
Resource leaks unknown
Known gaps
  • identitySquash, anonymousUid/anonymousGid, isAnonymousAccessAllowed and Kerberos or LDAP id mapping are stored and validated but not applied: go-nfs v0.0.4 passes the Handler and billy file system no RPC credentials (conn.go:116-125 calls the procedure with only the connection context), so every request runs as the emulator's user and new files are owned by it; chown/chmod act as the emulator's user. allowedAuth is applied at mount (an export that lists auth types without SYS refuses the mount).
  • No portmapper or NLM: go-nfs v0.0.4 implements neither (no program 100000 or 100021 in the module), and a portmapper must listen on port 111 of the mount target address, which the emulator cannot bind unprivileged. Clients mount with explicit port and mountport (mount -o port=N,mountport=N,nolock,tcp). The mount target's private IP lives in OCI Core only.
  • IAM policy enforcement is not modelled (out of scope).

More

Documentation

Index

Constants

View Source
const (
	EngineStub = "stub"
	EngineNFS  = "nfs"
)

Engine modes (--oci-filestorage-engine).

View Source
const DefaultPort = 8171

DefaultPort is the dedicated control-plane listener's default TCP port.

View Source
const (
	// Region is the fixed region key baked into emulated OCIDs.
	Region = "iad"
)

Variables

View Source
var ErrNilAppContext = errors.New("ocifilestorage: nil app context")

ErrNilAppContext is returned when Init is called with a nil AppContext.

View Source
var ErrNullEntry = errors.New("ocifilestorage: null entry in snapshot")

ErrNullEntry is returned when a persisted snapshot contains a null entry.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Code    string
	Message string
	Status  int
}

APIError is an OCI error response: HTTP status plus the `code` and `message` body fields.

func (*APIError) Error

func (e *APIError) Error() string

type ConfigProvider

type ConfigProvider interface {
	GetOCIFileStorageSettings() Settings
}

ConfigProvider extracts OCI File Storage configuration from the AppContext Config.

type Connector

type Connector struct {
	PasswordSecretVersion           *int       `json:"passwordSecretVersion,omitempty"`
	TrustedCertificateSecretVersion *int       `json:"trustedCertificateSecretVersion,omitempty"`
	CompartmentID                   string     `json:"compartmentId"`
	DisplayName                     string     `json:"displayName"`
	AvailabilityDomain              string     `json:"availabilityDomain"`
	ConnectorType                   string     `json:"connectorType"`
	BindDistinguishedName           string     `json:"bindDistinguishedName"`
	PasswordSecretID                string     `json:"passwordSecretId"`
	TrustedCertificateSecretID      string     `json:"trustedCertificateSecretId,omitempty"`
	Endpoints                       []endpoint `json:"endpoints"`
	// contains filtered or unexported fields
}

Connector is the stored and wire form of an LDAPBIND outbound connector.

type CreateMountTargetIn

type CreateMountTargetIn = createMTIn

CreateMountTargetIn is the CreateMountTarget request body.

type EngineConfigProvider

type EngineConfigProvider interface {
	GetOCIFileStorageEngine() string
}

EngineConfigProvider exposes the effective engine mode (stub or nfs).

type Export

type Export struct {
	IsIdmapGroupsForSysAuth *bool           `json:"isIdmapGroupsForSysAuth,omitempty"`
	ExportSetID             string          `json:"exportSetId"`
	FileSystemID            string          `json:"fileSystemId"`
	Path                    string          `json:"path"`
	ExportOptions           []clientOptions `json:"exportOptions"`
	// contains filtered or unexported fields
}

Export is the stored and wire form of an export.

type ExportFilter

type ExportFilter struct {
	Compartment, ExportSet, FileSystem, State, ID string
}

ExportFilter selects exports in a list.

type ExportMount

type ExportMount struct {
	// Quotas returns the enforced quota rules of the file system; nil when quotas are not in force.
	Quotas         func() []QuotaLimit
	ExportID       string
	Path           string
	FileSystemID   string
	Options        []clientOptions
	MaxFsStatBytes int64
	MaxFsStatFiles int64
	ForceRO        bool
}

ExportMount describes one export served by a mount target.

type ExportSet

type ExportSet struct {
	Int                *esInt `json:"_int,omitempty"`
	MaxFsStatBytes     *int64 `json:"maxFsStatBytes,omitempty"`
	MaxFsStatFiles     *int64 `json:"maxFsStatFiles,omitempty"`
	CompartmentID      string `json:"compartmentId"`
	DisplayName        string `json:"displayName"`
	VcnID              string `json:"vcnId"`
	AvailabilityDomain string `json:"availabilityDomain"`
	// contains filtered or unexported fields
}

ExportSet is the stored and wire form of an export set.

type FSFilter

type FSFilter struct {
	Compartment, AD, State, DisplayName, ID, SourceSnapshot, Parent, Policy string
}

FSFilter selects file systems in a list.

type FileSystem

type FileSystem struct {
	IsHydrated                       *bool          `json:"isHydrated,omitempty"`
	Int                              *fsInt         `json:"_int,omitempty"`
	SourceDetails                    *sourceDetails `json:"sourceDetails,omitempty"`
	ReplicationTargetID              string         `json:"replicationTargetId,omitempty"`
	QuotaEnforcementState            string         `json:"quotaEnforcementState,omitempty"`
	DisplayName                      string         `json:"displayName"`
	AvailabilityDomain               string         `json:"availabilityDomain"`
	KmsKeyID                         string         `json:"kmsKeyId,omitempty"`
	CloneAttachStatus                string         `json:"cloneAttachStatus,omitempty"`
	LifecycleDetails                 string         `json:"lifecycleDetails"`
	CompartmentQuotaEnforcementState string         `json:"compartmentQuotaEnforcementState,omitempty"`
	FilesystemSnapshotPolicyID       string         `json:"filesystemSnapshotPolicyId,omitempty"`
	CompartmentID                    string         `json:"compartmentId"`

	MeteredBytes           int64 `json:"meteredBytes"`
	CloneCount             int   `json:"cloneCount"`
	ReplicationSourceCount int   `json:"replicationSourceCount"`
	IsCloneParent          bool  `json:"isCloneParent"`
	IsTargetable           bool  `json:"isTargetable"`
	AreQuotaRulesEnabled   bool  `json:"areQuotaRulesEnabled"`
	// contains filtered or unexported fields
}

FileSystem is the stored and wire form of a file system.

type Handler

type Handler struct {
	Backend *InMemoryBackend

	Port        int
	EnforceAuth bool
	// contains filtered or unexported fields
}

Handler serves OCI File Storage on its own listener.

func NewHandler

func NewHandler(backend *InMemoryBackend) *Handler

NewHandler creates a Handler; callers override Port and EnforceAuth from Settings.

func (*Handler) ExtractOperation

func (h *Handler) ExtractOperation(c *echo.Context) string

ExtractOperation returns the operation name for metrics.

func (*Handler) ExtractResource

func (h *Handler) ExtractResource(c *echo.Context) string

ExtractResource returns the addressed resource id for metrics.

func (*Handler) GetSupportedOperations

func (h *Handler) GetSupportedOperations() []string

GetSupportedOperations lists the supported operations.

func (*Handler) Handler

func (h *Handler) Handler() echo.HandlerFunc

Handler returns the Echo handler for all OCIFileStorage requests.

func (*Handler) MatchPriority

func (h *Handler) MatchPriority() int

MatchPriority is irrelevant because RouteMatcher never matches.

func (*Handler) Name

func (h *Handler) Name() string

Name returns the service name.

func (*Handler) Reset

func (h *Handler) Reset()

Reset clears all in-memory state.

func (*Handler) RouteMatcher

func (h *Handler) RouteMatcher() service.Matcher

RouteMatcher never matches: OCIFileStorage runs on its own listener.

func (*Handler) Shutdown

func (h *Handler) Shutdown(ctx context.Context)

Shutdown stops the listener and the sweeper.

func (*Handler) StartWorker

func (h *Handler) StartWorker(ctx context.Context) error

StartWorker binds the dedicated listener synchronously so a port conflict is returned to the caller.

func (*Handler) Trusted

func (h *Handler) Trusted() echo.HandlerFunc

Trusted returns a handler that skips request-signature verification, for the in-process dashboard proxy.

type InMemoryBackend

type InMemoryBackend struct {
	Auth *ociauth.Registry
	// contains filtered or unexported fields
}

InMemoryBackend holds every File Storage resource under one lock.

func NewInMemoryBackend

func NewInMemoryBackend() *InMemoryBackend

NewInMemoryBackend creates an empty backend running in stub mode.

func (*InMemoryBackend) CancelDowngradeShape

func (b *InMemoryBackend) CancelDowngradeShape(id, ifMatch string) (MountTarget, string, error)

CancelDowngradeShape cancels a scheduled throughput reduction.

func (*InMemoryBackend) ChangeConnectorCompartment

func (b *InMemoryBackend) ChangeConnectorCompartment(id, ifMatch, compartment string) error

ChangeConnectorCompartment moves an outbound connector.

func (*InMemoryBackend) ChangeFileSystemCompartment

func (b *InMemoryBackend) ChangeFileSystemCompartment(id, ifMatch, compartment string) error

ChangeFileSystemCompartment moves a file system to another compartment.

func (*InMemoryBackend) ChangeMountTargetCompartment

func (b *InMemoryBackend) ChangeMountTargetCompartment(id, ifMatch, compartment string) error

ChangeMountTargetCompartment moves a mount target and its export set.

func (*InMemoryBackend) ChangePolicyCompartment

func (b *InMemoryBackend) ChangePolicyCompartment(id, ifMatch, compartment string) error

ChangePolicyCompartment moves a snapshot policy.

func (*InMemoryBackend) ChangeReplicationCompartment

func (b *InMemoryBackend) ChangeReplicationCompartment(id, ifMatch, compartment string) error

ChangeReplicationCompartment moves a replication.

func (*InMemoryBackend) Close

func (b *InMemoryBackend) Close()

Close stops the data plane.

func (*InMemoryBackend) Compartments

func (b *InMemoryBackend) Compartments() []string

Compartments lists the distinct compartments that hold File Storage resources.

func (*InMemoryBackend) CreateConnector

func (b *InMemoryBackend) CreateConnector(in createConnectorIn, token string) (Connector, string, error)

func (*InMemoryBackend) CreateExport

func (b *InMemoryBackend) CreateExport(in createExportIn, token string) (Export, string, error)

CreateExport exports a file system through an export set.

func (*InMemoryBackend) CreateFileSystem

func (b *InMemoryBackend) CreateFileSystem(in createFSIn, token string) (FileSystem, string, error)

CreateFileSystem creates a file system, optionally cloned from a snapshot.

func (*InMemoryBackend) CreateMountTarget

func (b *InMemoryBackend) CreateMountTarget(in createMTIn, token string) (MountTarget, string, error)

CreateMountTarget creates a mount target, its VNIC and its export set.

func (*InMemoryBackend) CreatePolicy

func (b *InMemoryBackend) CreatePolicy(in createPolicyIn, token string) (Policy, string, error)

CreatePolicy creates a file system snapshot policy.

func (*InMemoryBackend) CreateQuotaRule

func (b *InMemoryBackend) CreateQuotaRule(fsID string, in createQuotaIn) (map[string]any, string, error)

func (*InMemoryBackend) CreateReplication

func (b *InMemoryBackend) CreateReplication(in createReplicationIn, token string) (Replication, string, error)

CreateReplication replicates a file system into an unused target file system.

func (*InMemoryBackend) CreateSnapshot

func (b *InMemoryBackend) CreateSnapshot(in createSnapshotIn, token string) (Snapshot, string, error)

CreateSnapshot takes a user snapshot of a file system.

func (*InMemoryBackend) DeleteConnector

func (b *InMemoryBackend) DeleteConnector(id, ifMatch string, override bool) error

DeleteConnector deletes a connector that no mount target uses.

func (*InMemoryBackend) DeleteExport

func (b *InMemoryBackend) DeleteExport(id, ifMatch string, override bool) error

DeleteExport deletes an export; the file system keeps its data.

func (*InMemoryBackend) DeleteFileSystem

func (b *InMemoryBackend) DeleteFileSystem(id, ifMatch string, override, detachChildren bool) error

DeleteFileSystem deletes a file system together with its snapshots.

func (*InMemoryBackend) DeleteMountTarget

func (b *InMemoryBackend) DeleteMountTarget(id, ifMatch string, override bool) error

DeleteMountTarget deletes a mount target with its export set, exports and VNIC.

func (*InMemoryBackend) DeletePolicy

func (b *InMemoryBackend) DeletePolicy(id, ifMatch string, override bool) error

DeletePolicy deletes a policy and detaches it from the file systems that use it.

func (*InMemoryBackend) DeleteQuotaRule

func (b *InMemoryBackend) DeleteQuotaRule(fsID, id, ifMatch string) error

DeleteQuotaRule removes a quota rule.

func (*InMemoryBackend) DeleteReplication

func (b *InMemoryBackend) DeleteReplication(id, ifMatch, mode string, override bool) error

DeleteReplication deletes a replication according to the delete mode.

func (*InMemoryBackend) DeleteReplicationTarget

func (b *InMemoryBackend) DeleteReplicationTarget(id, ifMatch string) error

DeleteReplicationTarget deletes a replication target whose replication is gone.

func (*InMemoryBackend) DeleteSnapshot

func (b *InMemoryBackend) DeleteSnapshot(id, ifMatch string, override bool) error

DeleteSnapshot deletes a snapshot unless it is locked.

func (*InMemoryBackend) DetachClone

func (b *InMemoryBackend) DetachClone(id, ifMatch string) error

DetachClone detaches a clone from its parent.

func (*InMemoryBackend) EstimateReplication

func (b *InMemoryBackend) EstimateReplication(id string, rate *int) (ReplicationEstimate, error)

EstimateReplication estimates the base copy time of a file system from its metered size.

func (*InMemoryBackend) GetConnector

func (b *InMemoryBackend) GetConnector(id string) (Connector, string, error)

GetConnector returns one outbound connector.

func (*InMemoryBackend) GetExport

func (b *InMemoryBackend) GetExport(id string) (Export, string, error)

GetExport returns one export.

func (*InMemoryBackend) GetExportSet

func (b *InMemoryBackend) GetExportSet(id string) (ExportSet, string, error)

GetExportSet returns one export set.

func (*InMemoryBackend) GetFileSystem

func (b *InMemoryBackend) GetFileSystem(id string) (FileSystem, string, error)

GetFileSystem returns one file system.

func (*InMemoryBackend) GetMountTarget

func (b *InMemoryBackend) GetMountTarget(id string) (MountTarget, string, error)

GetMountTarget returns one mount target.

func (*InMemoryBackend) GetPolicy

func (b *InMemoryBackend) GetPolicy(id string) (Policy, string, error)

GetPolicy returns one snapshot policy.

func (*InMemoryBackend) GetQuotaRule

func (b *InMemoryBackend) GetQuotaRule(fsID, id string) (map[string]any, string, error)

GetQuotaRule returns one quota rule.

func (*InMemoryBackend) GetReplication

func (b *InMemoryBackend) GetReplication(id string) (Replication, string, error)

GetReplication returns one replication.

func (*InMemoryBackend) GetReplicationTarget

func (b *InMemoryBackend) GetReplicationTarget(id string) (ReplicationTarget, string, error)

GetReplicationTarget returns one replication target.

func (*InMemoryBackend) GetSnapshot

func (b *InMemoryBackend) GetSnapshot(id string) (Snapshot, string, error)

GetSnapshot returns one snapshot.

func (*InMemoryBackend) ListConnectors

func (b *InMemoryBackend) ListConnectors(f MTFilter, o ListOpts) (page.Page[map[string]any], error)

ListConnectors lists outbound connectors of a compartment and availability domain.

func (*InMemoryBackend) ListExportSets

func (b *InMemoryBackend) ListExportSets(f MTFilter, o ListOpts) (page.Page[map[string]any], error)

ListExportSets lists export sets of a compartment and availability domain.

func (*InMemoryBackend) ListExports

func (b *InMemoryBackend) ListExports(f ExportFilter, o ListOpts) (page.Page[map[string]any], error)

ListExports lists exports by compartment, export set or file system.

func (*InMemoryBackend) ListFileSystems

func (b *InMemoryBackend) ListFileSystems(f FSFilter, o ListOpts) (page.Page[map[string]any], error)

ListFileSystems lists the file systems of a compartment and availability domain.

func (*InMemoryBackend) ListMountTargets

func (b *InMemoryBackend) ListMountTargets(f MTFilter, o ListOpts) (page.Page[map[string]any], error)

ListMountTargets lists mount targets of a compartment and availability domain.

func (*InMemoryBackend) ListPolicies

func (b *InMemoryBackend) ListPolicies(f PolicyFilter, o ListOpts) (page.Page[map[string]any], error)

ListPolicies lists snapshot policies of a compartment and availability domain.

func (*InMemoryBackend) ListQuotaRules

func (b *InMemoryBackend) ListQuotaRules(fsID string, f QuotaFilter, o ListOpts) (page.Page[map[string]any], error)

ListQuotaRules lists the usage and quota rule of each principal of a file system. Usage comes from the owner of each file on the data plane, so principals appear only once they own data; without a data plane usage is 0.

func (*InMemoryBackend) ListReplicationTargets

func (b *InMemoryBackend) ListReplicationTargets(f MTFilter, o ListOpts) (page.Page[map[string]any], error)

ListReplicationTargets lists replication targets of a compartment and availability domain.

func (*InMemoryBackend) ListReplications

func (b *InMemoryBackend) ListReplications(f ReplicationFilter, o ListOpts) (page.Page[map[string]any], error)

ListReplications lists replications of a compartment and availability domain.

func (*InMemoryBackend) ListSnapshots

func (b *InMemoryBackend) ListSnapshots(f SnapshotFilter, o ListOpts) (page.Page[map[string]any], error)

ListSnapshots lists snapshots of a file system or snapshot policy.

func (*InMemoryBackend) NFSEnabled

func (b *InMemoryBackend) NFSEnabled() bool

NFSEnabled reports whether the NFS data plane is running.

func (*InMemoryBackend) NFSEndpoints

func (b *InMemoryBackend) NFSEndpoints() map[string]string

NFSEndpoints maps each mount target id to the loopback host:port its NFS server listens on.

func (*InMemoryBackend) Reset

func (b *InMemoryBackend) Reset()

Reset clears all state, mount target servers and file system data.

func (*InMemoryBackend) Restore

func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error

Restore loads backend state and restarts the NFS server of every ACTIVE mount target.

func (*InMemoryBackend) ScheduleDowngradeShape

func (b *InMemoryBackend) ScheduleDowngradeShape(id, ifMatch string, in throughputIn) (MountTarget, string, error)

ScheduleDowngradeShape schedules a throughput reduction for the end of the billing cycle.

func (*InMemoryBackend) SetClock

func (b *InMemoryBackend) SetClock(now func() time.Time)

SetClock injects the time source used for lifecycle transitions.

func (*InMemoryBackend) SetCloser

func (b *InMemoryBackend) SetCloser(fn func())

SetCloser registers fn to run when the backend closes.

func (*InMemoryBackend) SetCompartmentChecker

func (b *InMemoryBackend) SetCompartmentChecker(fn func(string) bool)

SetCompartmentChecker validates compartmentId arguments against another service (OCI Identity).

func (*InMemoryBackend) SetDataPlane

func (b *InMemoryBackend) SetDataPlane(dp dataPlane)

SetDataPlane enables the NFS data plane.

func (*InMemoryBackend) SetKeyChecker

func (b *InMemoryBackend) SetKeyChecker(fn func(keyID string) (string, bool))

SetKeyChecker makes kmsKeyId validated against OCI Vault: fn returns the key's lifecycle state.

func (*InMemoryBackend) SetNetwork

func (b *InMemoryBackend) SetNetwork(n Network)

SetNetwork wires subnet validation and VNIC provisioning from OCI Core.

func (*InMemoryBackend) SetPolicyPaused

func (b *InMemoryBackend) SetPolicyPaused(id, ifMatch string, pause bool) (Policy, string, error)

SetPolicyPaused pauses (INACTIVE) or resumes (ACTIVE) a policy.

func (*InMemoryBackend) SetQuotaUnit

func (b *InMemoryBackend) SetQuotaUnit(bytes int64)

SetQuotaUnit overrides the number of bytes in one quota gigabyte.

func (*InMemoryBackend) SetSecretLookup

func (b *InMemoryBackend) SetSecretLookup(fn SecretFunc)

SetSecretLookup wires Kerberos keytab and LDAP password secret validation from OCI Vault.

func (*InMemoryBackend) SetTransition

func (b *InMemoryBackend) SetTransition(d time.Duration)

SetTransition sets how long asynchronous lifecycle changes take to complete.

func (*InMemoryBackend) Snapshot

func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte

Snapshot serialises the backend state, including registered API keys. File data and the NFS listeners are not part of it: data lives in the data directory.

func (*InMemoryBackend) Sweep

func (b *InMemoryBackend) Sweep()

Sweep applies due time-based transitions and schedules against the backend clock.

func (*InMemoryBackend) ToggleQuotaRules

func (b *InMemoryBackend) ToggleQuotaRules(id, ifMatch string, in toggleQuotaIn) error

ToggleQuotaRules enables or disables quota enforcement on a file system.

func (*InMemoryBackend) UpdateConnector

func (b *InMemoryBackend) UpdateConnector(
	id, ifMatch string,
	override bool,
	in updateConnectorIn,
) (Connector, string, error)

UpdateConnector changes a connector's name and tags.

func (*InMemoryBackend) UpdateExport

func (b *InMemoryBackend) UpdateExport(id, ifMatch string, override bool, in updateExportIn) (Export, string, error)

UpdateExport replaces an export's client options.

func (*InMemoryBackend) UpdateExportSet

func (b *InMemoryBackend) UpdateExportSet(id, ifMatch string, in updateSetIn) (ExportSet, string, error)

UpdateExportSet changes an export set's name and FSSTAT limits.

func (*InMemoryBackend) UpdateFileSystem

func (b *InMemoryBackend) UpdateFileSystem(
	id, ifMatch string,
	override bool,
	in updateFSIn,
) (FileSystem, string, error)

UpdateFileSystem changes a file system's name, tags, key or snapshot policy.

func (*InMemoryBackend) UpdateMountTarget

func (b *InMemoryBackend) UpdateMountTarget(
	id, ifMatch string,
	override bool,
	in updateMTIn,
) (MountTarget, string, error)

UpdateMountTarget changes a mount target.

func (*InMemoryBackend) UpdatePolicy

func (b *InMemoryBackend) UpdatePolicy(id, ifMatch string, in updatePolicyIn) (Policy, string, error)

UpdatePolicy changes a snapshot policy.

func (*InMemoryBackend) UpdateQuotaRule

func (b *InMemoryBackend) UpdateQuotaRule(fsID, id, ifMatch string, in updateQuotaIn) (map[string]any, string, error)

UpdateQuotaRule changes a quota rule's name and limit.

func (*InMemoryBackend) UpdateReplication

func (b *InMemoryBackend) UpdateReplication(
	id, ifMatch string,
	override bool,
	in updateReplicationIn,
) (Replication, string, error)

UpdateReplication changes a replication's name, interval and tags.

func (*InMemoryBackend) UpdateSnapshot

func (b *InMemoryBackend) UpdateSnapshot(id, ifMatch string, in updateSnapshotIn) (Snapshot, string, error)

UpdateSnapshot changes a snapshot's tags, expiration or lock duration.

func (*InMemoryBackend) UpgradeShape

func (b *InMemoryBackend) UpgradeShape(id, ifMatch string, in throughputIn) (MountTarget, string, error)

UpgradeShape raises the requested throughput of a mount target.

func (*InMemoryBackend) ValidateKeyTabs

func (b *InMemoryBackend) ValidateKeyTabs(in validateKeyTabsIn) (KeytabValidation, error)

ValidateKeyTabs parses the keytab secret and reports its principals.

type KeytabValidation

type KeytabValidation struct {
	Current []keytabEntry `json:"currentKerberosKeytabEntries"`
	Backup  []keytabEntry `json:"backupKerberosKeytabEntries,omitempty"`
}

KeytabValidation is the ValidateKeyTabs result.

type ListOpts

type ListOpts struct {
	SortBy string
	Order  string
	Page   string
	Limit  int
}

ListOpts carries the shared list query parameters.

type MTFilter

type MTFilter struct {
	Compartment, AD, State, DisplayName, ID, ExportSet string
}

MTFilter selects mount targets and export sets in a list.

type MountTarget

type MountTarget struct {
	Int *mtInt `json:"_int,omitempty"`

	LdapIdmap           *ldapIdmap                `json:"ldapIdmap,omitempty"`
	Kerberos            *kerberos                 `json:"kerberos,omitempty"`
	TimeBillingCycleEnd *time.Time                `json:"timeBillingCycleEnd,omitempty"`
	SecurityAttributes  map[string]map[string]any `json:"securityAttributes,omitempty"`
	CompartmentID       string                    `json:"compartmentId"`
	DisplayName         string                    `json:"displayName"`
	LifecycleDetails    string                    `json:"lifecycleDetails"`
	SubnetID            string                    `json:"subnetId"`
	AvailabilityDomain  string                    `json:"availabilityDomain"`
	ExportSetID         string                    `json:"exportSetId,omitempty"`
	IdmapType           string                    `json:"idmapType,omitempty"`
	PrivateIPIDs        []string                  `json:"privateIpIds"`
	MountTargetIpv6IDs  []string                  `json:"mountTargetIpv6Ids,omitempty"`
	NsgIDs              []string                  `json:"nsgIds"`
	ObservedThroughput  int64                     `json:"observedThroughput"`
	RequestedThroughput int64                     `json:"requestedThroughput"`
	ReservedStorage     int64                     `json:"reservedStorageCapacity"`
	// contains filtered or unexported fields
}

MountTarget is the stored and wire form of a mount target.

type NFSConfig

type NFSConfig struct {
	Ports *portalloc.Allocator
	// Dir holds file system data; empty creates a temporary directory removed on Close.
	Dir string
}

NFSConfig configures the NFS data plane.

type NFSPlane

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

NFSPlane keeps one directory per file system and serves each mount target's exports over NFSv3 on a loopback port.

func NewNFSPlane

func NewNFSPlane(cfg NFSConfig) (*NFSPlane, error)

NewNFSPlane prepares the data directory.

func (*NFSPlane) CloneFrom

func (p *NFSPlane) CloneFrom(ctx context.Context, srcFS, snapshot, dstFS string) error

CloneFrom populates dstFS from a snapshot of srcFS.

func (*NFSPlane) Close

func (p *NFSPlane) Close()

Close stops every server; a temporary data directory is removed.

func (*NFSPlane) CreateFS

func (p *NFSPlane) CreateFS(id string) error

CreateFS creates the empty directories of a file system; existing data is kept.

func (*NFSPlane) DropSnapshot

func (p *NFSPlane) DropSnapshot(fsID, name string)

DropSnapshot removes a snapshot copy.

func (*NFSPlane) Endpoints

func (p *NFSPlane) Endpoints() map[string]string

Endpoints maps mount target ids to their listen addresses.

func (*NFSPlane) QuotaUsage

func (p *NFSPlane) QuotaUsage(id string) QuotaUsage

QuotaUsage measures a file system's logical size by file owner.

func (*NFSPlane) RemoveFS

func (p *NFSPlane) RemoveFS(id string)

RemoveFS deletes a file system's data and snapshots.

func (*NFSPlane) ReplicateSnapshot

func (p *NFSPlane) ReplicateSnapshot(ctx context.Context, srcFS, snapshot, dstFS string) (int64, error)

ReplicateSnapshot brings dstFS in line with a snapshot of srcFS, transferring only what changed. It returns the bytes transferred.

func (*NFSPlane) Reset

func (p *NFSPlane) Reset()

Reset stops every server and deletes all data.

func (*NFSPlane) SnapshotExclusiveBytes

func (p *NFSPlane) SnapshotExclusiveBytes(id, name string) int64

SnapshotExclusiveBytes returns the bytes only the named snapshot references.

func (*NFSPlane) StartMount

func (p *NFSPlane) StartMount(mtID string, exports func(string) []ExportMount) error

StartMount starts the NFS server of a mount target; a running one is left alone.

func (*NFSPlane) StopMount

func (p *NFSPlane) StopMount(mtID string)

StopMount stops a mount target's NFS server.

func (*NFSPlane) StopMounts

func (p *NFSPlane) StopMounts()

StopMounts stops every NFS server but keeps the data.

func (*NFSPlane) TakeSnapshot

func (p *NFSPlane) TakeSnapshot(ctx context.Context, fsID, name string) error

TakeSnapshot copies the file system tree into its snapshot area while writes are held off.

func (*NFSPlane) Usage

func (p *NFSPlane) Usage(id string) int64

Usage returns the metered bytes of a file system: its live data plus the data only snapshots still reference.

type Network

type Network struct {
	Subnet    func(id string) (SubnetInfo, bool)
	CreateNic func(NicRequest) (Nic, error)
	DeleteNic func(vnicID string)
}

Network is the in-process view of OCI Core that mount targets depend on.

type Nic

type Nic struct {
	VnicID      string
	PrivateIPID string
	IPAddress   string
}

Nic is the VNIC and primary private IP that back a mount target.

type NicRequest

type NicRequest struct {
	CompartmentID string
	AD            string
	SubnetID      string
	DisplayName   string
	Hostname      string
	IPAddress     string
	NsgIDs        []string
}

NicRequest asks the network service for a VNIC on behalf of a mount target.

type Policy

type Policy struct {
	Int *polInt `json:"_int,omitempty"`

	CompartmentID      string     `json:"compartmentId"`
	AvailabilityDomain string     `json:"availabilityDomain"`
	DisplayName        string     `json:"displayName"`
	PolicyPrefix       string     `json:"policyPrefix,omitempty"`
	Schedules          []schedule `json:"schedules"`
	// contains filtered or unexported fields
}

Policy is the stored and wire form of a file system snapshot policy.

type PolicyFilter

type PolicyFilter = MTFilter

PolicyFilter selects snapshot policies in a list.

type Provider

type Provider struct{}

Provider implements service.Provider for OCI File Storage. It runs on its own listener (see Handler.StartWorker) and never matches on the shared AWS router.

func (*Provider) Init

Init creates the backend and handler; the port is bound in StartWorker.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the service provider name.

type QuotaFilter

type QuotaFilter struct {
	PrincipalID *int
	Type        string
	Violators   bool
}

QuotaFilter selects quota rules in a list.

type QuotaLimit

type QuotaLimit struct {
	PrincipalID *int
	Type        string
	LimitBytes  int64
	Hard        bool
}

QuotaLimit is one quota rule of an enabled file system, with its limit in bytes.

type QuotaRule

type QuotaRule struct {
	TimeUpdated   time.Time `json:"timeUpdated"`
	PrincipalID   *int      `json:"principalId,omitempty"`
	FileSystemID  string    `json:"fileSystemId"`
	DisplayName   string    `json:"displayName"`
	PrincipalType string    `json:"principalType"`

	QuotaLimitGB int  `json:"quotaLimitInGigabytes"`
	IsHardQuota  bool `json:"isHardQuota"`
	// contains filtered or unexported fields
}

QuotaRule is the stored and wire form of a quota rule.

type QuotaUsage

type QuotaUsage struct {
	Users  map[int]int64
	Groups map[int]int64
	Total  int64
}

QuotaUsage is the logical size of a file system tree, in total and by owner uid and gid.

type Replication

type Replication struct {
	DeltaProgress       *int64     `json:"deltaProgress,omitempty"`
	Int                 *repInt    `json:"_int,omitempty"`
	RecoveryPointTime   *time.Time `json:"recoveryPointTime,omitempty"`
	SourceID            string     `json:"sourceId"`
	CompartmentID       string     `json:"compartmentId"`
	DisplayName         string     `json:"displayName"`
	TargetID            string     `json:"targetId"`
	ReplicationTargetID string     `json:"replicationTargetId"`
	AvailabilityDomain  string     `json:"availabilityDomain"`
	LastSnapshotID      string     `json:"lastSnapshotId,omitempty"`
	DeltaStatus         string     `json:"deltaStatus,omitempty"`
	LifecycleDetails    string     `json:"lifecycleDetails"`

	ReplicationInterval int64 `json:"replicationInterval"`
	// contains filtered or unexported fields
}

Replication is the stored and wire form of a replication.

type ReplicationEstimate

type ReplicationEstimate struct {
	AllowedTargetRegions              []string `json:"allowedTargetRegions"`
	ChangeRateInMBps                  int      `json:"changeRateInMBps"`
	MinimumSupportedIntervalInMinutes int      `json:"minimumSupportedIntervalInMinutes"`
	EstimatedBaseCopyTimeInMinutes    int      `json:"estimatedBaseCopyTimeInMinutes"`
	IsReplicationSupported            bool     `json:"isReplicationSupported"`
}

ReplicationEstimate is the EstimateReplication result.

type ReplicationFilter

type ReplicationFilter struct {
	MTFilter
	FileSystem string
}

ReplicationFilter selects replications and replication targets in a list.

type ReplicationTarget

type ReplicationTarget struct {
	RecoveryPointTime  *time.Time `json:"recoveryPointTime,omitempty"`
	DeltaProgress      *int64     `json:"deltaProgress,omitempty"`
	CompartmentID      string     `json:"compartmentId"`
	DisplayName        string     `json:"displayName"`
	SourceID           string     `json:"sourceId"`
	TargetID           string     `json:"targetId"`
	ReplicationID      string     `json:"replicationId"`
	AvailabilityDomain string     `json:"availabilityDomain"`
	LastSnapshotID     string     `json:"lastSnapshotId,omitempty"`
	DeltaStatus        string     `json:"deltaStatus,omitempty"`
	LifecycleDetails   string     `json:"lifecycleDetails"`
	// contains filtered or unexported fields
}

ReplicationTarget is the stored and wire form of a replication target.

type SecretFunc

type SecretFunc func(id string, version *int) ([]byte, bool)

SecretFunc returns the content of a vault secret version (nil version means current).

type Settings

type Settings struct {
	Engine string `` //nolint:lll // config struct tags are intentionally verbose
	/* 278-byte string literal not displayed */
	DataDir string `` //nolint:lll // config struct tags are intentionally verbose
	/* 197-byte string literal not displayed */
	Port int `` //nolint:lll // config struct tags are intentionally verbose
	/* 205-byte string literal not displayed */
	EnforceAuth bool `` //nolint:lll // config struct tags are intentionally verbose
	/* 241-byte string literal not displayed */
}

Settings holds service-level configuration, embedded in the root CLI as CLI.OCIFileStorage.

func DefaultSettings

func DefaultSettings() Settings

DefaultSettings returns the settings used when no ConfigProvider is available.

type Snapshot

type Snapshot struct {
	SnapshotTime               time.Time     `json:"snapshotTime"`
	LockDurationDetails        *lockDuration `json:"lockDurationDetails,omitempty"`
	ExpirationTime             *time.Time    `json:"expirationTime,omitempty"`
	TimeLocked                 *time.Time    `json:"timeLocked,omitempty"`
	Name                       string        `json:"name"`
	FileSystemID               string        `json:"fileSystemId"`
	SnapshotType               string        `json:"snapshotType"`
	ProvenanceID               string        `json:"provenanceId"`
	LifecycleDetails           string        `json:"lifecycleDetails"`
	FilesystemSnapshotPolicyID string        `json:"filesystemSnapshotPolicyId,omitempty"`

	ExclusiveBytes int64 `json:"exclusiveBytes"`
	IsCloneSource  bool  `json:"isCloneSource"`
	// contains filtered or unexported fields
}

Snapshot is the stored and wire form of a snapshot.

type SnapshotFilter

type SnapshotFilter struct {
	FileSystem, Policy, Compartment, State, ID string
}

SnapshotFilter selects snapshots in a list.

type SubnetInfo

type SubnetInfo struct {
	VcnID         string
	CIDR          string
	AD            string
	CompartmentID string
}

SubnetInfo describes a subnet known to OCI Core.

Jump to

Keyboard shortcuts

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