cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4061
Views
5
Helpful
3
Replies

ACI REST API for creating a Spine Switch Profile with Spine Selectors

Edvard Franke
Level 1
Level 1

-- updated --

was trying some name and simple nameing link SwitchProfileSelector101 seeams to work,

but still searching for this strange name or id when you creating it over the gui.

-- /updated --

 

Hi everyone,
during i try to script my aci deployment, i trapped into the situation, that the spine switch Profiles with the Spine Selectors cant be created with a script, because there are needed values for nodeblock are some strange id, like "5ea4c3c7e79e0138".

Some one may are also facing the same issue and solve it or know a workaround.

 

this is my request and the nameblock is my issue...

https://apic.aci.com/api/node/mo/uni/infra/spprof-{{ spinenodeId }}".json

{
  "infraSpineP": {
    "attributes": {
      "dn": "uni/infra/spprof-{{ spinenodeId }}",
      "name": "{{ spinenodeId }}",
      "rn": "spprof-{{ spinenodeId }}",
      "status": "created,modified"
    },
    "children": [
      {
        "infraSpineS": {
          "attributes": {
            "dn": "uni/infra/spprof-{{ spinenodeId }}/spines-{{ spinenodeId }}-typ-range",
            "type": "range",
            "name": "{{ spinenodeId }}",
            "rn": "spines-{{ spinenodeId }}-typ-range",
            "status": "created"
          },
          "children": [
            {
              "infraNodeBlk": {
                "attributes": {
                  "dn": "uni/infra/spprof-{{ spinenodeId }}/spines-{{ spinenodeId }}-typ-range/nodeblk-5ea4c3c7e79e0138",
                  "from_": "{{ spinenodeId }}",
                  "to_": "{{ spinenodeId }}",
                  "name": "5ea4c3c7e79e0138",
                  "rn": "nodeblk-5ea4c3c7e79e0138",
                  "status": "created"
                },
                "children": []
              }
            },
            {
              "infraRsSpineAccNodePGrp": {
                "attributes": {
                  "tDn": "uni/infra/funcprof/spaccnodepgrp-spine_spg",
                  "status": "created"
                },
                "children": []
              }
            }
          ]
        }
      }
    ]
  }
}

Cheers
Ed

 

1 Accepted Solution

Accepted Solutions

RedNectar
VIP
VIP

Hi @ed,

Can I assume from your 2nd contibuton that you've figured it out?  You can use any name you want - it doesn't have to be the same as the GUI uses.

This is the JSON from a Spine in one of our labs - built from a script of course.  As you can see we use pretty ordinaty names.  You don't need any more than what's here (and even that could be trimmed)

 

{
    "totalCount": "1",
    "imdata": [{
        "infraSpineP": {
            "attributes": {
                "annotation": "",
                "descr": "ISN Underlay config - setup by setup_MSO Lab Prereq",
                "dn": "uni/infra/spprof-infra:S2101_SpineProf",
                "name": "infra:S2101_SpineProf",
                "nameAlias": "",
                "ownerKey": "",
                "ownerTag": "",
                "userdom": ":all:"
            },
            "children": [{
                "infraSpineS": {
                    "attributes": {
                        "annotation": "",
                        "descr": "ISN Underlay config - setup by setup_MSO Lab Prereq",
                        "name": "2101",
                        "nameAlias": "",
                        "ownerKey": "",
                        "ownerTag": "",
                        "type": "range",
                        "userdom": ":all:"
                    },
                    "children": [{
                        "infraNodeBlk": {
                            "attributes": {
                                "annotation": "",
                                "descr": "ISN Underlay config - setup by setup_MSO Lab Prereq",
                                "from_": "2101",
                                "name": "SpineISN",
                                "nameAlias": "",
                                "to_": "2101",
                                "userdom": ":all:"
                            }
                        }
                    }]
                }
            }, {
                "infraRsSpAccPortP": {
                    "attributes": {
                        "annotation": "",
                        "tDn": "uni/infra/spaccportprof-infra:S2101_IntProf",
                        "userdom": ":all:"
                    }
                }
            }]
        }
    }]
}
RedNectar aka Chris Welsh.
Forum Tips: 1. Paste images inline - don't attach. 2. Always mark helpful and correct answers, it helps others find what they need.

View solution in original post

3 Replies 3

Edvard Franke
Level 1
Level 1

was trying some name and simple nameing link SwitchProfileSelector101 seeams to work,

but still searching for this strange name or id when you creating it over the gui.

RedNectar
VIP
VIP

Hi @ed,

Can I assume from your 2nd contibuton that you've figured it out?  You can use any name you want - it doesn't have to be the same as the GUI uses.

This is the JSON from a Spine in one of our labs - built from a script of course.  As you can see we use pretty ordinaty names.  You don't need any more than what's here (and even that could be trimmed)

 

{
    "totalCount": "1",
    "imdata": [{
        "infraSpineP": {
            "attributes": {
                "annotation": "",
                "descr": "ISN Underlay config - setup by setup_MSO Lab Prereq",
                "dn": "uni/infra/spprof-infra:S2101_SpineProf",
                "name": "infra:S2101_SpineProf",
                "nameAlias": "",
                "ownerKey": "",
                "ownerTag": "",
                "userdom": ":all:"
            },
            "children": [{
                "infraSpineS": {
                    "attributes": {
                        "annotation": "",
                        "descr": "ISN Underlay config - setup by setup_MSO Lab Prereq",
                        "name": "2101",
                        "nameAlias": "",
                        "ownerKey": "",
                        "ownerTag": "",
                        "type": "range",
                        "userdom": ":all:"
                    },
                    "children": [{
                        "infraNodeBlk": {
                            "attributes": {
                                "annotation": "",
                                "descr": "ISN Underlay config - setup by setup_MSO Lab Prereq",
                                "from_": "2101",
                                "name": "SpineISN",
                                "nameAlias": "",
                                "to_": "2101",
                                "userdom": ":all:"
                            }
                        }
                    }]
                }
            }, {
                "infraRsSpAccPortP": {
                    "attributes": {
                        "annotation": "",
                        "tDn": "uni/infra/spaccportprof-infra:S2101_IntProf",
                        "userdom": ":all:"
                    }
                }
            }]
        }
    }]
}
RedNectar aka Chris Welsh.
Forum Tips: 1. Paste images inline - don't attach. 2. Always mark helpful and correct answers, it helps others find what they need.

Edvard Franke
Level 1
Level 1

Hi Chris,

thank you for your Feedback and yes i figured it out. The naming is just confusing for a beginner.

Cheers
Ed

Save 25% on Day-2 Operations Add-On License