Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions descriptions/descriptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ const DeleteSnapshot = `Delete a snapshot of a volume on a cluster by cluster na
const RestoreSnapshot = `Restore a volume to a snapshot on a cluster by cluster name.`

const CreateSnapshotPolicy = `Create a snapshot policy on a cluster by cluster name.`
const UpdateSnapshotPolicy = `Update a snapshot policy on a cluster by cluster name.`
const UpdateSnapshotPolicy = `Update a snapshot policy comment and enable/disable snapshot policy on a cluster by cluster name.`
const DeleteSnapshotPolicy = `Delete a snapshot policy on a cluster by cluster name.`
const CreateSchedule = `Create a cron schedule on a cluster by cluster name. Ex: 5 1 * * *, this cron expression indicates schedule would be triggered at 01:05 AM for every day`

const AddScheduleInSnapshotPolicy = `Add a schedule entry to an existing snapshot policy on a cluster by cluster name.`
const UpdateScheduleInSnapshotPolicy = `Update a schedule entry within an existing snapshot policy on a cluster by cluster name. At least one of count or snapmirror_label must be provided.`
const UpdateScheduleInSnapshotPolicy = `Update a schedule entry within an existing snapshot policy by specifying the snapshot count or SnapMirror label on a cluster, identified by its cluster name. At least one of the following parameters—snapshot count or SnapMirror label—must be provided.`
const RemoveScheduleInSnapshotPolicy = `Remove a schedule entry from an existing snapshot policy on a cluster by cluster name.`
Comment thread
Hardikl marked this conversation as resolved.

const ListQoSPolicies = `List QoS policies from an ONTAP cluster — includes both SVM-scoped and cluster-scoped (admin SVM) policies.
Expand All @@ -63,18 +63,18 @@ Units:
- Fixed: *_iops fields are in IOPS; *_mbps fields are in MB/s.`

const CreateQoSPolicy = `Create a QoS policy on a cluster by cluster name.`
const UpdateQoSPolicy = `Update a QoS policy on a cluster by cluster name.`
const UpdateQoSPolicy = `Update a QoS policy name, max throughput iops, min throughput iops, expected iops, peak iops and absolute min iops on a cluster by cluster name.`
const DeleteQoSPolicy = `Delete a QoS policy on a cluster by cluster name.`
Comment thread
Hardikl marked this conversation as resolved.

const CreateNFSExportPolicy = `Create NFS Export policies on a cluster by cluster name.`
const UpdateNFSExportPolicy = `Update NFS Export policies on a cluster by cluster name.`
const UpdateNFSExportPolicy = `Update NFS Export policies name, client match, read only rules, read write rules on a cluster by cluster name.`
const DeleteNFSExportPolicy = `Delete NFS Export policies on a cluster by cluster name.`
const CreateNFSExportPolicyRules = `Create NFS Export policies rules on a cluster by cluster name.`
const UpdateNFSExportPolicyRules = `Update NFS Export policies rules on a cluster by cluster name.`
const UpdateNFSExportPolicyRules = `Update NFS Export policies rules with client match, read only rules, read write rules on a cluster by cluster name.`
const DeleteNFSExportPolicyRules = `Delete NFS Export policies rules on a cluster by cluster name.`

const CreateCIFSShare = `Create CIFS share on a cluster by cluster name.`
const UpdateCIFSShare = `Update CIFS share on a cluster by cluster name.`
const UpdateCIFSShare = `Update CIFS share path on a cluster by cluster name.`
const DeleteCIFSShare = `Delete CIFS share on a cluster by cluster name.`

const CreateNFSService = `Create (enable) NFS service on an SVM. Allows configuring NFSv3, NFSv4.0, and NFSv4.1 protocol versions.`
Expand All @@ -89,49 +89,49 @@ const CreateDNS = `Configure DNS on an SVM. Required before joining Active Direc
const DeleteDNS = `Remove DNS configuration from an SVM.`

