const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
servers: [
{
bmcAddress: '<string>',
tags: {},
displayName: '<string>',
description: '<string>',
persona: '<string>'
}
]
})
};
fetch('https://api.k0rdent.ai/v1/regions/{region}/projects/{project}/infrastructure/servers:batchCreate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"succeeded": [
{
"selfLink": "/v1/regions/us-texas-1/projects/project-x9y8z7/infrastructure/servers/server-p7q8r9",
"uid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"id": "server-p7q8r9",
"displayName": "<string>",
"description": "<string>",
"hardwareSpecs": {
"cpu": {},
"ram": {},
"gpu": {}
},
"bmcAddress": "<string>",
"provisioningState": "registered",
"healthStatus": {
"status": "healthy",
"lastCheckTime": "2023-11-07T05:31:56Z",
"failureReasons": [
"<string>"
]
},
"tags": {},
"persona": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"failed": [
{
"index": 123,
"error": {
"error": {
"code": 123,
"message": "<string>",
"details": [
{}
]
}
}
}
]
}Bulk enroll multiple servers via CSV or JSON file upload.
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
servers: [
{
bmcAddress: '<string>',
tags: {},
displayName: '<string>',
description: '<string>',
persona: '<string>'
}
]
})
};
fetch('https://api.k0rdent.ai/v1/regions/{region}/projects/{project}/infrastructure/servers:batchCreate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"succeeded": [
{
"selfLink": "/v1/regions/us-texas-1/projects/project-x9y8z7/infrastructure/servers/server-p7q8r9",
"uid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"id": "server-p7q8r9",
"displayName": "<string>",
"description": "<string>",
"hardwareSpecs": {
"cpu": {},
"ram": {},
"gpu": {}
},
"bmcAddress": "<string>",
"provisioningState": "registered",
"healthStatus": {
"status": "healthy",
"lastCheckTime": "2023-11-07T05:31:56Z",
"failureReasons": [
"<string>"
]
},
"tags": {},
"persona": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"failed": [
{
"index": 123,
"error": {
"error": {
"code": 123,
"message": "<string>",
"details": [
{}
]
}
}
}
]
}Bearer token authentication using OAuth2/OIDC tokens
Array of server registration requests
Show child attributes
Was this page helpful?