restansiblenetwork-programmingciscoapic

Why I can't change the administrative state of a port on cisco apic via rest API


When I try to change the administrative state of a port on the Cisco APIC via rest API (aci_rest) then I'm getting the following error :

"msg": "APIC Error 170: Invalid access, MO: l1PhysIf",
"status": -1

Does anyone have any idea about that?
Thanks in advance.

- name: Change admin state of the port 
  aci_rest:
    hostname: "{{ inventory_hostname }}"
    username: "{{ aci_user }}"
    password: "{{ aci_password }}"
    validate_certs: no
    path: "/api/node/mo/topology/pod-{{ pod_id }}/node-{{ node_id }}/sys/phys-[eth{{ interface }}].json"  
    method: post
    content:
      {
        "l1PhysIf": {
          "attributes": {
            "adminSt":"down",
          }
        }
     }

Solution

  • I've solved the problem. Cisco has restricted "l1PhysIf" object and there is documentation which looks like: Class l1: PhysIf (CONCRETE) Class ID:3627 Class Label: Layer 1 Physical Interface Configuration Encrypted: false - Exportable: false - Persistent: true - Configurable: false - Subject to Quota: Disabled - Abstraction Layer: Concrete Model - APIC NX Processing: Disabled Write Access: [NON CONFIGURABLE]

    I've used "fabricRsOosPath" instead and it has worked.