Every API here is available over the APIs.io API and to AI agents over MCP.
openapi: 3.2.0
info:
title: Ibm Db2 Scaling API
version: '4'
termsOfService: http://www.ibm.com/software/sla/sladb.nsf
x-github: https://github.ibm.com/cloud-api-docs/db2-saas
x-github-issues: https://github.ibm.com/cloud-api-docs/db2-saas/issues/new
x-last-updated: '2025-06-25'
x-sdk-supported-languages:
- java
- node
- go
- python
x-try-it-out-enabled: true
description: 'Operations tagged Scaling across 2 of this provider''s published API definitions: ibm-db2-db2-on-cloud-v4-openapi.json, ibm-db2-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://_HOSTNAME_VARIABLE_/dbapi/v4
security:
- authToken: []
- deploymentId: []
tags:
- name: Scaling
description: '### Authorization
The token must be IAM-issued.
You can use the API key to generate an IAM Bearer Token.
To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > name > Access policies.'
paths:
/scaling/request:
post:
tags:
- Scaling
summary: Create a scaling request
description: Scale the amount of storage and cpu cores for your instance.
operationId: postScalingRequest
requestBody:
content:
application/json:
schema:
type: object
required:
- total_cores
- total_storage
properties:
total_cores:
type: integer
description: The number of cores to scale
example: 4
total_storage:
type: integer
description: The amount of storage to scale in MB
example: 20480
description: The number of cores and the amount of storage to scale.
x-codegen-request-body-name: body
responses:
'200':
description: The scaling request was successful. Returns the task ID used to scale the deployment.
content:
application/json:
schema:
$ref: '#/components/schemas/SuccessScalingRequestResponse'
'400':
description: Bad request
'401':
description: Unauthorized
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
x-sdk-operations:
request-examples:
go:
- name: Example request
example:
- type: code
source:
- "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{HOSTNAME}/dbapi/v4/scaling/request\"\n\n\tpayload := strings.NewReader(\"{\\\"total_cores\\\":4,\\\"total_storage\\\":20480}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"accept\", \"application/json\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\treq.Header.Add(\"authorization\", \"Bearer {AUTH_TOKEN}\")\n\treq.Header.Add(\"x-deployment-id\", \"{DEPLOYMENT_ID}\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
java:
- name: Example request
example:
- type: code
source:
- "OkHttpClient client = new OkHttpClient();\n\nMediaType mediaType = MediaType.parse(\"application/json\");\nRequestBody body = RequestBody.create(mediaType, \"{\\\"total_cores\\\":4,\\\"total_storage\\\":20480}\");\nRequest request = new Request.Builder()\n .url(\"https://{HOSTNAME}/dbapi/v4/scaling/request\")\n .post(body)\n .addHeader(\"accept\", \"application/json\")\n .addHeader(\"content-type\", \"application/json\")\n .addHeader(\"authorization\", \"Bearer {AUTH_TOKEN}\")\n .addHeader(\"x-deployment-id\", \"{DEPLOYMENT_ID}\")\n .build();\n\nResponse response = client.newCall(request).execute();"
node:
- name: Example request
example:
- type: code
source:
- "var http = require(\"https\");\n\nvar options = {\n \"method\": \"POST\",\n \"hostname\": \"{HOSTNAME}\",\n \"port\": null,\n \"path\": \"/dbapi/v4/scaling/request\",\n \"headers\": {\n \"accept\": \"application/json\",\n \"content-type\": \"application/json\",\n \"authorization\": \"Bearer {AUTH_TOKEN}\",\n \"x-deployment-id\": \"{DEPLOYMENT_ID}\"\n }\n};\n\nvar req = http.request(options, function (res) {\n var chunks = [];\n\n res.on(\"data\", function (chunk) {\n chunks.push(chunk);\n });\n\n res.on(\"end\", function () {\n var body = Buffer.concat(chunks);\n console.log(body.toString());\n });\n});\n\nreq.write(JSON.stringify({total_cores: 4, total_storage: 20480}));\nreq.end();"
python:
- name: Example request
example:
- type: code
source:
- "import http.client\n\nconn = http.client.HTTPSConnection(\"{HOSTNAME}\")\n\npayload = \"{\\\"total_cores\\\":4,\\\"total_storage\\\":20480}\"\n\nheaders = {\n 'accept': \"application/json\",\n 'content-type': \"application/json\",\n 'authorization': \"Bearer {AUTH_TOKEN}\",\n 'x-deployment-id': \"{DEPLOYMENT_ID}\"\n }\n\nconn.request(\"POST\", \"/dbapi/v4/scaling/request\", payload, headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"
curl:
- name: Example request
example:
- type: code
source:
- "curl -X POST \\\n https://{HOSTNAME}/dbapi/v4/scaling/request \\\n -H 'accept: application/json' \\\n -H 'authorization: Bearer {AUTH_TOKEN}' \\\n -H 'content-type: application/json' \\\n -H 'x-deployment-id: {DEPLOYMENT_ID}' \\\n -d '{\"total_cores\":4,\"total_storage\":20480}'"
servers:
- url: https://_HOSTNAME_VARIABLE_/dbapi/v4
/scaling/resources/info:
get:
tags:
- Scaling
summary: Get supported scaling ranges and current allocated resources
description: 'View the allocated storage and cpu size at the time of the request.
This request will also return the supported scaling ranges for this Db2 on Cloud service.'
operationId: getResourcesInfo
responses:
'200':
description: Details for supported scaling ranges and current allocated resources.
content:
application/json:
schema:
$ref: '#/components/schemas/SuccessResourcesInfoResponse'
'400':
description: Bad request
'401':
description: Unauthorized
'500':
description: Unexpected error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
x-sdk-operations:
request-examples:
go:
- name: Example request
example:
- type: code
source:
- "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{HOSTNAME}/dbapi/v4/scaling/resources/info\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"accept\", \"application/json\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\treq.Header.Add(\"authorization\", \"Bearer {AUTH_TOKEN}\")\n\treq.Header.Add(\"x-deployment-id\", \"{DEPLOYMENT_ID}\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
java:
- name: Example request
example:
- type: code
source:
- "OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n .url(\"https://{HOSTNAME}/dbapi/v4/scaling/resources/info\")\n .get()\n .addHeader(\"accept\", \"application/json\")\n .addHeader(\"content-type\", \"application/json\")\n .addHeader(\"authorization\", \"Bearer {AUTH_TOKEN}\")\n .addHeader(\"x-deployment-id\", \"{DEPLOYMENT_ID}\")\n .build();\n\nResponse response = client.newCall(request).execute();"
node:
- name: Example request
example:
- type: code
source:
- "var http = require(\"https\");\n\nvar options = {\n \"method\": \"GET\",\n \"hostname\": \"{HOSTNAME}\",\n \"port\": null,\n \"path\": \"/dbapi/v4/scaling/resources/info\",\n \"headers\": {\n \"accept\": \"application/json\",\n \"content-type\": \"application/json\",\n \"authorization\": \"Bearer {AUTH_TOKEN}\",\n \"x-deployment-id\": \"{DEPLOYMENT_ID}\"\n }\n};\n\nvar req = http.request(options, function (res) {\n var chunks = [];\n\n res.on(\"data\", function (chunk) {\n chunks.push(chunk);\n });\n\n res.on(\"end\", function () {\n var body = Buffer.concat(chunks);\n console.log(body.toString());\n });\n});\n\nreq.end();"
python:
- name: Example request
example:
- type: code
source:
- "import http.client\n\nconn = http.client.HTTPSConnection(\"{HOSTNAME}\")\n\nheaders = {\n 'accept': \"application/json\",\n 'content-type': \"application/json\",\n 'authorization': \"Bearer {AUTH_TOKEN}\",\n 'x-deployment-id': \"{DEPLOYMENT_ID}\"\n }\n\nconn.request(\"GET\", \"/dbapi/v4/scaling/resources/info\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"
curl:
- name: Example request
example:
- type: code
source:
- "curl -X GET \\\n https://{HOSTNAME}/dbapi/v4/scaling/resources/info \\\n -H 'accept: application/json' \\\n -H 'authorization: Bearer {AUTH_TOKEN}' \\\n -H 'content-type: application/json' \\\n -H 'x-deployment-id: {DEPLOYMENT_ID}'"
servers:
- url: https://_HOSTNAME_VARIABLE_/dbapi/v4
/scaling/history:
get:
tags:
- Scaling
summary: View scaling history
description: View scaling historical data.
operationId: getScalingHistory
parameters:
- name: start
in: query
schema:
type: integer
- name: end
in: query
schema:
type: integer
- name: search
in: query
schema:
type: string
- name: sort_column
in: query
schema:
type: string
- name: sort_order
in: query
schema:
type: string
- name: activity_type
in: query
schema:
type: string
responses:
'200':
description: View scaling history
content:
application/json:
schema:
$ref: '#/components/schemas/SuccessScalingHistoryResponse'
'400':
description: Bad request
'401':
description: Unauthorized
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
x-sdk-operations:
request-examples:
go:
- name: Example request
example:
- type: code
source:
- "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{HOSTNAME}/dbapi/v4/scaling/history?start=SOME_INTEGER_VALUE&end=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sort_column=SOME_STRING_VALUE&sort_order=SOME_STRING_VALUE&activity_type=SOME_STRING_VALUE\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"accept\", \"application/json\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\treq.Header.Add(\"authorization\", \"Bearer {AUTH_TOKEN}\")\n\treq.Header.Add(\"x-deployment-id\", \"{DEPLOYMENT_ID}\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
java:
- name: Example request
example:
- type: code
source:
- "OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n .url(\"https://{HOSTNAME}/dbapi/v4/scaling/history?start=SOME_INTEGER_VALUE&end=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sort_column=SOME_STRING_VALUE&sort_order=SOME_STRING_VALUE&activity_type=SOME_STRING_VALUE\")\n .get()\n .addHeader(\"accept\", \"application/json\")\n .addHeader(\"content-type\", \"application/json\")\n .addHeader(\"authorization\", \"Bearer {AUTH_TOKEN}\")\n .addHeader(\"x-deployment-id\", \"{DEPLOYMENT_ID}\")\n .build();\n\nResponse response = client.newCall(request).execute();"
node:
- name: Example request
example:
- type: code
source:
- "var http = require(\"https\");\n\nvar options = {\n \"method\": \"GET\",\n \"hostname\": \"{HOSTNAME}\",\n \"port\": null,\n \"path\": \"/dbapi/v4/scaling/history?start=SOME_INTEGER_VALUE&end=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sort_column=SOME_STRING_VALUE&sort_order=SOME_STRING_VALUE&activity_type=SOME_STRING_VALUE\",\n \"headers\": {\n \"accept\": \"application/json\",\n \"content-type\": \"application/json\",\n \"authorization\": \"Bearer {AUTH_TOKEN}\",\n \"x-deployment-id\": \"{DEPLOYMENT_ID}\"\n }\n};\n\nvar req = http.request(options, function (res) {\n var chunks = [];\n\n res.on(\"data\", function (chunk) {\n chunks.push(chunk);\n });\n\n res.on(\"end\", function () {\n var body = Buffer.concat(chunks);\n console.log(body.toString());\n });\n});\n\nreq.end();"
python:
- name: Example request
example:
- type: code
source:
- "import http.client\n\nconn = http.client.HTTPSConnection(\"{HOSTNAME}\")\n\nheaders = {\n 'accept': \"application/json\",\n 'content-type': \"application/json\",\n 'authorization': \"Bearer {AUTH_TOKEN}\",\n 'x-deployment-id': \"{DEPLOYMENT_ID}\"\n }\n\nconn.request(\"GET\", \"/dbapi/v4/scaling/history?start=SOME_INTEGER_VALUE&end=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sort_column=SOME_STRING_VALUE&sort_order=SOME_STRING_VALUE&activity_type=SOME_STRING_VALUE\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"
curl:
- name: Example request
example:
- type: code
source:
- "curl -X GET \\\n 'https://{HOSTNAME}/dbapi/v4/scaling/history?start=SOME_INTEGER_VALUE&end=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sort_column=SOME_STRING_VALUE&sort_order=SOME_STRING_VALUE&activity_type=SOME_STRING_VALUE' \\\n -H 'accept: application/json' \\\n -H 'authorization: Bearer {AUTH_TOKEN}' \\\n -H 'content-type: application/json' \\\n -H 'x-deployment-id: {DEPLOYMENT_ID}'"
servers:
- url: https://_HOSTNAME_VARIABLE_/dbapi/v4
components:
schemas:
SuccessResourcesInfoResponse:
type: object
properties:
plan:
type: string
example: Enterprise
groupID:
type: string
example: member
storage:
type: object
description: current allocated storage and supported storage ranges for scaling
properties:
range:
type: array
items:
type: object
properties:
scale:
type: integer
example: 1
label:
type: integer
example: 20480
allocated:
type: number
format: float
example: 20480
unit:
type: string
example: MB
rangeDetail:
type: object
properties:
allocated:
type: integer
example: 20480
is_adjustable:
type: boolean
example: true
can_scale_down:
type: boolean
example: false
compute:
type: object
description: current allocated cpu and supported cpu ranges for scaling
properties:
range:
type: array
items:
type: object
properties:
scale:
type: integer
example: 1
label:
type: integer
example: 4
RAM:
type: object
properties:
value:
type: integer
example: 8
allocated:
type: number
format: float
example: 4
rangeDetail:
type: object
properties:
allocated:
type: integer
example: 4
is_adjustable:
type: boolean
example: true
can_scale_down:
type: boolean
example: true
SuccessScalingHistoryResponse:
required:
- list
properties:
list:
type: array
description: List of scaling history
items:
type: object
properties:
activity_id:
type: integer
example: 1
activity_content:
type: string
example: '+12'
activity_type:
type: string
example: scaling_compute
duration:
type: integer
example: 1261
incremental_cost:
type: string
example: +$1.30
requested_value:
type: string
example: '24'
status:
type: string
example: Success
time_completed:
type: string
example: '2021-04-09T19:36:48Z'
users:
type: string
example: bluadmin
ErrorResponse:
required:
- message
- code
properties:
message:
type: string
description: error message
example: An error occurred invoking the backend api
code:
type: integer
format: int32
description: error status code
example: 500
SuccessScalingRequestResponse:
required:
- scaling_id
properties:
scaling_id:
type: string
description: the task ID for scaling operation
example: crn:v1:ibm:local:database:us-south:a/c5555555580015ebfde430a819fa4bb3:console-dev01:expansion:ac9555b1-df50-4ecb-88ef-34b650eff712
securitySchemes:
authToken:
type: apiKey
in: header
name: Authorization
description: Authorize using **Bearer [access_token]**. The access token can be obtained by authenticating with the **/auth/tokens** endpoint or [use the API key to generate an IAM Bearer Token](https://cloud.ibm.com/docs/account?topic=account-iamtoken_from_apikey).
deploymentId:
type: apiKey
in: header
name: X-Deployment-Id
description: The deployment id of the service, which can be obtained after provision. When providing the deployment id in the header, use URL encoding. For example, ":" should be escaped as "%3A", and "/" should be escaped as "%2F".
x-refined-from:
- ibm-db2-db2-on-cloud-v4-openapi.json
- ibm-db2-openapi.yml