---
title: pydo.nfs.create_action()
description: Initiate an NFS action
product: Reference
url: https://docs.digitalocean.com/reference/pydo/reference/nfs/create_action/
last_updated: "2026-11-06"
---

> **For AI agents:** The documentation index is at [https://docs.digitalocean.com/llms.txt](https://docs.digitalocean.com/llms.txt). Markdown versions of pages use the same URL with `index.html.md` in place of the HTML page (for example, append `index.html.md` to the directory path instead of opening the HTML document).

# pydo.nfs.create_action()

Generated on 6 Nov 2026 from `pydo` version [`v0.45.0`](https://github.com/digitalocean/pydo/releases/tag/v0.45.0)

## Usage

```python
client.nfs.create_action(
    nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d",
    body={
        "type": "resize",
        "region": "atl1",
        "params": {...},
    },
)
```

Returns `JSON` Raises `HttpResponseError`

## Description

To execute an action (such as resize) on a specified NFS share, send a POST request to [`/v2/nfs/{nfs_id}/actions`](https://docs.digitalocean.com/reference/api/reference/nfs-actions/index.html.md#nfs_create_action). In the JSON body to the request, set the `type` attribute to on of the supported action types:

| Action | Details |
|---|---|
| `resize` | Resizes an NFS share. Set the size_gib attribute to a desired value in GiB |
| `snapshot` | Takes a snapshot of an NFS share |
| `attach` | Attaches an NFS share to a VPC. Set the vpc_id attribute to the desired VPC ID |
| `detach` | Detaches an NFS share from a VPC. Set the vpc_id attribute to the desired VPC ID |
| `reassign` | Reassigns an NFS share from one VPC to another. Set the old_vpc_id and new_vpc_id attributes to the desired VPC IDs |
| `switch_performance_tier` | Switches the performance tier of an NFS share. Set the performance_tier attribute to the desired tier (e.g., standard, high) |

## Parameters

`nfs_id` string required

The unique ID of the NFS share

`type` string required

The type of action to initiate for the NFS share (such as resize or snapshot).

One of: `resize`, `snapshot`, `attach`, `detach`, `reassign`, `switch_performance_tier`

`region` string optional

Example: `atl1`

The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides.

`params` object optional

## Show child properties

`performance_tier` string required

Example: `standard`

The performance tier to which the NFS share will be switched (e.g., standard, high).

## Request Sample

## Show Request Sample

```python
import os
from pydo import Client

client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))

req = {
  "type": "resize",
  "region": "atl1"
}

resp = client.nfs.create_action(nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", body=req)
```

## Response Example

## Show Response Example

```json
{
  "action": {
    "id": "084c3b9c-2382-441b-92d4-10b095bb5d7c",
    "region_slug": "atl1",
    "resource_id": "baf4827c-6fa9-456f-9dbd-9ddfcacd0720",
    "resource_type": "SHARE",
    "type": "RESIZE_SHARE",
    "status": "IN_PROGRESS",
    "started_at": "2026-06-25T08:11:12Z"
  }
}
```

## More Information

See [`/v2/nfs/{nfs_id}/actions`](https://docs.digitalocean.com/reference/api/reference/nfs-actions/index.html.md#nfs_create_action) in the API reference for additional detail on responses, headers, parameters, and more.