file

package
v1.0.0-beta.35 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package file provides methods and message types of the file v1alpha1 API.

Index

Constants

View Source
const (
	AttachmentResourceTypeUnknownResourceType = AttachmentResourceType("unknown_resource_type")
	AttachmentResourceTypeInstanceServer      = AttachmentResourceType("instance_server")
)
View Source
const (
	// If unspecified, the filesystem status is unknown by default.
	FileSystemStatusUnknownStatus = FileSystemStatus("unknown_status")
	// The filesystem is created and available.
	FileSystemStatusAvailable = FileSystemStatus("available")
	// The filesystem is in error state.
	FileSystemStatusError = FileSystemStatus("error")
	// The filesystem is under creation (transient).
	FileSystemStatusCreating = FileSystemStatus("creating")
	// The filesystem is being updated (transient).
	FileSystemStatusUpdating = FileSystemStatus("updating")
)
View Source
const (
	// Order by creation date (ascending).
	ListFileSystemsRequestOrderByCreatedAtAsc = ListFileSystemsRequestOrderBy("created_at_asc")
	// Order by creation date (descending).
	ListFileSystemsRequestOrderByCreatedAtDesc = ListFileSystemsRequestOrderBy("created_at_desc")
	// Order by name (ascending).
	ListFileSystemsRequestOrderByNameAsc = ListFileSystemsRequestOrderBy("name_asc")
	// Order by name (descending).
	ListFileSystemsRequestOrderByNameDesc = ListFileSystemsRequestOrderBy("name_desc")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

This API allows you to manage your File Storage resources.

func NewAPI

func NewAPI(client *scw.Client) *API

NewAPI returns a API object from a Scaleway client.

func (*API) CreateFileSystem

func (s *API) CreateFileSystem(req *CreateFileSystemRequest, opts ...scw.RequestOption) (*FileSystem, error)

CreateFileSystem: To create a new filesystem, you must specify a name, a size, and a project ID.

func (*API) DeleteFileSystem

func (s *API) DeleteFileSystem(req *DeleteFileSystemRequest, opts ...scw.RequestOption) error

DeleteFileSystem: You must specify the `filesystem_id` of the filesystem you want to delete.

func (*API) GetFileSystem

func (s *API) GetFileSystem(req *GetFileSystemRequest, opts ...scw.RequestOption) (*FileSystem, error)

GetFileSystem: Retrieve all properties and current status of a specific filesystem identified by its ID.

func (*API) ListAttachments

func (s *API) ListAttachments(req *ListAttachmentsRequest, opts ...scw.RequestOption) (*ListAttachmentsResponse, error)

ListAttachments: List all existing attachments in a specified region. By default, the attachments listed are ordered by creation date in ascending order. This can be modified using the `order_by` field.

func (*API) ListFileSystems

func (s *API) ListFileSystems(req *ListFileSystemsRequest, opts ...scw.RequestOption) (*ListFileSystemsResponse, error)

ListFileSystems: Retrieve all filesystems in the specified region. By default, the filesystems listed are ordered by creation date in ascending order. This can be modified using the `order_by` field.

func (*API) Regions

func (s *API) Regions() []scw.Region

func (*API) UpdateFileSystem

func (s *API) UpdateFileSystem(req *UpdateFileSystemRequest, opts ...scw.RequestOption) (*FileSystem, error)

UpdateFileSystem: Update the technical details of a filesystem, such as its name, tags or its new size.

func (*API) WaitForFileSystem

func (s *API) WaitForFileSystem(req *WaitForFileSystemRequest, opts ...scw.RequestOption) (*FileSystem, error)

type Attachment

type Attachment struct {
	// ID: UUID of the attachment.
	ID string `json:"id"`

	// FilesystemID: UUID of the filesystem.
	FilesystemID string `json:"filesystem_id"`

	// ResourceID: UUID of the attached resource.
	ResourceID string `json:"resource_id"`

	// ResourceType: the type of the attached resource.
	// Default value: unknown_resource_type
	ResourceType AttachmentResourceType `json:"resource_type"`

	// Zone: the zone where the resource is located.
	Zone *scw.Zone `json:"zone"`
}

Attachment: Represents an attachment between a filesystem and a resource.

type AttachmentResourceType

type AttachmentResourceType string

func (AttachmentResourceType) MarshalJSON

func (enum AttachmentResourceType) MarshalJSON() ([]byte, error)

func (AttachmentResourceType) String

func (enum AttachmentResourceType) String() string

func (*AttachmentResourceType) UnmarshalJSON

func (enum *AttachmentResourceType) UnmarshalJSON(data []byte) error

func (AttachmentResourceType) Values

type CreateFileSystemRequest

type CreateFileSystemRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// Name: name of the filesystem.
	Name string `json:"name"`

	// ProjectID: UUID of the project the filesystem belongs to.
	ProjectID string `json:"project_id"`

	// Size: must be compliant with the minimum (100 GB) and maximum (10 TB) allowed size.
	Size uint64 `json:"size"`

	// Tags: list of tags assigned to the filesystem.
	Tags []string `json:"tags"`
}

