Previous Topic: Unmounting VSS Snapshots from Replica Servers: unmount_snapshot()Next Topic: Getting Lists of VSS Snapshots from Replica Servers: get_snapshot_list()


Removing VSS Snapshots from Replica Servers: delete_snapshot()

The delete_snapshot API function lets you delete VSS snapshots from replica servers.

Arguments

The delete_snapshot API function includes the arguments described in the following table:

Name

Type

Description

session_id

uint

The session ID that was returned by calling the create_session API.

host_name

string

The engine host name

ip_string

string

The IP address of the host_name.

host_port

ushort

The engine port number. Typically, the port number is 25000.

snapshot_id

string

The VSS snapshot ID.

why_not_reason

out string

Contains the reason for failure when this API fails.

Return Values

The return type is Boolean. When the return value is true, the API completed successfully. When the return value is false, the API did not complete successfully. If the return value is false, review the message to determine the reason the API failed.

Example

public bool delete_snapshot_example()
        {
            try
            {
                string host_name = "155.35.66.142";
                string ip_string = "155.35.66.142";
                ushort host_port = 25000;
                string snapshot_id = "{9CFDE664-62D5-4fd8-A304-2B664900B98F}";
                string why_not_reason = "";
                return get_mng().delete_snapshot(session_id, host_name, ip_string, host_port, snapshot_id, out why_not_reason);
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }
            return false;
        }