Skip to content

Commit e191202

Browse files
committed
revamp glacier
1 parent 36cbea8 commit e191202

File tree

1 file changed

+57
-37
lines changed

1 file changed

+57
-37
lines changed

src/content/docs/aws/services/glacier.md

Lines changed: 57 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
2-
title: "Glacier"
3-
linkTitle: "Glacier"
2+
title: Glacier
43
description: Get started with S3 Glacier on LocalStack
54
tags: ["Ultimate"]
65
persistence: supported
@@ -16,7 +15,7 @@ Glacier uses Jobs to retrieve the data in an Archive or list the inventory of a
1615

1716
LocalStack allows you to use the Glacier APIs in your local environment to manage Vaults and Archives.
1817
You can use the Glacier API to configure and set up vaults where you can store archives and manage them.
19-
The supported APIs are available on our [API coverage page]({{< ref "coverage_glacier" >}}), which provides information on the extent of Glacier's integration with LocalStack.
18+
The supported APIs are available on our [API coverage page](), which provides information on the extent of Glacier's integration with LocalStack.
2019

2120
## Getting started
2221

@@ -30,16 +29,16 @@ We will demonstrate how to create a vault, upload an archive, initiate a job to
3029
You can create a vault using the [`CreateVault`](https://docs.aws.amazon.com/amazonglacier/latest/dev/api-vault-put.html) API.
3130
Run the follow command to create a Glacier Vault named `sample-vault`.
3231

33-
{{< command >}}
34-
$ awslocal glacier create-vault --vault-name sample-vault --account-id -
35-
{{< /command >}}
32+
```bash
33+
awslocal glacier create-vault --vault-name sample-vault --account-id -
34+
```
3635

3736
You can get the details from your vault using the [`DescribeVault`](https://docs.aws.amazon.com/amazonglacier/latest/dev/api-vault-get.html) API.
3837
Run the following command to describe your vault.
3938

40-
{{< command >}}
41-
$ awslocal glacier describe-vault --vault-name sample-vault --account-id -
42-
{{< /command >}}
39+
```bash
40+
awslocal glacier describe-vault --vault-name sample-vault --account-id -
41+
```
4342

4443
On successful creation of the Glacier vault, you will see the following output:
4544

@@ -60,9 +59,9 @@ You can upload an archive or an individual file to a vault using the [`UploadArc
6059
Download a random image from the internet and save it as `image.jpg`.
6160
Run the following command to upload the file to your Glacier vault:
6261

63-
{{< command >}}
64-
$ awslocal glacier upload-archive --vault-name sample-vault --account-id - --body image.jpg
65-
{{< /command >}}
62+
```bash
63+
awslocal glacier upload-archive --vault-name sample-vault --account-id - --body image.jpg
64+
```
6665

6766
On successful upload of the Glacier archive, you will see the following output:
6867

@@ -79,9 +78,13 @@ On successful upload of the Glacier archive, you will see the following output:
7978
You can initiate the retrieval of an archive from a vault using the [`InitiateJob`](https://docs.aws.amazon.com/amazonglacier/latest/dev/api-initiate-job-post.html) API.
8079

8180
To download an archive, you will need to initiate an `archive-retrieval` job first to make the Archive available for download.
82-
{{< command >}}
83-
$ awslocal glacier initiate-job --vault-name sample-vault --account-id - --job-parameters '{"Type":"archive-retrieval","ArchiveId":"d41d8cd98f00b204e9800998ecf8427e"}'
84-
{{< /command >}}
81+
82+
```bash
83+
awslocal glacier initiate-job \
84+
--vault-name sample-vault \
85+
--account-id - \
86+
--job-parameters '{"Type":"archive-retrieval","ArchiveId":"d41d8cd98f00b204e9800998ecf8427e"}'
87+
```
8588

8689
On successful execution of the job, you will see the following output:
8790

@@ -96,9 +99,9 @@ On successful execution of the job, you will see the following output:
9699

97100
You can list the current and previous processes, called Jobs, to monitor the requests sent to the Glacier API using the [`ListJobs`](https://docs.aws.amazon.com/amazonglacier/latest/dev/api-jobs-get.html) API.
98101

99-
{{< command >}}
100-
$ awslocal glacier list-jobs --vault-name sample-vault --account-id -
101-
{{< /command >}}
102+
```bash
103+
awslocal glacier list-jobs --vault-name sample-vault --account-id -
104+
```
102105

103106
On successful execution of the command, you will see the following output:
104107

@@ -130,22 +133,30 @@ The data download process can be verified through the previous `ListJobs` call t
130133
Once the `ArchiveRetrieval` Job is complete, the data can be downloaded.
131134
You can use the `JobId` of the Job to download your archive with the following command:
132135

133-
{{< command >}}
134-
$ awslocal glacier get-job-output --vault-name sample-vault --account-id - --job-id 25CEOTJ7ZUR5Q7YY0B1O55AE4C3L1502EOHWMNY10IIYEBWEQB73D23S8BVYO9RTRTPLRK2LJLUCCRM52GDV87C9A4JW my-archive.jpg
135-
{{< /command >}}
136+
```bash
137+
awslocal glacier get-job-output \
138+
--vault-name sample-vault \
139+
--account-id - \
140+
--job-id 25CEOTJ7ZUR5Q7YY0B1O55AE4C3L1502EOHWMNY10IIYEBWEQB73D23S8BVYO9RTRTPLRK2LJLUCCRM52GDV87C9A4JW \
141+
my-archive.jpg
142+
```
136143

137-
{{< callout >}}
144+
:::danger
138145
Please not that currently, this operation is only mocked, and will create an empty file named `my-archive.jpg`, not containing the contents of your archive.
139-
{{< /callout >}}
146+
:::
140147

141148
### Retrieve the inventory information
142149

143150
You can also initiate the retrieval of the inventory of a vault using the same [`InitiateJob`](https://docs.aws.amazon.com/amazonglacier/latest/dev/api-initiate-job-post.html) API.
144151

145152
Initiate a job of the specified type to get the details of the individual inventory items inside a Vault using the `initiate-job` command:
146-
{{< command >}}
147-
$ awslocal glacier initiate-job --vault-name sample-vault --account-id - --job-parameters '{"Type":"inventory-retrieval","ArchiveId":"d41d8cd98f00b204e9800998ecf8427e"}'
148-
{{< /command >}}
153+
154+
```bash
155+
awslocal glacier initiate-job \
156+
--vault-name sample-vault \
157+
--account-id - \
158+
--job-parameters '{"Type":"inventory-retrieval","ArchiveId":"d41d8cd98f00b204e9800998ecf8427e"}'
159+
```
149160

150161
On successful execution of the command, you will see the following output:
151162

@@ -157,10 +168,14 @@ On successful execution of the command, you will see the following output:
157168
```
158169

159170
In the same fashion as the archive retrieval, you can now download the result of the inventory retrieval job using `GetJobOutput` using the `JobId` from the result of the previous command:
160-
{{< command >}}
161-
$ awslocal glacier get-job-output \
162-
--vault-name sample-vault --account-id - --job-id P5972CSWFR803BHX48OD1A7JWNBFJUMYVWCMZWY55ZJPIJMG1XWFV9ISZPZH1X3LBF0UV3UG6ORETM0EHE5R86Z47B1F inventory.json
163-
{{< /command >}}
171+
172+
```bash
173+
awslocal glacier get-job-output \
174+
--vault-name sample-vault \
175+
--account-id - \
176+
--job-id P5972CSWFR803BHX48OD1A7JWNBFJUMYVWCMZWY55ZJPIJMG1XWFV9ISZPZH1X3LBF0UV3UG6ORETM0EHE5R86Z47B1F \
177+
inventory.json
178+
```
164179

165180
Inspecting the content of the `inventory.json` file, we can find an inventory of the vault:
166181

@@ -186,16 +201,21 @@ You can delete a Glacier archive using the [`DeleteArchive`](https://docs.aws.am
186201

187202
Run the following command to delete the previously created archive:
188203

189-
{{< command >}}
190-
$ awslocal glacier delete-archive \
191-
--vault-name sample-vault --account-id - --archive-id d41d8cd98f00b204e9800998ecf8427e
192-
{{< /command >}}
204+
```bash
205+
awslocal glacier delete-archive \
206+
--vault-name sample-vault \
207+
--account-id - \
208+
--archive-id d41d8cd98f00b204e9800998ecf8427e
209+
```
193210

194211
### Delete a vault
195212

196213
You can delete a Glacier vault with the [`DeleteVault`](https://docs.aws.amazon.com/amazonglacier/latest/dev/api-vault-delete.html) API.
197214

198215
Run the following command to delete the vault:
199-
{{< command >}}
200-
$ awslocal glacier delete-vault --vault-name sample-vault --account-id -
201-
{{< /command >}}
216+
217+
```bash
218+
awslocal glacier delete-vault \
219+
--vault-name sample-vault \
220+
--account-id -
221+
```

0 commit comments

Comments
 (0)