CreateFileSystemRequest: Request to create a new filesystem.

type DeleteFileSystemRequest

type DeleteFileSystemRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// FilesystemID: UUID of the filesystem.
	FilesystemID string `json:"-"`
}

DeleteFileSystemRequest: Request to delete a specific filesystem.

type FileSystem

type FileSystem struct {
	// ID: UUID of the filesystem.
	ID string `json:"id"`

	// Name: name of the filesystem.
	Name string `json:"name"`

	// Size: filesystem size in bytes.
	Size scw.Size `json:"size"`

	// Status: current status of the filesystem (e.g. creating, available, ...).
	// Default value: unknown_status
	Status FileSystemStatus `json:"status"`

	// ProjectID: UUID of the project to which the filesystem belongs.
	ProjectID string `json:"project_id"`

	// OrganizationID: UUID of the organization to which the filesystem belongs.
	OrganizationID string `json:"organization_id"`

	// Tags: list of tags assigned to the filesystem.
	Tags []string `json:"tags"`

	// NumberOfAttachments: the current number of attachments (mounts) that the filesystem has.
	NumberOfAttachments uint32 `json:"number_of_attachments"`

	// Region: region where the filesystem is located.
	Region scw.Region `json:"region"`

	// CreatedAt: creation date of the filesystem.
	CreatedAt *time.Time `json:"created_at"`

	// UpdatedAt: last update date of the properties of the filesystem.
	UpdatedAt *time.Time `json:"updated_at"`
}

FileSystem: Represents a filesystem resource and its properties.

type FileSystemStatus

type FileSystemStatus string

Status of the filesystem.

func (FileSystemStatus) MarshalJSON

func (enum FileSystemStatus) MarshalJSON() ([]byte, error)

func (FileSystemStatus) String

func (enum FileSystemStatus) String() string

func (*FileSystemStatus) UnmarshalJSON

func (enum *FileSystemStatus) UnmarshalJSON(data []byte) error

func (FileSystemStatus) Values

func (enum FileSystemStatus) Values() []FileSystemStatus

type GetFileSystemRequest

type GetFileSystemRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// FilesystemID: UUID of the filesystem.
	FilesystemID string `json:"-"`
}

GetFileSystemRequest: Request to retrieve a specific filesystem.

type ListAttachmentsRequest

type ListAttachmentsRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// FilesystemID: UUID of the File Storage volume.
	FilesystemID *string `json:"-"`

	// ResourceID: filter by resource ID.
	ResourceID *string `json:"-"`

	// ResourceType: filter by resource type.
	// Default value: unknown_resource_type
	ResourceType AttachmentResourceType `json:"-"`

	// Zone: filter by resource zone.
	Zone *scw.Zone `json:"-"`

	// Page: page number (starting at 1).
	Page *int32 `json:"-"`

	// PageSize: number of entries per page (default: 20, max: 100).
	PageSize *uint32 `json:"-"`
}

