GetLink Method

Creates a link that provides access to a container, blob, or snapshot.

Syntax

QString GetLink(const QString& qsBlob, const QString& qsPermissions, const QString& qsStartTime, const QString& qsExpiryTime);

Remarks

This method creates and returns a shared access signature (SAS), which is a link that provides access to a specific container, blob, or snapshot. The following table indicates which inputs must be provided to produce a link of the desired type:

Link TypeRequired Inputs
Container Non-empty Container, empty Blob, any Snapshot (ignored)
Blob Non-empty Container and Blob, empty Snapshot
Snapshot Non-empty Container, Blob, and Snapshot

Permissions specifies what permissions the SAS grants, in the form of an abbreviated permissions list. Refer to this section of Azure's "Create a Service SAS" article for more information about how to format this value.

StartTime and ExpiryTime specify the UTC start and end times of the SAS's validity interval. Refer to this section of Azure's "Create a Service SAS" article for more information about how to format these values.

StartTime may be empty, in which case the server will assume that the link is valid immediately. Permissions and ExpiryTime must both be non-empty, unless an si query parameter that references a stored access policy (which has corresponding non-empty values) is present in the QueryParam* properties.

If any of the query parameters listed below are present in the QueryParam* properties when this method is called, they will be included when creating the SAS. All other application-specified query parameters are ignored.

  • Response headers: rscc, rscd, rsce, rscl, rsct
  • IP address (single or range): sip
  • Allowed HTTP protocol(s): spr
  • Stored access policy ("signed identifier"): si

For more information about SAS links, refer to Azure's Create a Service SAS article.

Error Handling

This method returns a String value; after it returns, call the GetLastErrorCode() method to obtain its result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.

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