new module:api/ObjectsApi(apiClient)
Constructs a new ObjectsApi.
Parameters:
| Name | Type | Description |
|---|---|---|
apiClient |
module:ApiClient | Optional API client implementation to use, default to module:ApiClient#instance if unspecified. |
- Source:
Methods
(async) calculateSHA1(strorbuffer) → {Promise.<String>}
Calc SHA1
Parameters:
| Name | Type | Description |
|---|---|---|
strorbuffer |
String | Buffer | Stream | Content to calc SHA1 for |
- Source:
Returns:
- Type
- Promise.<String>
(async) completeS3Upload(bucketKey, objectKey, body, credentials, optsopt, oauth2client, credentials) → {Promise.<any>}
Instructs OSS to complete the object creation process after the bytes have been uploaded directly to S3.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bucketKey |
String | bucket key (will be URL-encoded automatically) |
|||||||||||||||||||||
objectKey |
String | object key (will be URL-encoded automatically) |
|||||||||||||||||||||
body |
Object |
Properties
|
|||||||||||||||||||||
credentials |
|||||||||||||||||||||||
opts |
Object |
<optional> |
Optional parameters Properties
|
||||||||||||||||||||
oauth2client |
Object | oauth2client for the call |
|||||||||||||||||||||
credentials |
Object | credentials for the call |
- Source:
Returns:
- Type
- Promise.<any>
(async) completeS3Uploads(bucketKey, body, optsopt, oauth2client, credentials) → {Promise.<any>}
Instructs OSS to complete the object creation process for numerous objects after their bytes have been uploaded directly to S3.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bucketKey |
String | bucket key (will be URL-encoded automatically) |
|||||||||||||||||||||||
body |
Object | body parameter Properties
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||||
body.requests[].xAdsMetaContentType |
String |
<optional> |
(x-ads-meta-Content-Type) The Content-Type value that OSS will store in the record for the uploaded object. |
||||||||||||||||||||||
body.requests[].xAdsMetaContentDisposition |
String |
<optional> |
(x-ads-meta-Content-Disposition) The Content-Disposition value that OSS will store in the record for the uploaded object. |
||||||||||||||||||||||
body.requests[].xAdsMetaContentEncoding |
String |
<optional> |
(x-ads-meta-Content-Encoding) The Content-Encoding value that OSS will store in the record for the uploaded object. |
||||||||||||||||||||||
body.requests[].xAdsMetaCacheControl |
String |
<optional> |
(x-ads-meta-Cache-Control) The Cache-Control value that OSS will store in the record for the uploaded object. |
||||||||||||||||||||||
opts |
Object |
<optional> |
Optional parameters |
||||||||||||||||||||||
oauth2client |
Object | oauth2client for the call |
|||||||||||||||||||||||
credentials |
Object | credentials for the call |
- Source:
Returns:
- Type
- Promise.<any>
(async) copyTo(bucketKey, objectKey, newObjectKey, oauth2client, credentials) → {Promise.<ObjectDetails>}
Copies an object to another object name in the same bucket.
Parameters:
| Name | Type | Description |
|---|---|---|
bucketKey |
String | bucket key (will be URL-encoded automatically) |
objectKey |
String | object key (will be URL-encoded automatically) |
newObjectKey |
String | bject key to use as the destination (will be URL-encoded automatically) data is of type: {module:model/ObjectDetails} |
oauth2client |
Object | oauth2client for the call |
credentials |
Object | credentials for the call |
- Source:
Returns:
- Type
- Promise.<ObjectDetails>
(async) createSignedResource(bucketKey, objectKey, postBucketsSigned, optsopt, oauth2client, credentials) → {Promise.<PostObjectSigned>}
This endpoint creates a signed URL that can be used to download an object within the specified expiration time. Be aware that if the object the signed URL points to is deleted or expires before the signed URL expires, then the signed URL will no longer be valid. A successful call to this endpoint requires bucket owner access.
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bucketKey |
String | bucket key (will be URL-encoded automatically) |
||||||||||||||||
objectKey |
String | object key (will be URL-encoded automatically) |
||||||||||||||||
postBucketsSigned |
module:model/PostBucketsSigned | Body Structure |
||||||||||||||||
opts |
Object |
<optional> |
Optional parameters Properties
|
|||||||||||||||
oauth2client |
Object | oauth2client for the call |
||||||||||||||||
credentials |
Object | credentials for the call |
- Source:
Returns:
- Type
- Promise.<PostObjectSigned>
(async) deleteObject(bucketKey, objectKey, oauth2client, credentials) → {Promise.<void>}
Deletes an object from the bucket.
Parameters:
| Name | Type | Description |
|---|---|---|
bucketKey |
String | bucket key (will be URL-encoded automatically) |
objectKey |
String | object key (will be URL-encoded automatically) |
oauth2client |
Object | oauth2client for the call |
credentials |
Object | credentials for the call |
- Source:
Returns:
- Type
- Promise.<void>
(async) deleteSignedResource(id, optsopt, oauth2client, credentials) → {Promise.<void>}
Delete a signed URL. A successful call to this endpoint requires bucket owner access.
Parameters:
| Name | Type | Attributes | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id |
String | Id of signed resource |
|||||||||||
opts |
Object |
<optional> |
Optional parameters Properties
|
||||||||||
oauth2client |
Object | oauth2client for the call |
|||||||||||
credentials |
Object | credentials for the call |
- Source:
Returns:
- Type
- Promise.<void>
(async) downloadResources(bucketKey, objects, optsopt, oauth2client, credentials) → {Promise.<Array.<any>>}
Download a resource.
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bucketKey |
String | bucket key (will be URL-encoded automatically) |
||||||||||||||||||||||||||
objects |
Object | Array.<Object> | Object or Object array of resource to uplaod with their parameters |
||||||||||||||||||||||||||
object[].objectKey |
String | object key |
||||||||||||||||||||||||||
object[].responseType |
String | Resource to upload If String, it is the expected response type (defaults to json) ['arraybuffer', 'document', 'json', 'text', 'stream'] If you 'stream', you need to provide a writable stream ('data'), the method will pipe content into it. |
||||||||||||||||||||||||||
opts |
Object |
<optional> |
Optional parameters Properties
|
|||||||||||||||||||||||||
oauth2client |
Object | oauth2client for the call |
||||||||||||||||||||||||||
credentials |
Object | credentials for the call |
- Source:
Returns:
- Type
- Promise.<Array.<any>>
(async) getObject(bucketKey, objectKey, optsopt, oauth2client, credentials) → {Promise.<any>}
Download an object.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bucketKey |
String | bucket key (will be URL-encoded automatically) |
|||||||||||||||||||||||||
objectKey |
String | object key (will be URL-encoded automatically) |
|||||||||||||||||||||||||
opts |
Object |
<optional> |
Optional parameters Properties
|
||||||||||||||||||||||||
oauth2client |
Object | oauth2client for the call |
|||||||||||||||||||||||||
credentials |
Object | credentials for the call |
- Deprecated:
- Yes
- Source:
Returns:
- Type
- Promise.<any>
(async) getObjectDetails(bucketKey, objectKey, optsopt, oauth2client, credentials) → {Promise.<ObjectFullDetails>}
Returns object details in JSON format.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bucketKey |
String | bucket key (will be URL-encoded automatically) |
|||||||||||||
objectKey |
String | object key (will be URL-encoded automatically) |
|||||||||||||
opts |
Object |
<optional> |
Optional parameters Properties
|
||||||||||||
oauth2client |
Object | oauth2client for the call |
|||||||||||||
credentials |
Object | credentials for the call |
- Source:
Returns:
- Type
- Promise.<ObjectFullDetails>
(async) getObjects(bucketKey, optsopt, oauth2client, credentials) → {Promise.<BucketObjects>}
List objects in a bucket. It is only available to the bucket creator.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bucketKey |
String | bucket key (will be URL-encoded automatically) |
|||||||||||||||||||||
opts |
Object |
<optional> |
Optional parameters Properties
|
||||||||||||||||||||
oauth2client |
Object | oauth2client for the call |
|||||||||||||||||||||
credentials |
Object | credentials for the call |
- Source:
Returns:
- Type
- Promise.<BucketObjects>
(async) getS3DownloadURL(bucketKey, objectKey, optsopt, oauth2client, credentials) → {Promise.<ObjectS3Download>}
Returns a signed S3 URL.
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bucketKey |
String | bucket key (will be URL-encoded automatically) |
||||||||||||||||||||||||||||||||||||||||||||||
objectKey |
String | bucobjectket key (will be URL-encoded automatically) |
||||||||||||||||||||||||||||||||||||||||||||||
opts |
Object |
<optional> |
Optional parameters Properties
|
|||||||||||||||||||||||||||||||||||||||||||||
oauth2client |
Object | oauth2client for the call |
||||||||||||||||||||||||||||||||||||||||||||||
credentials |
Object | credentials for the call |
- Source:
Returns:
- Type
- Promise.<ObjectS3Download>
(async) getS3DownloadURLs(bucketKey, body, optsopt, oauth2client, credentials) → {Promise.<any>}
Gets one or more signed URLs to objects. The signed URLs can be used to download the objects directly from S3, skipping OSS servers. Be aware that expiration time for the signed URL(s) is just 60 seconds. So, a request to the URL(s) must begin within 60 seconds; the transfer of the data can exceed 60 seconds. A successful call to this endpoint requires bucket owner access. Note that resumable uploads store each chunk individually. After upload completes, an async process merges all the chunks and creates the definitive OSS file. This async process can take time. If you request an S3 download URL before the async process completes, the response returns a map of S3 URLs, one per chunk where the key is the corresponding range bytes. In case you don’t want multiple URLs in the response, you can use OSS signed URL functionality, with the public-resource-fallback query parameter set to true. Note: While this endpoint does not support range headers, the returned URL(s) can be used for ranged downloads. This way, downloads can be parallelized using multiple ranges for maximum speed.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bucketKey |
String | bucket key (will be URL-encoded automatically) |
|||||||||||||||||||||||||||||||||||
body |
Object | body parameter Properties
|
|||||||||||||||||||||||||||||||||||
opts |
Object |
<optional> |
Optional parameters Properties
|
||||||||||||||||||||||||||||||||||
oauth2client |
Object | oauth2client for the call |
|||||||||||||||||||||||||||||||||||
credentials |
Object | credentials for the call |
- Source:
Returns:
- Type
- Promise.<any>
(async) getS3UploadURL(bucketKey, objectKey, optsopt, oauth2client, credentials) → {Promise.<any>}
Requests an S3 signed URL with which to upload an object, or an array of signed URLs with which to upload an object in multiple parts.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bucketKey |
String | bucket key (will be URL-encoded automatically) |
|||||||||||||||||||||
objectKey |
String | object key (will be URL-encoded automatically) |
|||||||||||||||||||||
opts |
Object |
<optional> |
Optional parameters Properties
|
||||||||||||||||||||
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
oauth2client |
Object | oauth2client for the call |
|||||||||||||||||||||
credentials |
Object | credentials for the call |
- Source:
Returns:
- Type
- Promise.<any>
(async) getS3UploadURLs(bucketKey, body, optsopt, oauth2client, credentials) → {Promise.<any>}
Requests a batch of S3 signed URL with which to upload multiple objects or chunks of multiple objects.
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bucketKey |
String | bucket key (will be URL-encoded automatically) |
||||||||||||||||||||||||||||||||
body |
Object | body parameter Properties
|
||||||||||||||||||||||||||||||||
opts |
Object |
<optional> |
Optional parameters Properties
|
|||||||||||||||||||||||||||||||
oauth2client |
Object | oauth2client for the call |
||||||||||||||||||||||||||||||||
credentials |
Object | credentials for the call |
- Source:
Returns:
- Type
- Promise.<any>
(async) getSignedResource(id, optsopt, oauth2client, credentials) → {Promise.<any>}
Download an object using a signed URL.
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id |
String | Id of signed resource |
||||||||||||||||||||||||||||||||||||
opts |
Object |
<optional> |
Optional parameters Properties
|
|||||||||||||||||||||||||||||||||||
oauth2client |
Object | oauth2client for the call |
||||||||||||||||||||||||||||||||||||
credentials |
Object | credentials for the call |
- Deprecated:
- Yes
- Source:
Returns:
- Type
- Promise.<any>
(async) getStatusBySessionId(bucketKey, objectKey, sessionId, oauth2client, credentials)
This endpoint returns status information about a resumable upload.
Parameters:
| Name | Type | Description |
|---|---|---|
bucketKey |
String | bucket key (will be URL-encoded automatically) |
objectKey |
String | object key (will be URL-encoded automatically) |
sessionId |
String | Unique identifier of a session of a file being uploaded |
oauth2client |
Object | oauth2client for the call |
credentials |
Object | credentials for the call |
- Source:
(async) uploadChunk(bucketKey, objectKey, contentLength, contentRange, sessionId, body, optsopt, oauth2client, credentials) → {Promise.<ObjectDetails>}
This endpoint allows resumable uploads for large files in chunks.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bucketKey |
String | bucket key (will be URL-encoded automatically) |
|||||||||||||||||||||
objectKey |
String | object key (will be URL-encoded automatically) |
|||||||||||||||||||||
contentLength |
Integer | Indicates the size of the request body. |
|||||||||||||||||||||
contentRange |
String | Byte range of a segment being uploaded |
|||||||||||||||||||||
sessionId |
String | Unique identifier of a session of a file being uploaded |
|||||||||||||||||||||
body |
File | ||||||||||||||||||||||
opts |
Object |
<optional> |
Optional parameters Properties
|
||||||||||||||||||||
oauth2client |
Object | oauth2client for the call |
|||||||||||||||||||||
credentials |
Object | credentials for the call |
- Deprecated:
- Yes
- Source:
Returns:
- Type
- Promise.<ObjectDetails>
(async) uploadObject(bucketKey, objectKey, contentLength, body, optsopt, oauth2client, credentials) → {Promise.<ObjectDetails>}
Upload an object. If the specified object name already exists in the bucket, the uploaded content will overwrite the existing content for the bucket name/object name combination.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bucketKey |
String | bucket key (will be URL-encoded automatically) |
|||||||||||||||||||||
objectKey |
String | object key (will be URL-encoded automatically) |
|||||||||||||||||||||
contentLength |
Integer | Indicates the size of the request body. |
|||||||||||||||||||||
body |
File | ||||||||||||||||||||||
opts |
Object |
<optional> |
Optional parameters Properties
|
||||||||||||||||||||
oauth2client |
Object | oauth2client for the call |
|||||||||||||||||||||
credentials |
Object | credentials for the call |
- Deprecated:
- Yes
- Source:
Returns:
- Type
- Promise.<ObjectDetails>
(async) uploadResources(bucketKey, objects, credentials, optsopt, oauth2client, credentials) → {Promise.<Array.<any>>}
Upload a resource. If the specified object name already exists in the bucket, the uploaded content will overwrite the existing content for the bucket name/object name combination.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
bucketKey |
String | bucket key (will be URL-encoded automatically) |
|
objects |
Object | Array.<Object> | Object or Object array of resource to uplaod with their parameters |
|
object[].objectKey |
String | object key |
|
object[].data |
String | Buffer | Stream | Resource to upload (String| Buffer | Stream) |
|
credentials |
|||
object[].xAdsMetaContentType |
String |
<optional> |
(x-ads-meta-Content-Type) The Content-Type value that OSS will store in the record for the uploaded object. |
object[].xAdsMetaContentDisposition |
String |
<optional> |
(x-ads-meta-Content-Disposition) The Content-Disposition value that OSS will store in the record for the uploaded object. |
object[].xAdsMetaContentEncoding |
String |
<optional> |
(x-ads-meta-Content-Encoding) The Content-Encoding value that OSS will store in the record for the uploaded object. |
object[].xAdsMetaCacheControl |
String |
<optional> |
(x-ads-meta-Cache-Control) The Cache-Control value that OSS will store in the record for the uploaded object. |
opts |
Object |
<optional> |
Optional parameters |
|
|||
|
|||
|
|||
|
|||
|
|||
oauth2client |
Object | oauth2client for the call |
|
credentials |
Object | credentials for the call |
- Source:
Returns:
- Type
- Promise.<Array.<any>>
(async) uploadSignedResource(id, contentLength, body, optsopt, oauth2client, credentials) → {Promise.<ObjectDetails>}
Overwrite a existing object using a signed URL. Conditions to call this operation: Object is available Expiration period is valid Signed URL should be created with write or readwrite
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
id |
String | Id of signed resource |
||
contentLength |
Integer | Indicates the size of the request body. |
||
body |
File | |||
opts |
Object |
<optional> |
Optional parameters |
|
opt.contentType |
String |
<optional> |
Optional array of possible Content-Type header |
|
opts.contentDisposition |
String |
<optional> |
The suggested default filename when downloading this object to a file after it has been uploaded. |
|
opts.xAdsRegion |
String |
<optional> |
US | The region where the bucket resides Acceptable values: |
opts.ifMatch |
String | If-Match header containing a SHA-1 hash of the bytes in the request body can be sent by the calling service or client application with the request. If present, OSS will use the value of If-Match header to verify that a SHA-1 calculated for the uploaded bytes server side matches what was sent in the header. If not, the request is failed with a status 412 Precondition Failed and the data is not written. data is of type: {module:model/ObjectDetails} |
||
oauth2client |
Object | oauth2client for the call |
||
credentials |
Object | credentials for the call |
- Deprecated:
- Yes
- Source:
Returns:
- Type
- Promise.<ObjectDetails>
(async) uploadSignedResourcesChunk(id, contentRange, sessionId, body, optsopt, oauth2client, credentials) → {Promise.<ObjectDetails>}
Resumable upload for signed URLs.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id |
String | Id of signed resource |
|||||||||||||||||||||
contentRange |
String | Byte range of a segment being uploaded |
|||||||||||||||||||||
sessionId |
String | Unique identifier of a session of a file being uploaded |
|||||||||||||||||||||
body |
File | ||||||||||||||||||||||
opts |
Object |
<optional> |
Optional parameters Properties
|
||||||||||||||||||||
oauth2client |
Object | oauth2client for the call |
|||||||||||||||||||||
credentials |
Object | credentials for the call |
- Deprecated:
- Yes
- Source:
Returns:
- Type
- Promise.<ObjectDetails>