Endpoint: /sites/{siteId}/ram/agents/templates/{remoteAgentsTemplateID}

NOTE: Available as of EFT 8.1.0

Returns a remote agent settings template from a specified site, update/patch a remote agent settings template, or allows the deletion of a remote agent settings template on a specific EFT site.

  • GET

  • PATCH

  • DELETE

Method & URL

GET https://[server URL]:[port]/admin/v2/sites/{siteId}/ram/templates/{remoteAgentsTemplateID}

GET Body Sample

Copy
############################
#GET RAM Template by ID
#RAM TEMPLATES
# @name RAMTemplates
GET https://{{host}}/admin/v2/sites/{{Siteid}}/ram/templates 
HTTP/1.1
Authorization: EFTAdminAuthToken {{AuthToken}}
###
@ramTemplateID = {{RAMTemplates.response.body.$.data[0].id}}

###
#GET Template by Template ID
GET https://{{host}}/admin/v2/sites/{{Siteid}}/ram/templates/
{{ramTemplateID}} HTTP/1.1
Authorization: EFTAdminAuthToken {{AuthToken}}
###

GET Response Body Sample

Copy
{ "data": { "id": "04cd2f6f-dea6-4674-bcde-3c7fe5a800a1", "type": "remote-agents-template", 
"attributes": { "name": "RAM Template1", "updateInterval": "EveryFiveMinutes", 
"eventRuleIds": [], "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": false } ], "autoban": [], 
"defaultAction": "Allow" } }, "links": { "self": 
"/admin/v2/sites/4ebb829f-f84c-4355-8d55-d43a2852ca12/ram/templates/04cd2f6f-dea6-4674-bcde-3c7fe5a800a1" 
} } }

GET PowerShell Sample

Copy
###############
##GET Remote Agent Templates
$ramTemplateList = Invoke-RestMethod -Uri "$baseURL/v2/sites/$siteID/ram/templates" 
-Method 'GET' -Headers $authHeader
$ramTemplateID = $ramTemplateList.data[0].id

####
#GET Remote Agent Template by ID
Write-Output "Remote Agent Template by ID: " $ramTemplateID
Write-Output "----"
$ramTemplate = Invoke-RestMethod -Uri "$baseURL/v2/sites/$siteID/ram/templates/$ramTemplateID" 
-Method 'GET' -Headers $authHeader
Write-Output $ramTemplate | ConvertTo-Json -Depth 10 

Method & URL

PATCH https://[server URL]:[port]/admin/v2/sites/{siteId}/ram/templates/{remoteAgentsTemplateID}

PATCH Body Sample

Copy
####
#PATCH Template by Template ID
PATCH https://{{host}}/admin/v2/sites/{{Siteid}}/ram/templates/{{ramTemplateID}} 
HTTP/1.1
Authorization: EFTAdminAuthToken {{AuthToken}}

{
  "data": {
    "attributes": {
        "ipAccess": {
        "masks": [
          {
            "ipMask": "0.0.0.0",
            "reason": "",
            "matchAction": "Deny",
            "timeStamp": 0,
            "autobanEntry": false
          }
        ],
        "defaultAction": "Allow"
      }
    }
  }
}

PATCH Response Body Sample

Copy
{ "data": { "id": "04cd2f6f-dea6-4674-bcde-3c7fe5a800a1", "type": "remote-agents-template", 
"attributes": { "name": "RAM Template1", "updateInterval": "EveryFiveMinutes", 
"eventRuleIds": [], "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": false } ], "autoban": [], 
"defaultAction": "Allow" } }, "links": { "self": 
"/admin/v2/sites/4ebb829f-f84c-4355-8d55-d43a2852ca12/ram/templates/04cd2f6f-dea6-4674-bcde-3c7fe5a800a1"
} } }

PATCH PowerShell Sample

Copy
##########
##GET Remote Agent Template ID

$ramTemplateList = Invoke-RestMethod -Uri "$baseURL/v2/sites/$siteID/ram/templates" 
-Method 'GET' -Headers $authHeader
$ramTemplateID = $ramTemplateList.data[0].id

###
##Patch Remote Agent Template by ID
Write-Output "Remote Agent Template Patch (update)"
Write-Output "-----"
$update = 
'{
  "data": {
    "attributes": {
        "ipAccess": {
        "masks": [
          {
            "ipMask": "1.1.1.1",
            "reason": "",
            "matchAction": "Deny",
            "timeStamp": 0,
            "autobanEntry": false
          }
        ],
        "defaultAction": "Allow"
      }
    }
  }
}'
$update = $update | ConvertFrom-Json
$update = $update | ConvertTo-Json -Depth 10
$patchReturn = Invoke-RestMethod -Uri "$baseURL/v2/sites/$siteID/ram/templates/$ramTemplateID" 
-Method 'PATCH' -Headers $authHeader -Body $update 

Method & URL

DELETE https://[server URL]:[port]/admin/v2/sites/{siteId}/ram/templates/{remoteAgentsTemplateID}

DELETE Body Sample

Copy
####
#DELETE Remote Agent Template
#Template must not have existing associated Remote Agents
DELETE https://{{host}}/admin/v2/sites/{{Siteid}}/ram/templates/{{ramTemplateID}} HTTP/1.1
Authorization: EFTAdminAuthToken {{AuthToken}}
###

DELETE Response Body Sample

Copy
HTTP/1.1 204 No Content Date: Sun, 24 Jul 2022 02:05:46 GMT Content-Length: 0 
Cache-Control: no-cache, no-store, must-revalidate Expires: -1 
X-Content-Type-Options: nosniff X-XSS-Protection: 1; mode=block 
Content-Security-Policy: default-src 'self' 'unsafe-inline' 'unsafe-eval' data:; 
Referrer-Policy: no-referrer

DELETE PowerShell Sample

Copy
####################################
##########
##GET Remote Agent Template ID
$ramTemplateList = Invoke-RestMethod -Uri "$baseURL/v2/sites/$siteID/ram/templates" 
-Method 'GET' -Headers $authHeader
$ramTemplateID = $ramTemplateList.data[1].id

####
#DELETE Remote Agent Template by ID
$ramTemplateList = Invoke-RestMethod -Uri "$baseURL/v2/sites/$siteID/ram/templates/$ramTemplateID" 
-Method 'DELETE' -Headers $authHeader