cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1506
Views
11
Helpful
7
Replies

APIC-EM Uniq documentation

ivillalo
Cisco Employee
Cisco Employee

Howdy,

Where do we have documented the Uniq library? I know we have the CiscoDevNet/uniq on github.com but unless I am missing something, I can't find where all calls are documented. When I look under uniq/apis/nb/ I see some of the functions in the library but I don't see everything.

Any pointers would be highly appreciated.

Ivan Villalobos

1 Accepted Solution

Accepted Solutions

This is generated from swagger.

You can look at swagger on the controller or use help() in Python.

Let me write up some examples.

Adam

Sent from my iPhone

View solution in original post

7 Replies 7

yawming
Cisco Employee
Cisco Employee

I have the same question and I couldn't find ti either. But I found most of classes, functions have nice comments.

Wonder if there is a tool extract the comment as reference guide.

example:

class ClientManager(object):

   """ Client manager to interact with API Clients of various services. """

   def __init__(self, server, username, password, base_url, protocol="https", port=None):

   """ Object initializer

  Initializer also authenticates using the credentials, and stores the generated

  authentication ticket/token.

  Args:

  server (str): cluster server name (routable DNS addess or ip)

  username (str): user name to authenticate with

  password (str): password to authenticate with

  port (str): port number

  service (str): service to which the api calls are to be made

  connect (bool): flag to authenticate and establish api client

   """

This is generated from swagger.

You can look at swagger on the controller or use help() in Python.

Let me write up some examples.

Adam

Sent from my iPhone

I tried "pydoc" looks like easy to use.

clone uniq to my local

go to that directory the execute "pydoc -g"

Click on open browser, that bring us views of all modules then find "uniq" we will get the uniq package contents

Package Contents
     
apis (package)setuputils (package)

Some links I got nice doc

for example

http://localhost:7464/uniq.utils.wait.html

but some I got the errors like the following.

problem in ./uniq/apis/client_manager.py - <type 'exceptions.SyntaxError'>: Non-ASCII character '\xe2' in file ./uniq/apis/client_manager.py on line 158, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (client_manager.py, line 157)

Update

So I was running pydoc 2.7 after running 3.5 thing getting better.

Thank you Adam,

This is basically the documentation on developer.cisco.com but it helps that I can test it directly on my server.

What I am missing is the name of the functions I can use in Python. For instance, from one of your scripts, I see this call:

pnpproject.getPnpSiteByRange()

I know that is call for GET /pnp-project. Also, pnpproject.getPnpSiteDevicesBySiteNameAndRange(), is that a call to GET /pnp-device? Where would I find this documentation?

yawchen, have you been able to figure this out?

Check the scripts under this directory see if they help:

patiredd
Cisco Employee
Cisco Employee

hi all

I am trying to install uniq environment in virtualbox using github and trying to load maglev platform on that. But am getting below errors while updating recent packages.

build/temp.linux-x86_64-3.5/_openssl.c:434:30: fatal error: openssl/opensslv.h: No such file or directory

     #include <openssl/opensslv.h>

                                  ^

    compilation terminated.

    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

can anyone suggest me how to install the uniq environment with maglev platform. Any docs will be appreciated.