Uploading chapter 14 files

This commit is contained in:
muassif
2021-08-11 17:27:39 +04:00
committed by GitHub
parent b5a44b66fd
commit 80c742c923
21 changed files with 428 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
import requests
import json
token = 'VEtOLWFkbWluYTIyNTIzODktNmZhYy00ZGU2LTg5ZjUtYTEyMDc4ZmQwMTdl'
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer {}'.format(token)
}
url1 = "https://10.52.90.90:8443/nfm-p/rest/api/v1/managedobjects/searchWithFilter"
payload1 = json.dumps({
"fullClassName": "equipment.PhysicalPort",
"filterExpression": "siteId = '10.172.172.172' AND portName='1/1/1'",
"resultFilter":[
"objectFullName",
"description"
]
})
response = requests.request("POST", url1, headers=headers, data=payload1, verify=False)
print(response.json()[0]['objectFullName'])
print(response.json()[0]['description'])