cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

Choose one of the topics below for SD-WAN Resources to help you on your journey with SD-WAN

This community is for technical, feature, configuration and deployment questions.
For production deployment issues, please contact the TAC!
We will not comment or assist with your TAC case in these forums.

361
Views
10
Helpful
4
Replies
Beginner

vManage API log

Hello,

 

Does anybody know where to find vManage API log ? I try to do some API calls to create a template using API, but unfortunately I got an "internal server error" with an internal code like

{
  "error": {
    "message": "Server error",
    "details": "Unknown error",
    "code": "REST0001"
  }
}

Could anyone please help how to get more verbose information ?

 

 

Everyone's tags (5)
2 ACCEPTED SOLUTIONS

Accepted Solutions
Cisco Employee

Re: vManage API log

Hello,

 

you can look at the /var/log/nms/vmanage-server.log and /var/log/nms/vmanage-server-rest.log.

 

Use command show log and one of the above path names and you will see the logs printed on screen.

 

Or go into vsh and look at the files using your favourite linux commands.

 

REST001 seems to be some uncaught exception. Maybe the above logs show more detail.

 

Regards,

 

Danny.

Cisco Employee

Re: vManage API log

Hello,

 

the closest example I could get for the json body is in jinja format used in Python.

One needs other calls to get all the feature template IDs so it it not that straightforward.

 

There are some good API examples on devnet.

 

https://developer.cisco.com/learning/modules/cisco_sd-wan_with_ansible

 

Regards,

 

Danny.

 

 

 

{
  "templateName": "{{item.keys()[0]}}",
  "templateDescription": "{{ item.values()[0].Template_Description }}",
  "deviceType": "{{ Type }}",
  "configType": "template",
  "factoryDefault": false,
  "policyId": "",
  "featureTemplateUidRange": [],
  "connectionPreferenceRequired": true,
  "connectionPreference": true,
  "generalTemplates": [
    {
      "templateId": "{{feature_template_db[item.values()[0].Feature_AAA]}}",
      "templateType": "aaa"
    },
    {
      "templateId": "{{feature_template_db[item.values()[0].Feature_BFD]}}",
      "templateType": "bfd-vedge"
    },
    {
      "templateId": "{{feature_template_db[item.values()[0].Feature_OMP]}}",
      "templateType": "omp-vedge"
    },
    {
      "templateId": "{{feature_template_db[item.values()[0].Feature_Security]}}",
      "templateType": "security-vedge"
    },
    {
      "templateId": "{{feature_template_db[item.values()[0].Feature_System]}}",
      "templateType": "system-vedge",
      "subTemplates": [
        {
          "templateId": "{{feature_template_db[item.values()[0].Feature_Logging]}}",
          "templateType": "logging"
        }
      ]
    },

{% for vpn in  item.values()[0].Feature_VPN  %}

    {
      "templateId": "{{feature_template_db[vpn]}}",
      "templateType": "vpn-vedge",
      "subTemplates": [

{% for subtemplate in  item.values()[0].Feature_VPN[vpn] %}

        {
          "templateId": "{{feature_template_db[subtemplate]}}",
          "templateType": "vpn-vedge-interface"
        },
{% endfor %}

      ]
    },

{% endfor %}

    {
      "templateId": "{{feature_template_db[item.values()[0].Feature_Banner]}}",
      "templateType": "banner"
    },
    {
      "templateId": "{{feature_template_db[item.values()[0].Feature_SNMP]}}",
      "templateType": "snmp"
    }
  ]
}

 

4 REPLIES 4
Cisco Employee

Re: vManage API log

Hello,

 

you can look at the /var/log/nms/vmanage-server.log and /var/log/nms/vmanage-server-rest.log.

 

Use command show log and one of the above path names and you will see the logs printed on screen.

 

Or go into vsh and look at the files using your favourite linux commands.

 

REST001 seems to be some uncaught exception. Maybe the above logs show more detail.

 