ListAttachmentsRequest: Request to list filesystem attachments with filtering and pagination options.

type ListAttachmentsResponse

type ListAttachmentsResponse struct {
	// Attachments: list of filesystem attachments matching the request criteria.
	Attachments []*Attachment `json:"attachments"`

	// TotalCount: total number of filesystem attachments matching the criteria.
	TotalCount uint64 `json:"total_count"`
}

ListAttachmentsResponse: Response containing a list of filesystem attachments and total count.

func (*ListAttachmentsResponse) UnsafeAppend

func (r *ListAttachmentsResponse) UnsafeAppend(res any) (uint64, error)

UnsafeAppend should not be used Internal usage only

func (*ListAttachmentsResponse) UnsafeGetTotalCount

func (r *ListAttachmentsResponse) UnsafeGetTotalCount() uint64

UnsafeGetTotalCount should not be used Internal usage only

type ListFileSystemsRequest

type ListFileSystemsRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// OrderBy: criteria to use when ordering the list.
	// Default value: created_at_asc
	OrderBy ListFileSystemsRequestOrderBy `json:"-"`

	// ProjectID: filter by project ID.
	ProjectID *string `json:"-"`

	// OrganizationID: filter by organization ID.
	OrganizationID *string `json:"-"`

	// Page: page number (starting at 1).
	Page *int32 `json:"-"`

	// PageSize: number of entries per page (default: 20, max: 100).
	PageSize *uint32 `json:"-"`

	// Name: filter the returned filesystems by their names.
	Name *string `json:"-"`

	// Tags: filter by tags. Only filesystems with one or more matching tags will be returned.
	Tags []string `json:"-"`
}

ListFileSystemsRequest: Request to list filesystems with filtering and pagination options.

type ListFileSystemsRequestOrderBy

type ListFileSystemsRequestOrderBy string

Sorting options for filesystem listing.

func (ListFileSystemsRequestOrderBy) MarshalJSON

func (enum ListFileSystemsRequestOrderBy) MarshalJSON() ([]byte, error)

func (ListFileSystemsRequestOrderBy) String

func (enum ListFileSystemsRequestOrderBy) String() string

func (*ListFileSystemsRequestOrderBy) UnmarshalJSON

func (enum *ListFileSystemsRequestOrderBy) UnmarshalJSON(data []byte) error

func (ListFileSystemsRequestOrderBy) Values

type ListFileSystemsResponse

type ListFileSystemsResponse struct {
	// Filesystems: list of filesystems matching the request criteria.
	Filesystems []*FileSystem `json:"filesystems"`

	// TotalCount: total number of filesystems matching the criteria.
	TotalCount uint64 `json:"total_count"`
}

ListFileSystemsResponse: Response containing a list of filesystems and total count.

func (*ListFileSystemsResponse) UnsafeAppend

func (r *ListFileSystemsResponse) UnsafeAppend(res any) (uint64, error)

UnsafeAppend should not be used Internal usage only

func (*ListFileSystemsResponse) UnsafeGetTotalCount

func (r *ListFileSystemsResponse) UnsafeGetTotalCount() uint64

UnsafeGetTotalCount should not be used Internal usage only

type UpdateFileSystemRequest

type UpdateFileSystemRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// FilesystemID: UUID of the filesystem.
	FilesystemID string `json:"-"`

	// Name: when defined, is the new name of the filesystem.
	Name *string `json:"name,omitempty"`

	// Size: size in bytes, with a granularity of 100 GB (10^11 bytes).
	// Must be compliant with the minimum (100 GB) and maximum (10 TB) allowed size.
	Size *uint64 `json:"size,omitempty"`

	// Tags: list of tags assigned to the filesystem.
	Tags *[]string `json:"tags,omitempty"`
}

UpdateFileSystemRequest: Request to update a specific filesystem.

type WaitForFileSystemRequest

type WaitForFileSystemRequest struct {
	FileSystemID  string
	Region        scw.Region
	Timeout       *time.Duration
	RetryInterval *time.Duration
}

Jump to

Keyboard shortcuts

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