|
14 | 14 | create_snapshot, |
15 | 15 | list_snapshots, |
16 | 16 | create_snap_mirror_relationship, |
17 | | - list_snap_mirror_relationships |
| 17 | + list_snap_mirror_relationships, |
| 18 | + create_flexcache |
18 | 19 | ) |
19 | 20 |
|
20 | 21 | mcp = FastMCP("NetApp DataOps Traditional Toolkit MCP") |
@@ -419,6 +420,57 @@ async def list_snap_mirror_relationships_tool( |
419 | 420 | print(f"Error listing snapmirror relationships: {e}") |
420 | 421 | raise |
421 | 422 |
|
| 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 |
422 | 474 |
|
423 | 475 |
|
424 | 476 | if __name__ == "__main__": |
|
0 commit comments