Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JsonCodeGen issue #9

Closed
makaveli0129 opened this issue Apr 17, 2017 · 7 comments
Closed

JsonCodeGen issue #9

makaveli0129 opened this issue Apr 17, 2017 · 7 comments

Comments

@makaveli0129
Copy link

makaveli0129 commented Apr 17, 2017

Json codegen does not output when datatypes are table,scalar,row,column object.

Having this information inside of the object would be useful when deciding whether or not to use a bulk get or single get.

I would expect to see something like scalar/table/row etc like in the PYSNMP output format

ifNumber = MibScalar((1, 3, 6, 1, 2, 1, 2, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ifNumber.setStatus('current')
ifTableLastChange = MibScalar((1, 3, 6, 1, 2, 1, 31, 1, 5), TimeTicks()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ifTableLastChange.setStatus('current')
ifTable = MibTable((1, 3, 6, 1, 2, 1, 2, 2), )
ifEntry = MibTableRow((1, 3, 6, 1, 2, 1, 2, 2, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))

Example below for IF-MIB

"ifNumber": {
    "name": "ifNumber", 
    "oid": "1.3.6.1.2.1.2.1", 
    "class": "objecttype", 
    "syntax": {
      "type": "Integer32", 
      "class": "type"
    }, 
    "maxaccess": "read-only", 
    "status": "current"
  }, 
  "ifTableLastChange": {
    "name": "ifTableLastChange", 
    "oid": "1.3.6.1.2.1.31.1.5", 
    "class": "objecttype", 
    "syntax": {
      "type": "TimeTicks", 
      "class": "type"
    }, 
    "maxaccess": "read-only", 
    "status": "current"
  }, 
  "ifTable": {
    "name": "ifTable", 
    "oid": "1.3.6.1.2.1.2.2", 
    "class": "objecttype", 
    "maxaccess": "not-accessible", 
    "status": "current"
  }, 
  "ifEntry": {
    "name": "ifEntry", 
    "oid": "1.3.6.1.2.1.2.2.1", 
    "class": "objecttype", 
    "maxaccess": "not-accessible", 
    "indices": [
      {
        "module": "IF-MIB", 
        "object": "ifIndex"
      }
    ], 
    "status": "current"
  }, 
@makaveli0129
Copy link
Author

smidump

Shows it as a nodetype

"nodes" : {
        "interfaces" : {
            "nodetype" : "node",
            "moduleName" : "IF-MIB",
            "oid" : "1.3.6.1.2.1.2",
        }, # node
        "ifNumber" : {
            "nodetype" : "scalar",

@etingof
Copy link
Owner

etingof commented Apr 17, 2017

Thank you for raising this issue!

The nodetype feature has been implemented since 2384836. Please, test and let me know in case of further ideas/issues.

@makaveli0129
Copy link
Author

AWESOME!!! you are the best

@makaveli0129
Copy link
Author

is this in pip already or is compiling the only way to get it? Just asking for my cookbook :-)

@makaveli0129
Copy link
Author

Verified working BTW:

"ifTable": {
    "name": "ifTable", 
    "oid": "1.3.6.1.2.1.2.2", 
    "nodetype": "table", 
    "class": "objecttype", 
    "maxaccess": "not-accessible", 
    "status": "current"
  }, 
  "ifEntry": {
    "name": "ifEntry", 
    "oid": "1.3.6.1.2.1.2.2.1", 
    "nodetype": "row", 
    "class": "objecttype", 
    "maxaccess": "not-accessible", 
    "indices": [
      {
        "module": "IF-MIB", 
        "object": "ifIndex"
      }
    ], 
    "status": "current"
  }, 
  "ifIndex": {
    "name": "ifIndex", 
    "oid": "1.3.6.1.2.1.2.2.1.1", 
    "nodetype": "column", 
    "class": "objecttype", 
    "syntax": {
      "type": "InterfaceIndex", 
      "class": "type"
    }, 
    "maxaccess": "read-only", 
    "status": "current"
  }, 

@etingof
Copy link
Owner

etingof commented Apr 17, 2017

is this in pip already or is compiling the only way to get it? Just asking for my cookbook :-)

Not it pip yet, but you can link a repo in the meanwhile.

@etingof
Copy link
Owner

etingof commented Jun 27, 2017

Released in 0.1.3

@etingof etingof closed this as completed Jun 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants