cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
8370
Views
0
Helpful
26
Comments
kesimmon
Cisco Employee
Cisco Employee

Task Name

APIC API Command

Description

Send XML/JSON to Application Policy Infrastructure Controller

Prerequisites

Validated on UCSD 5.3.1.1

Category

Workflow Task

Components

Application Centric Infrastructure

User Inputs

  1. APIC IP
  2. APIC User
  3. APIC User Password
  4. Method (POST/GET)
  5. XML/JSON

Output

Result of operation

Date 05-SEP-2017: New Custom task uploaded which works both on HTTP and HTTPS. Tested and validated on UCSD 6.0.1.2 - by Phani Penmethsa

Summary

Provides custom task to send/retrieve information from an Application Centric Infrastructure Controller using XML or JSON.

Installation

  1. Download the attached .ZIP file below to your computer. *Remember the location of the saved file on your computer.
  2. Unzip the file on your computer. Should end up with a .WFDX file.
  3. Log in to UCS Director as a user that has "system-admin" privileges.
  4. Navigate to "Policies-->Orchestration" and click on "Import".
  5. Click "Browse" and navigate to the location on your computer where the .WFD file resides. Choose the .WFD file and click "Open".
  6. Click "Upload" and then "OK" once the file upload is completed. Then click "Next".
  7. Click the "Select" button next to "Import Workflows". Click the "Check All" button to check all checkboxes and then the "Select" button.
  8. Click "Submit".
  9. A new folder should appear in "Policies-->Orchestration" that contains the imported workflow. You will now need to update the included tasks with information about the specific environment.

Usage

See attached document “UCS Director – APIC API Command”

The workflow also includes a sample Unit Test script that can be used to validate the custom task against different releases of UCS Director.

Also contains tips on finding APIC API calls.

Example

Use Post/Get operations to send/query the Application Policy Infrastructure Controller.

APIC API Example.png

Comments
Orf Gelbrich
Cisco Employee
Cisco Employee

you may have to use a pre task (string combine) and built the line and then feed it to this place. 

 

Orf Gelbrich
Cisco Employee
Cisco Employee

have you tried escaping the [ . like \] 

 

just a suggestion

harishap.24
Level 1
Level 1

Tired in both ways but still facing same issue.

Orf Gelbrich
Cisco Employee
Cisco Employee

how / where can I test this 

 

I guess you are saying then an set of square brackets is in the API call it will fail? yes?

Orf Gelbrich
Cisco Employee
Cisco Employee

take a look at this... 

 

https://stackoverflow.com/questions/48949788/rest-url-request-and-square-brackets-and

 

 

you may need to do this . "["

harishap.24
Level 1
Level 1

The above two did

 

I tried these 2 method but no sucess, attached screenshots for the same. 

   1. "[" -  using quotes for the square brackets

   2. using forward and backward slash.

 

To try this: Not sure if you would have an environment to try this, but below is the URI to fetch the properties of a single physical port of a node.

/api/node/mo/topology/pod-1/node-1005/sys/phys-[eth1/34].json

 

issue3.PNGissue4.PNGissue5.PNG

 

Orf Gelbrich
Cisco Employee
Cisco Employee

I assume you are talking to an APIC controller via API call? 

Are you using a generic API call in UCSD 6.6.? 

 

Orf Gelbrich
Cisco Employee
Cisco Employee

this works... 

 

/api/node/mo/topology/pod-1/node-1005/sys/phys-%5Beth1/34%5D.json

 

 

Orf Gelbrich
Cisco Employee
Cisco Employee

Did this work for you? 

 

Orf Gelbrich
Cisco Employee
Cisco Employee

%5B and %5D

 

 

Screen Shot 2018-07-25 at 10.45.03 AM.png

 

 

harishap.24
Level 1
Level 1

Hi Orf;

 

Thanks for the inputs, After Replacing the square bracket with  %5B It is working fine.

 

Thanks

Harish

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:

Quick Links

Review Cisco Networking for a $25 gift card