Regards,

 

Danny.

Highlighted
Beginner

Re: vManage API log


@Danny De Ridder wrote:

Hello,

 

you can look at the /var/log/nms/vmanage-server.log and /var/log/nms/vmanage-server-rest.log.

 

Use command show log and one of the above path names and you will see the logs printed on screen.

 

Or go into vsh and look at the files using your favourite linux commands.

 

REST001 seems to be some uncaught exception. Maybe the above logs show more detail.

 

Regards,

 

Danny.



Thank you for the information Danny. I did get some logs of the API, especially on /var/log/nms/vmanage-server.log where there is a java error stack displayed. However the error is java.lang.NullPointerException, which doesn't tell what did I do wrong. You can find the screenshot attached.

I tried to create a device template by posting on this API endpoint (/template/device/feature) with the following data :

{
"templateName":"testAPI_DeviceTemplate",
"configType":"template",
"deviceType" : "vedge-cloud",
"templateDescription" : "testAPI_DeviceTemplate",
"requiredTemplate" : [
"Factory_Default_vSmart_vManage_Security_Template"
]
}

 

I couldn't find any way to know what is the correct json object to put to the request body. Would there be some hints please?

Fyi. I tried to surf the documentation but nothing explained on how to create a device template via API.

Thank you for any help.

 

Regards,

 

Rahenda

 

 

Everyone's tags (5)
Cisco Employee

Re: vManage API log

Hello,

 

the closest example I could get for the json body is in jinja format used in Python.

One needs other calls to get all the feature template IDs so it it not that straightforward.

 

There are some good API examples on devnet.

 

https://developer.cisco.com/learning/modules/cisco_sd-wan_with_ansible

 

Regards,

 

Danny.

 

 

 

{
  "templateName": "{{item.keys()[0]}}",
  "templateDescription": "{{ item.values()[0].Template_Description }}",
  "deviceType": "{{ Type }}",
  "configType": "template",
  "factoryDefault": false,
  "policyId": "",
  "featureTemplateUidRange": [],
  "connectionPreferenceRequired": true,
  "connectionPreference": true,
  "generalTemplates": [
    {
      "templateId": "{{feature_template_db[item.values()[0].Feature_AAA]}}",
      "templateType": "aaa"
    },
    {
      "templateId": "{{feature_template_db[item.values()[0].Feature_BFD]}}",
      "templateType": "bfd-vedge"
    },
    {
      "templateId": "{{feature_template_db[item.values()[0].Feature_OMP]}}",
      "templateType": "omp-vedge"
    },
    {
      "templateId": "{{feature_template_db[item.values()[0].Feature_Security]}}",
      "templateType": "security-vedge"
    },
    {
      "templateId": "{{feature_template_db[item.values()[0].Feature_System]}}",
      "templateType": "system-vedge",
      "subTemplates": [
        {
          "templateId": "{{feature_template_db[item.values()[0].Feature_Logging]}}",
          "templateType": "logging"
        }
      ]
    },

{% for vpn in  item.values()[0].Feature_VPN  %}

    {
      "templateId": "{{feature_template_db[vpn]}}",
      "templateType": "vpn-vedge",
      "subTemplates": [

{% for subtemplate in  item.values()[0].Feature_VPN[vpn] %}

        {
          "templateId": "{{feature_template_db[subtemplate]}}",
          "templateType": "vpn-vedge-interface"
        },
{% endfor %}

      ]
    },

{% endfor %}

    {
      "templateId": "{{feature_template_db[item.values()[0].Feature_Banner]}}",
      "templateType": "banner"
    },
    {
      "templateId": "{{feature_template_db[item.values()[0].Feature_SNMP]}}",
      "templateType": "snmp"
    }
  ]
}

 

Beginner

Re: vManage API log

Thank you very much for your helps ! :)
CreatePlease to create content
Content for Community-Ad
July's Community Spotlight Awards