Endpoint: /sites/{siteId}/ram/agents/templates
Note: Available as of EFT 8.1.0
Returns a remote agent template list from a specified site or allows the creation of a template on a specific EFT site.
-
GET
Method & URL
GET https://[server URL]:[port]/admin/v2/sites/{siteId}/ram/templates
GET Body Sample
########################
#RAM TEMPLATES
GET https://{{host}}/admin/v2/sites/{{Siteid}}/ram/templates HTTP/1.1
Authorization: EFTAdminAuthToken {{AuthToken}}
###
GET Response Body Sample
{ "data": [ { "id": "04cd2f6f-dea6-4674-bcde-3c7fe5a800a1", "type": "remote-agents-template",
"attributes": { "name": "RAM Template1", "updateInterval": "EveryFiveMinutes",
"eventRuleIds": [ null, "d352632d-5f3f-49bf-99af-849f7453dd0a" ], "autoEnroll": false,
"autoEnrollDate": 1659757989, "homeFolder": "/Usr/Agents/%AgentNetBIOSName%/", "updateFailure":
"Stop_Disable_Unenroll", "enableIPAccess": false, "ipAccess": { "masks": [ { "ipMask": "0.0.0.0",
"reason": "", "matchAction": "Deny", "timeStamp": 0, "autobanEntry": true } ], "autoban": [],
"defaultAction": "Allow" } }, "links": { "self": "/admin/v2/sites/
4ebb829f-f84c-4355-8d55-d43a2852ca12/ram/templates/04cd2f6f-dea6-4674-bcde-3c7fe5a800a1" } }, {
"id": "b672dec5-567e-4baa-bc3f-5be948802b42", "type": "remote-agents-template", "attributes": {
"name": "RAM Template 2", "updateInterval": "EveryFiveMinutes", "eventRuleIds": [ null,
"d352632d-5f3f-49bf-99af-849f7453dd0a" ], "autoEnroll": false, "autoEnrollDate": 1659761201,
"homeFolder": "/Usr/Agents/%AgentNetBIOSName%/", "updateFailure": "Stop_Disable_Unenroll",
"enableIPAccess": true, "ipAccess": { "masks": [ { "ipMask": "10.15.25.35", "reason": "TEst BAN",
"matchAction": "Allow", "timeStamp": 1658551620, "autobanEntry": false }, { "ipMask": "0.0.0.0",
"reason": "", "matchAction": "Deny", "timeStamp": 0, "autobanEntry": true } ], "autoban": [],
"defaultAction": "Allow" } }, "links": { "self": "/admin/v2/sites/4ebb829f-f84c-4355-8d55-d43a2852ca12/ram/templates/
b672dec5-567e-4baa-bc3f-5be948802b42" } } ], "links": { "self": "/admin/v2/sites/
4ebb829f-f84c-4355-8d55-d43a2852ca12/ram/templates" } }
GET PowerShell Sample
###############
##GET Remote Agent Templates
Write-Output "Remote Agent Templates"
Write-Output "----"
$ramTemplateList = Invoke-RestMethod -Uri "$baseURL/v2/sites/$siteID/ram/templates"
-Method 'GET' -Headers $authHeader
Write-Output $ramTemplateList | ConvertTo-Json -Depth 10
foreach ($ramTemplateList in $ramTemplateList.data)
{
Write-Output ("Remote Agent Template $($ramTemplateList.id): $($ramTemplateList.attributes.name)")
}
POST https://[server URL]:[port]/admin/v2/sites/{siteId}/ram/templates
POST Body Sample
### Add New RAM Template ###
POST https://{{host}}/admin/v2/sites/{{Siteid}}/ram/templates HTTP/1.1
Authorization: EFTAdminAuthToken {{AuthToken}}
{
"data": {
"attributes": {
"name": "NewRAMTemplateName",
"updateInterval": "EveryFiveMinutes",
"eventRuleIds": [
"d352632d-5f3f-49bf-99af-849f7453dd0a"
],
"autoEnroll": true,
"autoEnrollDate": 0,
"homeFolder": "/Usr/Agents/%AgentNetBIOSName%/",
"updateFailure": "Stop_Disable_Unenroll",
"enableIPAccess": true,
"ipAccess": {
"masks": [
{
"ipMask": "0.0.0.0",
"reason": "",
"matchAction": "Deny",
"timeStamp": 0,
"autobanEntry": true
}
],
"defaultAction": "Allow"
}
}
}
}
POST Response Body Sample
{ "data": { "id": "b3ed1f50-ce61-479f-ba48-094cee3c13fd", "type": "remote-agents-template", "attributes": {
"name": "NewRAMTemplateName", "updateInterval": "EveryFiveMinutes", "eventRuleIds": [ null,
"d352632d-5f3f-49bf-99af-849f7453dd0a" ], "autoEnroll": true, "autoEnrollDate": 0, "homeFolder":
"/Usr/Agents/%AgentNetBIOSName%/", "updateFailure": "Stop_Disable_Unenroll", "enableIPAccess": true,
"ipAccess": { "masks": [ { "ipMask": "0.0.0.0", "reason": "", "matchAction": "Deny", "timeStamp": 0,
"autobanEntry": false } ], "autoban": [], "defaultAction": "Allow" } }, "links": { "self":
"/admin/v2/sites/4ebb829f-f84c-4355-8d55-d43a2852ca12/ram/templates/b3ed1f50-ce61-479f-ba48-094cee3c13fd" } } }
POST PowerShell Sample
#######
###
#POST New RAM Template
Write-Output "POST RAM Template"
Write-Output "-----"
$update =
'{
"data": {
"attributes": {
"name": "NewRAMTemplateName",
"updateInterval": "EveryFiveMinutes",
"eventRuleIds": [
"d352632d-5f3f-49bf-99af-849f7453dd0a"
],
"autoEnroll": true,
"autoEnrollDate": 0,
"homeFolder": "/Usr/Agents/%AgentNetBIOSName%/",
"updateFailure": "Stop_Disable_Unenroll",
"enableIPAccess": true,
"ipAccess": {
"masks": [
{
"ipMask": "0.0.0.0",
"reason": "",
"matchAction": "Deny",
"timeStamp": 0,
"autobanEntry": true
}
],
"defaultAction": "Allow"
}
}
}
}'
$update = $update | ConvertFrom-Json
$update = $update | ConvertTo-Json -Depth 10
$patchReturn = Invoke-RestMethod -Uri "$baseURL/v2/sites/$siteID/ram/templates"
-Method 'POST' -Headers $authHeader -Body $update