cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
925
Views
2
Helpful
3
Replies

How access services metadata (refcount etc) from Java/Python/API

cnicasio
Level 1
Level 1

Currently is there a way to access/read service metadata from Java/Python APIs?

We have to find service instances that are not fully reconciliated, from a large list of service instances.

Any suggestions?

1 Accepted Solution

Accepted Solutions

alex-filippov
Level 1
Level 1

get_attrs in Erlang API does work.

The equivalent in Python API is _ncs.maapi.get_attrs.

View solution in original post

3 Replies 3

alex-filippov
Level 1
Level 1

get_attrs in Erlang API does work.

The equivalent in Python API is _ncs.maapi.get_attrs.

cnicasio
Level 1
Level 1

Thanks! that works, here is an example:

import ncs.maapi as maapi
import ncs.maagic as maagic
m = maapi.Maapi()
m.start_user_session('admin','system')
t = m.start_write_trans()
root = maagic.get_root(t)

val = _ncs.maapi.get_attrs(m.msock, t.th, [0x80000002], '/devices/device{DEV}/config/xpon:interface/gpon-onu{1 3 6 50}')
refcount = val[0].v.as_pyval()

 

grv
Level 1
Level 1

Hi. Is there any way to get the service metadata via the root object? For example:

xxxx.get_attrs(root.devices.device[‘blabla’].config.acl)

Thanks.