You can delete specific resource data by specifying it in the input criteria.
Request line
POST baseURL/dbapi.do?action=deleteResourceData&dataset=<Datasetname>
Request body
{ "dataSubsetId":"", "resType":"", "attrId":"", "attrValue":"" }
Request example
POST /dbapi.do?action=deleteResourceData&dataset=defaultDs HTTP /1.1 Authorization:Basic ZnJlZDpmcmVk
{ "resType":"host", "attrId":"name", "attrValue":"Host1" }
Request parameters
Parameter | Type | Description |
---|---|---|
action | String | deleteResourceData
Specify the API function to be invoked. |
dataset | String | Dataset name. From 2 to 32 alphanumeric, underscore (_), and hyphen (-) characters are allowed. |
resSignatures | String[ ] | Optional) One or more comma-separated resource signatures. |
dataSubsetId | String | (Optional) The resources data subset ID. |
resType | String | (Optional) The resource data type.
From 1 to 32 alphanumeric, underscore (_), and hyphen (-) characters are allowed. |
attrId | String | (Optional) Attribute ID of type scalar.
From 2 to 3 alphanumeric, underscore (_), and hyphen (-) characters are allowed. |
attrValue | String | (Optional) Value for the specified attribute ID. From 1 to 4,000 alphanumeric characters are allowed. |
- resSignatures
- dataSubsetId
- resType
- attrId and attrValue
If the resSignatures parameter is specified, then the following parameters are not considered: dataSubsetId, resType, attrId, and attrValue.
Response body
{ "deleted": } { "code":"", "error":"" }
Response example
{ "deleted":2 }
Response parameters
Parameter |
Type |
Description |
---|---|---|
deleted | Integer | If the resource data is deleted, shows the list of deleted resources. |
code | String | Eight-digit hexadecimal error code. |
error | String | Error message. |
Status codes
Status code |
Message |
Description |
---|---|---|
200 | OK | Request was successful, and the response body contains the requested log details. |
206 | PARTIAL CONTENT | Request is in progress, and the incremental content is available in the response body. |
400 | BAD REQUEST | Request URL or request body validation failed. Check the response body for details. |
401 | UNAUTHORIZED | Supplied authentication token is invalid or does not have the appropriate credentials to access the resource. |
404 | NOT FOUND | API server could not find a resource matching the request. |
405 | METHOD NOT ALLOWED | Request HTTP method is not allowed for the operation. |
500 | SERVER ERROR | API operation request failed. Check the response body for details. |
Response codes
The following table lists the common API response codes that might be generated through the standard API. If an error response is not listed, examine the HTTP status codes to determine the best method for addressing the issue.
Response code | Message | Condition |
---|---|---|
54010002 | Invalid JSON Request. | Specified JSON input is invalid. |
54020009 | At least one of {resType}, {attrId}, {attrValue}, {dataSubsetId}, or {resSignatures} parameters must be specified | Required parameters are specified, or the specified parameters are not sufficient. |
5401000F | Invalid value specified for parameter {resSignatures}. It must be of type JSON list of string. | Specified resSignatures is not JSON list of string. |
5402000F | Invalid value specified for parameter {resSignatures}. | Specified resSignatures is an empty list. |
5402000F | Invalid value specified for parameter {attrValue}. If {attrId} is specified, then {attrValue} must be specified. | Parameter attrId is specified but attrValue is not specified. |
5402000F | Invalid value specified for parameter {attrId}. If {attrValue} is specified, then {attrId} must be specified. | Parameter attrValue is specified but attrId is not specified. |
5402000F | Invalid value specified for parameter {resType} | Specified value for parameter resType is not of type string. |
5402000F | Invalid value specified for parameter {resType}. Resource {type}:[] length must be between 1-32 characters. | Specified value for resType contains an invalid length. |
5402000F | Invalid value specified for parameter {resType}. Resource {type}:[#] contains invalid characters. Valid characters are [alphanumeric, - and _]. | Specified value for resType contains an invalid character. |
5402000F | Invalid value specified for parameter {attrId} | Specified value for parameter attrId is not of type string. |
5402000F | Invalid value specified for parameter {attrId}. {attrId} length must be between 2-32 characters. | Specified value for attrId contains an invalid length. |
5402000F | Invalid value specified for parameter {attrId}. {attrId} contains invalid characters. Valid characters are [alphanumeric, - and _]. | Specified value for attrId contains an invalid character. |
5402000F | Invalid value specified for parameter {attrValue} | Specified value for parameter attrValue is not of type string. |
5402000F | Invalid value specified for parameter {attrValue}. {attrValue} length must be between 1-4000 characters. | Specified value for attrValue has an invalid length. |
5402000F | Invalid value specified for parameter {dataSubsetId}. | Specified value for parameter dataSubsetId is not of type string. |
5402000F | Invalid value specified for parameter {dataSubsetId}. {dataSubsetId} length must be between 1-512 characters. | Specified value for dataSubsetId contains an invalid length. |
54000005 | Resource definition with {resType}:[vm] does not exist. | Resource definition does not exist with the specified resType parameter. |
54000005 | Attribute definition with {attrId}:[name] does not exist. | Attribute definition does not exist with the specified attrId parameter. |
5400000F | Invalid value specified for parameter {attrId}. Specified Attribute definition is not of type scalar. | Specified attrId is not of type scalar. |
54050005 | DataSubset with {dataSubsetId}:[ds1] does not exist. | DataSubset does not exist with the specified dataSubsetId parameter. |
540000E9 | License is not valid. | License is not uploaded, or the uploaded license is invalid or expired. |
540000E9 | Authorization needed . | Request is sent with an invalid authentication token. |
540000E4 | Dataset with {name}:[ds1] does not exist. | Request is sent for a dataset that does not exist. |
54000005 | Resource definition with {resType}:[h] does not exist. | Specified resType does not exist. |
54000005 | Attribute definition with {attrId}:[abc] does not exist. | Specified attrId does not exist. |
54050005 | DataSubset with {dataSubsetId}:[ds] does not exist. | Specified dataSubsetId does not exist. |
540000E0 | HTTP method [GET] is not supported for action [deleteResourceData]. | Request is sent with any HTTP method other than POST. |
540000E2 | Application encountered an internal error . | API server encountered an unknown error. |