diff --git a/menu/navigation.json b/menu/navigation.json index edbbe0d104..6a30074c67 100644 --- a/menu/navigation.json +++ b/menu/navigation.json @@ -4998,6 +4998,10 @@ "label": "Managing a volume", "slug": "managing-a-volume" }, + { + "label": "Increasing volume size via the API", + "slug": "increasing-volume-size" + }, { "label": "Identifying the API managing Block Storage volumes and snapshots", "slug": "identifying-volume-snapshot-api" diff --git a/pages/block-storage/api-cli/increasing-volume-size.mdx b/pages/block-storage/api-cli/increasing-volume-size.mdx new file mode 100644 index 0000000000..cd5f5c0d7c --- /dev/null +++ b/pages/block-storage/api-cli/increasing-volume-size.mdx @@ -0,0 +1,55 @@ +--- +meta: + title: &title Increasing the size of Block Storage volumes via the Scaleway API + description: &desc This page explains how to increase the size of a Block Storage volume using the Scaleway API. +content: + h1: *title + paragraph: *desc +tags: increase expand increment raise storage volume block +dates: + validation: 2025-03-04 + posted: 2025-03-04 +categories: + - block-storage + - storage +--- + +The Block storage API allows you to interact with Block Storage volumes programmatically through API calls. Refer to the [Developers reference website](https://www.scaleway.com/en/developers/api/block/) for more information on how to use the Block Storage API. + + + +- A Scaleway account logged into the [console](https://console.scaleway.com) +- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization +- A valid [API key](/iam/how-to/create-api-keys/) +- A [Block Storage volume](/instances/api-cli/creating-a-volume/) + +1. Run the command below to list your Block Storage volumes. Do not forget to replace the `{zone}` placeholder with the desired Availability Zone (`fr-par-1`, `nl-ams-2`, etc.): + ``` + curl -X GET \ + -H "X-Auth-Token: $SCW_SECRET_KEY" \ + "https://api.scaleway.com/block/v1alpha1/zones/{zone}/volumes" + ``` + + An output similar to the following displays: + + ``` + {"volume": {"creation_date": "2020-06-02T08:04:50.094118+00:00", "server": null, "id": "", "size": 25000000000, "name": "myAwesomeVolume", "zone": "", "export_uri": null, "volume_type": "b_ssd", "modification_date": "2020-06-02T08:04:50.094118+00:00", "state": "available", "organization": ""}} + ``` + +2. To modify the volume size, run the request below. Do not forget to replace the placeholders with the appropriate value: + ``` + curl -X PATCH \ + -H "X-Auth-Token: $SCW_SECRET_KEY" \ + -H "Content-Type: application/json" \ + -d '{"size" : "{size_in_bytes}"}' \ + "https://api.scaleway.com/block/v1alpha1/zones/{zone}/volumes/{volume_id}" + ``` + + You can only increase the size of a Block Storage volume. Reducing its size is not permitted due to technical constraints. + + An output similar to the following displays: + ``` + {"volume": {"creation_date": "2020-06-02T08:04:50.094118+00:00", "server": null, "id": "VOLUME_ID", "size": 26000000000, "name": "new_name", "zone": "REGION", "export_uri": null, "volume_type": "b_ssd", "modification_date": "2020-06-02T08:08:27.385208+00:00", "state": "resizing", "organization": "ORGANIZATION_ID"}} + ``` + +The size of your volume has been updated. diff --git a/pages/instances/api-cli/increasing-volume-size.mdx b/pages/instances/api-cli/increasing-volume-size.mdx index 10516d807e..e9572b4718 100644 --- a/pages/instances/api-cli/increasing-volume-size.mdx +++ b/pages/instances/api-cli/increasing-volume-size.mdx @@ -5,7 +5,7 @@ meta: content: h1: Increasing Block Storage volumes via the Instance API paragraph: This page explains how to increase a Block Storage volume -tags: increase expland increment raise storage volume block +tags: increase expand increment raise storage volume block dates: validation: 2024-08-26 posted: 2020-01-10 @@ -14,12 +14,14 @@ categories: - storage --- +The Instances API allows you to interact with Block Storage volumes programmatically through API calls. To increase the size of a volume using the Block Storage API, refer to the [dedicated documentation](/block-storage/api-cli/increasing-volume-size/). + - A Scaleway account logged into the [console](https://console.scaleway.com) - [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization - A valid [API key](/iam/how-to/create-api-keys/) -- A [Block Storage volume](/instances/api-cli/creating-a-volume/) +- A [Block Storage volume](/instances/api-cli/creating-a-volume/) attached to an Instance 1. Inspect the volume and verify its name, size, and if the type is `b_ssd` by running the following request.