When trying to use the Spectrum REST API to create a new SNMPv3 profile the following error is returned
JAXBException occurred : cvc-elt.1.a: Cannot find the declaration of element 'v3profile-request'.
Example Call
POST http://<spectrum OneClick host>:<spectrum OneClick port>/spectrum/restful/v3profiles/createv3profiles
| <v3profile-request xmlns="http://www.example.com/spectrum/restful/schema/request"> <v3profile-create-list> <create-v3profile> <profile-name profile-name="test1"/> <user-name user-name="user1"/> <security-level security-level="0"/> <!— Allowed Security values : 0-->no authentication, 1-->authentication only, 2 -->authentication with privacy —> <auth-proto auth-proto="sha"/> <!— Allowed auth- proto: md5, sha, sha256, sha512 —> <auth-password auth-password="authpassword"/> <priv-proto priv-proto="aes"/> <!— Allowed priv- proto: des56, 3des, aes, aes256—> <priv-password priv-password="privpassword"/> <secure-domain secure-domain="None"/> <dh-flag dh-flag="0"/> <dh-random-number dh-random-number=""/> </create-v3profile> </v3profile-create-list> </v3profile-request> |
ANY
Use the following payload adjusting the values to suit the need
| <?xml version="1.0" encoding="UTF-8"?> <rs:v3profile-request xmlns:rs="http://www.ca.com/spectrum/restful/schema/request" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ca.com/spectrum/restful/schema/request ../../../xsd/Request.xsd"> <rs:v3profile-create-list> <rs:create-v3profile> <rs:profile-name profile-name="TestProfile"/> <rs:user-name user-name="TestUsername"/> <rs:security-level security-level="2"/> <!-- Allowed Security values : 0-> NoAuthNoPriv, 1->AuthNoPriv, 2->AuthPriv --> <rs:auth-proto auth-proto="SHA"/> <!-- Allowed auth-proto: md5, sha, sha256, sha512 --> <rs:auth-password auth-password="TestPassword"/> <rs:priv-proto priv-proto="AES128"/> <!-- Allowed priv-proto: des56, 3des, aes, aes256 --> <rs:priv-password priv-password="Testpriv"/> <rs:secure-domain secure-domain="None"/> <rs:dh-flag dh-flag="0"/> <rs:dh-random-number dh-random-number=""/> </rs:create-v3profile> </rs:v3profile-create-list> </rs:v3profile-request> |
Successful Response
| { "v3profile-response": { "create-v3profile-response-list": { "v3profile-response-list": { "@profile-name": "TestProfile", "@error": "Success" } } } } |