Cloud Databases API
2세대
Cloud Databases API는 일반적으로 운영을 위해 리소스 컨트롤러 API를 활용합니다. 이 API 문서를 활용하여 데이터 서비스를 관리하십시오.
인증
API에 액세스할 때는 헤더 Authorization: Bearer <token> 를 사용하여 토큰 인증 방식을 적용합니다. 토큰은 IAM에서 발급된 것이어야 합니다. IAM API 키를 토큰으로 직접 전송하거나, 해당 API 키를 사용하여 IAM 베어러 토큰을 생성할 수 있습니다.
각 메서드를 호출하려면, 필요한 IAM 작업이 포함된 역할이 할당되어 있어야 합니다. 각 메소드는 연관된 조치를 나열합니다. IAM 조치 및 역할을 맵핑하는 방법에 대한 자세한 정보는 IBM Cloud®에 대한 액세스 관리를 참조하십시오.
오류 처리
이 API는 메서드가 성공적으로 완료되었는지 여부를 나타내기 위해 표준 HTTP 응답 코드를 사용합니다. 200 응답은 항상 성공을 나타냅니다. 4xx 유형의 응답은 일종의 오류이며, 500 유형의 응답은 대개 내부 시스템 오류를 나타냅니다. 이러한 응답 중 어느 것이든, 보다 상세한 오류 정보가 포함된 JSON 형식의 본문이 함께 제공될
수 있습니다.
이벤트 추적
다음 서비스를 사용하여 계정 내 API 활동을 모니터링할 수 있습니다. IBM Cloud® Activity Tracker 서비스를 사용하여 계정 내의 API 활동을 모니터링할 수 있습니다. API 메서드가 호출될 때마다 이벤트가 생성되며, 이 이벤트는 Activity Tracker 내에서 추적하고 감사할 수 있습니다. 각 메서드별로 구체적인 이벤트 유형이 나열되어 있습니다.
배포 ID 및 CRN
배포 ID는 Cloud Data Services 플랫폼의 CRN입니다. CRN을 사용할 때는 CRN 값에 슬래시(/) %2F 문자가 포함될 수 있으므로, 반드시 URL 방식으로 인코딩해야 합니다.
예: 다음 CRN
crn:v1:bluemix:public:databases-for-redis:us-south:a/274074dce64e9c423ffc238516c755e1:29caf0e7-120f-4da8-9551-3abf57ebcfc7::
URL 로 인코딩하면 다음과 같이 됩니다.
crn:v1:bluemix:public:databases-for-redis:us-south:a%2F274074dce64e9c423ffc238516c755e1:29caf0e7-120f-4da8-9551-3abf57ebcfc7::
페이지 매김
현재 페이지 단위로 데이터를 반환하는 엔드포인트는 없습니다.
속도 제한
현재 속도 제한을 구현한 엔드포인트는 없습니다.
메소드
배포된 모든 제품 나열하기
배포된 모든 클라우드 서비스의 목록을 반환합니다.
GET /v2/resource_instances
요청 예제:
curl -X GET https://resource-controller.cloud.ibm.com/v2/resource_instances -H "Authorization: Bearer <IAM token>"
리소스 예:
{
"rows_count": 100,
"next_url": "/v2/resource_instances?start=<token>",
"resources": [
{
"id": "crn:v1:bluemix:public:databases-for-redis:eu-de:a/40ddc34a953a8c02f10987b59085b60e:07d523b1-6eea-4263-bd03-c17edf355e0b::",
"guid": "07d523b1-6eea-4263-bd03-c17edf355e0b",
"url": "/v2/resource_instances/07d523b1-6eea-4263-bd03-c17edf355e0b",
"created_at": "2026-07-17T06:41:51.267012883Z",
"updated_at": "2026-07-17T06:42:11.22949657Z",
"deleted_at": null,
"created_by": "Id-270000000X",
"updated_by": "",
"deleted_by": "",
"scheduled_reclaim_at": null,
"restored_at": null,
"scheduled_reclaim_by": "",
"restored_by": "",
"name": "test-redis-gen2",
"region_id": "eu-de",
"account_id": "40ddc34a953a8c02f10987b59085b60e",
"reseller_channel_id": "",
"resource_plan_id": "databases-for-redis-gen2-standard",
"resource_group_id": "eb922ba0717f47589ca26d202c5cc915",
"resource_group_crn": "crn:v1:bluemix:public:resource-controller::a/40ddc34a953a8c02f10987b59085b60e::resource-group:eb922ba0717f47589ca26d202c5cc915",
"target_crn": "crn:v1:bluemix:public:globalcatalog::::deployment:databases-for-redis-standard-gen2%3Aeu-de",
"parameters": {
"dataservices": {
"redis": {
"host_flavor": "bxf.4x16",
"members": 2,
"storage_gb": 15,
"version": "8.2"
}
}
},
"allow_cleanup": false,
"crn": "crn:v1:bluemix:public:databases-for-redis:eu-de:a/40ddc34a953a8c02f10987b59085b60e:07d523b1-6eea-4263-bd03-c17edf355e0b::",
"state": "provisioning",
"type": "service_instance",
"sub_type": "Public",
"resource_id": "databases-for-redis",
"dashboard_url": null,
"last_operation": {
"type": "create",
"state": "in progress",
"async": true,
"description": "Provision in progress",
"cancelable": true,
"poll": true
},
"resource_keys_url": "/v2/resource_instances/07d523b1-6eea-4263-bd03-c17edf355e0b/resource_keys",
"plan_history": [
{
"resource_plan_id": "databases-for-redis-gen2-standard",
"start_date": "2026-07-17T06:41:51.267012883Z",
"requestor_id": "Id-270000000X"
}
],
"migrated": false,
"controlled_by": "",
"locked": false,
"onetime_credentials": false
}
]
}
resources 배열에는 추가 리소스 객체들이 반환됩니다. next_url 토큰을 사용하여 결과의 다음 페이지를 불러오세요.
배포 정보 확인하기
배포와 관련된 전체 데이터를 가져옵니다. 이 데이터에는 ID, 이름, 데이터베이스 유형 및 버전이 포함됩니다.
GET /v2/resource_instances/{id}
요청 예제:
curl -X GET https://resource-controller.cloud.ibm.com/v2/resource_instances/95004d03-9fec-443b-9f6e-083f2b25e73a -H "Authorization: Bearer <IAM token>" \
리소스 예:
{
"id": "crn:v1:bluemix:public:databases-for-postgresql:us-east:a/23b09aee04da4545b6e32805fa93249d:95004d03-9fec-443b-9f6e-083f2b25e73a::",
"guid": "95004d03-9fec-443b-9f6e-083f2b25e73a",
"url": "/v2/resource_instances/95004d03-9fec-443b-9f6e-083f2b25e73a",
"created_at": "2026-07-02T14:04:29.613949688Z",
"updated_at": "2026-07-02T14:15:54.226535327Z",
"deleted_at": null,
"created_by": "Id-4700030B2K",
"updated_by": "",
"deleted_by": "",
"scheduled_reclaim_at": null,
"restored_at": null,
"scheduled_reclaim_by": "",
"restored_by": "",
"name": "Databases for PostgreSQL-3b",
"region_id": "us-east",
"account_id": "23b09aee04da4545b6e32805fa93249d",
"reseller_channel_id": "",
"resource_plan_id": "databases-for-postgresql-gen2-standard",
"resource_group_id": "c21a4e8564c14d1aab2a9a8b441904eb",
"resource_group_crn": "crn:v1:bluemix:public:resource-controller::a/23b09aee04da4545b6e32805fa93249d::resource-group:c21a4e8564c14d1aab2a9a8b441904eb",
"target_crn": "crn:v1:bluemix:public:globalcatalog::::deployment:databases-for-postgresql-standard-gen2%3Aus-east",
"parameters": {
"dataservices": {
"postgresql": {
"host_flavor": "bx3d.4x20",
"members": 2,
"storage_gb": 10,
"version": "18"
}
}
},
"allow_cleanup": false,
"crn": "crn:v1:bluemix:public:databases-for-postgresql:us-east:a/23b09aee04da4545b6e32805fa93249d:95004d03-9fec-443b-9f6e-083f2b25e73a::",
"state": "active",
"type": "service_instance",
"sub_type": "Public",
"resource_id": "databases-for-postgresql",
"dashboard_url": null,
"last_operation": {
"type": "create",
"state": "succeeded",
"async": true,
"description": "Provision completed successfully",
"cancelable": true,
"poll": true
},
"resource_keys_url": "/v2/resource_instances/95004d03-9fec-443b-9f6e-083f2b25e73a/resource_keys",
"plan_history": [
{
"resource_plan_id": "databases-for-postgresql-gen2-standard",
"start_date": "2026-07-02T14:04:29.613949688Z",
"requestor_id": "Id-4700030B2K"
}
],
"migrated": false,
"extensions": {
"dataservices": {
"$schema": {
"version": "1.0.0"
},
"connection": {
"cli": {
"arguments": [
"host=95004d03-9fec-443b-9f6e-083f2b25e73a.private.uhp.postgresql.us-east.dataservices.appdomain.cloud port=5432 dbname=postgres user=$PGUSER password=$PGPASSWORD sslmode=verify-full"
],
"bin": "psql",
"composed": [
"PGUSER=$PGUSER PGPASSWORD=$PGPASSWORD PGSSLMODE=verify-full PGSSLROOTCERT=system psql 'host=95004d03-9fec-443b-9f6e-083f2b25e73a.private.uhp.postgresql.us-east.dataservices.appdomain.cloud port=5432 dbname=postgres'"
],
"environment": {
"PGPASSWORD": "$PGPASSWORD",
"PGSSLMODE": "verify-full",
"PGSSLROOTCERT": "system",
"PGUSER": "$PGUSER"
},
"type": "cli"
},
"postgres": {
"authentication": {
"method": "direct",
"password": "$PGPASSWORD",
"username": "$PGUSER"
},
"composed": [
"postgres://$PGUSER:$PGPASSWORD@95004d03-9fec-443b-9f6e-083f2b25e73a.private.uhp.postgresql.us-east.dataservices.appdomain.cloud:5432/postgres?sslmode=verify-full"
],
"database": "postgres",
"hosts": [
{
"hostname": "95004d03-9fec-443b-9f6e-083f2b25e73a.private.uhp.postgresql.us-east.dataservices.appdomain.cloud",
"port": 5432
}
],
"path": "/postgres",
"port": 5432,
"query_options": {
"sslmode": "verify-full"
},
"scheme": "postgres",
"type": "uri"
}
},
"postgresql": {
"configuration": {
"max_connections": 115
},
"cpu_count": 4,
"host_flavor": "bx3d.4x20",
"members": 2,
"memory_gb": 20,
"storage_gb": 10,
"version": "18"
}
},
"virtual_private_endpoints": {
"dns_domain": "95004d03-9fec-443b-9f6e-083f2b25e73a.private.uhp.postgresql.us-east.dataservices.appdomain.cloud",
"dns_hosts": [
"",
"*"
],
"endpoints": [
{
"ip_address": "10.51.217.34",
"zone": "us-east-1"
},
{
"ip_address": "10.51.219.57",
"zone": "us-east-2"
},
{
"ip_address": "10.51.221.12",
"zone": "us-east-3"
}
],
"origin_type": "vpc",
"ports": [
{
"port_max": 5432,
"port_min": 5432
}
]
}
},
"controlled_by": "",
"locked": false,
"onetime_credentials": false
}
API 응답에서 다음과 같은 정보를 확인할 수 있습니다:
last_operation객체 - 가장 최근에 수행한 작업을 표시합니다.connection객체 - 제품 연결 정보를 표시합니다.- 제품별 정보는 해당 제품 항목 아래에 표시됩니다(예:
postgresql).
데이터베이스 프로비저닝 방법
POST /v2/resource_instances
요청 예제:
curl -X POST https://resource-controller.cloud.ibm.com/v2/resource_instances \
-H "Authorization: Bearer <IAM token>" \
-H 'Content-Type: application/json' \
-d '{
"name": "my-instance",
"target": "ca-mon",
"resource_group": "5c49eabc-f5e8-5881-a37e-2d100a33b3df",
"resource_plan_id": "databases-for-postgresql-gen2-standard",
"parameters": {
"dataservices": {
"postgresql": {
"storage_gb": 10,
"members": 2,
"host_flavor": "b3c.8x32.encrypted",
"version": "18"
},
"encryption": {
"disk": "crn:v1..."
},
"$schema": {
"version": "1.0.0"
}
}
}
}'
입력 매개변수
name(String)- 인스턴스의 이름.target(문자열)- 배포할 리전(예:us-south,eu-de).resource_group(문자열)- 리소스 그룹의 ID입니다.resource_plan_id(문자열)- 플랜 ID(예:databases-for-postgresql-gen2-standard).parameters(객체)dataservices(객체)<service>(객체)- 서비스 이름 키(예:postgresql,mysql).storage_gb(정수)- 저장 용량(GB 단위).members(정수)- 회원 수.host_flavor(문자열)- 호스트 유형 ID(예:b3c.8x32.encrypted).version(문자열)- 데이터베이스 버전(예:"18").
encryption(객체, 선택 사항)- 디스크 암호화 설정.disk(문자열)- 디스크 암호화를 위한 ‘ Key Protect ’ 키의 CRN.
$schema(객체)- 스키마 메타데이터.version(문자열)- 스키마 버전. 반드시"1.0.0"이어야 합니다.
데이터베이스를 확장하는 방법
PATCH /v2/resource_instances/{id}
요청 예제:
curl -X PATCH https://resource-controller.cloud.ibm.com/v2/resource_instances/ed9d2c9b-444b-421d-bbc0-503ca8dd3036 \
-H "Authorization: Bearer <IAM token>" \
-H 'Content-Type: application/json' \
-d '{
"parameters": {
"dataservices": {
"postgresql": {
"storage_gb": 12,
"members": 2,
"host_flavor": "bxf.4x16"
}
}
}
}'
입력 매개변수
parameters(객체)dataservices(객체)<service>(객체)- 서비스 이름 키(예:postgresql,mysql).storage_gb(정수)- 저장 용량(GB 단위).members(정수)- 회원 수.host_flavor(문자열)- 호스트 유형 ID(예:bxf.4x16).