cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1917
Views
0
Helpful
5
Replies

send rest API requests from ACI APIC to another third-party device

Networker0
Level 1
Level 1
Hello,
Is it possible to send rest API requests from ACI to another third-party device?
Thanks
 
2 Accepted Solutions

Accepted Solutions

Hi @Networker0 

You'll need to download the modules on your PC, then copy them on APIC (you can use /data/techsupport as destination folder)

After that, you can manually install the modules in your python env. Here is an example for requests module:

1. Copy the module from a public repository on your personal PC:
$ git clone git://github.com/psf/requests.git
2. Copy the files on APIC (in /data/techsupport)
3. Create a new venv for your project
admin@apic1:techsupport> python3 -m venv venv
admin@apic1:techsupport> source venv/bin/activate
4. Go to the module directory you copied (requests in this example):
(venv) admin@apic1:techsupport>  cd requests
(venv) admin@apic1:techsupport>  python -m pip install .

Stay safe,

Sergiu

View solution in original post

It looks like you'll either have to install an older version of requests, or install a newer version of pip.

 

Stay safe,

Sergiu

View solution in original post

5 Replies 5

Sergiu.Daniluk
VIP Alumni
VIP Alumni

Hi @Networker0 

Yes you can do it. You can use python/curl to send requests, directly from CLI, or you can build your own ACI app:

https://blogs.cisco.com/datacenter/training-how-to-develop-cisco-aci-applications

 

Stay safe,

Sergiu

Thank you for your response,

how can i install pip and modules in APIC if ACI have no internet access?

Br

Hi @Networker0 

You'll need to download the modules on your PC, then copy them on APIC (you can use /data/techsupport as destination folder)

After that, you can manually install the modules in your python env. Here is an example for requests module:

1. Copy the module from a public repository on your personal PC:
$ git clone git://github.com/psf/requests.git
2. Copy the files on APIC (in /data/techsupport)
3. Create a new venv for your project
admin@apic1:techsupport> python3 -m venv venv
admin@apic1:techsupport> source venv/bin/activate
4. Go to the module directory you copied (requests in this example):
(venv) admin@apic1:techsupport>  cd requests
(venv) admin@apic1:techsupport>  python -m pip install .

Stay safe,

Sergiu

Thank you for your support Sergiu,

 

I followed the steps but, i get the following error. should i download another version of requests?

Capture.PNG

Thnx.

It looks like you'll either have to install an older version of requests, or install a newer version of pip.

 

Stay safe,

Sergiu

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

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