const CreateQtree = `Create Qtree on a cluster by cluster name.`
const UpdateQtree = `Update Qtree on a cluster by cluster name.`
const UpdateQtree = `Update Qtree name on a cluster by cluster name.`
const DeleteQtree = `Delete Qtree on a cluster by cluster name.`

const CreateNVMeService = `Create NVMe service on a cluster by cluster name.`
const UpdateNVMeService = `Update NVMe service on a cluster by cluster name.`
const UpdateNVMeService = `Update NVMe service admin state on a cluster by cluster name.`
const DeleteNVMeService = `Delete NVMe service on a cluster by cluster name.`

const CreateIscsiService = `Create iSCSI service on a cluster by cluster name.`
const UpdateIscsiService = `Update iSCSI service on a cluster by cluster name.`
const UpdateIscsiService = `Update iSCSI service admin state on a cluster by cluster name.`
const DeleteIscsiService = `Delete iSCSI service on a cluster by cluster name.`

const CreateNetworkIPInterface = `Create Network IP interface on a cluster by cluster name.`
const UpdateNetworkIPInterface = `Update Network IP interface on a cluster by cluster name.`
const UpdateNetworkIPInterface = `Update Network IP interface with auto revert enable/disable and service policy name on a cluster by cluster name.`
const DeleteNetworkIPInterface = `Delete Network IP interface on a cluster by cluster name.`

const CreateNVMeSubsystem = `Create NVMe subsystem on a cluster by cluster name.`
const UpdateNVMeSubsystem = `Update NVMe subsystem on a cluster by cluster name.`
const UpdateNVMeSubsystem = `Update NVMe subsystem comment on a cluster by cluster name.`
const DeleteNVMeSubsystem = `Delete NVMe subsystem on a cluster by cluster name.`

const AddNVMeSubsystemHost = `Add a host NQN to an NVMe subsystem on a cluster by cluster name.`
const RemoveNVMeSubsystemHost = `Remove a host NQN from an NVMe subsystem on a cluster by cluster name.`

const CreateNVMeNamespace = `Create NVMe namespace on a cluster by cluster name.`
const UpdateNVMeNamespace = `Update NVMe namespace on a cluster by cluster name.`
const UpdateNVMeNamespace = `Update NVMe namespace total provisioned size on a cluster by cluster name.`
const DeleteNVMeNamespace = `Delete NVMe namespace on a cluster by cluster name.`

const CreateNVMeSubsystemMap = `Create NVMe subsystem map on a cluster by cluster name.`
const DeleteNVMeSubsystemMap = `Delete NVMe subsystem map on a cluster by cluster name.`

const CreateLUN = `Create a LUN on a specified volume and SVM with a given size and OS type.`
const UpdateLUN = `Update a LUN: resize, rename, or toggle enabled/disabled state (online/offline).`
const UpdateLUN = `Update a LUN: resize, rename, or toggle enable/disable state (online/offline).`
const DeleteLUN = `Delete a LUN from a specified volume and SVM.`

const CreateFCPService = `Create FCP service on a cluster by cluster name.`
const UpdateFCPService = `Update FCP service on a cluster by cluster name.`
const UpdateFCPService = `Update FCP service admin state on a cluster by cluster name.`
const DeleteFCPService = `Delete FCP service on a cluster by cluster name.`

const CreateFCInterface = `Create FC interface on a cluster by cluster name.`
const UpdateFCInterface = `Update FC interface on a cluster by cluster name.`
const UpdateFCInterface = `Update FC interface admin state, name of the FC port and node on which the FC port is located on a cluster by cluster name.`
const DeleteFCInterface = `Delete FC interface on a cluster by cluster name.`

