IBM Object Storage๋Š” ํฌ๊ด„์ ์ธ ๊ฒ€์ƒ‰ ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. SoftLayer์˜ ํ†ตํ•ฉ ๊ฒ€์ƒ‰ ์„œ๋น„์Šค๋ฅผ ํ†ตํ•ด ์‚ฌ์šฉ์ž๋Š” ๊ณ„์ •, ์ปจํ…Œ์ด๋„ˆ ๋˜๋Š” ํŠน์ • ๊ฒฝ๋กœ(ํด๋”)๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ ์ธ๋ฑ์Šค๋ฅผ ๊ฒ€์ƒ‰ ํ•  ์ˆ˜ ์žˆ์œผ๋ฉฐ ๊ฒ€์ƒ‰ ๊ฒฐ๊ณผ๋ฅผ ํ•„ํ„ฐ๋งํ•˜๋Š” ๋ฐ ๋„์›€์ด๋˜๋Š” ๋‹ค์–‘ํ•œ ๋งค๊ฐœ ๋ณ€์ˆ˜๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. Search Service API๋Š” ๊ธฐ์กด Object Storage API ์œ„์— ๋ฉ”ํƒ€ ์ •๋ณด, ์ปจํ…Œ์ด๋„ˆ ๋ฐ ๊ฐ์ฒด๋ฅผ ์ธ๋ฑ์‹ฑํ•˜๋Š” ๋™์‹œ์— ์ธ๋ฑ์Šค๋ฅผ ๊ฒ€์ƒ‰ํ•˜๊ธฐ ์œ„ํ•œ ์ต์ˆ™ํ•œ ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.

๊ฒ€์ƒ‰ ์š”์ฒญ

๊ฒ€์ƒ‰ URL์— ๋”ฐ๋ผ ์ „์ฒด ๊ณ„์ •, ํŠน์ • ์ปจํ…Œ์ด๋„ˆ ๋˜๋Š” ํŠน์ • ๊ฒฝ๋กœ์— ๋Œ€ํ•ด ๊ฒ€์ƒ‰์„ ์š”์ฒญํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์•„๋ž˜์˜ ์˜ˆ์ œ๋ฅผ ํ™œ์šฉํ•˜์‹ญ์‹œ์˜ค.

๊ฒ€์ƒ‰ URL ์˜ˆ์‹œ

Account https://dal05.objectstorage.softlayer.net/v1/AUTH_12345ABCDE
Container https://dal05.objectstorage.softlayer.net/v1/AUTH_12345ABCDE/container
Path https://dal05.objectstorage.softlayer.net/v1/AUTH_12345ABCDE/container/path

ํŒŒ๋ผ๋ฏธํ„ฐ

X-Context ํ—ค๋” ๊ฐ’์— search ๊ฐ’์„ ์„ค์ •ํ•˜๊ณ  Http GET Request๋ฅผ ์ˆ˜ํ–‰ํ•ฉ๋‹ˆ๋‹ค. ํ•„ํ„ฐ๋ง๋œ ๊ฒฐ๊ณผ๋ฌผ์„ ์œ„ํ•ด์„œ๋Š” ๋ช‡๋ช‡ ํŒŒ๋ผ๋ฏธํ„ฐ๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.

1) q : ๊ฒ€์ƒ‰์„ ์œ„ํ•œ ์ฟผ๋ฆฌ ์ŠคํŠธ๋ง

์˜ˆ์‹œ:

?q=test
?q.meta.foo=bar
?q.meta-foo=bar

์œ„ ์˜ˆ์ œ์—์„œ q.meta.foo ์™€ q.meta-foo ์˜ ๊ฒฝ์šฐ customํ•˜๊ฒŒ ์„ค์ •ํ•˜๋Š” metadata๋ฅผ ์˜๋ฏธํ•ฉ๋‹ˆ๋‹ค. foo๋Š” key๋ฅผ, bar๋Š” ๊ฒ€์ƒ‰ํ•˜๋ ค๋Š” value๋ฅผ ์˜๋ฏธํ•ฉ๋‹ˆ๋‹ค.

2) field : ๊ฒ€์ƒ‰ํ•  ํ•„๋“œ ๊ฐ’. ๊ธฐ๋ณธ์ ์œผ๋กœ๋Š” name๊ณผ custom meta ๊ฐ’๋“ค์„ ์‚ฌ์šฉํ•˜์—ฌ ๊ฒ€์ƒ‰ํ•ฉ๋‹ˆ๋‹ค.

