Deleting the custom attribute definition

Ops Center Analyzer Detail View REST API Reference Guide

Version
11.0.x
Audience
anonymous
Part Number
MK-99ANA004-10

You can delete a specific attribute definition or multiple attribute definitions. If the requested attribute is being used by any other resource definition or if it does not exist, then an error message is received in a response message. You can delete multiple attribute definitions in a single request.

The data of the deleted attribute definition is not deleted from the database. If you need to create the same attribute definition, then you can retrieve the old data. You cannot delete predefined attribute definitions.

Request line

 Post baseURL/dbapi.do?action=deleteAttributeDef&dataset=<Datasetname>
Note: To delete the dynamic attribute definitions, use HTTP-POST and specify the attribute definition IDs in the request body.

Request body

{
  "attrIds":[
    "",
    "",
    ""
  ]
}

Request example using GET

GET /dbapi.do?action=deleteAttributeDef&dataset=defaultDs&attrIds=numCPU,cpuUsage,memory HTTP /1.1 Authorization:Basic ZnJlZDpmcmVk

Request example using POST

Post /dbapi.do?action=deleteAttributeDef&dataset=defaultDs memory HTTP /1.1 Authorization:Basic ZnJlZDpmcmVk
{
  "attrIds":[
    "numCPU",
    "cpuUsage",
    "memory"
  ]
}

Request parameters

The following table describes the values for the supported parameters of a query string:

Parameter Type Description
action String deleteAttributeDef

Specify the API function to be invoked.

dataset String Dataset name. From 2 to 32 alphanumeric, underscore (_), and hyphen (-) characters are allowed.
attrIds String[ ]

Attribute IDs are involved in request URL for GET method and in request body for POST method.

From 2 to 32 alphanumeric, underscore (_), and hyphen (-) characters are allowed.

GET: One or more comma-separated attribute IDs.

Example: A,B,C

POST: JSON format

Example:

{

“attrIds”:[“A”,”B”,”C”]

}

To delete the dynamic attribute definition, you must provide the attribute definition ID that you specified while creating it. The following example deletes the dynamic attribute definition for the specified ID. The request to delete the dynamic attributes that contain the comma-separated attribute definitions IDs must be called with the POST method.

Response body

{
  "deleted":[
    ""
  ],
  "failed":[
    {
      "code":"",
      "id":"",
      "error":""
    },
    {
      "code":"",
      "id":"",
      "error":""
    }
  ]
}

Response example

{
  "deleted":[
    "cpuUsage"
  ],
  "failed":[
    {
      "code":"44050005",
      "id":"memory",
      "error":"Attribute definition with {id}:[memory] does not exist"
    },
    {
      "code":"44050005",
      "id":"numCPU",
      "error":"Attribute definition with {id}:[numCPU] does not exist"
    }
  ]
}

Response parameters

Parameter

Type

Description

deleted String[ ] List of deleted attribute IDs.
failed Object[ ] List of failed entities.
failed:code String Eight-digit hexadecimal error code.
failed:id String Failed attribute ID.
failed: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.
277 PARTIAL OK Request completed successfully with some failures. Check the response body for details.
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.
Note: If all of the specified attribute definitions fail, then the 500 SERVER ERROR message is received in the response message.

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
44050005 Attribute definition with {id}:[cpuUsage] does not exist. Minimum of one attribute definition is deleted and the deletion of one or more attribute definitions failed. The specified attribute definitions do not exist.
4402000F Invalid value specified for parameter {id}. {id} contains invalid characters. Valid characters are alphanumeric and -. Minimum of one attribute definition is obtained and getting one or more attribute IDs failed. The static part of the attribute ID contains the invalid characters.
4402000F Invalid value specified for parameter {id}. {id} length must be between 2 to 32 characters. Minimum of one attribute definition is obtained and getting one or more attribute IDs failed. The length of the static part of the attribute ID exceeds the allowed length.
44050011 Attribute definition deletion failed due to dependency on one or more Resource definition. Minimum of one attribute definition is deleted and the deletion of one or more attribute definitions failed. There is a dependency on one or more resource definitions.
44050014 Cannot delete read-only 'Attribute definition' . Minimum of one attribute definition is deleted and the deletion of one or more attribute definitions failed. The attribute definition corresponding to the specified attribute ID is predefined.
44010002 Invalid JSON Request. Specified JSON input is invalid.
44040007 No Attribute definition is specified. No attribute definition is specified for the deletion.
440000E9 License is not valid. License is not uploaded, or the uploaded license is invalid or expired.
440000E9 Authorization needed. Request is sent with an invalid authentication token.
440000E4 Dataset with {name}:[ds1] does not exist. Request is sent for a dataset that does not exist.
440000E0 HTTP method [PUT] is not supported for action [deleteAttributeDef]. Request is sent with any HTTP method other than GET or POST.
440400E2 Application encountered an internal error. API server encountered an unknown error.