QuestionQ16
Network Automation FoundationDrag the appropriate code snippets into the Python code to create a new WebApp application profile by using the ACI REST API. Not every option is used.
Drag & Drop
payload = {
"fvTenant": {"name": "MyCompany"},
"fvApp": "WebApp" }}
requests.request("POST", url, data=payload,
headers=headers, cookies=cookie,
verify=False)
payload = '<fvAp name="WebApp" />'
payload = '<fvAp name="MyCompany/WebApp" >'
requests.request("POST", url, data=payload,
headers={'Content-Type': 'application/json'},
verify=False)
requests.request("PATCH", url, data=payload,
headers=headers, cookies=cookie,
verify=False)
import requests response = requests.post( 'https://apic/api/aaaLogin.json', json={"aaaUser": {"attributes": {"name": "admin","pwd": "ciscop@dt"}}}, verify=False) token = response.json()['imdata'][0]['aaaLogin']['attributes']['token'] url = 'https://apic/api/mo/uni/tn-MyCompany.xml' headers = {'Content-Type': 'text/xml'} cookie = {'APIC-cookie': token} response = print(response.text)
Community Discussion