-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheat-storage.txt
256 lines (206 loc) · 9.27 KB
/
cheat-storage.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
####
## v1
##
### auth REST end point :
### https://secdomain.storage.oraclecloud.com/auth/v1.0
## rest endpint ==> https://secdomain.storage.oraclecloud.com/v1/Storage-secdomain
## auth endpoint ==> https://secdomain.storage.oraclecloud.com/auth/v1.0
https://secdomain.storage.oraclecloud.com/v1/Storage-secdomain
curl -v -X GET \
-H "X-Storage-User: Compute-secdomain:ora1" \
-H "X-Storage-Pass: password" \
https://secdomain.storage.oraclecloud.com/auth/v1.0
### store an object "Hello World!==> container ora1"
curl -v -X PUT \
-H "X-Auth-Token: AUTH_tk90aaa8d34929ae7a1efccae2871f3006" \
-d "Hello, World!" \
https://secdomain.storage.oraclecloud.com/v1/Storage-secdomain/ora1/myObject
## create a container
curl -v -X PUT \
-H "X-Auth-Token: AUTH_tk90aaa8d34929ae7a1efccae2871f3006" \
https://secdomain.storage.oraclecloud.com/v1/Storage-secdomain/FirstContainer
## create an archive container
curl -v -X PUT \
-H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
-H "X-Storage-Class: Archive" \
https://secdomain.storage.oraclecloud.com/v1/Storage-secdomain/ArchiveContainer
### accounts
### create matadata
curl -v -X POST \
-H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
-H "X-Account-Meta-Owner: IT" \
https://secdomain.storage.oraclecloud.com/v1/Storage-secdomain
## bulk delete containers and objects
curl -v -X POST \
-H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
-T objects_to_delete \
"https://secdomain.storage.oraclecloud.com/v1/Storage-secdomain?bulk-delete"
### account details and list container
curl -v -X GET \
-H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
https://secdomain.storage.oraclecloud.com/v1/Storage-secdomain
## list 15 first containers
curl -v -X GET \
-H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
https://secdomain.storage.oraclecloud.com/v1/Storage-secdomain?limit=15
### show account metadata
curl -v -X HEAD \
-H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
https://secdomain.storage.oraclecloud.com/v1/Storage-secdomain
### create a container
curl -v -X PUT \
-H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
https://secdomain.storage.oraclecloud.com/v1/Storage-secdomain/FirstContainer
## set a quota
curl -v -X POST \
-H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b"" \
-H "X-Container-Meta-Quota-Bytes: 100000" \
-H "X-Container-Meta-Quota-Count: 5000" \
https://secdomain.storage.oraclecloud.com/v1/Storage-secdomain/FirstContainer
## set container meta data
curl -v -X POST \
-H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
-H "X-Container-Meta-Category: Books" \
https://secdomain.storage.oraclecloud.com/v1/Storage-secdomain/FirstContainer
## activate CORS
curl -i -XPOST \
-H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
-H "X-Container-Meta-Access-Control-Allow-Origin: http://acmeadmin.example.com/ http://acme-app.example.com/" \
https://secdomain.storage.oraclecloud.com/v1/Storage-secdomain/FirstContainer
## allow access from any domain
curl -i -XPOST \
-H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
-H "X-Container-Meta-Access-Control-Allow-Origin: *" \
https://secdomain.storage.oraclecloud.com/v1/Storage-secdomain/FirstContainer
## allow access for a certain duration
curl -i -XPOST \
-H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
-H "X-Container-Meta-Access-Control-Max-Age: 10000" \
https://secdomain.storage.oraclecloud.com/v1/Storage-secdomain/FirstContainer
## expose the HEADERS to the borwser reqests
curl -i -XPOST \
-H "X-Auth-Token: token" \
-H "X-Container-Meta-Access-Control-Expose-Headers: X-Container-Object-Count X-Container-Bytes-Used" \
https://secdomain.storage.oraclecloud.com/v1/Storage-secdomain/FirstContainer
##verify CORS setp
curl -i -XOPTIONS \
-H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
-H "Origin: http://www.example.com" \
-H "Access-Control-Request-Method: GET" \
https://secdomain.storage.oraclecloud.com/v1/Storage-secdomain/FirstContainer
### delete container meta-data
curl -v -X POST \
-H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
-H "X-Remove-Container-Meta-Name: any_arbitrary_string" \
https://secdomain.storage.oraclecloud.com/v1/Storage-secdomain/FirstContainer
## create a tar archive of any files
## upplaod the archive to the container
curl -v -X PUT \
-H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
"https://secdomain.storage.oraclecloud.com/v1/Storage-secdomain/BulkContainer?extract-archive=tar.gz"
-T bulk-test.tar.gz
## verify the content of the container
curl -X GET \
-H "X-Auth-Token: AUTH_tk1269e2899ecbc86b4402167c94bad149" \
"https://secdomain.storage.oraclecloud.com/v1/Storage-secdomain/BulkContainer"
### create multiple containers and objects
## create any archive of files
## then pload the archive to the container
curl -v -X PUT \
-H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
"https://secdomain.storage.oraclecloud.com/v1/Storage-secdomain?extract-archive=tar.gz"
-T bulk-test.tar.gz
## verify the bulk upload operation
curl -X GET \
-H "X-Auth-Token: AUTH_tk1269e2899ecbc86b4402167c94bad149" \
"https://secdomain.storage.oraclecloud.com/v1/Storage-secdomain/folder1"
## create / delete bulk data/metadata
## create custome metadata for the account
curl -v -X POST \
-H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
-H "X-Account-Meta-Owner: IT" \
https://secdomain.storage.oraclecloud.com/v1/Storage-secdomain
## bulk delete
curl -v -X POST \
-H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
-T objects_to_delete \
"https://secdomain.storage.oraclecloud.com/v1/Storage-secdomain?bulk-delete"
## delete multiple containers or objects
## create a local file with the content to be deleted
cat objects_to_delete
container1/object1
container1/object2
container1
container2/object3
container3
curl -v -X DELETE \
-H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
-H "Content-Type: text/plain" \
-T objects_to_delete \
"https://secdomain.storage.oraclecloud.com/v1/Storage-secdomain?bulk-delete"
### create / delete containers metadata
curl -v -X POST \
-H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
-H "X-Container-Write:myDomain.Storage.Storage_ReadWriteGroup,myDomain.myCustomRole" \
https://secdomain.storage.oraclecloud.com/v1/Storage-secdomain/FirstContainer
## delete container
curl -v -X DELETE \
-H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
https://secdomain.storage.oraclecloud.com/v1/Storage-secdomain/FirstContaine
## show container details and list of objects
curl -v -X GET \
-H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
https://secdomain.storage.oraclecloud.com/v1/Storage-secdomain/FirstContainer
## show container metadata
curl -v -X HEAD \
-H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
https://secdomain.storage.oraclecloud.com/v1/Storage-secdomain/FirstContainer
## list capabilites with open stack
curl -v -X GET \
-H "X-Auth-Token: AUTH_tk90aaa8d34929ae7a1efccae2871f3006" \
https://foo.storage.oraclecloud.com/info
### create or replace objects
curl -v -X PUT \
-H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
-T myFile.txt \
https://secdomain.storage.oraclecloud.com/v1/Storage-secdomain/FirstContainer/myObject
### create or update object metadata
curl -v -X POST \
-H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
-H "X-Object-Meta-Language: english" \
https://secdomain.storage.oraclecloud.com/v1/Storage-secdomain/FirstContainer/myObject
## delete object in container
curl -v -X DELETE \
-H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
https://secdomain.storage.oraclecloud.com/v1/Storage-secdomain/FirstContainer/myObject
## get object and metadata
curl -v -X GET \
-H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
-o myFile.txt \
https://secdomain.storage.oraclecloud.com/v1/Storage-secdomain/FirstContainer/myObject
## show objects metadata
curl -v -X HEAD \
-H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
https://secdomain.storage.oraclecloud.com/v1/Storage-secdomain/FirstContainer/myObject
### archive containers restore
curl -v -X POST \
-H "X-Auth-Token: AUTH_tk1ff0554c1fefff9209696d63553722fd" \
"https://secdomain.storage.oraclecloud.com/v0/Compute-secdomain/FirstArchiveContainer/file.txt?restore"
## track restoration timz
curl -v -X GET \
-H "X-Auth-Token: AUTH_tk1ff0554c1fefff9209696d63553722fd"
"https://secdomain.storage.oraclecloud.com/v0/Compute-secdomain/FirstArchiveContainer?jobs&jobid=a75c8bbf53224a88738e68d6628acd83a4b300e4"
$ tar -tzf bulk-test.tar.gz
file1
folder1/file2
folder1/file3
folder1/subfolder1
folder1/subfolder2/file4
folder2/file5
curl -v -X PUT \
-H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
"https://secdomain.storage.oraclecloud.com/v0/Compute-secdomain/BulkContainer?extract-archive=tar.gz"
-T bulk-test.tar.gz
curl -X GET \
-H "X-Auth-Token: AUTH_tk1269e2899ecbc86b4402167c94bad149" \
"https://secdomain.storage.oraclecloud.com/v1/Storage-secdomain/BulkContainer"