Documentation
¶
Index ¶
- Constants
- Variables
- type APIError
- type ConfigProvider
- type Connector
- type CreateMountTargetIn
- type EngineConfigProvider
- type Export
- type ExportFilter
- type ExportMount
- type ExportSet
- type FSFilter
- type FileSystem
- type Handler
- func (h *Handler) ExtractOperation(c *echo.Context) string
- func (h *Handler) ExtractResource(c *echo.Context) string
- func (h *Handler) GetSupportedOperations() []string
- func (h *Handler) Handler() echo.HandlerFunc
- func (h *Handler) MatchPriority() int
- func (h *Handler) Name() string
- func (h *Handler) Reset()
- func (h *Handler) RouteMatcher() service.Matcher
- func (h *Handler) Shutdown(ctx context.Context)
- func (h *Handler) StartWorker(ctx context.Context) error
- func (h *Handler) Trusted() echo.HandlerFunc
- type InMemoryBackend
- func (b *InMemoryBackend) CancelDowngradeShape(id, ifMatch string) (MountTarget, string, error)
- func (b *InMemoryBackend) ChangeConnectorCompartment(id, ifMatch, compartment string) error
- func (b *InMemoryBackend) ChangeFileSystemCompartment(id, ifMatch, compartment string) error
- func (b *InMemoryBackend) ChangeMountTargetCompartment(id, ifMatch, compartment string) error
- func (b *InMemoryBackend) ChangePolicyCompartment(id, ifMatch, compartment string) error
- func (b *InMemoryBackend) ChangeReplicationCompartment(id, ifMatch, compartment string) error
- func (b *InMemoryBackend) Close()
- func (b *InMemoryBackend) Compartments() []string
- func (b *InMemoryBackend) CreateConnector(in createConnectorIn, token string) (Connector, string, error)
- func (b *InMemoryBackend) CreateExport(in createExportIn, token string) (Export, string, error)
- func (b *InMemoryBackend) CreateFileSystem(in createFSIn, token string) (FileSystem, string, error)
- func (b *InMemoryBackend) CreateMountTarget(in createMTIn, token string) (MountTarget, string, error)
- func (b *InMemoryBackend) CreatePolicy(in createPolicyIn, token string) (Policy, string, error)
- func (b *InMemoryBackend) CreateQuotaRule(fsID string, in createQuotaIn) (map[string]any, string, error)
- func (b *InMemoryBackend) CreateReplication(in createReplicationIn, token string) (Replication, string, error)
- func (b *InMemoryBackend) CreateSnapshot(in createSnapshotIn, token string) (Snapshot, string, error)
- func (b *InMemoryBackend) DeleteConnector(id, ifMatch string, override bool) error
- func (b *InMemoryBackend) DeleteExport(id, ifMatch string, override bool) error
- func (b *InMemoryBackend) DeleteFileSystem(id, ifMatch string, override, detachChildren bool) error
- func (b *InMemoryBackend) DeleteMountTarget(id, ifMatch string, override bool) error
- func (b *InMemoryBackend) DeletePolicy(id, ifMatch string, override bool) error
- func (b *InMemoryBackend) DeleteQuotaRule(fsID, id, ifMatch string) error
- func (b *InMemoryBackend) DeleteReplication(id, ifMatch, mode string, override bool) error
- func (b *InMemoryBackend) DeleteReplicationTarget(id, ifMatch string) error
- func (b *InMemoryBackend) DeleteSnapshot(id, ifMatch string, override bool) error
- func (b *InMemoryBackend) DetachClone(id, ifMatch string) error
- func (b *InMemoryBackend) EstimateReplication(id string, rate *int) (ReplicationEstimate, error)
- func (b *InMemoryBackend) GetConnector(id string) (Connector, string, error)
- func (b *InMemoryBackend) GetExport(id string) (Export, string, error)
- func (b *InMemoryBackend) GetExportSet(id string) (ExportSet, string, error)
- func (b *InMemoryBackend) GetFileSystem(id string) (FileSystem, string, error)
- func (b *InMemoryBackend) GetMountTarget(id string) (MountTarget, string, error)
- func (b *InMemoryBackend) GetPolicy(id string) (Policy, string, error)
- func (b *InMemoryBackend) GetQuotaRule(fsID, id string) (map[string]any, string, error)
- func (b *InMemoryBackend) GetReplication(id string) (Replication, string, error)
- func (b *InMemoryBackend) GetReplicationTarget(id string) (ReplicationTarget, string, error)
- func (b *InMemoryBackend) GetSnapshot(id string) (Snapshot, string, error)
- func (b *InMemoryBackend) ListConnectors(f MTFilter, o ListOpts) (page.Page[map[string]any], error)
- func (b *InMemoryBackend) ListExportSets(f MTFilter, o ListOpts) (page.Page[map[string]any], error)
- func (b *InMemoryBackend) ListExports(f ExportFilter, o ListOpts) (page.Page[map[string]any], error)
- func (b *InMemoryBackend) ListFileSystems(f FSFilter, o ListOpts) (page.Page[map[string]any], error)
- func (b *InMemoryBackend) ListMountTargets(f MTFilter, o ListOpts) (page.Page[map[string]any], error)
- func (b *InMemoryBackend) ListPolicies(f PolicyFilter, o ListOpts) (page.Page[map[string]any], error)
- func (b *InMemoryBackend) ListQuotaRules(fsID string, f QuotaFilter, o ListOpts) (page.Page[map[string]any], error)
- func (b *InMemoryBackend) ListReplicationTargets(f MTFilter, o ListOpts) (page.Page[map[string]any], error)
- func (b *InMemoryBackend) ListReplications(f ReplicationFilter, o ListOpts) (page.Page[map[string]any], error)
- func (b *InMemoryBackend) ListSnapshots(f SnapshotFilter, o ListOpts) (page.Page[map[string]any], error)
- func (b *InMemoryBackend) NFSEnabled() bool
- func (b *InMemoryBackend) NFSEndpoints() map[string]string
- func (b *InMemoryBackend) Reset()
- func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
- func (b *InMemoryBackend) ScheduleDowngradeShape(id, ifMatch string, in throughputIn) (MountTarget, string, error)
- func (b *InMemoryBackend) SetClock(now func() time.Time)
- func (b *InMemoryBackend) SetCloser(fn func())
- func (b *InMemoryBackend) SetCompartmentChecker(fn func(string) bool)
- func (b *InMemoryBackend) SetDataPlane(dp dataPlane)
- func (b *InMemoryBackend) SetKeyChecker(fn func(keyID string) (string, bool))
- func (b *InMemoryBackend) SetNetwork(n Network)
- func (b *InMemoryBackend) SetPolicyPaused(id, ifMatch string, pause bool) (Policy, string, error)
- func (b *InMemoryBackend) SetQuotaUnit(bytes int64)
- func (b *InMemoryBackend) SetSecretLookup(fn SecretFunc)
- func (b *InMemoryBackend) SetTransition(d time.Duration)
- func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
- func (b *InMemoryBackend) Sweep()
- func (b *InMemoryBackend) ToggleQuotaRules(id, ifMatch string, in toggleQuotaIn) error
- func (b *InMemoryBackend) UpdateConnector(id, ifMatch string, override bool, in updateConnectorIn) (Connector, string, error)
- func (b *InMemoryBackend) UpdateExport(id, ifMatch string, override bool, in updateExportIn) (Export, string, error)
- func (b *InMemoryBackend) UpdateExportSet(id, ifMatch string, in updateSetIn) (ExportSet, string, error)
- func (b *InMemoryBackend) UpdateFileSystem(id, ifMatch string, override bool, in updateFSIn) (FileSystem, string, error)
- func (b *InMemoryBackend) UpdateMountTarget(id, ifMatch string, override bool, in updateMTIn) (MountTarget, string, error)
- func (b *InMemoryBackend) UpdatePolicy(id, ifMatch string, in updatePolicyIn) (Policy, string, error)
- func (b *InMemoryBackend) UpdateQuotaRule(fsID, id, ifMatch string, in updateQuotaIn) (map[string]any, string, error)
- func (b *InMemoryBackend) UpdateReplication(id, ifMatch string, override bool, in updateReplicationIn) (Replication, string, error)
- func (b *InMemoryBackend) UpdateSnapshot(id, ifMatch string, in updateSnapshotIn) (Snapshot, string, error)
- func (b *InMemoryBackend) UpgradeShape(id, ifMatch string, in throughputIn) (MountTarget, string, error)
- func (b *InMemoryBackend) ValidateKeyTabs(in validateKeyTabsIn) (KeytabValidation, error)
- type KeytabValidation
- type ListOpts
- type MTFilter
- type MountTarget
- type NFSConfig
- type NFSPlane
- func (p *NFSPlane) CloneFrom(ctx context.Context, srcFS, snapshot, dstFS string) error
- func (p *NFSPlane) Close()
- func (p *NFSPlane) CreateFS(id string) error
- func (p *NFSPlane) DropSnapshot(fsID, name string)
- func (p *NFSPlane) Endpoints() map[string]string
- func (p *NFSPlane) QuotaUsage(id string) QuotaUsage
- func (p *NFSPlane) RemoveFS(id string)
- func (p *NFSPlane) ReplicateSnapshot(ctx context.Context, srcFS, snapshot, dstFS string) (int64, error)
- func (p *NFSPlane) Reset()
- func (p *NFSPlane) SnapshotExclusiveBytes(id, name string) int64
- func (p *NFSPlane) StartMount(mtID string, exports func(string) []ExportMount) error
- func (p *NFSPlane) StopMount(mtID string)
- func (p *NFSPlane) StopMounts()
- func (p *NFSPlane) TakeSnapshot(ctx context.Context, fsID, name string) error
- func (p *NFSPlane) Usage(id string) int64
- type Network
- type Nic
- type NicRequest
- type Policy
- type PolicyFilter
- type Provider
- type QuotaFilter
- type QuotaLimit
- type QuotaRule
- type QuotaUsage
- type Replication
- type ReplicationEstimate
- type ReplicationFilter
- type ReplicationTarget
- type SecretFunc
- type Settings
- type Snapshot
- type SnapshotFilter
- type SubnetInfo
Constants ¶
const ( EngineStub = "stub" EngineNFS = "nfs" )
Engine modes (--oci-filestorage-engine).
const DefaultPort = 8171
DefaultPort is the dedicated control-plane listener's default TCP port.
const (
// Region is the fixed region key baked into emulated OCIDs.
Region = "iad"
)
Variables ¶
var ErrNilAppContext = errors.New("ocifilestorage: nil app context")
ErrNilAppContext is returned when Init is called with a nil AppContext.
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 ¶
APIError is an OCI error response: HTTP status plus the `code` and `message` body fields.
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 ¶
ExtractOperation returns the operation name for metrics.
func (*Handler) ExtractResource ¶
ExtractResource returns the addressed resource id for metrics.
func (*Handler) GetSupportedOperations ¶
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 ¶
MatchPriority is irrelevant because RouteMatcher never matches.
func (*Handler) RouteMatcher ¶
RouteMatcher never matches: OCIFileStorage runs on its own listener.
func (*Handler) StartWorker ¶
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 ¶
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) 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 (*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 ¶
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 ¶
ListConnectors lists outbound connectors of a compartment and availability domain.
func (*InMemoryBackend) ListExportSets ¶
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 ¶
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 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 ¶
NewNFSPlane prepares the data directory.
func (*NFSPlane) Close ¶
func (p *NFSPlane) Close()
Close stops every server; a temporary data directory is removed.
func (*NFSPlane) CreateFS ¶
CreateFS creates the empty directories of a file system; existing data is kept.
func (*NFSPlane) DropSnapshot ¶
DropSnapshot removes a snapshot copy.
func (*NFSPlane) QuotaUsage ¶
func (p *NFSPlane) QuotaUsage(id string) QuotaUsage
QuotaUsage measures a file system's logical size by file owner.
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) SnapshotExclusiveBytes ¶
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) StopMounts ¶
func (p *NFSPlane) StopMounts()
StopMounts stops every NFS server but keeps the data.
func (*NFSPlane) TakeSnapshot ¶
TakeSnapshot copies the file system tree into its snapshot area while writes are held off.
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 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 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 ¶
func (p *Provider) Init(ctx *service.AppContext) (service.Registerable, error)
Init creates the backend and handler; the port is bound in StartWorker.
type QuotaFilter ¶
QuotaFilter selects quota rules in a list.
type QuotaLimit ¶
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 ¶
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 ¶
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 ¶
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.
Source Files
¶
- background.go
- common.go
- connectors.go
- dataplane.go
- errors.go
- exports.go
- filesystems.go
- handler.go
- inproc.go
- keytab.go
- kms.go
- meter.go
- models.go
- mounttargets.go
- nfs.go
- ops.go
- persistence.go
- policies.go
- provider.go
- quota.go
- quota_enforce.go
- quota_owner_unix.go
- replication.go
- route.go
- settings.go
- snapshots.go
- store.go
- tree.go
- vfs.go