Skip to content

Commit 2b33925

Browse files
committed
Pull request #11: Feature/mcp flexcache traditional
Merge in SIE-BB/netapp-dataops-toolkit from feature/mcp-flexcache-traditional to release-v2.7.0 * commit '70b86f95ee494c54452b71a707b26450dae9a989': Added flexcache tool to readme files Modified tool names in traditional MCP server (removed extra spaces) Added MCP tool to create flexcache
2 parents b93842f + 70b86f9 commit 2b33925

3 files changed

Lines changed: 55 additions & 1 deletion

File tree

mcp_servers.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ The [NetApp DataOps Toolkit MCP Server for ONTAP](netapp_dataops_traditional/doc
1616
- **List Snapshots**: Retrieve a list of all snapshots for a specific volume.
1717
- **Create SnapMirror Relationship**: Set up SnapMirror relationships for efficient data replication.
1818
- **List SnapMirror Relationships**: Retrieve a list of all SnapMirror relationships on the storage system.
19+
- **Create FlexCache Volume**: Create FlexCache volumes for efficient data access and caching.
1920

2021
## NetApp DataOps Toolkit for Kubernetes MCP Server
2122

netapp_dataops_traditional/docs/mcp_server.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ The NetApp DataOps Toolkit MCP Server for ONTAP is an open-source server compone
1515
- **List Snapshots**: Retrieve a list of all snapshots for a specific volume.
1616
- **Create SnapMirror Relationship**: Set up SnapMirror relationships for efficient data replication.
1717
- **List SnapMirror Relationships**: Retrieve a list of all SnapMirror relationships on the storage system.
18+
- **Create FlexCache Volume**: Create FlexCache volumes for efficient data access and caching.
1819

1920
### Prerequisites
2021

netapp_dataops_traditional/netapp_dataops/mcp_server/netapp_dataops_ontap_mcp.py

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
create_snapshot,
1515
list_snapshots,
1616
create_snap_mirror_relationship,
17-
list_snap_mirror_relationships
17+
list_snap_mirror_relationships,
18+
create_flexcache
1819
)
1920

2021
mcp = FastMCP("NetApp DataOps Traditional Toolkit MCP")
@@ -419,6 +420,57 @@ async def list_snap_mirror_relationships_tool(
419420
print(f"Error listing snapmirror relationships: {e}")
420421
raise
421422

423+
@mcp.tool(name="CreateFlexCache")
424+
async def create_flexcache_tool(
425+
source_vol: str,
426+
source_svm: str,
427+
flexcache_vol: str,
428+
flexcache_svm: Optional[str] = None,
429+
cluster_name: Optional[str] = None,
430+
flexcache_size: Optional[str] = None,
431+
junction: Optional[str] = None,
432+
export_policy: str = "default",
433+
mountpoint: Optional[str] = None,
434+
readonly: bool = False,
435+
print_output: bool = False
436+
) -> None:
437+
438+
"""
439+
Use this tool to create a FlexCache volume from a specified source volume.
440+
441+
Args:
442+
source_vol (str): Name of the source volume (required).
443+
source_svm (str): Name of the SVM hosting the source volume (required).
444+
flexcache_vol (str): Name of the FlexCache volume to create (required).
445+
flexcache_svm (str): Name of the SVM hosting the FlexCache volume. Defaults to None.
446+
cluster_name (str): Non-default cluster name, same credentials as the default credentials should be used. Defaults to None.
447+
flexcache_size (str): Size of the FlexCache volume (e.g., '100GB', '10TB'). Defaults to 10% of source volume size if not specified.
448+
junction (str): Custom junction path for the FlexCache volume to be exported at. If not specified, the junction path will be: ("/"+FlexCache Volume Name). Defaults to None.
449+
export_policy (str): NFS export policy to use when exporting the FlexCache volume. Defaults to "default".
450+
mountpoint (str): Local mountpoint to mount the FlexCache volume at. If not specified, the volume will not be mounted locally. On Linux hosts - if specified, the calling program must be run as root. Defaults to None.
451+
readonly (bool): Mount the FlexCache volume locally as "read-only." If not specified, the volume will be mounted as "read-write". On Linux hosts - if specified, the calling program must be run as root. Defaults to False.
452+
print_output (bool): Denotes whether or not to print messages to the console during execution. Defaults to False.
453+
454+
Returns:
455+
None
456+
"""
457+
try:
458+
create_flexcache(
459+
source_vol=source_vol,
460+
source_svm=source_svm,
461+
flexcache_vol=flexcache_vol,
462+
flexcache_svm=flexcache_svm,
463+
cluster_name=cluster_name,
464+
flexcache_size=flexcache_size,
465+
junction=junction,
466+
export_policy=export_policy,
467+
mountpoint=mountpoint,
468+
readonly=readonly,
469+
print_output=print_output
470+
)
471+
except Exception as e:
472+
print(f"Error creating FlexCache: {e}")
473+
raise
422474

423475

424476
if __name__ == "__main__":

0 commit comments

Comments
 (0)