godo.Nfs.Create()

Generated on 5 Nov 2026 from godo version v1.236.0

Usage

client.Nfs.Create(ctx context.Context, createRequest *godo.NfsCreateRequest) (*godo.Nfs, *godo.Response, error)

Description

Create creates a new NFS share.

There is no client-side size validation: minimum and maximum sizes differ per performance tier and can change server-side, so the API is the source of truth. Use Nfs.GetOptions to read the current per-tier floors.

This method sends a POST request to /v2/nfs.

Parameters

createRequest *godo.NfsCreateRequest required

Fields of godo.NfsCreateRequest

NfsCreateRequest represents a request to create an NFS share.

Name string

JSON key: name

SizeGib int

JSON key: size_gib

Region string

JSON key: region

VpcIDs []string

Omitted from JSON when empty. JSON key: vpc_ids

PerformanceTier string

Omitted from JSON when empty. JSON key: performance_tier

ManagerURN string

Omitted from JSON when empty. JSON key: manager_urn

Returns

*godo.Nfs
*godo.Response

The HTTP response, with pagination Links, Meta, and Rate limit information.

error

Non-nil when the request fails. API errors are returned as *godo.ErrorResponse.

Fields of godo.Nfs

Nfs represents a DigitalOcean NFS share

ID string

ID is the unique identifier for the NFS share

JSON key: id

Name string

Name is the human-readable name for the NFS share

JSON key: name

SizeGib int

SizeGib is the size of the NFS share in gibibytes

JSON key: size_gib

Region string

Region is the datacenter region where the NFS share is located

JSON key: region

Status godo.NfsShareStatus

Status represents the current state of the NFS share

JSON key: status

CreatedAt string

CreatedAt is the timestamp when the NFS share was created

JSON key: created_at

VpcIDs []string

VpcIDs is a list of VPC IDs that have access to the NFS share

JSON key: vpc_ids

Host string

Host is the IP address of the NFS server accessible from the associated VPC

JSON key: host

MountPath string

MountPath is the path at which the share will be available

JSON key: mount_path

PerformanceTier string

PerformanceTier is the performance tier of the NFS share

JSON key: performance_tier

ManagerURN string

ManagerURN associates the share with the resource that manages it

Omitted from JSON when empty. JSON key: manager_urn

AccessPoints []*godo.NfsAccessPoint

AccessPoints is the list of access points configured for the NFS share.

Omitted from JSON when empty. JSON key: access_points

Request Sample

Show Request Sample
package main

import (
	"context"
	"fmt"
	"log"
	"os"

	"github.com/digitalocean/godo"
)

func main() {
	client := godo.NewFromToken(os.Getenv("DIGITALOCEAN_TOKEN"))
	ctx := context.TODO()

	result, _, err := client.Nfs.Create(ctx, &godo.NfsCreateRequest{
		Name: "<your-name>",
		SizeGib: 1234567,
		Region: "<your-region>",
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", result)
}

More Information

See POST /v2/nfs in the API reference for additional detail on responses, headers, parameters, and more.

See the Go package documentation for the source of this method.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.