const CreateIGroup = `Create an igroup (initiator group) on a cluster by cluster name.`
const UpdateIGroup = `Update an igroup on a cluster by cluster name.`
const UpdateIGroup = `Update an igroup name, comment, host operating system on a cluster by cluster name.`
const DeleteIGroup = `Delete an igroup on a cluster by cluster name.`
const AddIGroupInitiator = `Add an initiator to an igroup on a cluster by cluster name.`
const RemoveIGroupInitiator = `Remove an initiator from an igroup on a cluster by cluster name.`
Expand All @@ -140,7 +140,7 @@ const CreateLunMap = `Create a LUN map on a cluster by cluster name. Maps a LUN
const DeleteLunMap = `Delete a LUN map on a cluster by cluster name. Removes the mapping between a LUN and an igroup.`

const CreateSnapMirror = `Create a SnapMirror relationship on a cluster by cluster name.`
const UpdateSnapMirror = `Update a SnapMirror relationship on a cluster by cluster name. Supports updating the policy and transfer schedule of an existing relationship identified by its destination SVM and volume.`
const UpdateSnapMirror = `Update a SnapMirror relationship on a cluster by cluster name. Supports updating the snapmirror policy, snapmirror relationship state and transfer schedule of an existing relationship identified by its destination SVM and volume.`
const DeleteSnapMirror = `Delete a SnapMirror relationship on a cluster by cluster name. Identifies the relationship by destination SVM and volume names.`
const InitializeSnapMirror = `Initialize a SnapMirror relationship on a cluster by cluster name. Starts the baseline transfer from source to destination. Identifies the relationship by destination SVM and volume names.`
const UpdateSnapMirrorTransfer = `Trigger a SnapMirror update transfer on a cluster by cluster name. Transfers new data from source to destination to bring the relationship up to date. Identifies the relationship by destination SVM and volume names.`
Expand All @@ -158,7 +158,7 @@ const DescribeOntapEndpoint = `Get filterable query params for an endpoint. Call
Pass cluster_name to automatically filter out fields and filters not available in that cluster's ONTAP version.`

const CreateSVM = `Create an SVM on a cluster by cluster name.`
const UpdateSVM = `Update an SVM on a cluster by cluster name.`
const UpdateSVM = `Update an SVM name, comment, or SVM state on a cluster by cluster name.`
const DeleteSVM = `Delete an SVM on a cluster by cluster name.`
const DeleteSVMPeer = `Delete an SVM peer on a cluster by cluster name and local SVM name. The peer relationship UUID is looked up internally using the svm.name filter.`

