ShareURL class

A ShareURL represents a URL to the Azure Storage share allowing you to manipulate its directories and files.

Extends

Constructors

ShareURL(string, Pipeline)

Creates an instance of ShareURL.

Inherited Properties

url

URL string value.

Methods

create(Aborter, IShareCreateOptions)

Creates a new share under the specified account. If the share with the same name already exists, the operation fails.

See https://docs.microsoft.com/en-us/rest/api/storageservices/create-share

createPermission(Aborter, string)

Creates a file permission (a security descriptor) at the share level. The created security descriptor can be used for the files/directories in the share.

See https://docs.microsoft.com/en-us/rest/api/storageservices/create-permission

createSnapshot(Aborter, IShareCreateSnapshotOptions)

Creates a read-only snapshot of a share.

delete(Aborter, IShareDeleteMethodOptions)

Marks the specified share for deletion. The share and any directories or files contained within it are later deleted during garbage collection.

See https://docs.microsoft.com/en-us/rest/api/storageservices/delete-share

fromServiceURL(ServiceURL, string)

Creates a ShareURL object from ServiceURL

getAccessPolicy(Aborter)

Gets the permissions for the specified share. The permissions indicate whether share data may be accessed publicly.

WARNING: JavaScript Date will potential lost precision when parsing start and expiry string. For example, new Date("2018-12-31T03:44:23.8827891Z").toISOString() will get "2018-12-31T03:44:23.882Z".

See https://docs.microsoft.com/en-us/rest/api/storageservices/get-share-acl

getPermission(Aborter, string)

Gets the Security Descriptor Definition Language (SDDL) for a given file permission key which indicates a security descriptor.

See https://docs.microsoft.com/en-us/rest/api/storageservices/get-permission

getProperties(Aborter)

Returns all user-defined metadata and system properties for the specified share.

See https://docs.microsoft.com/en-us/rest/api/storageservices/get-share-properties

getStatistics(Aborter)

Retrieves statistics related to the share.

setAccessPolicy(Aborter, ISignedIdentifier[])

Sets the permissions for the specified share. The permissions indicate whether directories or files in a share may be accessed publicly.

When you set permissions for a share, the existing permissions are replaced. If no shareAcl provided, the existing share ACL will be removed.

See https://docs.microsoft.com/en-us/rest/api/storageservices/set-share-acl

setMetadata(Aborter, IMetadata)

Sets one or more user-defined name-value pairs for the specified share.

If no option provided, or no metadata defined in the option parameter, the share metadata will be removed.

See https://docs.microsoft.com/en-us/rest/api/storageservices/set-share-metadata

setQuota(Aborter, number)

Sets quota for the specified share.

withPipeline(Pipeline)

Creates a new ShareURL object identical to the source but with the specified request policy pipeline.

withSnapshot(string)

Creates a new ShareURL object identical to the source but with the specified snapshot timestamp. Provide "" will remove the snapshot and return a URL to the base share.

Inherited Methods

newPipeline(Credential, INewPipelineOptions)

A static method used to create a new Pipeline object with Credential provided.

Constructor Details

ShareURL(string, Pipeline)

Creates an instance of ShareURL.

new ShareURL(url: string, pipeline: Pipeline)

Parameters

url

string

A URL string pointing to Azure Storage file share, such as "https://myaccount.file.core.windows.net/share". You can append a SAS if using AnonymousCredential, such as "https://myaccount.file.core.windows.net/share?sasString".

pipeline
Pipeline

Call StorageURL.newPipeline() to create a default pipeline, or provide a customized pipeline.

Inherited Property Details

url

URL string value.

url: string

Property Value

string

Inherited From StorageURL.url

Method Details

create(Aborter, IShareCreateOptions)

Creates a new share under the specified account. If the share with the same name already exists, the operation fails.

See https://docs.microsoft.com/en-us/rest/api/storageservices/create-share

function create(aborter: Aborter, options?: IShareCreateOptions): Promise<ShareCreateResponse>

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation

Returns

createPermission(Aborter, string)

Creates a file permission (a security descriptor) at the share level. The created security descriptor can be used for the files/directories in the share.

See https://docs.microsoft.com/en-us/rest/api/storageservices/create-permission

function createPermission(aborter: Aborter, filePermission: string): Promise<ShareCreatePermissionResponse>

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation

filePermission

string

File permission described in the SDDL

Returns

createSnapshot(Aborter, IShareCreateSnapshotOptions)

Creates a read-only snapshot of a share.

