# ModifyPortAttribute

## 1. API Description

This API is used to modify attributes of a port.

#### Prerequisites

Before modifying attributes of a port, you can call [`DescribePorts`](https://docs.console.zenlayer.com/api-reference/networking/sdn/describeports#DescribePorts) to query port list.

{% hint style="info" %} <mark style="color:blue;">**Note**</mark>

<mark style="color:blue;">You can only modify</mark> <mark style="color:blue;">`businessEntityName`</mark> <mark style="color:blue;">when LOA file has not been uploaded.</mark>
{% endhint %}

## 2. Input Parameters

The following request parameter list only provides API request parameters.

<table><thead><tr><th width="216.44444444444446">Parameter Name</th><th width="101">Required</th><th width="111">Type</th><th>Description</th></tr></thead><tbody><tr><td>portId</td><td>Yes</td><td>String</td><td>Port ID.</td></tr><tr><td>portName</td><td>No</td><td>String</td><td><p>Port name.</p><p>Up to 255 characters in length are allowed. You're recommended to use data center code combined with port speed.</p></td></tr><tr><td>portRemarks</td><td>No</td><td>String</td><td><p>Note of port.</p><p>Up to 255 characters in length are allowed.</p></td></tr><tr><td>businessEntityName</td><td>No</td><td>String</td><td><p>Your business entity name.</p><p>The entity name to be used on the Letter of Authorization (LOA). This should be the name that is registered with the colocation facility.</p></td></tr></tbody></table>

## 3. Output Parameters

<table><thead><tr><th width="213.33333333333331">Parameter Name</th><th width="95">Type</th><th>Description</th></tr></thead><tbody><tr><td>requestId</td><td>String</td><td>The unique request ID, which is returned for each request. RequestId is required for locating a problem.</td></tr></tbody></table>

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**Modify attributes of a port.**

```json
POST /api/v2/sdn HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: ModifyPortAttribute
<Common Request Params>

Request:
{
  "portId": "your-port-id"
}

Response:
{
  "requestId": "T3811A0E7-C250-40A2-96AD-08AD759E1BC2",
  "response": {
    "requestId": "T3811A0E7-C250-40A2-96AD-08AD759E1BC2"
  }
}
```

{% endtab %}
{% endtabs %}

## 5. Developer Resources

Zenlayer Cloud API 2.0 integrates [SDKs](https://docs.console.zenlayer.com/api-reference/api-introduction/toolkit/api-sdk) to make it easier for you to call APIs. More programming languages will be supported.

## 6. Error Codes

The following only lists the error codes related to the API business logic. For other error codes, see [Common Error Codes](https://docs.console.zenlayer.com/api-reference/api-introduction/instruction/commonerrorcode).​

<table><thead><tr><th width="207.33333333333331">HTTP Status Code</th><th width="299">Error Code</th><th>Description</th></tr></thead><tbody><tr><td>7105</td><td>SELF_SERVICE_PORT_NOT_FOUND</td><td>Port not found.</td></tr><tr><td>7109</td><td>SELF_SERVICE_PORT_NOT_SUPPORT_BUSINESS_LOA_DONE</td><td>Operations are not supported because LOA has been uploaded already.</td></tr></tbody></table>
