This is a feature/improvement request.
I am working on a tool that sets up a few templates onto a cluster, each template is meant for automated testing and relies on cloud-init to do all of the early bootstrapping.
Right now, I can issue a `GET` request to the API to see any snippets/images ... etc that I have stored:
And I get back an array of objects like so:
The current API allows me to upload the IMG/qcow2 file for import with an API call like this:
But there is a limit to what the **required** `content` parameter will take :
`iso | vztmpl | import`
Which means that there is no way for me to use the API to upload the cloud-init yaml snippet.
Which brings me to the ask:
- Update the API so `POST /api2/json/nodes/{node}/storage/{storage}/upload?content=snippet` works and allows me to programmatically upload cloud-init snippets to the cluster
I am working on a tool that sets up a few templates onto a cluster, each template is meant for automated testing and relies on cloud-init to do all of the early bootstrapping.
Right now, I can issue a `GET` request to the API to see any snippets/images ... etc that I have stored:
Code:
GET /api2/json/nodes/{node}/storage/{storage}/content/
And I get back an array of objects like so:
Code:
[
<...>
{'volid': 'local:import/ubuntu-26.04-server-cloudimg-amd64v3.qcow2', 'format': 'qcow2', ... 'content': 'import'},
{'volid': 'local:snippets/ubuntu-resolute-cloudinit.yaml', ... 'format': 'snippet', 'content': 'snippets'},
<...>
]
The current API allows me to upload the IMG/qcow2 file for import with an API call like this:
Code:
POST /api2/json/nodes/{node}/storage/{storage}/upload
But there is a limit to what the **required** `content` parameter will take :
`iso | vztmpl | import`
Which means that there is no way for me to use the API to upload the cloud-init yaml snippet.
Which brings me to the ask:
- Update the API so `POST /api2/json/nodes/{node}/storage/{storage}/upload?content=snippet` works and allows me to programmatically upload cloud-init snippets to the cluster