listBlocks
List Block storages
Details
- Method:
GET - Path:
/blocks - Operation ID:
list-blocks
Parameters
{
"per_page": {
"description": "Number of items requested per page. Default is 100 and Max is 500.",
"required": false,
"location": "query",
"type": "integer"
},
"cursor": {
"description": "Cursor for paging. See [Meta and Pagination](#section/Introduction/Meta-and-Pagination).",
"required": false,
"location": "query",
"type": "string"
}
}Response Schema
{
"type": "object",
"properties": {
"blocks": {
"type": "array",
"items": {
"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."
}
}
}
},
"meta": {
"title": "meta",
"type": "object",
"x-examples": {
"meta response": {
"meta": {
"total": 31,
"links": {
"next": "WxYzExampleNext",
"prev": ""
}
}
}
},
"description": "The meta information object. See [Meta and Pagination](#section/Introduction/Meta-and-Pagination) for more information.",
"properties": {
"total": {
"type": "integer",
"description": "Total objects available in the list. This value may be greater than the number of objects returned if `per_page` is set."
},
"links": {
"type": "object",
"description": "Cursor values for pagination.",
"properties": {
"next": {
"type": "string",
"description": "Cursor value for the next page."
},
"prev": {
"type": "string",
"description": "Cursor value for the previous page."
}
}
}
}
}
}
}Usage
from ocp_agent import OCPAgent
agent = OCPAgent()
await agent.register_api('vultr')
# Call this tool
result = await agent.call_tool('listBlocks', {
# Add required parameters here
})