Create asset
POST /container/<containerId>/asset
Description
Create a new asset.
Duplicated asset names are allowed although not recommended.
Path parameters
| Param | Description |
|---|---|
containerId |
Container Id. |
Query parameters
none
Body
| Param | Type | Required | Description |
|---|---|---|---|
name |
string | Yes | Name of the asset. |
Return codes
| Error code | Reason |
|---|---|
201 |
Success. |
400 |
Invalid body. |
401 |
Invalid or missing token. |
403 |
Insufficient permissions (required: API+ASSET_MANAGEMENT). |
404 |
Container not found. |
Example
Curl request:
curl \
-X POST 'https://api.infrasonar.com/container/123/asset' \
-H 'Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
-H 'Content-Type: application/json' \
--data-raw '{
"name": "my-host.local"
}'
Response:
{
"assetId": 456
}