Forum Discussion
gregorycox-cv
10 months agoLevel 1
updating bandwidth for connection
I'm attempting to change the bandwidth using python requests
based on this https://developer.equinix.com/catalog/fabricv4#operation/updateConnectionByUuid authorization is solid, used same headers...
vaibhav
8 months agoEquinix Employee
Issue: Payload was added as Form data in request
Solution: We need to submit JSON payload to the API call. Below is a working example.
import requests
cid = e7ea19ba-5d53-476d-a041-43a3004c6683
bw= 50
url = f"https://api.equinix.com/fabric/v4/connections/{cid}"
headers = {}
headers["content-type"] = 'application/json-patch+json'
data=[
{
"op": "replace",
"path": "/bandwidth",
"value": bw
}
]
response = requests.patch(
url,
headers=headers,
timeout=5,
json=data
)
Related Content
- 3 years ago
- 3 years ago
- 2 years ago