Update virtual machine metadata and run permission policy
curl --request PATCH \
--url https://api.acornops.dev/api/v1/workspaces/{workspaceId}/virtual-machines/{vmId} \
--header 'Content-Type: application/json' \
--cookie acornops_cp_session= \
--data '
{
"name": "payments-vm-01",
"hostname": "payments-vm-01.internal",
"allowedLogSources": [
"system",
"app"
]
}
'const options = {
method: 'PATCH',
headers: {cookie: 'acornops_cp_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'payments-vm-01',
hostname: 'payments-vm-01.internal',
allowedLogSources: ['system', 'app']
})
};
fetch('https://api.acornops.dev/api/v1/workspaces/{workspaceId}/virtual-machines/{vmId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"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>"
]
}{
"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
Update virtual machine metadata and run permission policy
Update virtual machine metadata and run permission policy
curl --request PATCH \
--url https://api.acornops.dev/api/v1/workspaces/{workspaceId}/virtual-machines/{vmId} \
--header 'Content-Type: application/json' \
--cookie acornops_cp_session= \
--data '
{
"name": "payments-vm-01",
"hostname": "payments-vm-01.internal",
"allowedLogSources": [
"system",
"app"
]
}
'const options = {
method: 'PATCH',
headers: {cookie: 'acornops_cp_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'payments-vm-01',
hostname: 'payments-vm-01.internal',
allowedLogSources: ['system', 'app']
})
};
fetch('https://api.acornops.dev/api/v1/workspaces/{workspaceId}/virtual-machines/{vmId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"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>"
]
}{
"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"
Example:
"9254df42-4d9b-4e63-8bb6-93442e7d9a45"
Body
application/json
Example:
"payments-vm-01"
Example:
"payments-vm-01.internal"
Example:
["system", "app"]
VM-specific assistant run policy. Null restores the deployment default.
Available options:
read_only, ask_before_changes, auto_allowed_changes, null Response
VM metadata and effective permission policy updated.
Available options:
kubernetes, virtual_machine Available options:
read_only, read_write Show child attributes
Show child attributes
Available options:
read_only, ask_before_changes, auto_allowed_changes Available options:
read_only, ask_before_changes, auto_allowed_changes, null Available options:
virtual_machine_override, deployment_default Show child attributes
Show child attributes
Show child attributes
Show child attributes
Available options:
linux Available options:
systemd