Skip to content

Conversation

@sreeram-venkitesh
Copy link
Member

Part of MNFS-164. Follow up of #912. Adding NFS resize and snapshot APIs and corresponding tests to godo.

nfs.go Outdated
// Region is the datacenter region where the NFS snapshot is located
Region string `json:"region"`
// Status represents the current status of the NFS snapshot
Status string `json:"status"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this status be an enum

nfs.go Outdated
}

// List returns a list of NFS snapshots.
func (s *NfsServiceOp) ListSnapshots(ctx context.Context, opts *ListOptions, id, region string) ([]*NfsSnapshot, *Response, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
func (s *NfsServiceOp) ListSnapshots(ctx context.Context, opts *ListOptions, id, region string) ([]*NfsSnapshot, *Response, error) {
func (s *NfsServiceOp) ListSnapshots(ctx context.Context, opts *ListOptions, shareID, region string) ([]*NfsSnapshot, *Response, error) {

nfs_actions.go Outdated
"net/http"
)

// NfsActionsService is an interface for interfacing with the NFS actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// NfsActionsService is an interface for interfacing with the NFS actions
// NfsActionsService is an interface for interacting with the NFS actions

nfs_actions.go Outdated
// endpoints of the DigitalOcean API
// See: https://docs.digitalocean.com/reference/api/api-reference/#tag/NFS-Actions
type NfsActionsService interface {
Resize(context.Context, string, uint64, string) (*Action, *Response, error)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Resize(context.Context, string, uint64, string) (*Action, *Response, error)
Resize(context.Context, shareID string, size uint64, region string) (*Action, *Response, error)

nfs.go Outdated
Comment on lines 14 to 27
// List retrieves a list of NFS shares filtered by region
List(context.Context, *ListOptions, string) ([]*Nfs, *Response, error)
// Create creates a new NFS share with the provided configuration
Create(context.Context, *NfsCreateRequest) (*Nfs, *Response, error)
// Delete removes an NFS share by its ID and region
Delete(context.Context, string, string) (*Response, error)
// Get retrieves a specific NFS share by its ID and region
Get(context.Context, string, string) (*Nfs, *Response, error)
// List retrieves a list of NFS snapshots filtered by an optional share ID and region
ListSnapshots(context.Context, *ListOptions, string, string) ([]*NfsSnapshot, *Response, error)
// Get retrieves a specific NFS snapshot by its ID and region
GetSnapshot(context.Context, string, string) (*NfsSnapshot, *Response, error)
// Delete removes an NFS snapshot by its ID and region
DeleteSnapshot(context.Context, string, string) (*Response, error)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add vars meaningful names

Copy link
Contributor

@singhsaubhikdo singhsaubhikdo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SSharma-10 SSharma-10 merged commit 184275c into digitalocean:main Oct 17, 2025
9 checks passed
@SSharma-10 SSharma-10 mentioned this pull request Oct 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants