IPWorks Cloud 2020 Node.js Edition

Questions / Feedback?

ListShares Method

Lists shares in the file storage account.

Syntax

azurefile.listShares([callback])

Callback

The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).

The callback for this method is defined as:

function(err){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'err' has 2 properties which hold detailed information:

err.code
err.message

Remarks

This method lists the shares in the file storage account specified by the Account property.

Before calling this method, the Prefix property may be set in order to restrict the results to only the items whose names begin with a given string. The MaxResults configuration setting may also be used to limit the number of results returned.

Calling this method will fire the ShareList event once for each share, and will also populate the Share* properties.

If there are still more shares available to list when this method returns, the ShareMarker property will be populated. Continue to call this method until ShareMarker is empty to accumulate all pages of results in the Share* properties.

Note that the server does not return the shares' ShareSpaceUsed property when listing shares; use GetShareInfo to retrieve all properties for a specific share.

// ShareList event handler.
azurefile.OnShareList += (s, e) => {
  Console.WriteLine(e.Name);
};

do {
  azurefile.ListShares();

  for (int i = 0; i < azurefile.Shares.Count; i++) {
    // Process shares here.
  }
} while (!string.IsNullOrEmpty(azurefile.ShareMarker));

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks Cloud 2020 Node.js Edition - Version 20.0 [Build 8265]