Expand Down
14 changes: 7 additions & 7 deletions integration/test/igroup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,18 +123,18 @@ func TestIGroupLUNMap(t *testing.T) {
expectedOntapErr: "",
verifyAPI: ontapVerifier{api: "api/protocols/san/lun-maps?igroup.name=" + rn("igroupFinNew") + "&lun.name=" + "/vol/" + rn("doc") + "/" + rn("lundoc") + "&svm.name=" + rn("marketing"), validationFunc: deleteObject},
},
{
name: "Clean volume",
input: ClusterStr + "delete volume " + rn("doc") + " in " + rn("marketing") + " svm",
expectedOntapErr: "",
verifyAPI: ontapVerifier{api: "api/storage/volumes?name=" + rn("doc") + "&svm.name=" + rn("marketing"), validationFunc: deleteObject},
},
{
name: "Clean LUN",
input: ClusterStr + "delete lun " + rn("lundoc") + " in volume " + rn("doc") + " in " + rn("marketing") + " svm",
expectedOntapErr: "",
verifyAPI: ontapVerifier{api: "api/storage/luns?name=/vol/" + rn("doc") + "/" + rn("lundoc") + "&svm.name=" + rn("marketing"), validationFunc: deleteObject},
},
{
name: "Clean volume",
input: ClusterStr + "delete volume " + rn("doc") + " in " + rn("marketing") + " svm",
expectedOntapErr: "",
verifyAPI: ontapVerifier{api: "api/storage/volumes?name=" + rn("doc") + "&svm.name=" + rn("marketing"), validationFunc: deleteObject},
},
{
name: "Clean igroup",
input: ClusterStr + "delete igroup " + rn("igroupFinNew") + " on the " + rn("marketing") + " svm",
Expand All @@ -155,7 +155,7 @@ func TestIGroupLUNMap(t *testing.T) {
},
{
name: "Update iSCSI service",
input: ClusterStr + "disabled iscsi service on the " + rn("marketing") + " svm",
input: ClusterStr + "disable the admin state of the iscsi service on the " + rn("marketing") + " svm",
expectedOntapErr: "",
verifyAPI: ontapVerifier{},
},
Expand Down
2 changes: 1 addition & 1 deletion integration/test/iscsi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func TestIscsiProtocol(t *testing.T) {
},
{
name: "Update iSCSI service",
input: ClusterStr + "disabled iscsi service on the " + rn("marketing") + " svm",
input: ClusterStr + "disable the admin state of the iscsi service on the " + rn("marketing") + " svm",
expectedOntapErr: "",
verifyAPI: ontapVerifier{},
},
Expand Down
2 changes: 1 addition & 1 deletion integration/test/lun_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func TestLUN(t *testing.T) {
{
name: "Clean LUN",
input: ClusterStr + "delete lun " + rn("lundocnew") + " in volume " + rn("doc") + " in " + rn("marketing") + " svm",
expectedOntapErr: "because it does not exist",
expectedOntapErr: "",
verifyAPI: ontapVerifier{api: "api/storage/luns?name=/vol/" + rn("doc") + "/" + rn("lundocnew") + "&svm.name=" + rn("marketing"), validationFunc: deleteObject},
Comment thread
Hardikl marked this conversation as resolved.
},
{
Expand Down
2 changes: 1 addition & 1 deletion integration/test/tools_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ func (a *Agent) ChatWithResponse(ctx context.Context, t *testing.T, userMessage
failedTool = toolName
argsUsed = args
errFound = err
slog.Warn("LLM will retry", slog.String("tool", toolName), slog.Any("args", args), slog.Any("error", err))
slog.Warn("LLM will retry", slog.String("tool", toolName), slog.Any("args", args), slog.String("input", userMessage), slog.Any("error", err))

result = "Error: " + err.Error()
}
Expand Down
4 changes: 2 additions & 2 deletions server/Snapshotpolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strings"
)

func (a *App) CreateSnapshotPolicy(ctx context.Context, _ *mcp.CallToolRequest, parameters tool.SnapshotPolicy) (*mcp.CallToolResult, any, error) {
func (a *App) CreateSnapshotPolicy(ctx context.Context, _ *mcp.CallToolRequest, parameters tool.SnapshotPolicyCreate) (*mcp.CallToolResult, any, error) {
if !a.locks.TryLock(parameters.Cluster) {
return errorResult(fmt.Errorf("another write operation is in progress on cluster %s, please try again", parameters.Cluster)), nil, nil
}
Expand Down Expand Up @@ -102,7 +102,7 @@ func (a *App) DeleteSnapshotPolicy(ctx context.Context, _ *mcp.CallToolRequest,

// newCreateSnapshotPolicy validates the customer provided arguments and converts them into
// the corresponding ONTAP object ready to use via the REST API
func newCreateSnapshotPolicy(in tool.SnapshotPolicy) (ontap.SnapshotPolicy, error) {
func newCreateSnapshotPolicy(in tool.SnapshotPolicyCreate) (ontap.SnapshotPolicy, error) {
out := ontap.SnapshotPolicy{}
if in.SVM == "" {
return out, errors.New("SVM name is required")
Expand Down
8 changes: 8 additions & 0 deletions tool/tool.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ type Autosize struct {
ShrinkThreshold string `json:"shrink_threshold,omitzero" jsonschema:"percentage of auto shrinkage"`
}

type SnapshotPolicyCreate struct {
Cluster string `json:"cluster_name" jsonschema:"cluster name"`
SVM string `json:"svm_name" jsonschema:"SVM name"`
Name string `json:"name" jsonschema:"snapshot policy name"`
Schedule string `json:"schedule" jsonschema:"schedule of snapshot policy"`
Count int `json:"count" jsonschema:"number of snapshots"`
}

type SnapshotPolicy struct {
Cluster string `json:"cluster_name" jsonschema:"cluster name"`
SVM string `json:"svm_name" jsonschema:"SVM name"`
Expand Down
Loading