CostExplorer
Overview
SCP에서 제공하는 CostExplorer 서비스를 프로그램적으로 이용할 수 있도록 지원하는 응용 프로그램 인터페이스(Application Programming Interface, API)를 제공합니다.
본 가이드는 CostExplorer 서비스에 대한 간략한 설명 및 API를 호출하는 방법을 제공합니다.
API는 RESTful API 방식으로 제공되며, JSON 형식으로 응답합니다.
Version
| Version | Status | Supported Until |
|---|
| 1.0 | CURRENT | - |
OpenAPI URL
https://costexplorer.{environment}.samsungsdscloud.com
Environment and Region List
| environment | region |
|---|
| s | kr-west1 |
| s | kr-east1 |
| g | kr-south1 |
| g | kr-south2 |
| g | kr-south3 |
| e | kr-west1 |
| e | kr-east1 |
1.1.1 - 1.0
get /v1/payments/monthly
Description
Get payment monthly data.
상태
ACTIVE (CURRENT)
Parameters
| Type | Name | Description | Schema | Default |
|---|
| query | size optional | Size Example : 10
| any of [integer, null] | 20 |
| query | page optional | Page Example : 1
| any of [integer, null] | 1 |
Responses
Example HTTP request
Request path
/v1/payments/monthly
"Scp-Accesskey = 2sd2gg=2agbdSD26svcD",
"Scp-Signature = fsfsdf235f9U35sdgf35Xsf/qgsdgsdg326=sfsdr23rsef=",
"Scp-Timestamp = 1605290625682",
"Scp-ClientType = Openapi",
"Accept-Language = ko-KR",
"Scp-Api-Version = costexplorer 1.0"
Example HTTP response
Response 200
{
"count": 20,
"size": 10,
"page": 1,
"payments": [
{
"payer_account_id": "228cb9e4a7934f84853594c7f26f7a21",
"payer_account_name": "test-account",
"payer_account_type": "MEMBER",
"bill_year_month": "2024-08",
"used_year_month": "2024-08",
"payment_date": "2024-08-01",
"bill_currency": "KRW",
"payment_currency": "KRW",
"payment_state": "PAID",
"bill_amount": {
"krw": "0.000",
"usd": "0.00"
},
"used_amount": {
"krw": "0.000",
"usd": "0.00"
},
"unpaid_amount": {
"krw": "0.000",
"usd": "0.00"
},
"paid_amount": {
"krw": "0.000",
"usd": "0.00"
},
"accumulated_unpaid_amount": {
"krw": "0.000",
"usd": "0.00"
},
"suspended_year_month": "2024-08"
}
]
}
1.2.1 - 1.0
get /v1/bills
Description
Get bill list.
상태
ACTIVE (CURRENT)
Parameters
| Type | Name | Description | Schema | Default |
|---|
| query | start_year_month optional | Start year-month (YYYY-mm) Example : 2024-08
| any of [string, null] | None |
| query | end_year_month optional | End year-month (YYYY-mm) Example : 2024-08
| any of [string, null] | None |
| query | with_count optional | with count Example : true
| any of [string, null] | None |
| query | limit optional | limit Example : 20
| any of [integer, null] | None |
| query | marker optional | marker Example : 607e0938521643b5b4b266f343fae693
| any of [string, null] | None |
| query | sort optional | sort Example : created_at:desc
| any of [string, null] | None |
| query | account_id optional | Account Id Example : 228cb9e4a7934f84853594c7f26f7a21
| any of [string, array[string], null] | None |
| query | service_category optional | Service Category Example : COMPUTE
| any of [string, array[string], null] | None |
| query | billing_item_id optional | Billing Item Id Example : VIRTUAL_SERVER
| any of [string, array[string], null] | None |
| query | resource_name optional | Resource Name Example : test-vm
| any of [string, null] | None |
| query | region optional | Region Example : kr-west1
| any of [string, array[string], null] | None |
| query | contract_id optional | Contract Id Example : C002612775
| any of [string, null] | None |
| query | order_status optional | CCBS Order Status Example : 04
| any of [string, null] | None |
| query | bill_year_month optional | Bill Date (YYYY-MM) Example : 2024-07
| any of [string, null] | None |
| query | bill_state optional | Billing State Example : USED
| any of [string, null] | None |
Responses
| HTTP Code | Description | Schema |
|---|
| 200 | OK | BillListResponse |
| 400 | Bad Request | None |
| 403 | Forbidden | None |
| 404 | Not Found | None |
Example HTTP request
Request path
/v1/bills
"Scp-Accesskey = 2sd2gg=2agbdSD26svcD",
"Scp-Signature = fsfsdf235f9U35sdgf35Xsf/qgsdgsdg326=sfsdr23rsef=",
"Scp-Timestamp = 1605290625682",
"Scp-ClientType = Openapi",
"Accept-Language = ko-KR",
"Scp-Api-Version = costexplorer 1.0"
Example HTTP response
Response 200
{
"count": 20,
"links": [
{
"href": "http://scp.samsungsdscloud.com/v1/notices",
"rel": "self"
}
],
"bills": [
{
"amounts": {
"krw": "500.000",
"usd": "0.000"
},
"discount_amounts": {
"krw": "500.000",
"usd": "0.000"
},
"asset": {
"krw": "500.000",
"usd": "0.000"
},
"operation": {
"krw": "500.000",
"usd": "0.000"
},
"option": {
"krw": "500.000",
"usd": "0.000"
},
"support_plan": {
"krw": "500.000",
"usd": "0.000"
},
"cancellation_fee": {
"krw": "500.000",
"usd": "0.000"
},
"planned_compute": {
"krw": "500.000",
"usd": "0.000"
},
"msp_discount": {
"krw": "500.000",
"usd": "0.000"
},
"new_business_discount": {
"krw": "500.000",
"usd": "0.000"
},
"sales_discount": {
"krw": "500.000",
"usd": "0.000"
},
"sla_discount": {
"krw": "500.000",
"usd": "0.000"
},
"reseller_discount": {
"krw": "500.000",
"usd": "0.000"
},
"account_cost_savings": {
"krw": "500.000",
"usd": "0.000"
},
"project_cost_savings": {
"krw": "500.000",
"usd": "0.000"
},
"account_credit": {
"krw": "500.000",
"usd": "0.000"
},
"project_credit": {
"krw": "500.000",
"usd": "0.000"
},
"edp": {
"krw": "500.000",
"usd": "0.000"
},
"id": "5f3688a192094ddeb0c94166a3e88935",
"account_id": "228cb9e4a7934f84853594c7f26f7a21",
"service_category": "COMPUTE",
"billing_item_id": "VIRTUAL_SERVER",
"resource_id": "7f6741f3-d9f0-4262-9a5f-627e373567a7",
"resource_name": "test-vm",
"region": "kr-west1",
"contract_id": "C002612775",
"order_status": "04",
"bill_year_month": "2024-07",
"bill_state": "USED"
}
]
}
1.3.1 - 1.0
get /v1/usages
Description
Get usage list.
상태
ACTIVE (CURRENT)
Parameters
| Type | Name | Description | Schema | Default |
|---|
| query | start_date optional | Start date (YYYY-MM-dd) Example : 2024-08-01
| string | None |
| query | end_date optional | End date (YYYY-MM-dd) Example : 2024-08-01
| string | None |
| query | with_count optional | with count Example : true
| any of [string, null] | None |
| query | limit optional | limit Example : 20
| any of [integer, null] | None |
| query | marker optional | marker Example : 607e0938521643b5b4b266f343fae693
| any of [string, null] | None |
| query | sort optional | sort Example : created_at:desc
| any of [string, null] | None |
| query | account_id optional | Account Id Example : 228cb9e4a7934f84853594c7f26f7a21
| any of [string, array[string], null] | None |
| query | service_category optional | Service Category Example : COMPUTE
| any of [string, array[string], null] | None |
| query | billing_item_id optional | Billing Item Id Example : VIRTUAL_SERVER
| any of [string, array[string], null] | None |
| query | resource_name optional | Resource Name Example : test-vm
| any of [string, null] | None |
| query | region optional | Region Example : kr-west1
| any of [string, array[string], null] | None |
| query | contract_id optional | Contract Id Example : C002612775
| any of [string, null] | None |
| query | order_status optional | CCBS Order Status Example : 04
| any of [string, array[string], null] | None |
Responses
| HTTP Code | Description | Schema |
|---|
| 200 | OK | UsageListResponse |
| 400 | Bad Request | None |
| 403 | Forbidden | None |
| 404 | Not Found | None |
Example HTTP request
Request path
/v1/usages
"Scp-Accesskey = 2sd2gg=2agbdSD26svcD",
"Scp-Signature = fsfsdf235f9U35sdgf35Xsf/qgsdgsdg326=sfsdr23rsef=",
"Scp-Timestamp = 1605290625682",
"Scp-ClientType = Openapi",
"Accept-Language = ko-KR",
"Scp-Api-Version = costexplorer 1.0"
Example HTTP response
Response 200
{
"timezone": "Asia/Seoul",
"count": 20,
"links": [
{
"href": "http://scp.samsungsdscloud.com/v1/notices",
"rel": "self"
}
],
"usages": [
{
"id": "5f3688a192094ddeb0c94166a3e88935",
"account_id": "228cb9e4a7934f84853594c7f26f7a21",
"service_category": "COMPUTE",
"billing_item_id": "VIRTUAL_SERVER",
"ccbs_product_code": "PD00013862",
"resource_id": "7f6741f3-d9f0-4262-9a5f-627e373567a7",
"contract_id": "C002612775",
"order_status": "04",
"usage_date": "2024-08-01T00:00:00",
"amounts": {
"krw": "500.0000000000",
"usd": "0.0"
},
"status_code": "0"
}
]
}