์˜ˆ์‹œ:

container: name of the container
content_type: Content type of the object
count: number of objects in a container
hash: a summarized hash of the file (etag)
last_modified: dateTime stamp indicating the objectโ€™s most recent modify date
meta.myfield: custom meta values defined on the container or object
name: name of the object or container
object: object name
read: x-container read header value (used for ACL)
write: x-container write header value (used for ACL)

3) type : ๊ฒ€์ƒ‰ํ•  ์—”ํ‹ฐํ‹ฐ ํƒ€์ž…. ๊ธฐ๋ณธ์ ์œผ๋กœ๋Š” ๋ชจ๋“  ํƒ€์ž…์„ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค. (์ปจํ…Œ์ด๋„ˆ์™€ ์˜ค๋ธŒ์ ํŠธ)

์˜ˆ์‹œ:

container
object

4) format : Request์˜ ์‘๋‹ต ํ˜•์‹. ์„ค์ •ํ•˜์ง€ ์•Š์œผ๋ฉด plain ํƒ€์ž…์„ ๋ฆฌํ„ดํ•ฉ๋‹ˆ๋‹ค.

์˜ˆ์‹œ:

json
xml
plain

5) recursive : ํด๋” ์•ˆ์— ์žˆ๋Š” ํด๋”๊นŒ์ง€ ๊ฒ€์ƒ‰ํ•  ๊ฒƒ์ธ์ง€๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. Default ๊ฐ’์€ true ์ž…๋‹ˆ๋‹ค.

์˜ˆ์‹œ:

true
false

๊ฒ€์ƒ‰ ์š”์ฒญ ์˜ˆ์‹œ

๊ฒ€์ƒ‰์„ ํ•  ๋•Œ์—๋Š” ์š”๊ฑด์— ๋”ฐ๋ผ ํ•˜๋‚˜ ์ด์ƒ์˜ ํŒŒ๋ผ๋ฏธํ„ฐ๋ฅผ ์‚ฌ์šฉํ•˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค. ๋‘๊ฐœ ์ด์ƒ์˜ ๊ฒ€์ƒ‰ ํŒŒ๋ผ๋ฏธํ„ฐ๋ฅผ ์‚ฌ์šฉํ•  ๋•Œ์—๋Š” & ๊ฐ’์œผ๋กœ ๊ตฌ๋ถ„ํ•ฉ๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด ์•„๋ž˜ 3๊ฐ€์ง€ ์กฐ๊ฑด์„ ๊ฐ€์ง€๊ณ  ๊ฒ€์ƒ‰์„ ํ•˜๊ณ  ์‹ถ๋‹ค๋ฉด,

  • ์ „์ฒด account๋ฅผ recursiveํ•˜๊ฒŒ ๊ฒ€์ƒ‰
  • content type์ด “application/directory”์ธ ๊ฒƒ์„ ๊ฒ€์ƒ‰
  • xml ํฌ๋งท์˜ ์‘๋‹ต

์•„๋ž˜์™€ ๊ฐ™์ด ๊ฒ€์ƒ‰์„ ์š”์ฒญํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

GET /v1/?q=application%2Fdirectory&field=content_type&recursive=true&format=xml
X-Context: search
X-Auth-Token: AUTH_SADASDM43423DMSSAZXC234

์œ„์˜ ์˜ˆ์ œ๋ฅผ ์š”์ฒญํ•˜๋ฉด ์‘๋‹ต ํ—ค๋”์—์„œ ์•„๋ž˜์™€ ๊ฐ™์€ ์ •๋ณด๋ฅผ ๋ฐ›์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

HTTP/1.1 200 OK
Date: Thu, 19 Oct 2011 12:00:00 GMT
Content-Type: application/xml; charset=utf-8
X-Search-Items-Count: 3
X-Search-Items-Total: 29

