Create Image via API
-
Hey,
I’m trying to create image via API using Postman, but all i get is “error”: “Required database field is empty”. Does anyone have any experience with it?
This is my body:
{
“name”:“test-api1”,
“description”:“test-api1”,
“storagegroup”:“2”,
“os”:“9”,
“file”:“test-api1”,
“imagetype”:“1”,
“imagepartitiontype”:“1”,
“isEnabled”:“on”,
“toReplicate”:“on”,
“compress”:“6”,
“imagemanage”:“5”
} -
@makswojciech You might look here at the community contributed powershell modules, they might give you a good direction. https://github.com/FOGProject/fog-community-scripts/tree/master/PowershellModules
Though, sometimes it’s best to go look at the source code. Have a look-see at the files with the word
image
in their name here: https://github.com/FOGProject/fogproject/tree/master/packages/web/lib/fog -
@wayne-workman Thanks you for your aid! Those Powershell scripts helped me. For those in the future with the same problem as me.
{
“name”:“test-api1”,
“description”:“test-api1”,
“storagegroups”:“2”,
“osID”:“9”,
“path”:“test-api1”,
“imageTypeID”:“1”,
“imagePartitionTypeID”:“1”,
“isEnabled”:“1”,
“toReplicate”:“1”,
“compress”:“6”,
“imagemanage”:“5”
}
That’s how the body should more or less look like