Freigeben über


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.

Properties

pipeline

Request policy pipeline.

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.

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.

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.

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".

getPermission(Aborter, string)

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

getProperties(Aborter)

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

getStatistics(Aborter)

Retrieves statistics related to the share.

newPipeline(Credential, INewPipelineOptions)

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

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.

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.

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.

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.

Property Details

pipeline

Request policy pipeline.

pipeline: Pipeline

Property Value

url

URL string value.

url: string

Property Value

string

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.

function create(aborter: Aborter, options?: IShareCreateOptions)

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

Promise<Models.ShareCreateResponse>

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.

function createPermission(aborter: Aborter, filePermission: string)

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

Promise<Models.ShareCreatePermissionResponse>

createSnapshot(Aborter, IShareCreateSnapshotOptions)

Creates a read-only snapshot of a share.

function createSnapshot(aborter: Aborter, options?: IShareCreateSnapshotOptions)

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

Promise<Models.ShareCreateSnapshotResponse>

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.

function delete(aborter: Aborter, options?: IShareDeleteMethodOptions)

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

Promise<Models.ShareDeleteResponse>

fromServiceURL(ServiceURL, string)

Creates a ShareURL object from ServiceURL

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

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".

function getAccessPolicy(aborter: Aborter)

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.

function getPermission(aborter: Aborter, filePermissionKey: string)

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

Promise<Models.ShareGetPermissionResponse>

getProperties(Aborter)

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

function getProperties(aborter: Aborter)

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

Promise<Models.ShareGetPropertiesResponse>

getStatistics(Aborter)

Retrieves statistics related to the share.

function getStatistics(aborter: Aborter)

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

newPipeline(Credential, INewPipelineOptions)

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

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

Parameters

credential
Credential

Such as AnonymousCredential, SharedKeyCredential.

pipelineOptions
INewPipelineOptions

Returns

A new Pipeline object.

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.

function setAccessPolicy(aborter: Aborter, shareAcl?: ISignedIdentifier[])

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

Promise<Models.ShareSetAccessPolicyResponse>

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.

function setMetadata(aborter: Aborter, metadata?: IMetadata)

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

Returns

Promise<Models.ShareSetMetadataResponse>

setQuota(Aborter, number)

Sets quota for the specified share.

function setQuota(aborter: Aborter, quotaInGB: number)

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

Promise<Models.ShareSetQuotaResponse>

withPipeline(Pipeline)

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

function withPipeline(pipeline: Pipeline)

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)

Parameters

snapshot

string

Returns

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