Register a Linux/systemd virtual machine and issue a one-use AgentV enrollment command
curl --request POST \
--url https://api.acornops.dev/api/v1/workspaces/{workspaceId}/virtual-machines \
--header 'Content-Type: application/json' \
--cookie acornops_cp_session= \
--data '
{
"name": "payments-vm-01",
"hostname": "payments-vm-01.internal",
"osFamily": "linux",
"serviceManager": "systemd",
"allowedLogSources": [
"system",
"app",
"security"
],
"agentAccessMode": "read_only",
"restartServices": [
"nginx.service"
]
}
'const options = {
method: 'POST',
headers: {cookie: 'acornops_cp_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'payments-vm-01',
hostname: 'payments-vm-01.internal',
osFamily: 'linux',
serviceManager: 'systemd',
allowedLogSources: ['system', 'app', 'security'],
agentAccessMode: 'read_only',
restartServices: ['nginx.service']
})
};
fetch('https://api.acornops.dev/api/v1/workspaces/{workspaceId}/virtual-machines', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"virtualMachine": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"targetType": "kubernetes",
"name": "<string>",
"agentAccessMode": "read_only",
"restartServices": [
"<string>"
],
"pendingAgentAccessPolicy": {
"accessMode": "read_only",
"restartServices": [
"<string>"
]
},
"permissionMode": "read_only",
"permissionModeOverride": "read_only",
"permissionModeSource": "virtual_machine_override",
"status": "<string>",
"connectionStatus": "<string>",
"latestSnapshot": {
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"clusterId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"targetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"timestamp": "2023-11-07T05:31:56Z"
},
"summary": {},
"permissions": {},
"hostname": "<string>",
"osFamily": "linux",
"serviceManager": "systemd",
"allowedLogSources": [
"<string>"
]
},
"installInstructions": {
"command": "<string>",
"releaseVersion": "<string>",
"bootstrapUrl": "<string>",
"warnings": [
"<string>"
],
"enrollmentExpiresAt": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}Targets and inventory
Register a Linux/systemd virtual machine and issue a one-use AgentV enrollment command
Register a Linux/systemd virtual machine and issue a one-use AgentV enrollment command
curl --request POST \
--url https://api.acornops.dev/api/v1/workspaces/{workspaceId}/virtual-machines \
--header 'Content-Type: application/json' \
--cookie acornops_cp_session= \
--data '
{
"name": "payments-vm-01",
"hostname": "payments-vm-01.internal",
"osFamily": "linux",
"serviceManager": "systemd",
"allowedLogSources": [
"system",
"app",
"security"
],
"agentAccessMode": "read_only",
"restartServices": [
"nginx.service"
]
}
'const options = {
method: 'POST',
headers: {cookie: 'acornops_cp_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'payments-vm-01',
hostname: 'payments-vm-01.internal',
osFamily: 'linux',
serviceManager: 'systemd',
allowedLogSources: ['system', 'app', 'security'],
agentAccessMode: 'read_only',
restartServices: ['nginx.service']
})
};
fetch('https://api.acornops.dev/api/v1/workspaces/{workspaceId}/virtual-machines', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"virtualMachine": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"targetType": "kubernetes",
"name": "<string>",
"agentAccessMode": "read_only",
"restartServices": [
"<string>"
],
"pendingAgentAccessPolicy": {
"accessMode": "read_only",
"restartServices": [
"<string>"
]
},
"permissionMode": "read_only",
"permissionModeOverride": "read_only",
"permissionModeSource": "virtual_machine_override",
"status": "<string>",
"connectionStatus": "<string>",
"latestSnapshot": {
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"clusterId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"targetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"timestamp": "2023-11-07T05:31:56Z"
},
"summary": {},
"permissions": {},
"hostname": "<string>",
"osFamily": "linux",
"serviceManager": "systemd",
"allowedLogSources": [
"<string>"
]
},
"installInstructions": {
"command": "<string>",
"releaseVersion": "<string>",
"bootstrapUrl": "<string>",
"warnings": [
"<string>"
],
"enrollmentExpiresAt": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}Authorizations
Path Parameters
Example:
"4b930d98-add9-4924-ab26-3c16d96ec373"
Body
application/json
Example:
"payments-vm-01"
Example:
"payments-vm-01.internal"
Available options:
linux Example:
"linux"
Available options:
systemd Example:
"systemd"
Example:
["system", "app", "security"]
Available options:
read_only, read_write Maximum array length:
32Pattern:
^[A-Za-z0-9][A-Za-z0-9_.@:-]{0,254}\.service$Example:
["nginx.service"]