Skip to content

Commit

Permalink
feat: restore support DeepColdArchive type
Browse files Browse the repository at this point in the history
  • Loading branch information
孟凡荣 committed Oct 11, 2024
1 parent 07ce713 commit 696a92d
Show file tree
Hide file tree
Showing 5 changed files with 2,629 additions and 5 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2986,6 +2986,33 @@ const result = await store.restore('ossdemo.txt', { type: 'ColdArchive', Days: 2
console.log(result.status);
```
- JobParameters for unfreezing Specifies the JobParameters for unfreezing
```js
const result = await store.restore('ossdemo.txt', { type: 'ColdArchive', Days: 2, JobParameters: 'Standard' });
console.log(result.status);
```
- Restore an object with DeepColdArchive type
```js
const result = await store.restore('ossdemo.txt', { type: 'DeepColdArchive' });
console.log(result.status);
```
- Days for unfreezing Specifies the days for unfreezing
```js
const result = await store.restore('ossdemo.txt', { type: 'DeepColdArchive', Days: 2 });
console.log(result.status);
```
- JobParameters for unfreezing Specifies the JobParameters for unfreezing
```js
const result = await store.restore('ossdemo.txt', { type: 'DeepColdArchive', Days: 2, JobParameters: 'Standard' });
console.log(result.status);
```
- Restore an history object
```js
Expand Down
2 changes: 1 addition & 1 deletion lib/browser/object.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ proto.restore = async function restore(name, options = { type: 'Archive' }) {
options.subres.versionId = options.versionId;
}
const params = this._objectRequestParams('POST', name, options);
if (options.type === 'ColdArchive') {
if (options.type === 'ColdArchive' || options.type === 'DeepColdArchive') {
const paramsXMLObj = {
RestoreRequest: {
Days: options.Days ? options.Days : 2,
Expand Down
2 changes: 1 addition & 1 deletion lib/object.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ proto.restore = async function restore(name, options = { type: 'Archive' }) {
options.subres.versionId = options.versionId;
}
const params = this._objectRequestParams('POST', name, options);
if (options.type === 'ColdArchive') {
if (options.type === 'ColdArchive' || options.type === 'DeepColdArchive') {
const paramsXMLObj = {
RestoreRequest: {
Days: options.Days ? options.Days : 2,
Expand Down
Loading

0 comments on commit 696a92d

Please sign in to comment.