์ด ์‘๋‹ต ํ—ค๋”์—์„œ, X-Search-Items-Count ๊ฐ’์€ ์ด ์‘๋‹ต์— ํฌํ•จ๋œ item์˜ ๊ฐœ์ˆ˜๋ฅผ ๋‚˜ํƒ€๋‚ด๊ณ  X-Search-Items-Total์€ ์ด ๊ฒ€์ƒ‰ ๊ฒฐ๊ณผ ์–ป์„ ์ˆ˜ ์žˆ๋Š” item์˜ ์ˆ˜๋ฅผ ๋‚˜ํƒ€๋ƒ…๋‹ˆ๋‹ค. Total ๊ฐ’์ด Count ๊ฐ’๋ณด๋‹ค ํฌ๋ฉด ๋” ๋งŽ์€ ์•„์ดํ…œ์ด ์žˆ๋‹ค๋Š” ๊ฒƒ์„ ๋‚˜ํƒ€๋ƒ…๋‹ˆ๋‹ค. ์š”์ฒญ์‹œ ์‚ฌ์šฉํ•˜๋Š” ํŒŒ๋ผ๋ฏธํ„ฐ์— ๋”ฐ๋ผ ์ด ํ—ค๋”์— ๋” ๋งŽ์€ ์ •๋ณด๊ฐ€ ํฌํ•จ๋  ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค.

