Skip to main content
REST API reference

Add an attribute to a LUN

POST /storage/luns/{lun.uuid}/attributes

Introduced In: 9.10

Adds an attribute to a LUN.

Required properties

  • name - The name of the attribute to add.

  • value - The value of the attribute to add.

Parameters

Name Type In Required Description

lun.uuid

string

path

True

The unique identifier of the LUN.

return_timeout

integer

query

False

The number of seconds to allow the call to execute before returning. When doing a POST, PATCH, or DELETE operation on a single record, the default is 0 seconds. This means that if an asynchronous operation is started, the server immediately returns HTTP code 202 (Accepted) along with a link to the job. If a non-zero value is specified for POST, PATCH, or DELETE operations, ONTAP waits that length of time to see if the job completes so it can return something other than 202.

  • Default value: 1

  • Max value: 120

  • Min value: 0

return_records

boolean

query

False

The default is false. If set to true, the records are returned.

  • Default value:

Request Body

Name Type Description

lun

lun

The LUN for which the attribute is set.

name

string

The attribute name. Required in POST.

value

string

The attribute value. Required in POST; valid in PATCH.

Example request
{
  "lun": {
    "uuid": "4ea7a442-86d1-11e0-ae1c-123478563412"
  },
  "name": "name1",
  "value": "value1"
}

Response

Status: 202, Accepted
Name Type Description

job

job_link

Example response
{
  "job": {
    "uuid": "string"
  }
}

Headers

Name Description Type

Location

Useful for tracking the resource location

string

Response

Status: 201, Created

Error

Status: Default

ONTAP Error Response Codes

Error Code Description

5374875

The specified LUN was not found.

5374928

An incomplete attribute name/value pair was supplied.

5374929

The combined sizes of an attribute name and value are too large.

5374930

The attribute already exists for the LUN.

5375060

The copy start operation failed.

Also see the table of common errors in the Response body overview section of this documentation.

Definitions

See Definitions

href

Name Type Description

href

string

lun

The LUN for which the attribute is set.

Name Type Description

uuid

string

The unique identifier of the LUN.

lun_attribute

A name/value pair optionally stored with the LUN. Attributes are available to callers to persist small amounts of application-specific metadata. They are in no way interpreted by ONTAP.

Attribute names and values must be at least one byte and no more than 4091 bytes in length. The sum of the name and value lengths must be no more than 4092 bytes.

Name Type Description

lun

lun

The LUN for which the attribute is set.

name

string

The attribute name. Required in POST.

value

string

The attribute value. Required in POST; valid in PATCH.

Name Type Description

uuid

string

The UUID of the asynchronous job that is triggered by a POST, PATCH, or DELETE operation.

error_arguments

Name Type Description

code

string

Argument code

message

string

Message argument

returned_error

Name Type Description

arguments

array[error_arguments]

Message arguments

code

string

Error code

message

string

Error message

target

string

The target parameter that caused the error.