Skip to main content

POST /api/sam/admin/target

Add an instance to SAM

Description

This method adds the provided InterSystems IRIS® data platform instance to the targets.json file and %SAM.Target table.

To use this endpoint, you must log in as a user with access to the %SAM.Admin resource.

Request Example (SAM 1.0 and 1.1)

POST http://localhost:8080/api/sam/admin/target

Example JSON request packet: 

{
    "name": "IRIS3",
    "description": "Local IRIS3",
    "cluster": 1,
    "instance": "iris:80"
}

Request Example (SAM 2.0 and later)

POST http://localhost:8080/api/sam/admin/target

Starting with SAM version 2.0, a JSON request packet for SAM 2.0 must also include dashboardId and urlPrefix properties. If the instance has no URL prefix, specify the value of urlPrefix as an empty string (""). For example: 

{
    "name": "IRIS3",
    "description": "Local IRIS3",
    "cluster": 1,
    "instance": "iris:80",
    "urlPrefix": "/local3",
    "dashboardId": "UBE6j_IVk"
}

Response Example

{
    "id": 4
}
FeedbackOpens in a new tab