์œ„์˜ ์˜ˆ์ œ๋ฅผ ์š”์ฒญํ•˜๋ฉด ์‘๋‹ต ๋ฐ”๋””์— ํฌ๋งท์— ๋”ฐ๋ผ ์•„๋ž˜์™€ ๊ฐ™์€ ์ •๋ณด๋ฅผ ๋ฐ›์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  • JSON Response Body (application/json)
  •  
    [
        {
            "container": "test1",
            "content_type": "application/x-python-code",
            "hash": "c23c402de9d67332bce2a73f31a503c3",
            "last_modified": "Wed, 19 Oct 2011 21:26:30 GMT",
            "meta_mtime": "1318343501.0",
            "name": "test.py",
            "object": "test.py",
            "type": "object"
        },
        {
            "container": "test",
            "content_type": "text/plain",
            "hash": "d41d8cd98f00b204e9800998ecf8427e",
            "last_modified": "Mon, 17 Oct 2011 14:31:11 GMT",
            "meta_mtime": "1318861839.0",
            "name": "test_data/3.txt",
            "object": "test_data/3.txt",
            "type": "object"
        }   
    ]
    
  • XML Response Body (text/xml)
  • 
    
        
            test1
            test.py
            test.py
            Wed, 19 Oct 2011 21:26:30 GMT
            application/x-python-code
            c23c402de9d67332bce2a73f31a503c3
            object
            1318343501.0
        
        
            test
            test_data/3.txt
            test_data/3.txt
            Mon, 17 Oct 2011 14:31:11 GMT
            text/plain
            d41d8cd98f00b204e9800998ecf8427e
            object
            1318861839.0
        
    
    
  • Plain Text Response Body (text/plain)
  • container: test1
    name: test.py
    object: test.py
    last_modified: Wed, 19 Oct 2011 21:26:30 GMT
    content_type: application/x-python-code
    hash: c23c402de9d67332bce2a73f31a503c3
    type: object
    meta_mtime: 1318343501.0
     
    container: test
    name: test_data/3.txt
    object: test_data/3.txt
    last_modified: Mon, 17 Oct 2011 14:31:11 GMT
    content_type: text/plain
    hash: d41d8cd98f00b204e9800998ecf8427e
    type: object
    meta_mtime: 1318861839.0
    

    3 ๊ฐœ์˜ ๋Œ“๊ธ€"IBMยฎ Object Storage for Bluemixยฎ ์‚ฌ์šฉ๋ฒ• 4. ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ ๊ฒ€์ƒ‰(Metadata Search) ๊ธฐ๋Šฅ ์†Œ๊ฐœ"

    1. ์•ˆ๋…•ํ•˜์„ธ์š” ์™“์Šจ ์„œ๋น„์Šค๋ฅผ ์ด์šฉ์ค‘์ธ ๋Œ€ํ•™์ƒ์ž…๋‹ˆ๋‹ค.
      ํ•œ๊ฐ€์ง€ ๊ถ๊ธˆํ•œ ์ ์ด ์žˆ์–ด์„œ ๊ฐœ๋ฐœ์ž๋‹˜๊ป˜ ๋Œ“๊ธ€ ๋‚จ๊น๋‹ˆ๋‹ค.

      IBM Bluemix ์ƒ์—์„œ Object Storage๋ฅผ ์ƒ์„ฑํ•˜๊ณ  ๋ฒ„ํ‚ท ์•ˆ์— ์ด๋ฏธ์ง€ ํŒŒ์ผ๋“ค์„ ๋„ฃ์–ด๋‘์—ˆ์Šต๋‹ˆ๋‹ค.
      ์™ธ๋ถ€์—์„œ ํŒŒ์ผ์— ์ ‘๊ทผํ•  ๋•Œ, URL์„ ์ด์šฉํ•ด์„œ ์ด ํŒŒ์ผ๋“ค์„ ์ฝ์–ด์˜ฌ ์ˆ˜ ์žˆ๋‹ค๊ณ  ๋“ค์—ˆ๋Š”๋ฐ, ์•„๋ฌด๋ฆฌ ์ด๊ฒƒ์ €๊ฒƒ ํ•ด๋ณด์•„๋„ ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹คใ… ใ… 

      Cloudberry.net์„ ์ด์šฉํ•ด์„œ URL์„ ์ƒ์„ฑํ•˜๋Š” ๋ฐฉ๋ฒ•๋„ ์žˆ๋‹ค๊ณ  ๋“ค์—ˆ์ง€๋งŒ, access key์™€ secret key๊ฐ€ ์žˆ์–ด์•ผ ๋œ๋‹ค๊ณ  ํ•˜๋„ค์š”..
      ํ˜น์‹œ ์–ด๋–ค ๋ฐฉ๋ฒ•์œผ๋กœ ํŒŒ์ผ๋“ค์„ ์ฝ๋Š” URL์„ ์ƒ์„ฑํ•  ์ˆ˜ ์žˆ๋Š”์ง€ ์•Œ ์ˆ˜ ์žˆ์„๊นŒ์š”?

      • HyeonJeong_Jo 3์›” 08, 2018

        ์•ˆ๋…•ํ•˜์„ธ์š”. Object Storage์˜ ํŒŒ์ผ์— ์ ‘๊ทผํ•˜๋Š” ๋ฐฉ๋ฒ•์€ ์—ฌ๋Ÿฌ๊ฐ€์ง€๊ฐ€ ์žˆ๋Š”๋ฐ์š”.

        ๊ทธ ์ค‘ ์™ธ๋ถ€์—์„œ ๊ทธ๋ƒฅ ์ ‘๊ทผ ๊ฐ€๋Šฅํ•œ URL์„ ์ƒ์„ฑํ•˜๋Š” ๋ฐฉ๋ฒ•์€ Temporary URL์„ ์ƒ์„ฑํ•จ์œผ๋กœ์จ ๊ตฌํ˜„ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. IBM Cloud์˜ Object Storage๋Š” OpenStack์˜ Swift์˜ Spec์„ ๋”ฐ๋ฅด๊ณ  ์žˆ์œผ๋ฏ€๋กœ ๋‹ค์Œ ๋งํฌ๋ฅผ ์ฐธ์กฐํ•˜์‹ญ์‹œ์˜ค.
        https://docs.openstack.org/swift/latest/api/temporary_url_middleware.html

        JavaScript๋กœ ๊ตฌํ˜„ํ•ด ๋†“์€ ์ฝ”๋“œ๋Š” ์•„๋ž˜๋ฅผ ์ฐธ์กฐํ•˜์‹ญ์‹œ์˜ค.
        https://github.com/hjjo/bluemix-objectstorage-serversdk-nodejs/blob/master/lib/ObjectStorageObject.js

        ๊ตฌํ˜„ํ•˜๋Š” ์ˆœ์„œ๋Š” ์ปจํ…Œ์ด๋„ˆ์— ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ๋กœ X-Container-Meta-Temp-URL-Key ์— key ๊ฐ’์„ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.
        (๋˜๋Š” Account ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ๋กœ X-Account-Meta-Temp-URL-Key ๊ฐ’์„ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.)

        ๊ทธ ๋‹ค์Œ ์„ค์ •ํ•œ key๊ฐ’๊ณผ ํŒŒ์ผ์˜ ๊ฒฝ๋กœ, ํ”„๋กœ์ ํŠธ ID ๋“ฑ์„ ์กฐํ•ฉํ•˜์—ฌ HMAC-SHA1 signature๋ฅผ ์ด์šฉํ•ด์„œ Temporary URL์„ ์ƒ์„ฑํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

        • ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹คใ… ใ…  ํ•ด๋ณผ๊ฒŒ์š”!! ์ •๋ง ๊ฐ์‚ฌ๋“œ๋ ค์š”:)

    ํ† ๋ก  ์ฐธ๊ฐ€

    ์ด๋ฉ”์ผ์€ ๊ณต๊ฐœ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ํ•„์ˆ˜ ์ž…๋ ฅ์ฐฝ์€ * ๋กœ ํ‘œ์‹œ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.