What are CRUD operations?
CRUD is an acronym that stands for Create, Read, Update, and Delete—the four fundamental operations for interacting with data in any software application. These operations form the backbone of database management and are critical in building robust applications.
While CRUD is a well-known concept among programmers, it is often considered more of a guiding principle than a framework for modern API design. Originally rooted in database management systems, CRUD defines a cycle for managing data rather than serving as an architectural model. As software development has evolved, developers frequently adapt and extend CRUD principles to meet the demands of modern APIs and dynamic application architectures.

How to Create a Snapshot in NetApp ONTAP
Creating a snapshot in NetApp ONTAP involves sending a POST request to the following endpoint:
/storage/volumes/{volume.uuid}/snapshots
Required Properties
name
– The name of the snapshot copy to be created. This is a mandatory field and should be unique within the volume. Optional Properties
comment
– A descriptive comment associated with the snapshot copy. This is useful for providing context or notes about the snapshot’s purpose. expiry_time
– A retention time for the snapshot. Snapshots with an expiry time cannot be deleted until the specified retention period is reached, ensuring critical data is preserved during that time. Example Request
POST /storage/volumes/{volume.uuid}/snapshots
Example Request Body
{
"name": "daily_backup",
"comment": "Daily backup before updates",
"expiry_time": "2024-12-10T23:59:59Z"
}
Example Endpoint with Variables
Replace {volume.uuid}
with the UUID of the volume where you want to create the snapshot:
POST /storage/volumes/67890-fghij/snapshots
Example Script
Below is an example of how to make the request using python:
def create_snapshot(storage, svm, vol_name):
uuid = '67890-fghi'
headers = Headers
url = f"https:///api/storage/volumes/{uuid}/snapshots"
snap_name = input('Enter the name of SNAPSHOT: ')
data = {}
data['name'] = snap_name
resp = requests.post(
url,
json=data,
headers=headers,
verify=False
)
url_res = resp.json()
if 'error' in url_res:
print(url_res)
sys.exit(1)
elif 'job' in url_res:
job_status = url_res
jobstat(job_status, headers, storage)
else:
print('*' * 50)
print(url_res)
sys.exit(1)
How to Retrieve Snapshot Details in NetApp ONTAP
To retrieve detailed information about a specific snapshot, send a GET request to the following endpoint:
/storage/volumes/{volume.uuid}/snapshots/{uuid}
Required Properties
Volume UUID
– The unique identifier of the volume where the snapshot resides. Snapshot UUID
– The unique identifier of the snapshot you want to retrieve details for. Example Request
GET /storage/volumes/67890-fghij/snapshots/12345-abcde
Example python script
def create_snapshot(storage, svm, vol_name):
uuid = '028baa66-41bd-11e9-81d5-00a0986138f7'
headers = Headers
url = "https:///api/storage/volumes//snapshots/"
resp = requests.get(
url,
headers=headers,
verify=false,
)
data = dict(url_res)
print(data)
Example Response
A successful request will return details about the snapshot in JSON format, including properties like its name, creation time, and any associated comments:
{
"uuid": "12345-abcde",
"name": "backup_2024",
"creation_time": "2024-12-01T10:00:00Z",
"comment": "Weekly backup snapshot",
"expiry_time": "2024-12-31T23:59:59Z"
}
This method allows you to programmatically access and manage snapshot metadata, ensuring efficient storage management and monitoring.
To see the implementation visit our git repository. (GITHUB)