{"openapi":"3.0.0","info":{"title":"OVHcloud API specification","description":"Specification for OVHcloud API","version":"1.0","contact":{"name":"OVH","email":"api@ml.ovh.net"}},"servers":[{"url":"https://api.eu.ovhcloud.com/v2"}],"components":{"schemas":{"any":{"description":"Can be anything (text, int, bool, json, html, etc.)","example":"This is a content of any type !"},"common.CurrentTask":{"type":"object","description":"Asynchronous operation currently running","properties":{"errors":{"type":"array","description":"Errors that occurred on the task","nullable":true,"items":{"$ref":"#/components/schemas/common.TaskError"},"readOnly":true},"id":{"type":"string","description":"Identifier of the current task","format":"uuid","readOnly":true},"link":{"type":"string","description":"Link to the task details","readOnly":true},"status":{"allOf":[{"$ref":"#/components/schemas/common.CurrentTaskStatusEnum"}],"description":"Current global status of the current task","nullable":true,"readOnly":true},"type":{"type":"string","description":"Type of the current task","readOnly":true}}},"common.CurrentTaskStatusEnum":{"type":"string","description":"Current status of a task. A task in ERROR cannot be retried without your inputs. PENDING tasks will be executed as soon as possible. A RUNNING task is currently executing your original request. SCHEDULED is used for tasks that will be executed in the future.","enum":["ERROR","PENDING","RUNNING","SCHEDULED","WAITING_USER_INPUT"]},"common.ResourceStatusEnum":{"type":"string","description":"Current status of a resource","enum":["CREATING","CREATION_PLANNED","DELETING","ERROR","OUT_OF_SYNC","READY","SUSPENDED","UNKNOWN","UPDATING"]},"common.TaskError":{"type":"object","description":"Errors that occurred on the task","properties":{"message":{"type":"string","description":"Error description","readOnly":true}}},"duration":{"type":"string","description":"Duration (e.g., P1Y2M3DT4H6M9S)","example":"P1Y2M3DT4H6M9S"},"email":{"type":"string","description":"Email address (e.g., api@ml.ovh.net)","format":"email","example":"api@ml.ovh.net"},"internationalPhoneNumber":{"type":"string","description":"International phone number","format":"phone-number"},"ip":{"type":"string","description":"IP address (e.g., 192.0.2.0)","format":"ipv4","example":"192.0.2.0"},"ipBlock":{"type":"string","description":"IP (v4 or v6) CIDR notation (e.g., 192.0.2.0/24)","format":"ip-block","example":"192.0.2.0/24"},"ipInterface":{"type":"string","description":"IP address (e.g., 192.0.2.0)","format":"ipv4","example":"192.0.2.0"},"ipv4":{"type":"string","description":"IPv4 address (e.g., 192.0.2.0)","format":"ipv4","example":"192.0.2.0"},"ipv4Block":{"type":"string","description":"IPv4 CIDR notation (e.g., 192.0.2.0/24)","format":"ipv4-block","example":"192.0.2.0/24"},"ipv6":{"type":"string","description":"IPv6 address (e.g., 2001:41d0:1:1994::1)","format":"ipv6","example":"2001:41d0:1:1994::1"},"ipv6Block":{"type":"string","description":"IPv6 CIDR notation (e.g., 2001:41d0::/128)","format":"ipv6-block","example":"2001:41d0::/128"},"macAddress":{"type":"string","description":"MAC address (e.g., 00:00:5e:00:53:01)","format":"mac-address","example":"00:00:5e:00:53:01"},"phoneNumber":{"type":"string","description":"Phone number","format":"phone-number"},"publicCloud.blockStorage.Block":{"type":"object","description":"A Public Cloud block storage volume","properties":{"checksum":{"type":"string","description":"Computed hash representing the current target specification value","readOnly":true},"createdAt":{"type":"string","description":"Creation date of the volume","format":"date-time","readOnly":true},"currentState":{"allOf":[{"$ref":"#/components/schemas/publicCloud.blockStorage.BlockCurrentState"}],"description":"Current observed state of the volume from the infrastructure","nullable":true,"readOnly":true},"currentTasks":{"type":"array","description":"Ongoing asynchronous tasks related to the volume","nullable":true,"items":{"$ref":"#/components/schemas/common.CurrentTask"},"readOnly":true},"id":{"type":"string","description":"Unique identifier of the volume","format":"uuid","readOnly":true},"resourceStatus":{"allOf":[{"$ref":"#/components/schemas/common.ResourceStatusEnum"}],"description":"Volume readiness in the system","readOnly":true},"targetSpec":{"allOf":[{"$ref":"#/components/schemas/publicCloud.blockStorage.BlockTargetSpec"}],"description":"Last target specification of the volume","readOnly":true},"updatedAt":{"type":"string","description":"Last update date of the volume","format":"date-time","readOnly":true}}},"publicCloud.blockStorage.BlockActionParameters":{"type":"object","description":"Parameters for a block storage volume action","properties":{"backupId":{"type":"string","description":"ID of the backup to restore from (for RESTORE_FROM_BACKUP)","nullable":true}}},"publicCloud.blockStorage.BlockActionRequest":{"type":"object","description":"Payload to perform an imperative action on a block storage volume","properties":{"checksum":{"type":"string","description":"Optional concurrency-control checksum. When supplied, it must match the resource's current checksum or the request is rejected with a 409 checksum-mismatch conflict. When omitted or empty, the concurrency check is skipped and the write is forced (last-write-wins).","nullable":true},"parameters":{"allOf":[{"$ref":"#/components/schemas/publicCloud.blockStorage.BlockActionParameters"}],"description":"Parameters for the action","nullable":true},"type":{"allOf":[{"$ref":"#/components/schemas/publicCloud.blockStorage.VolumeActionTypeEnum"}],"description":"The action to perform"}},"required":["type"]},"publicCloud.blockStorage.BlockAttachedInstance":{"type":"object","description":"An instance currently attached to a block storage volume","properties":{"id":{"type":"string","description":"Unique identifier of the instance","format":"uuid","readOnly":true}}},"publicCloud.blockStorage.BlockCreateFrom":{"type":"object","description":"Optional source to create a block storage volume from (backup, snapshot, or image). Only one source may be specified.","properties":{"backupId":{"type":"string","description":"UUID of a backup to restore from. `volumeType` and `encryption` may be specified explicitly. When omitted, they are inferred from the source volume when known.","nullable":true,"format":"uuid"},"imageId":{"type":"string","description":"UUID of a Glance image to create the volume from. The resulting volume will be bootable. `volumeType` is required when using this field.","nullable":true,"format":"uuid"},"snapshotId":{"type":"string","description":"UUID of a snapshot to create from. `volumeType` and `encryption` may be specified explicitly. When omitted, they are inferred from the source volume when known.","nullable":true,"format":"uuid"}}},"publicCloud.blockStorage.BlockCreation":{"type":"object","description":"Payload to create a Public Cloud block storage volume","properties":{"targetSpec":{"allOf":[{"$ref":"#/components/schemas/publicCloud.blockStorage.BlockTargetSpec"}],"description":"Desired target specification for the volume"}},"required":["targetSpec"]},"publicCloud.blockStorage.BlockCurrentState":{"type":"object","description":"Current state of a block storage volume as observed from the infrastructure","properties":{"attachedInstances":{"type":"array","description":"Instances currently attached to this volume","nullable":true,"items":{"$ref":"#/components/schemas/publicCloud.blockStorage.BlockAttachedInstance"},"readOnly":true},"bootable":{"type":"boolean","description":"Whether the volume is bootable","readOnly":true},"description":{"type":"string","description":"Volume description","nullable":true,"readOnly":true},"encryption":{"allOf":[{"$ref":"#/components/schemas/publicCloud.blockStorage.BlockEncryption"}],"description":"Encryption configuration of the volume","readOnly":true},"location":{"allOf":[{"$ref":"#/components/schemas/publicCloud.blockStorage.BlockLocation"}],"description":"Current location","readOnly":true},"locked":{"type":"boolean","description":"Whether the volume is locked","readOnly":true},"name":{"type":"string","description":"Current volume name","readOnly":true},"size":{"type":"integer","description":"Current size of the volume in GB","readOnly":true},"status":{"allOf":[{"$ref":"#/components/schemas/publicCloud.blockStorage.VolumeStatusEnum"}],"description":"OpenStack volume status","readOnly":true},"volumeType":{"allOf":[{"$ref":"#/components/schemas/publicCloud.blockStorage.VolumeTypeEnum"}],"description":"Current volume type","readOnly":true}}},"publicCloud.blockStorage.BlockEncryption":{"type":"object","description":"Encryption configuration for a block storage volume","properties":{"enabled":{"type":"boolean","description":"Whether the volume is encrypted at rest with LUKS"},"kms":{"allOf":[{"$ref":"#/components/schemas/publicCloud.blockStorage.BlockEncryptionKms"}],"description":"Customer-managed OVH Key Management Service (OKMS) key used to encrypt the volume. When omitted and enabled is true, the volume is encrypted with an OVH-managed key (OMK). Ignored (must be absent) when enabled is false. Immutable after creation.","nullable":true}},"required":["enabled"]},"publicCloud.blockStorage.BlockEncryptionKms":{"type":"object","description":"Reference to a customer-owned OVH Key Management Service (OKMS) key used to encrypt a block storage volume with a customer-managed key (CMK)","properties":{"domainId":{"type":"string","description":"Identifier of the OKMS domain that owns the service key","format":"uuid"},"serviceKeyId":{"type":"string","description":"Identifier of the OKMS service key used to encrypt the volume","format":"uuid"}},"required":["domainId","serviceKeyId"]},"publicCloud.blockStorage.BlockLocation":{"type":"object","description":"Location for a block storage volume","properties":{"availabilityZone":{"type":"string","description":"Availability zone within the region","nullable":true},"region":{"type":"string","description":"Region code"}},"required":["region"]},"publicCloud.blockStorage.BlockTargetSpec":{"type":"object","description":"Target specification for a block storage volume","properties":{"createFrom":{"allOf":[{"$ref":"#/components/schemas/publicCloud.blockStorage.BlockCreateFrom"}],"description":"Optional source to create the volume from (backup or snapshot). Immutable after creation.","nullable":true},"encryption":{"allOf":[{"$ref":"#/components/schemas/publicCloud.blockStorage.BlockEncryption"}],"description":"Encryption configuration for the volume. When omitted on a create from a backup or snapshot, the source volume's encryption is used when known.","nullable":true},"location":{"allOf":[{"$ref":"#/components/schemas/publicCloud.blockStorage.BlockLocation"}],"description":"Target location"},"name":{"type":"string","description":"Desired volume name"},"size":{"type":"integer","description":"Size of the volume in GB"},"volumeType":{"allOf":[{"$ref":"#/components/schemas/publicCloud.blockStorage.VolumeTypeEnum"}],"description":"Type of the volume. Required when creating a blank volume or from an image. Optional when creating from a backup or snapshot: an explicit value is honored, and when omitted the type is inferred from the source volume when known.","nullable":true}},"required":["location","name","size"]},"publicCloud.blockStorage.BlockUpdate":{"type":"object","description":"Payload to update a Public Cloud block storage volume","properties":{"checksum":{"type":"string","description":"Optional concurrency-control checksum. When supplied, it must match the resource's current checksum or the request is rejected with a 409 checksum-mismatch conflict. When omitted or empty, the concurrency check is skipped and the write is forced (last-write-wins).","nullable":true},"targetSpec":{"allOf":[{"$ref":"#/components/schemas/publicCloud.blockStorage.BlockUpdateTargetSpec"}],"description":"Desired target specification for the volume"}},"required":["targetSpec"]},"publicCloud.blockStorage.BlockUpdateTargetSpec":{"type":"object","description":"Target specification for updating a block storage volume. This body is the complete desired specification: every field below is replaced by what the request carries, and a field left out is cleared rather than carried over from the stored specification, so read the volume first and restate every value you want to keep. The create-only fields location, encryption and createFrom cannot be changed once the volume exists. They are deliberately absent from this model and sending one is rejected as an unknown field.","properties":{"name":{"type":"string","description":"Desired volume name"},"size":{"type":"integer","description":"Size of the volume in GB. The size can only be increased (extend). Shrinking a volume is not supported. Leaving it out, or sending 0, is rejected with a 400."},"volumeType":{"allOf":[{"$ref":"#/components/schemas/publicCloud.blockStorage.VolumeTypeEnum"}],"description":"Target volume type. Changing this triggers an online retype (migration).","nullable":true}},"required":["name","size"]},"publicCloud.blockStorage.VolumeActionTypeEnum":{"type":"string","description":"Supported imperative action types for a block-storage volume","enum":["RESTORE_FROM_BACKUP"]},"publicCloud.blockStorage.VolumeStatusEnum":{"type":"string","description":"Possible statuses for a block storage volume","enum":["ATTACHING","AVAILABLE","AWAITING_TRANSFER","BACKING_UP","CREATING","DELETING","DETACHING","DOWNLOADING","ERROR","ERROR_BACKING_UP","ERROR_DELETING","ERROR_EXTENDING","ERROR_RESTORING","EXTENDING","IN_USE","MAINTENANCE","RESERVED","RESTORING_BACKUP","RETYPING","UPLOADING"]},"publicCloud.blockStorage.VolumeTypeEnum":{"type":"string","description":"Possible volume types for a block storage volume","enum":["CLASSIC","HIGH_SPEED","HIGH_SPEED_GEN2"]},"time":{"type":"string","description":"Time (e.g., 15:04:05)","format":"time","example":"15:04:05"}},"securitySchemes":{"oAuth2AuthCode":{"type":"oauth2","description":"Oauth2","x-client-id":"1bb9c7df371741c0","x-client-secret":"a5b4de870aca620d10fbf63cd18d205b","flows":{"authorizationCode":{"authorizationUrl":"https://auth.eu.ovhcloud.com/oauth2/authorize","tokenUrl":"https://auth.eu.ovhcloud.com/oauth2/token","scopes":{"account/all":"Manage your account","all":"Manage your whole account and all your services","services/all":"Manage your services lifecycle and billing"}}}}}},"paths":{"/publicCloud/project/{projectId}/storage/block/volume":{"get":{"operationId":"getVolumes","summary":"List volumes","description":"Returns the volumes of the project.","security":[{"oAuth2AuthCode":[]}],"parameters":[{"in":"header","name":"X-Pagination-Cursor","description":"Pagination cursor","schema":{"type":"string"}},{"in":"header","name":"X-Pagination-Size","description":"Pagination size","schema":{"type":"integer"}},{"in":"path","name":"projectId","description":"Project ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/publicCloud.blockStorage.Block"}}}}}},"tags":["Storage","Block"],"x-developer-hub-navigation":[["Public Cloud","Storage","Block Storage@@@10"]],"x-badges":[{"color":"green","label":"Stable production version"}],"x-code-samples":[{"lang":"python","label":"Python","source":"'''\nFirst, install the latest release of Python wrapper: $ pip install ovh\n'''\nimport json\nimport ovh\n\n# Instantiate an OVH Client.\n# You can generate new credentials with full access to your account on\n# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\nclient = ovh.Client(\n\tendpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n\tapplication_key='xxxxxxxxxx',    # Application Key\n\tapplication_secret='xxxxxxxxxx', # Application Secret\n\tconsumer_key='xxxxxxxxxx',       # Consumer Key\n)\n\nresult = client.get(\"/v2/publicCloud/project/{projectId}/storage/block/volume\")\n\n# Pretty print\nprint(json.dumps(result, indent=4))"},{"lang":"php","label":"PHP","source":"<?php\n/**\n * First, download the latest release of PHP wrapper on github\n * And include this script into the folder with extracted files\n */\nrequire __DIR__ . '/vendor/autoload.php';\nuse \\Ovh\\Api;\n\n/**\n * Instantiate an OVH Client.\n * You can generate new credentials with full access to your account on\n * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\n */\n$ovh = new Api('xxxxxxxxxx',  // Application Key\n               'xxxxxxxxxx',  // Application Secret\n               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n               'xxxxxxxxxx'); // Consumer Key\n\n$result = $ovh->get(\"/v2/publicCloud/project/{projectId}/storage/block/volume\");\n\nprint_r($result);\n?>"}],"x-iam-actions":[{"name":"publicCloudProject:apiovh:volume/get","required":true}],"x-response-identifier":"id","x-expanded-response":"PublicCloudBlockStorageBlock"},"post":{"operationId":"createVolume","summary":"Create a volume","description":"Creates a volume, blank or from a backup, a snapshot or an image. `volumeType` is required for a blank volume or one created from an image. The source and the encryption can only be set at creation.","security":[{"oAuth2AuthCode":[]}],"parameters":[{"in":"path","name":"projectId","description":"Project ID","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/publicCloud.blockStorage.BlockCreation"},"examples":{"Create block storage":{"value":{"targetSpec":{"location":{"region":"GRA1"},"name":"test-volume","size":10,"volumeType":"CLASSIC"}},"summary":"Create a block storage volume with minimal target spec"}}}}},"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/publicCloud.blockStorage.Block"}}}},"400":{"description":"Error 400 response","content":{"application/json":{"schema":{"type":"object","description":"Common error model","properties":{"class":{"type":"string","description":"Class of the error"},"message":{"type":"string","description":"Error message"}}},"examples":{"Client::BadRequest::CustomerManagedKeyNotAccessible":{"value":{"class":"Client::BadRequest::CustomerManagedKeyNotAccessible","message":"The OVH KMS key {{.serviceKeyId}} does not exist in the OVH KMS domain {{.domainId}}, or no IAM policy on the key grants the Public Cloud identity {{.identityUrn}} the IAM action(s) {{.missingActions}}"}},"Client::BadRequest::CustomerManagedKeyRegionMismatch":{"value":{"class":"Client::BadRequest::CustomerManagedKeyRegionMismatch","message":"The OVH KMS key {{.serviceKeyId}} belongs to an OVH KMS domain in region {{.kmsDomainRegion}} and cannot encrypt a volume in region {{.region}}. Use a key from an OVH KMS domain in the region of the volume"}},"Client::BadRequest::CustomerManagedKeyUnsuitable":{"value":{"class":"Client::BadRequest::CustomerManagedKeyUnsuitable","message":"The OVH KMS key {{.serviceKeyId}} cannot encrypt a volume: the key {{.violations}}. Volume encryption requires an AES key of 256 bits that allows wrap and unwrap"}},"Client::BadRequest::InvalidParameter":{"value":{"class":"Client::BadRequest::InvalidParameter","message":"Invalid parameter in the request"}}}}}},"409":{"description":"Error 409 response","content":{"application/json":{"schema":{"type":"object","description":"Common error model","properties":{"class":{"type":"string","description":"Class of the error"},"message":{"type":"string","description":"Error message"}}},"examples":{"Client::Conflict::RegionInMaintenance":{"value":{"class":"Client::Conflict::RegionInMaintenance","message":"This region is currently in maintenance"}}}}}}},"tags":["Storage","Block"],"x-developer-hub-navigation":[["Public Cloud","Storage","Block Storage@@@30"]],"x-badges":[{"color":"green","label":"Stable production version"}],"x-code-samples":[{"lang":"python","label":"Python","source":"'''\nFirst, install the latest release of Python wrapper: $ pip install ovh\n'''\nimport json\nimport ovh\n\n# Instantiate an OVH Client.\n# You can generate new credentials with full access to your account on\n# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\nclient = ovh.Client(\n\tendpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n\tapplication_key='xxxxxxxxxx',    # Application Key\n\tapplication_secret='xxxxxxxxxx', # Application Secret\n\tconsumer_key='xxxxxxxxxx',       # Consumer Key\n)\n\n# Request body type: publicCloud.blockStorage.BlockCreation\nresult = client.post(\"/v2/publicCloud/project/{projectId}/storage/block/volume\",\n\ttargetSpec = None, # Desired target specification for the volume (type: publicCloud.blockStorage.BlockTargetSpec)\n)\n\n# Pretty print\nprint(json.dumps(result, indent=4))"},{"lang":"php","label":"PHP","source":"<?php\n/**\n * First, download the latest release of PHP wrapper on github\n * And include this script into the folder with extracted files\n */\nrequire __DIR__ . '/vendor/autoload.php';\nuse \\Ovh\\Api;\n\n/**\n * Instantiate an OVH Client.\n * You can generate new credentials with full access to your account on\n * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\n */\n$ovh = new Api('xxxxxxxxxx',  // Application Key\n               'xxxxxxxxxx',  // Application Secret\n               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n               'xxxxxxxxxx'); // Consumer Key\n\n// Request body type: publicCloud.blockStorage.BlockCreation\n$result = $ovh->post(\"/v2/publicCloud/project/{projectId}/storage/block/volume\", array(\n\ttargetSpec => null, // Desired target specification for the volume (type: publicCloud.blockStorage.BlockTargetSpec)\n));\n\nprint_r($result);\n?>"}],"x-iam-actions":[{"name":"publicCloudProject:apiovh:volume/create","required":true}]}},"/publicCloud/project/{projectId}/storage/block/volume/{id}":{"delete":{"operationId":"deleteVolume","summary":"Delete a volume","description":"Deletes the volume. An attached volume cannot be deleted: detach it first.","security":[{"oAuth2AuthCode":[]}],"parameters":[{"in":"path","name":"id","description":"Id","required":true,"schema":{"type":"string","format":"uuid"}},{"in":"path","name":"projectId","description":"Project ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/publicCloud.blockStorage.Block"}}}},"404":{"description":"Error 404 response","content":{"application/json":{"schema":{"type":"object","description":"Common error model","properties":{"class":{"type":"string","description":"Class of the error"},"message":{"type":"string","description":"Error message"}}},"examples":{"Client::NotFound::VolumeDoesNotExist":{"value":{"class":"Client::NotFound::VolumeDoesNotExist","message":"Volume not found"}}}}}},"409":{"description":"Error 409 response","content":{"application/json":{"schema":{"type":"object","description":"Common error model","properties":{"class":{"type":"string","description":"Class of the error"},"message":{"type":"string","description":"Error message"}}},"examples":{"Client::Conflict::ResourceAlreadyBeingDeleted":{"value":{"class":"Client::Conflict::ResourceAlreadyBeingDeleted","message":"Resource is already being deleted"}},"Client::Conflict::ResourceInInvalidState":{"value":{"class":"Client::Conflict::ResourceInInvalidState","message":"Resource cannot be modified in its current state"}}}}}}},"tags":["Storage","Block"],"x-developer-hub-navigation":[["Public Cloud","Storage","Block Storage@@@50"]],"x-badges":[{"color":"green","label":"Stable production version"}],"x-code-samples":[{"lang":"python","label":"Python","source":"'''\nFirst, install the latest release of Python wrapper: $ pip install ovh\n'''\nimport json\nimport ovh\n\n# Instantiate an OVH Client.\n# You can generate new credentials with full access to your account on\n# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\nclient = ovh.Client(\n\tendpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n\tapplication_key='xxxxxxxxxx',    # Application Key\n\tapplication_secret='xxxxxxxxxx', # Application Secret\n\tconsumer_key='xxxxxxxxxx',       # Consumer Key\n)\n\nresult = client.delete(\"/v2/publicCloud/project/{projectId}/storage/block/volume/{id}\")\n\n# Pretty print\nprint(json.dumps(result, indent=4))"},{"lang":"php","label":"PHP","source":"<?php\n/**\n * First, download the latest release of PHP wrapper on github\n * And include this script into the folder with extracted files\n */\nrequire __DIR__ . '/vendor/autoload.php';\nuse \\Ovh\\Api;\n\n/**\n * Instantiate an OVH Client.\n * You can generate new credentials with full access to your account on\n * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\n */\n$ovh = new Api('xxxxxxxxxx',  // Application Key\n               'xxxxxxxxxx',  // Application Secret\n               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n               'xxxxxxxxxx'); // Consumer Key\n\n$result = $ovh->delete(\"/v2/publicCloud/project/{projectId}/storage/block/volume/{id}\");\n\nprint_r($result);\n?>"}],"x-iam-actions":[{"name":"publicCloudProject:apiovh:volume/delete","required":true}]},"get":{"operationId":"getVolume","summary":"Get a volume","description":"Returns the volume configuration and its current state, including the instances it is attached to.","security":[{"oAuth2AuthCode":[]}],"parameters":[{"in":"path","name":"id","description":"Id","required":true,"schema":{"type":"string","format":"uuid"}},{"in":"path","name":"projectId","description":"Project ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/publicCloud.blockStorage.Block"},"examples":{"Example":{"value":{"checksum":"6af6af88d8df425668fd0c98de1e0795","createdAt":"2026-01-20T17:10:32Z","currentState":{"bootable":false,"encryption":{"enabled":false},"location":{"region":"GRA1"},"locked":false,"name":"test-from-apiv2","size":20,"status":"AVAILABLE","volumeType":"CLASSIC"},"currentTasks":null,"id":"a53bbebb-2366-4d4e-b074-5cb81515173e","resourceStatus":"READY","targetSpec":{"location":{"region":"GRA1"},"name":"test-from-apiv2","size":20,"volumeType":"CLASSIC"},"updatedAt":"2026-01-20T17:13:34Z"},"summary":"Example"}}}}},"404":{"description":"Error 404 response","content":{"application/json":{"schema":{"type":"object","description":"Common error model","properties":{"class":{"type":"string","description":"Class of the error"},"message":{"type":"string","description":"Error message"}}},"examples":{"Client::NotFound::VolumeDoesNotExist":{"value":{"class":"Client::NotFound::VolumeDoesNotExist","message":"Volume not found"}}}}}}},"tags":["Storage","Block"],"x-developer-hub-navigation":[["Public Cloud","Storage","Block Storage@@@20"]],"x-badges":[{"color":"green","label":"Stable production version"}],"x-code-samples":[{"lang":"python","label":"Python","source":"'''\nFirst, install the latest release of Python wrapper: $ pip install ovh\n'''\nimport json\nimport ovh\n\n# Instantiate an OVH Client.\n# You can generate new credentials with full access to your account on\n# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\nclient = ovh.Client(\n\tendpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n\tapplication_key='xxxxxxxxxx',    # Application Key\n\tapplication_secret='xxxxxxxxxx', # Application Secret\n\tconsumer_key='xxxxxxxxxx',       # Consumer Key\n)\n\nresult = client.get(\"/v2/publicCloud/project/{projectId}/storage/block/volume/{id}\")\n\n# Pretty print\nprint(json.dumps(result, indent=4))"},{"lang":"php","label":"PHP","source":"<?php\n/**\n * First, download the latest release of PHP wrapper on github\n * And include this script into the folder with extracted files\n */\nrequire __DIR__ . '/vendor/autoload.php';\nuse \\Ovh\\Api;\n\n/**\n * Instantiate an OVH Client.\n * You can generate new credentials with full access to your account on\n * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\n */\n$ovh = new Api('xxxxxxxxxx',  // Application Key\n               'xxxxxxxxxx',  // Application Secret\n               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n               'xxxxxxxxxx'); // Consumer Key\n\n$result = $ovh->get(\"/v2/publicCloud/project/{projectId}/storage/block/volume/{id}\");\n\nprint_r($result);\n?>"}],"x-iam-actions":[{"name":"publicCloudProject:apiovh:volume/get","required":true}],"x-response-identifier":"id"},"put":{"operationId":"editVolume","summary":"Update a volume","description":"Replaces the volume's target specification as a whole. The body carries the complete desired state of every field `publicCloud.blockStorage.BlockUpdateTargetSpec` exposes (`name`, `size` and `volumeType`), so read the volume first and restate every value you want to keep: a field left out of `targetSpec` is cleared, not carried over from the stored specification.\n\nThe create-only fields `location`, `encryption` and `createFrom` cannot be changed once the volume exists. They are deliberately absent from the update model, and sending one is rejected with a 400.\n\n`name` and `size` are both required. `size` can only grow: restate the volume's current size to keep it, or send a larger value to extend it, because shrinking a volume is not supported. Leaving `size` out, or sending 0, is rejected with a 400. Restate `volumeType` to keep it. Sending a different type triggers an online retype (migration).\n\nThe optional `checksum` guards against a lost update: when supplied it must match the volume's current checksum or the request is rejected with a 409 checksum mismatch. Omitting it skips the check and forces the write (last-write-wins).","security":[{"oAuth2AuthCode":[]}],"parameters":[{"in":"path","name":"id","description":"Id","required":true,"schema":{"type":"string","format":"uuid"}},{"in":"path","name":"projectId","description":"Project ID","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/publicCloud.blockStorage.BlockUpdate"},"examples":{"Update block storage target spec":{"value":{"checksum":"6af6af88d8df425668fd0c98de1e0795","targetSpec":{"name":"test-from-apiv2-renamed","size":40,"volumeType":"CLASSIC"}},"summary":"Rename the volume and extend it from 20 GB to 40 GB. The body is the complete target spec: volumeType is restated so the volume keeps its type"}}}}},"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/publicCloud.blockStorage.Block"}}}},"400":{"description":"Error 400 response","content":{"application/json":{"schema":{"type":"object","description":"Common error model","properties":{"class":{"type":"string","description":"Class of the error"},"message":{"type":"string","description":"Error message"}}},"examples":{"Client::BadRequest::InvalidParameter":{"value":{"class":"Client::BadRequest::InvalidParameter","message":"Invalid parameter in the request"}}}}}},"404":{"description":"Error 404 response","content":{"application/json":{"schema":{"type":"object","description":"Common error model","properties":{"class":{"type":"string","description":"Class of the error"},"message":{"type":"string","description":"Error message"}}},"examples":{"Client::NotFound::VolumeDoesNotExist":{"value":{"class":"Client::NotFound::VolumeDoesNotExist","message":"Volume not found"}}}}}},"409":{"description":"Error 409 response","content":{"application/json":{"schema":{"type":"object","description":"Common error model","properties":{"class":{"type":"string","description":"Class of the error"},"message":{"type":"string","description":"Error message"}}},"examples":{"Client::Conflict::ChecksumMismatch":{"value":{"class":"Client::Conflict::ChecksumMismatch","message":"Checksum mismatch — a concurrent update was detected. Refresh the resource and retry"}},"Client::Conflict::ResourceInInvalidState":{"value":{"class":"Client::Conflict::ResourceInInvalidState","message":"Resource cannot be modified in its current state"}}}}}}},"tags":["Storage","Block"],"x-developer-hub-navigation":[["Public Cloud","Storage","Block Storage@@@60"]],"x-badges":[{"color":"green","label":"Stable production version"}],"x-code-samples":[{"lang":"python","label":"Python","source":"'''\nFirst, install the latest release of Python wrapper: $ pip install ovh\n'''\nimport json\nimport ovh\n\n# Instantiate an OVH Client.\n# You can generate new credentials with full access to your account on\n# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\nclient = ovh.Client(\n\tendpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n\tapplication_key='xxxxxxxxxx',    # Application Key\n\tapplication_secret='xxxxxxxxxx', # Application Secret\n\tconsumer_key='xxxxxxxxxx',       # Consumer Key\n)\n\n# Request body type: publicCloud.blockStorage.BlockUpdate\nresult = client.put(\"/v2/publicCloud/project/{projectId}/storage/block/volume/{id}\",\n\tchecksum = None, # Optional concurrency-control checksum. When supplied, it must match the resource's current checksum or the request is rejected with a 409 checksum-mismatch conflict. When omitted or empty, the concurrency check is skipped and the write is forced (last-write-wins). (type: string, nullable)\n\ttargetSpec = None, # Desired target specification for the volume (type: publicCloud.blockStorage.BlockUpdateTargetSpec)\n)\n\n# Pretty print\nprint(json.dumps(result, indent=4))"},{"lang":"php","label":"PHP","source":"<?php\n/**\n * First, download the latest release of PHP wrapper on github\n * And include this script into the folder with extracted files\n */\nrequire __DIR__ . '/vendor/autoload.php';\nuse \\Ovh\\Api;\n\n/**\n * Instantiate an OVH Client.\n * You can generate new credentials with full access to your account on\n * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\n */\n$ovh = new Api('xxxxxxxxxx',  // Application Key\n               'xxxxxxxxxx',  // Application Secret\n               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n               'xxxxxxxxxx'); // Consumer Key\n\n// Request body type: publicCloud.blockStorage.BlockUpdate\n$result = $ovh->put(\"/v2/publicCloud/project/{projectId}/storage/block/volume/{id}\", array(\n\tchecksum => null, // Optional concurrency-control checksum. When supplied, it must match the resource's current checksum or the request is rejected with a 409 checksum-mismatch conflict. When omitted or empty, the concurrency check is skipped and the write is forced (last-write-wins). (type: string, nullable)\n\ttargetSpec => null, // Desired target specification for the volume (type: publicCloud.blockStorage.BlockUpdateTargetSpec)\n));\n\nprint_r($result);\n?>"}],"x-iam-actions":[{"name":"publicCloudProject:apiovh:volume/edit","required":true}]}},"/publicCloud/project/{projectId}/storage/block/volume/{id}/action":{"post":{"operationId":"postVolumeAction","summary":"Run an action on a volume","description":"Runs an action on the volume. The only action available is `RESTORE_FROM_BACKUP`, which restores the volume from the backup given in `parameters.backupId`.","security":[{"oAuth2AuthCode":[]}],"parameters":[{"in":"path","name":"id","description":"Id","required":true,"schema":{"type":"string","format":"uuid"}},{"in":"path","name":"projectId","description":"Project ID","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/publicCloud.blockStorage.BlockActionRequest"},"examples":{"Restore volume from backup":{"value":{"checksum":"6af6af88d8df425668fd0c98de1e0795","parameters":{"backupId":"b64ccfcc-3477-5e5f-c185-6dc92626284f"},"type":"RESTORE_FROM_BACKUP"},"summary":"Restore a block storage backup in-place into the existing volume"}}}}},"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/publicCloud.blockStorage.Block"}}}},"400":{"description":"Error 400 response","content":{"application/json":{"schema":{"type":"object","description":"Common error model","properties":{"class":{"type":"string","description":"Class of the error"},"message":{"type":"string","description":"Error message"}}},"examples":{"Client::BadRequest::InvalidParameter":{"value":{"class":"Client::BadRequest::InvalidParameter","message":"Invalid parameter in the request"}}}}}},"404":{"description":"Error 404 response","content":{"application/json":{"schema":{"type":"object","description":"Common error model","properties":{"class":{"type":"string","description":"Class of the error"},"message":{"type":"string","description":"Error message"}}},"examples":{"Client::NotFound::VolumeDoesNotExist":{"value":{"class":"Client::NotFound::VolumeDoesNotExist","message":"Volume not found"}}}}}},"409":{"description":"Error 409 response","content":{"application/json":{"schema":{"type":"object","description":"Common error model","properties":{"class":{"type":"string","description":"Class of the error"},"message":{"type":"string","description":"Error message"}}},"examples":{"Client::Conflict::ResourceInInvalidState":{"value":{"class":"Client::Conflict::ResourceInInvalidState","message":"Resource cannot be modified in its current state"}}}}}}},"tags":["Storage","Block"],"x-developer-hub-navigation":[["Public Cloud","Storage","Block Storage@@@40"]],"x-badges":[{"color":"green","label":"Stable production version"}],"x-code-samples":[{"lang":"python","label":"Python","source":"'''\nFirst, install the latest release of Python wrapper: $ pip install ovh\n'''\nimport json\nimport ovh\n\n# Instantiate an OVH Client.\n# You can generate new credentials with full access to your account on\n# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\nclient = ovh.Client(\n\tendpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n\tapplication_key='xxxxxxxxxx',    # Application Key\n\tapplication_secret='xxxxxxxxxx', # Application Secret\n\tconsumer_key='xxxxxxxxxx',       # Consumer Key\n)\n\n# Request body type: publicCloud.blockStorage.BlockActionRequest\nresult = client.post(\"/v2/publicCloud/project/{projectId}/storage/block/volume/{id}/action\",\n\tchecksum = None, # Optional concurrency-control checksum. When supplied, it must match the resource's current checksum or the request is rejected with a 409 checksum-mismatch conflict. When omitted or empty, the concurrency check is skipped and the write is forced (last-write-wins). (type: string, nullable)\n\tparameters = None, # Parameters for the action (type: publicCloud.blockStorage.BlockActionParameters, nullable)\n\ttype = None, # The action to perform (type: publicCloud.blockStorage.VolumeActionTypeEnum)\n)\n\n# Pretty print\nprint(json.dumps(result, indent=4))"},{"lang":"php","label":"PHP","source":"<?php\n/**\n * First, download the latest release of PHP wrapper on github\n * And include this script into the folder with extracted files\n */\nrequire __DIR__ . '/vendor/autoload.php';\nuse \\Ovh\\Api;\n\n/**\n * Instantiate an OVH Client.\n * You can generate new credentials with full access to your account on\n * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\n */\n$ovh = new Api('xxxxxxxxxx',  // Application Key\n               'xxxxxxxxxx',  // Application Secret\n               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n               'xxxxxxxxxx'); // Consumer Key\n\n// Request body type: publicCloud.blockStorage.BlockActionRequest\n$result = $ovh->post(\"/v2/publicCloud/project/{projectId}/storage/block/volume/{id}/action\", array(\n\tchecksum => null, // Optional concurrency-control checksum. When supplied, it must match the resource's current checksum or the request is rejected with a 409 checksum-mismatch conflict. When omitted or empty, the concurrency check is skipped and the write is forced (last-write-wins). (type: string, nullable)\n\tparameters => null, // Parameters for the action (type: publicCloud.blockStorage.BlockActionParameters, nullable)\n\ttype => null, // The action to perform (type: publicCloud.blockStorage.VolumeActionTypeEnum)\n));\n\nprint_r($result);\n?>"}],"x-iam-actions":[{"name":"publicCloudProject:apiovh:volume/runAction","required":true}]}}},"tags":[{"name":"Storage","x-tag-expanded":false,"description":"Missing description"},{"name":"Block","x-tag-expanded":false,"description":"Missing description"}]}