function createSnapshot(aborter: Aborter, options?: IShareCreateSnapshotOptions): Promise<ShareCreateSnapshotResponse>

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation

Returns

delete(Aborter, IShareDeleteMethodOptions)

Marks the specified share for deletion. The share and any directories or files contained within it are later deleted during garbage collection.

See https://docs.microsoft.com/en-us/rest/api/storageservices/delete-share

function delete(aborter: Aborter, options?: IShareDeleteMethodOptions): Promise<ShareDeleteResponse>

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation

Returns

fromServiceURL(ServiceURL, string)

Creates a ShareURL object from ServiceURL

static function fromServiceURL(serviceURL: ServiceURL, shareName: string): ShareURL

Parameters

serviceURL
ServiceURL
shareName

string

Returns

getAccessPolicy(Aborter)

Gets the permissions for the specified share. The permissions indicate whether share data may be accessed publicly.

WARNING: JavaScript Date will potential lost precision when parsing start and expiry string. For example, new Date("2018-12-31T03:44:23.8827891Z").toISOString() will get "2018-12-31T03:44:23.882Z".

See https://docs.microsoft.com/en-us/rest/api/storageservices/get-share-acl

function getAccessPolicy(aborter: Aborter): Promise<ShareGetAccessPolicyResponse>

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation

Returns

getPermission(Aborter, string)

Gets the Security Descriptor Definition Language (SDDL) for a given file permission key which indicates a security descriptor.

See https://docs.microsoft.com/en-us/rest/api/storageservices/get-permission

function getPermission(aborter: Aborter, filePermissionKey: string): Promise<ShareGetPermissionResponse>

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation

filePermissionKey

string

File permission key which indicates the security descriptor of the permission.

Returns

getProperties(Aborter)

Returns all user-defined metadata and system properties for the specified share.

See https://docs.microsoft.com/en-us/rest/api/storageservices/get-share-properties

function getProperties(aborter: Aborter): Promise<ShareGetPropertiesResponse>

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation

Returns

getStatistics(Aborter)

Retrieves statistics related to the share.

function getStatistics(aborter: Aborter): Promise<ShareGetStatisticsResponse>

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation

Returns

setAccessPolicy(Aborter, ISignedIdentifier[])

Sets the permissions for the specified share. The permissions indicate whether directories or files in a share may be accessed publicly.

When you set permissions for a share, the existing permissions are replaced. If no shareAcl provided, the existing share ACL will be removed.

See https://docs.microsoft.com/en-us/rest/api/storageservices/set-share-acl

function setAccessPolicy(aborter: Aborter, shareAcl?: ISignedIdentifier[]): Promise<ShareSetAccessPolicyResponse>

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation

shareAcl

ISignedIdentifier[]

Returns

setMetadata(Aborter, IMetadata)

Sets one or more user-defined name-value pairs for the specified share.

If no option provided, or no metadata defined in the option parameter, the share metadata will be removed.

See https://docs.microsoft.com/en-us/rest/api/storageservices/set-share-metadata

function setMetadata(aborter: Aborter, metadata?: IMetadata): Promise<ShareSetMetadataResponse>

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation

metadata

IMetadata

If no metadata provided, all existing directory metadata will be removed

Returns

setQuota(Aborter, number)

Sets quota for the specified share.

function setQuota(aborter: Aborter, quotaInGB: number): Promise<ShareSetQuotaResponse>

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation

quotaInGB

number

Specifies the maximum size of the share in gigabytes

Returns

withPipeline(Pipeline)

Creates a new ShareURL object identical to the source but with the specified request policy pipeline.

function withPipeline(pipeline: Pipeline): ShareURL

Parameters

pipeline
Pipeline

Returns

withSnapshot(string)

Creates a new ShareURL object identical to the source but with the specified snapshot timestamp. Provide "" will remove the snapshot and return a URL to the base share.

function withSnapshot(snapshot: string): ShareURL

Parameters

snapshot

string

Returns

A new ShareURL object identical to the source but with the specified snapshot timestamp

Inherited Method Details

newPipeline(Credential, INewPipelineOptions)

A static method used to create a new Pipeline object with Credential provided.

static function newPipeline(credential: Credential, pipelineOptions?: INewPipelineOptions): Pipeline

Parameters

credential
Credential

Such as AnonymousCredential, SharedKeyCredential.

pipelineOptions
INewPipelineOptions

Optional. Options.

Returns

A new Pipeline object.

Inherited From StorageURL.newPipeline