Postman
사용
다음은 IBM Cloud® Object Storage REST API에 대한 기본 Postman
설정입니다. 세부사항은 버킷 또는 오브젝트에
대한 API 참조에 있습니다.
Postman
를 사용하면 IBM Cloud Object Storage시작하기 에 표시된 대로 Object Storage 및 서비스 인증 정보 또는 콘솔에서 필요한 정보에 어느 정도 익숙하다고 가정합니다. 익숙하지 않은 용어나 변수가 있으면 FAQ 에서 찾을 수 있습니다.
PII (Personally Identifiable Information): 이름 지정 버킷 또는 오브젝트의 경우 이름, 위치 또는 기타 방법으로 사용자 (자연 사용자) 를 식별할 수 있는 정보를 사용하지 마십시오.
REST API 클라이언트 개요
REST API와의 상호작용은 표준 인터넷 브라우저를 사용하는 것만큼 단순하지 않습니다. 단순 브라우저는 URL 요청 조작을 허용하지 않습니다. REST API 클라이언트는 단순 HTTP 요청과 복잡한 HTTP 요청을 빠르게 조합하는 데 도움이 될 수 있습니다.
전제조건
- IBM Cloud 계정
- 클라우드 스토리지 리소스 작성됨 (라이트 플랜이 제대로 작동함)
- IBM Cloud COS CLI가 설치 및 구성됨
- 클라우드 스토리지의 서비스 인스턴스 ID
- Identity and Access Management(IAM) 토큰
- COS 버킷의 엔드포인트
버킷 작성
- Postman을 시작하십시오.
- 새로 작성 탭에서
PUT
을 선택하십시오. - 주소 표시줄에 엔드포인트를 입력하고 새 버킷의 이름을 추가하십시오. a. 버킷 이름은 모든 버킷에서 고유해야 하므로 특정한 이름을 선택하십시오.
- 유형 메뉴에서 Bearer 토큰을 선택하십시오.
- 토큰 상자에 IAM 토큰을 추가하십시오.
- 요청 미리보기를 클릭하십시오. a. 헤더가 추가되었다는 확인 메시지가 표시됩니다.
- 권한에 대한 기존 항목이 표시되어야 하는 헤더 탭을 클릭하십시오.
- 키를 추가하십시오. a. 키:
ibm-service-instance-id
b. 값: 클라우드 스토리지 서비스의 리소스 인스턴스 ID. - 전송을 클릭하십시오.
- 상태
200 OK
메시지가 수신됩니다.
텍스트 파일 오브젝트 작성
- 더하기(+) 아이콘을 클릭하여 탭을 작성하십시오.
- 목록에서
PUT
을 선택하십시오. - 주소 표시줄에 파일 이름 및 이전 섹션의 버킷 이름을 사용하여 엔드포인트 주소를 입력하십시오.
- 유형 목록에서 Bearer 토큰을 선택하십시오.
- 토큰 상자에 IAM 토큰을 추가하십시오.
- 본문 탭을 선택하십시오.
- 원시 옵션을 선택하고 텍스트가 선택되었는지 확인하십시오.
- 제공된 공백에 텍스트를 입력하십시오.
- 전송을 클릭하십시오.
- 상태
200 OK
메시지가 수신됩니다.
버킷의 컨텐츠 나열
- 더하기(+) 아이콘을 선택하여 탭을 새로 작성하십시오.
- 목록에서
GET
을 선택했는지 확인하십시오. - 주소 표시줄에 이전 섹션의 버킷 이름을 사용하여 엔드포인트 주소를 입력하십시오.
- 유형 목록에서 Bearer 토큰을 선택하십시오.
- 토큰 상자에 IAM 토큰을 추가하십시오.
- 전송을 클릭하십시오.
- 상태
200 OK
메시지가 수신됩니다. - 응답 섹션의 본문에 버킷의 파일 목록과 함께 XML 메시지가 표시됩니다.
샘플 콜렉션 사용
이 Postman 콜렉션은 API를 실험하기 위한 시작점으로 제공되며 프로덕션 용도로는 사용되지 않습니다.
{
"info": {
"_postman_id": "56d99641-9ad6-4218-b3d4-18ac8f3361e0",
"name": "IBM COS",
"description": "IBM COS samples",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Retrieve list of buckets",
"event": [
{
"listen": "test",
"script": {
"id": "d67afcf2-6d35-4a2a-9542-b8d5df78eded",
"type": "text/javascript",
"exec": [
"pm.test(\"Request was successful\", function() {",
" pm.response.to.be.success; ",
"});",
"",
"pm.test(\"Response contains expected content\", function() {",
" pm.expect(pm.response.text()).to.include(\"ListAllMyBucketsResult\");",
"});"
]
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{iamtoken}}",
"type": "string"
}
]
},
"method": "GET",
"header": [
{
"key": "ibm-service-instance-id",
"value": "{{serviceid}}"
}
],
"body": {},
"url": {
"raw": "https://{{endpoint-region}}cloud-object-storage.appdomain.cloud",
"protocol": "https",
"host": [
"{{endpoint-region}}",
"objectstorage",
"softlayer",
"net"
]
}
},
"response": []
},
{
"name": "Create new bucket",
"event": [
{
"listen": "test",
"script": {
"id": "3cebb9d7-90ee-42c0-9154-b26bd229e179",
"type": "text/javascript",
"exec": [
"pm.test(\"Request was successful\", function() {",
" pm.response.to.be.success; ",
"});"
]
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{iamtoken}}",
"type": "string"
}
]
},
"method": "PUT",
"header": [
{
"key": "ibm-service-instance-id",
"value": "{{serviceid}}"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "https://{{endpoint-region}}cloud-object-storage.appdomain.cloud/{{bucket}}",
"protocol": "https",
"host": [
"{{endpoint-region}}",
"objectstorage",
"softlayer",
"net"
],
"path": [
"{{bucket}}"
]
},
"description": "Create new bucket"
},
"response": []
},
{
"name": "Create new text file",
"event": [
{
"listen": "test",
"script": {
"id": "0a54c09b-0032-4933-ae99-81911935cb4d",
"type": "text/javascript",
"exec": [
"pm.test(\"Request was successful\", function() {",
" pm.response.to.be.success; ",
"});",
"",
"pm.test(\"Response contains expected header\", function() {",
" pm.response.to.have.header(\"ETag\");",
"});"
]
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{iamtoken}}",
"type": "string"
}
]
},
"method": "PUT",
"header": [
{
"key": "Content-Type",
"value": "application/x-www-form-urlencoded"
}
],
"body": {
"mode": "raw",
"raw": "This is test data for the text file."
},
"url": {
"raw": "https://{{endpoint-region}}cloud-object-storage.appdomain.cloud/{{bucket}}/testfile.txt",
"protocol": "https",
"host": [
"{{endpoint-region}}",
"objectstorage",
"softlayer",
"net"
],
"path": [
"{{bucket}}",
"testfile.txt"
]
},
"description": "Create a new text file in the bucket"
},
"response": []
},
{
"name": "Create new binary file",
"event": [
{
"listen": "test",
"script": {
"id": "80e3e8bd-3fb5-4874-a638-510cf5b8c872",
"type": "text/javascript",
"exec": [
"pm.test(\"Request was successful\", function() {",
" pm.response.to.be.success; ",
"});",
"",
"pm.test(\"Response contains expected header\", function() {",
" pm.response.to.have.header(\"ETag\");",
"});"
]
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{iamtoken}}",
"type": "string"
}
]
},
"method": "PUT",
"header": [
{
"key": "Content-Type",
"value": "image/jpeg"
}
],
"body": {
"mode": "file",
"file": {}
},
"url": {
"raw": "https://{{endpoint-region}}cloud-object-storage.appdomain.cloud/{{bucket}}/testimage.jpg",
"protocol": "https",
"host": [
"{{endpoint-region}}",
"objectstorage",
"softlayer",
"net"
],
"path": [
"{{bucket}}",
"testimage.jpg"
]
},
"description": "Create a new binary (image) file in the bucket"
},
"response": []
},
{
"name": "Retrieve list of files from bucket",
"event": [
{
"listen": "test",
"script": {
"id": "aae11dfd-89e5-464d-a6da-44c05652ccec",
"type": "text/javascript",
"exec": [
"pm.test(\"Request was successful\", function() {",
" pm.response.to.be.success; ",
"});",
"",
"pm.test(\"Response contains expected content\", function() {",
" pm.expect(pm.response.text()).to.include(\"ListBucketResult\");",
"});"
]
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{iamtoken}}",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "https://{{endpoint-region}}cloud-object-storage.appdomain.cloud/{{bucket}}",
"protocol": "https",
"host": [
"{{endpoint-region}}",
"objectstorage",
"softlayer",
"net"
],
"path": [
"{{bucket}}"
]
},
"description": "Retrieve the list of files available in the bucket"
},
"response": []
},
{
"name": "Retrieve list of files from bucket (filter by prefix)",
"event": [
{
"listen": "test",
"script": {
"id": "aae11dfd-89e5-464d-a6da-44c05652ccec",
"type": "text/javascript",
"exec": [
"pm.test(\"Request was successful\", function() {",
" pm.response.to.be.success; ",
"});",
"",
"pm.test(\"Response contains expected content\", function() {",
" pm.expect(pm.response.text()).to.include(\"ListBucketResult\");",
"});"
]
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{iamtoken}}",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "https://{{endpoint-region}}cloud-object-storage.appdomain.cloud/{{bucket}}?prefix=new",
"protocol": "https",
"host": [
"{{endpoint-region}}",
"objectstorage",
"softlayer",
"net"
],
"path": [
"{{bucket}}"
],
"query": [
{
"key": "prefix",
"value": "new"
}
]
},
"description": "Retrieve the list of files available in the bucket"
},
"response": []
},
{
"name": "Retrieve text file",
"event": [
{
"listen": "test",
"script": {
"id": "58817cc7-7d15-45a9-b372-7712d2fd389d",
"type": "text/javascript",
"exec": [
"pm.test(\"Request was successful\", function() {",
" pm.response.to.be.success; ",
"});",
"",
"pm.test(\"Response contains expected body content\", function() {",
" pm.expect(pm.response.text()).to.include(\"This is test data\");",
"});",
"",
"pm.test(\"Response contains expected header\", function() {",
" pm.response.to.have.header(\"ETag\");",
"});"
]
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{iamtoken}}",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "https://{{endpoint-region}}cloud-object-storage.appdomain.cloud/{{bucket}}/testfile.txt",
"protocol": "https",
"host": [
"{{endpoint-region}}",
"objectstorage",
"softlayer",
"net"
],
"path": [
"{{bucket}}",
"testfile.txt"
]
},
"description": "Retrieving a file from bucket"
},
"response": []
},
{
"name": "Retrieve binary file",
"event": [
{
"listen": "test",
"script": {
"id": "db6fa324-080a-43bc-a301-32e70d9bbd65",
"type": "text/javascript",
"exec": [
"pm.test(\"Request was successful\", function() {",
" pm.response.to.be.success; ",
"});",
"",
"pm.test(\"Response contains expected header\", function() {",
" pm.response.to.have.header(\"ETag\");",
"});"
]
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{iamtoken}}",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "https://{{endpoint-region}}cloud-object-storage.appdomain.cloud/{{bucket}}/testimage.jpg",
"protocol": "https",
"host": [
"{{endpoint-region}}",
"objectstorage",
"softlayer",
"net"
],
"path": [
"{{bucket}}",
"testimage.jpg"
]
},
"description": "Retrieve a binary file from the bucket"
},
"response": []
},
{
"name": "Retrieve list of failed multipart uploads",
"event": [
{
"listen": "test",
"script": {
"id": "835bcaf6-6e7d-4fa9-883e-1a5c5538ac7e",
"type": "text/javascript",
"exec": [
"pm.test(\"Request was successful\", function() {",
" pm.response.to.be.success; ",
"});",
"",
"pm.test(\"Response contains expected content\", function() {",
" pm.expect(pm.response.text()).to.include(\"ListMultipartUploadsResult\");",
"});"
]
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{iamtoken}}",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "https://{{endpoint-region}}cloud-object-storage.appdomain.cloud/{{bucket}}?uploads=",
"protocol": "https",
"host": [
"{{endpoint-region}}",
"objectstorage",
"softlayer",
"net"
],
"path": [
"{{bucket}}"
],
"query": [
{
"key": "uploads",
"value": ""
}
]
},
"description": "Retrieve the list of files available in the bucket"
},
"response": []
},
{
"name": "Retrieve list of failed multipart uploads (filter by name)",
"event": [
{
"listen": "test",
"script": {
"id": "835bcaf6-6e7d-4fa9-883e-1a5c5538ac7e",
"type": "text/javascript",
"exec": [
"pm.test(\"Request was successful\", function() {",
" pm.response.to.be.success; ",
"});",
"",
"pm.test(\"Response contains expected content\", function() {",
" pm.expect(pm.response.text()).to.include(\"ListMultipartUploadsResult\");",
"});"
]
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{iamtoken}}",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "https://{{endpoint-region}}cloud-object-storage.appdomain.cloud/{{bucket}}?uploads=&prefix=my",
"protocol": "https",
"host": [
"{{endpoint-region}}",
"objectstorage",
"softlayer",
"net"
],
"path": [
"{{bucket}}"
],
"query": [
{
"key": "uploads",
"value": ""
},
{
"key": "prefix",
"value": "my"
}
]
},
"description": "Retrieve the list of files available in the bucket"
},
"response": []
},
{
"name": "Set CORS enabled bucket",
"event": [
{
"listen": "test",
"script": {
"id": "5cf3d531-13f1-4cf6-a4fc-2f8d2d8e48af",
"type": "text/javascript",
"exec": [
"pm.test(\"Request was successful\", function() {",
" pm.response.to.be.success; ",
"});"
]
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{iamtoken}}",
"type": "string"
}
]
},
"method": "PUT",
"header": [
{
"key": "ibm-service-instance-id",
"value": "{{serviceid}}"
},
{
"key": "Content-MD5",
"value": "GQmpTNpruOyK6YrxHnpj7g=="
}
],
"body": {
"mode": "raw",
"raw": "<CORSConfiguration>\n <CORSRule>\n <AllowedOrigin>http:www.ibm.com</AllowedOrigin>\n <AllowedMethod>GET</AllowedMethod>\n <AllowedMethod>PUT</AllowedMethod>\n <AllowedMethod>POST</AllowedMethod>\n </CORSRule>\n</CORSConfiguration>"
},
"url": {
"raw": "https://{{endpoint-region}}cloud-object-storage.appdomain.cloud/{{bucket}}?cors=",
"protocol": "https",
"host": [
"{{endpoint-region}}",
"objectstorage",
"softlayer",
"net"
],
"path": [
"{{bucket}}"
],
"query": [
{
"key": "cors",
"value": ""
}
]
}
},
"response": []
},
{
"name": "Retrieve bucket CORS config",
"event": [
{
"listen": "test",
"script": {
"id": "d9c0dce3-decd-4f3e-b5b1-e3f4a89f1283",
"type": "text/javascript",
"exec": [
"pm.test(\"Request was successful\", function() {",
" pm.response.to.be.success; ",
"});",
"",
"pm.test(\"Response contains expected content\", function() {",
" pm.expect(pm.response.text()).to.include(\"CORSConfiguration\");",
"});"
]
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{iamtoken}}",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "https://{{endpoint-region}}cloud-object-storage.appdomain.cloud/{{bucket}}?cors=",
"protocol": "https",
"host": [
"{{endpoint-region}}",
"objectstorage",
"softlayer",
"net"
],
"path": [
"{{bucket}}"
],
"query": [
{
"key": "cors",
"value": ""
}
]
},
"description": "Retrieve the list of files available in the bucket"
},
"response": []
},
{
"name": "Delete bucket CORS config",
"event": [
{
"listen": "test",
"script": {
"id": "83ce0bed-572f-4c16-b45f-67a7a9cc5550",
"type": "text/javascript",
"exec": [
"pm.test(\"Request was successful\", function() {",
" pm.response.to.be.success; ",
"});"
]
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{iamtoken}}",
"type": "string"
}
]
},
"method": "DELETE",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "https://{{endpoint-region}}cloud-object-storage.appdomain.cloud/{{bucket}}?cors=",
"protocol": "https",
"host": [
"{{endpoint-region}}",
"objectstorage",
"softlayer",
"net"
],
"path": [
"{{bucket}}"
],
"query": [
{
"key": "cors",
"value": ""
}
]
},
"description": "Retrieve the list of files available in the bucket"
},
"response": []
},
{
"name": "Delete text file",
"event": [
{
"listen": "test",
"script": {
"id": "78b76a84-9562-4692-9634-e10912574a89",
"type": "text/javascript",
"exec": [
"pm.test(\"Request was successful\", function() {",
" pm.response.to.be.success; ",
"});",
""
]
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{iamtoken}}",
"type": "string"
}
]
},
"method": "DELETE",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "https://{{endpoint-region}}cloud-object-storage.appdomain.cloud/{{bucket}}/testfile.txt",
"protocol": "https",
"host": [
"{{endpoint-region}}",
"objectstorage",
"softlayer",
"net"
],
"path": [
"{{bucket}}",
"testfile.txt"
]
},
"description": "Retrieving a file from bucket"
},
"response": []
},
{
"name": "Delete binary file",
"event": [
{
"listen": "test",
"script": {
"id": "a8363887-2b04-4deb-a75b-10220d30e856",
"type": "text/javascript",
"exec": [
"pm.test(\"Request was successful\", function() {",
" pm.response.to.be.success; ",
"});"
]
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{iamtoken}}",
"type": "string"
}
]
},
"method": "DELETE",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "https://{{endpoint-region}}cloud-object-storage.appdomain.cloud/{{bucket}}/testimage.jpg",
"protocol": "https",
"host": [
"{{endpoint-region}}",
"objectstorage",
"softlayer",
"net"
],
"path": [
"{{bucket}}",
"testimage.jpg"
]
},
"description": "Retrieve a binary file from the bucket"
},
"response": []
},
{
"name": "Delete bucket",
"event": [
{
"listen": "test",
"script": {
"id": "3cebb9d7-90ee-42c0-9154-b26bd229e179",
"type": "text/javascript",
"exec": [
"pm.test(\"Request was successful\", function() {",
" pm.response.to.be.success; ",
"});"
]
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{iamtoken}}",
"type": "string"
}
]
},
"method": "DELETE",
"header": [
{
"key": "ibm-service-instance-id",
"value": "{{serviceid}}"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "https://{{endpoint-region}}cloud-object-storage.appdomain.cloud/{{bucket}}",
"protocol": "https",
"host": [
"{{endpoint-region}}",
"objectstorage",
"softlayer",
"net"
],
"path": [
"{{bucket}}"
]
},
"description": "Create new bucket"
},
"response": []
},
{
"name": "Create new bucket (different storage class)",
"event": [
{
"listen": "test",
"script": {
"id": "5cf3d531-13f1-4cf6-a4fc-2f8d2d8e48af",
"type": "text/javascript",
"exec": [
"pm.test(\"Request was successful\", function() {",
" pm.response.to.be.success; ",
"});"
]
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{iamtoken}}",
"type": "string"
}
]
},
"method": "PUT",
"header": [
{
"key": "ibm-service-instance-id",
"value": "{{serviceid}}"
},
{
"key": "Content-Type",
"value": "application/x-www-form-urlencoded"
}
],
"body": {
"mode": "raw",
"raw": "<CreateBucketConfiguration>\n\t<LocationConstraint>{{bucketlocationvault}}</LocationConstraint>\n</CreateBucketConfiguration>"
},
"url": {
"raw": "https://{{endpoint-region}}cloud-object-storage.appdomain.cloud/{{bucket}}vault",
"protocol": "https",
"host": [
"{{endpoint-region}}",
"objectstorage",
"softlayer",
"net"
],
"path": [
"{{bucket}}vault"
]
}
},
"response": []
},
{
"name": "Delete bucket (different storage class)",
"event": [
{
"listen": "test",
"script": {
"id": "5cf3d531-13f1-4cf6-a4fc-2f8d2d8e48af",
"type": "text/javascript",
"exec": [
"pm.test(\"Request was successful\", function() {",
" pm.response.to.be.success; ",
"});"
]
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{iamtoken}}",
"type": "string"
}
]
},
"method": "DELETE",
"header": [
{
"key": "ibm-service-instance-id",
"value": "{{serviceid}}"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "https://{{endpoint-region}}cloud-object-storage.appdomain.cloud/{{bucket}}vault",
"protocol": "https",
"host": [
"{{endpoint-region}}",
"objectstorage",
"softlayer",
"net"
],
"path": [
"{{bucket}}vault"
]
}
},
"response": []
},
{
"name": "Create new bucket (key protect)",
"event": [
{
"listen": "test",
"script": {
"id": "5cf3d531-13f1-4cf6-a4fc-2f8d2d8e48af",
"type": "text/javascript",
"exec": [
"pm.test(\"Request was successful\", function() {",
" pm.response.to.be.success; ",
"});"
]
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{iamtoken}}",
"type": "string"
}
]
},
"method": "PUT",
"header": [
{
"key": "ibm-service-instance-id",
"value": "{{serviceid}}"
},
{
"key": "ibm-sse-kp-encryption-algorithm",
"value": "AES256"
},
{
"key": "ibm-sse-kp-customer-root-key-crn",
"value": "{{rootkeycrn}}"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "https://{{endpoint-region}}cloud-object-storage.appdomain.cloud/{{bucket}}kp",
"protocol": "https",
"host": [
"{{endpoint-region}}",
"objectstorage",
"softlayer",
"net"
],
"path": [
"{{bucket}}kp"
]
}
},
"response": []
},
{
"name": "Delete bucket (key protect)",
"event": [
{
"listen": "test",
"script": {
"id": "5cf3d531-13f1-4cf6-a4fc-2f8d2d8e48af",
"type": "text/javascript",
"exec": [
"pm.test(\"Request was successful\", function() {",
" pm.response.to.be.success; ",
"});"
]
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{iamtoken}}",
"type": "string"
}
]
},
"method": "DELETE",
"header": [
{
"key": "ibm-service-instance-id",
"value": "{{serviceid}}"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "https://{{endpoint-region}}cloud-object-storage.appdomain.cloud/{{bucket}}kp",
"protocol": "https",
"host": [
"{{endpoint-region}}",
"objectstorage",
"softlayer",
"net"
],
"path": [
"{{bucket}}kp"
]
}
},
"response": []
}
],
"event": [
{
"listen": "prerequest",
"script": {
"id": "08caf505-3991-4273-8027-db00d867680f",
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"id": "6e61fa13-e3b9-42f0-8c38-9d3468748922",
"type": "text/javascript",
"exec": [
""
]
}
}
],
"variable": [
{
"id": "643d5480-e629-4e26-b244-1b3c3a85195a",
"key": "bucket",
"value": "jsaitocosbucketapitest41",
"type": "string",
"description": ""
},
{
"id": "7554e40a-f4d5-4938-972e-43b28ce52ad1",
"key": "serviceid",
"value": "crn:v1:bluemix:public:cloud-object-storage:global:a/1d524cd94a0dda86fd8eff3191340732:8888b05b-a143-4917-9d8e-9d5b326a1604::",
"type": "string",
"description": ""
},
{
"id": "f06bc8b2-3476-47a6-aacb-c603dd808310",
"key": "iamtoken",
"value": "eyJraWQiOiIyMDE3MTAzMC0wMDowMDowMCIsImFsZyI6IlJTMjU2In0.eyJpYW1faWQiOiJJQk1pZC01MFkxNjdNOFRZIiwiaWQiOiJJQk1pZC01MFkxNjdNOFRZIiwicmVhbG1pZCI6IklCTWlkIiwiaWRlbnRpZmllciI6IjUwWTE2N004VFkiLCJnaXZlbl9uYW1lIjoiSmFtZXMiLCJmYW1pbHlfbmFtZSI6IlNhaXRvIiwibmFtZSI6IkphbWVzIFNhaXRvIiwiZW1haWwiOiJKYW1lcy5TYWl0bzFAaWJtLmNvbSIsInN1YiI6IkphbWVzLlNhaXRvMUBpYm0uY29tIiwiYWNjb3VudCI6eyJic3MiOiIxZDUyNGNkOTRhMGRkYTg2ZmQ4ZWZmMzE5MTM0MDczMiJ9LCJpYXQiOjE1Mjg2MDk0ODIsImV4cCI6MTUyODYxMzA4MiwiaXNzIjoiaHR0cHM6Ly9pYW0uYmx1ZW1peC5uZXQvaWRlbnRpdHkiLCJncmFudF90eXBlIjoidXJuOmlibTpwYXJhbXM6b2F1dGg6Z3JhbnQtdHlwZTphcGlrZXkiLCJzY29wZSI6ImlibSBvcGVuaWQiLCJjbGllbnRfaWQiOiJieCIsImFjciI6MSwiYW1yIjpbInB3ZCJdfQ.iG5ey13QlXHu3OH81v8J5sduKv3NzSqCFng_DlpNglPo07K-nWst3O9o6iEJfm0AzJwYNTZqWVru1pjI-KcAPXFBe503DPIf6cYolAw4rarU5booW-pdzk8-R5HZ7MJK7b8sxJtm7PAilXVZvl5yFE-tJsFkeMH6XCIj_R9i6dwSemDBL3Juq79_x3KsgJGFg37p5f2vck1_7gR7nSb03m8m3mCvrrx7zGkLDuM8NXAVlwwxKcitwlG_UfEBwSbX3krF04zF2tFCpGkcWAnuaFdaVTOL6uaULxCi5BWHqzLXIPhAoyfnVGNv0TBJtyFcpJ1LdlsBmz7RS2fROlDf2w",
"type": "string",
"description": ""
},
{
"id": "dba24a46-e1df-4201-9a9b-f247fff22315",
"key": "endpoint-region",
"value": "s3.us-south",
"type": "string",
"description": ""
},
{
"id": "ca751949-eea0-4f36-9f58-aea1ed324cd5",
"key": "rootkeycrn",
"value": "crn:v1:bluemix:public:kms:us-south:a/1d524cd94a0dda86fd8eff3191340732:90b7a1db-0fe2-4de9-b90e-922c127ff530:key:0b43e36e-a863-40e2-b713-5caa2bf99288",
"type": "string",
"description": ""
},
{
"id": "e486732e-c9bc-4ec4-8bf9-04b66d513e5a",
"key": "bucketlocationvault",
"value": "us-south-vault",
"type": "string",
"description": ""
}
]
}
Postman으로 콜렉션 가져오기
- Postman에서 오른쪽 상단 모서리에 있는 가져오기를 클릭하십시오.
- 다음 방법 중 하나를 사용하여 콜렉션 파일을 가져오십시오.
- 가져오기 창에서 콜렉션 파일을 Drop files here로 레이블 지정된 창으로 끌어 오십시오.
- 파일 선택 단추를 클릭하고 폴더로 이동하여 콜렉션 파일을 선택하십시오.
- 이제 IBM COS가 콜렉션 창에 표시됩니다.
- 콜렉션을 펼치고 20개의 샘플 요청을 보십시오.
- 콜렉션 오른쪽에 있는 세 개의 점을 클릭하여 메뉴를 펼치고 편집을 클릭하십시오.
- 클라우드 스토리지 환경과 일치하도록 변수를 편집하십시오.
bucket
- 작성할 새 버킷의 이름을 입력하십시오(버킷 이름이 클라우드 스토리지에서 고유해야 함).serviceid
- 클라우드 스토리지 서비스의 CRN을 입력하십시오. CRN을 얻기 위한 지시사항은 여기에 있습니다.iamtoken
- 클라우드 스토리지 서비스의 OAUTH 토큰을 입력하십시오. OAUTH 토큰을 얻기 위한 지시사항은 여기에 있습니다.endpoint
- 클라우드 스토리지 서비스의 지역 엔드포인트를 입력하십시오. IBM Cloud 대시보드 에서 사용 가능한 엔드포인트를 확보하십시오.- 샘플이 올바르게 실행되도록 하기 위해 선택한 엔드포인트가 Key Protect 서비스와 일치하는지 확인하십시오.
rootkeycrn
- 기본 Key Protect 서비스에서 작성된 루트 키의 CRN입니다.- CRN은 다음과 유사합니다.
crn:v1:bluemix:public:kms:us-south:a/3d624cd74a0dea86ed8efe3101341742:90b6a1db-0fe1-4fe9-b91e-962c327df531:key:0bg3e33e-a866-50f2-b715-5cba2bc93234
- 선택한 Key Protect 서비스가 엔드포인트의 지역과 일치하는지 확인하십시오.
- CRN은 다음과 유사합니다.
bucketlocationvault
- 버킷 새로 작성(다른 스토리지 클래스) API 요청을 위한 버킷 작성에 대해 위치 제한조건 값을 입력하십시오.- 허용 가능한 값에 다음이 포함됩니다.
us-south-vault
us-standard-flex
eu-cold
- 허용 가능한 값에 다음이 포함됩니다.
- 업데이트를 클릭하십시오.
샘플 실행
API 샘플 요청은 매우 간단하고 사용하기 쉽습니다. 이러한 요청은 순서대로 실행되도록 설계되었으며 클라우드 스토리지와 상호작용하는 방법을 설명합니다. 적절한 오퍼레이션을 위해 클라우드 스토리지 서비스에 대해 기능 테스트를 실행할 수도 있습니다.
요청 | 예상 결과 | 테스트 결과 |
---|---|---|
버킷 목록 검색 | 본문에서, 클라우드 스토리지에 있는 버킷의 XML 목록을 설정합니다. | 요청에 성공했습니다. 응답에 예상 컨텐츠 포함 |
버킷 새로 작성 | 상태 코드 200 OK | 요청 성공 |
텍스트 파일 새로 작성 | 상태 코드 200 OK | 요청에 성공했습니다. 응답에 예상 헤더 포함 |
바이너리 파일 새로 작성 | 본문을 클릭하고 파일 선택을 클릭하여 업로드할 이미지를 선택합니다. | 요청에 성공했습니다. 응답에 예상 헤더 포함 |
버킷에서 파일 목록 검색 | 응답 본문에서, 이전 요청에서 작성한 두 개의 파일을 확인합니다. | 요청에 성공했습니다. 응답에 예상 헤더 포함 |
버킷에서 파일 목록 검색(접두부로 필터링) | 조회 문자열 값을 prefix=<some text> 로 변경하십시오. 응답 본문에서, 이름이 지정된 접두부로 시작하는 파일을 확인합니다. |
요청에 성공했습니다. 응답에 예상 헤더 포함 |
텍스트 파일 검색 | 응답 본문에서, 이전 요청에서 입력한 텍스트를 확인합니다. | 요청에 성공했습니다. 응답에 예상 본문 컨텐츠 포함. 응답에 예상 헤더 포함 |
바이너리 파일 검색 | 응답 본문에서, 이전 요청에서 선택한 이미지를 확인합니다. | 요청에 성공했습니다. 응답에 예상 헤더 포함 |
실패한 다중 파트 업로드 목록 검색 | 응답 본문에서, 버킷에 대한 실패한 다중 파트 업로드를 확인합니다. | 요청에 성공했습니다. 응답에 예상 컨텐츠 포함 |
실패한 다중 파트 업로드 목록 검색(이름으로 필터링) | 조회 문자열 값을 prefix=<some text> 로 변경하십시오. 응답 본문에서, 이름이 지정된 접두부로 시작하는 버킷에 대한 실패한 다중 파트 업로드를 확인합니다. |
요청에 성공했습니다. 응답에 예상 컨텐츠 포함 |
CORS 사용 버킷 설정 | 상태 코드 200 OK | 요청 성공 |
버킷 CORS 구성 검색 | 응답 본문에서, 버킷에 대한 CORS 구성 세트를 확인합니다. | 요청에 성공했습니다. 응답에 예상 컨텐츠 포함 |
버킷 CORS 구성 삭제 | 상태 코드 200 OK | 요청 성공 |
텍스트 파일 삭제 | 상태 코드 200 OK | 요청 성공 |
바이너리 파일 삭제 | 상태 코드 200 OK | 요청 성공 |
버킷 삭제 | 상태 코드 200 OK | 요청 성공 |
버킷 새로 작성(다른 스토리지 클래스) | 상태 코드 200 OK | 요청 성공 |
버킷 삭제(다른 스토리지 클래스) | 상태 코드 200 OK | 요청 성공 |
버킷 새로 작성(Key Protect) | 상태 코드 200 OK | 요청 성공 |
버킷 삭제(Key Protect) | 상태 코드 200 OK | 요청 성공 |
Postman Collection Runner 사용
Postman Collection Runner는 콜렉션 테스트를 위한 사용자 인터페이스를 제공하고 콜렉션에서 한 번에 모든 요청을 실행하게 할 수 있습니다.
- 기본 Postman 창의 오른쪽 상단 모서리에 있는 Runner 단추를 클릭하십시오.
- Runner 창에서 IBM COS 콜렉션을 선택하고 화면의 맨 아래에 있는 큰 파란색 IBM COS 실행 단추를 클릭하십시오.
- Collection Runner 창에는 요청이 실행될 때 반복이 표시됩니다. 각 요청 아래에 테스트 결과가 표시됩니다.
- 요약 실행은 결과의 격자 보기를 표시하고 결과 필터링을 허용합니다.
- 결과 내보내기를 클릭하여 결과를 JOSN 파일에 저장할 수도 있습니다.