cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1209
Views
0
Helpful
3
Replies

How to get the session status in YDK0.5.2

haoywang
Cisco Employee
Cisco Employee

HI All

I'm using YDK 0.5.2 and I want to find a way to close a session safely.

I know that I can use close() to close a session, but when I call close() after a session has been closed, there will be a exception.

Is there a way to get the session status in version 0.5.2? If the session is still open, then I can close it.

And is there a way to find the document for older version of YDK?

Thanks

1 Accepted Solution

Accepted Solutions

abhirame
Cisco Employee
Cisco Employee

Hi Haoyu,

Currently, we do not have a way to get the status of the session.

To generate the documentation for 0.5.2, you can do a git checkout of the 0.5.2 tag and run generate.py.

git clone https://github.com/ciscodevnet/ydk-gen.git -b 0.5.2

cd ydk-gen

python generate.py --core --generate-doc

cd gen-api/python/ydk/docs_expanded/ # documents will be generated here

To handle such an exception that you are seeing, could you make use of a try/except block or some other python construct?

View solution in original post

3 Replies 3

abhirame
Cisco Employee
Cisco Employee

Hi Haoyu,

Currently, we do not have a way to get the status of the session.

To generate the documentation for 0.5.2, you can do a git checkout of the 0.5.2 tag and run generate.py.

git clone https://github.com/ciscodevnet/ydk-gen.git -b 0.5.2

cd ydk-gen

python generate.py --core --generate-doc

cd gen-api/python/ydk/docs_expanded/ # documents will be generated here

To handle such an exception that you are seeing, could you make use of a try/except block or some other python construct?

Thanks for your help. I will use try/except to deal with this case.

Note that as of 0.6.0, no explicit close is needed anymore.