cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 
cancel
363
Views
0
Helpful
2
Replies

Sending multiple REST API requests vs Sending a json data

pranayk2
Cisco Employee
Cisco Employee

Hi,

I have to choose between two options of sending multiple API Requests to push acl to device or sending a pretty huge json data to API 

Which option should be preferred and is more scalable?

Option 1 will be sending multiple API request as

https://localhost:8888/api/config/devices/device/ioslab11

https://localhost:8888/api/config/devices/device/ioslab21

and data be

device ioslab11 {

                      config {

                          ios:ip {

                              access-list {

                                  extended {

                                      ext-named-acl demosite {

                                       

                                       ext-access-list-rule "permit ip any any";

                                      }

                                  }

                              }

                          }

Option 2 is sending a single request but sending more json data

devices {

                  device ioslab11 {

                      config {

                          ios:ip {

                              access-list {

                                  extended {

                                      ext-named-acl demosite {

             +                            # after ext-access-list-rule "deny ip any any"

             +                            ext-access-list-rule "permit ip any any";

                                      }

                                  }

                              }

                          }

                      }

                  }

                  device ioslab21 {

                      config {

                          ios:ip {

                              access-list {

                                  extended {

                                      ext-named-acl demosite {

            

                                      ext-access-list-rule "permit ip any any";

                                      }

                                  }

                              }

                          }

                      }

                  }

              }



Thanks!

2 Replies 2

frjansso
Cisco Employee
Cisco Employee

Hard to say.

Multiple REST calls will result in multiple transactions between NSO and the device.

How many ACLs are we talking about in one go?

Jan Lindblad
Cisco Employee
Cisco Employee

Fewer transactions will be faster. If you can do what you want in a single transaction, you also don't have to worry about what to do if one part is accepted and the next isn't.