createBlock
Create Block Storage
Details
- Method:
POST - Path:
/blocks - Operation ID:
create-block
Parameters
{
"region": {
"description": "The [Region id](#operation/list-regions) where the Block Storage will be created.",
"required": true,
"location": "body",
"type": "string"
},
"size_gb": {
"description": "Size in GB may range between 10 and 40000, depending on the `block_type`.",
"required": true,
"location": "body",
"type": "integer"
},
"label": {
"description": "The user-supplied label.",
"required": false,
"location": "body",
"type": "string"
},
"block_type": {
"description": "An optional parameter, that determines on the type of block storage volume that will be created.\nSoon to become a required parameter.\n\n* `high_perf` from 10GB to 10,000GB\n* `storage_opt` from 40GB to 40,000GB",
"required": false,
"location": "body",
"type": "string"
}
}Response Schema
{
"type": "object",
"properties": {
"block": {
"title": "blockstorage",
"type": "object",
"x-tags": [
"block"
],
"description": "Block Storage information.",
"x-examples": {
"block structure": {
"id": "cb676a46-66fd-4dfb-b839-443f2e6c0b60",
"cost": 10,
"status": "active",
"size_gb": 100,
"region": "ewr",
"attached_to_instance": "b92f4771-d8cd-480a-b6e6-a14ca31ea2ca",
"date_created": "2020-10-10T01:56:20+00:00",
"label": "Example Block Storage"
}
},
"properties": {
"id": {
"type": "string",
"description": "A unique ID for the Block Storage."
},
"cost": {
"type": "integer",
"description": "The monthly cost of this Block Storage."
},
"status": {
"type": "string",
"description": "The current status of this Block Storage.\n\n* active"
},
"size_gb": {
"type": "integer",
"description": "Size of the Block Storage in GB."
},
"region": {
"type": "string",
"description": "The [Region id](#operation/list-regions) where the Block Storage is located."
},
"attached_to_instance": {
"type": "string",
"description": "The [Instance id](#operation/list-instances) with this Block Storage attached."
},
"date_created": {
"type": "string",
"description": "The date this Block Storage was created."
},
"label": {
"type": "string",
"description": "The user-supplied label."
},
"mount_id": {
"type": "string",
"description": "An ID associated with the instance, when mounted the ID can be found in /dev/disk/by-id prefixed with virtio."
}
}
}
}
}Usage
from ocp_agent import OCPAgent
agent = OCPAgent()
await agent.register_api('vultr')
# Call this tool
result = await agent.call_tool('createBlock', {
# Add required parameters here
})