admin管理员组

文章数量:1129399

I am currently trying to develop a plugin for ODL and simultaneously update the SNMP plugin to use the latest version of ODL.

I originally tried the opendaylight-startup-archetype, I believe the newest I could find was v 1.2.2. But the poms generated by this archetype used really old versions of all of the parent modules and consequently an old version of ODL.

I manually updated each parent in the pom to use the latest and then decided to move all of them to one same version.

I managed to get it all to package using version 14.0.4.In the process I found that the way services were exposed when the archetype was created had changed and now no interface for the service is created and instead there are interfaces for each action in the yang.

I created implementations for these interfaces and added them to the blueprint as follows:

  <bean id="getInterfaces" class="org.opendaylight.snmp.plugin.internal.rpcs.GetInterfacesImpl">
    <property name="snmp" ref="snmp"/>
  </bean>
  
  <odl:rpc-implementation ref="getInterfaces"/>

When I start karaf I have to install the features for restconf and for the snmp module which work without errors. But when I try to call the rest I keep getting errors.

Is there a better way to approach this? Some newer archetype to start from?

I saw in some issues that at some point there was a migration from XML blueprint to annotations, but every wiki url I click on for opendaylight is missing. What happened to this wiki?

Please, any help directing me on how to tackle this would be greatly appreciated.

What i did:

Started from the opendaylight-startup-archetype on the one hand and from the snmp plugin source on the other. In both cases I updated the parents to use v14.0.4 and modified the code to replace the service implementation with rpc implementations for each action. Manged to get them both to package with mvn package. Started the ODL included in the package and installed odl-restconf and features-snmp for the snmp case.

What I expect: I would expect to be able to access the snmp actions at http://127.0.0.1:8181/rests/operations/snmp:get-interfaces corresponding to the following yang:

module snmp {
    yang-version 1;

    namespace "urn:opendaylight:snmp";
    prefix snmp;

...

    rpc get-interfaces {
        input {
            leaf ip-address {
                type inet:ipv4-address;
            }

            leaf community {
                type string;
            }
        }

        output {
            uses if-mib:interfaces-group;
        }
    }
...
}

Error found in logs:

Caused by: java.lang.ClassCastException: class org.opendaylight.yang.rt.v1.obj.urn.opendaylight.params.xml.ns.yang.controller.config.distributed.datastore.provider.rev231229.DataStorePropertiesContainer cannot be cast to class org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.distributed.datastore.provider.rev231229.DataStorePropertiesContainer (org.opendaylight.yang.rt.v1.obj.urn.opendaylight.params.xml.ns.yang.controller.config.distributed.datastore.provider.rev231229.DataStorePropertiesContainer is in unnamed module of loader org.opendaylight.yangtools.binding.loader.LeafBindingClassLoader @7a467a7b; org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.distributed.datastore.provider.rev231229.DataStorePropertiesContainer is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @3e176b39)

I am currently trying to develop a plugin for ODL and simultaneously update the SNMP plugin to use the latest version of ODL.

I originally tried the opendaylight-startup-archetype, I believe the newest I could find was v 1.2.2. But the poms generated by this archetype used really old versions of all of the parent modules and consequently an old version of ODL.

I manually updated each parent in the pom to use the latest and then decided to move all of them to one same version.

I managed to get it all to package using version 14.0.4.In the process I found that the way services were exposed when the archetype was created had changed and now no interface for the service is created and instead there are interfaces for each action in the yang.

I created implementations for these interfaces and added them to the blueprint as follows:

  <bean id="getInterfaces" class="org.opendaylight.snmp.plugin.internal.rpcs.GetInterfacesImpl">
    <property name="snmp" ref="snmp"/>
  </bean>
  
  <odl:rpc-implementation ref="getInterfaces"/>

When I start karaf I have to install the features for restconf and for the snmp module which work without errors. But when I try to call the rest I keep getting errors.

Is there a better way to approach this? Some newer archetype to start from?

I saw in some issues that at some point there was a migration from XML blueprint to annotations, but every wiki url I click on for opendaylight is missing. What happened to this wiki?

Please, any help directing me on how to tackle this would be greatly appreciated.

What i did:

Started from the opendaylight-startup-archetype on the one hand and from the snmp plugin source on the other. In both cases I updated the parents to use v14.0.4 and modified the code to replace the service implementation with rpc implementations for each action. Manged to get them both to package with mvn package. Started the ODL included in the package and installed odl-restconf and features-snmp for the snmp case.

What I expect: I would expect to be able to access the snmp actions at http://127.0.0.1:8181/rests/operations/snmp:get-interfaces corresponding to the following yang:

module snmp {
    yang-version 1;

    namespace "urn:opendaylight:snmp";
    prefix snmp;

...

    rpc get-interfaces {
        input {
            leaf ip-address {
                type inet:ipv4-address;
            }

            leaf community {
                type string;
            }
        }

        output {
            uses if-mib:interfaces-group;
        }
    }
...
}

Error found in logs:

Caused by: java.lang.ClassCastException: class org.opendaylight.yang.rt.v1.obj.urn.opendaylight.params.xml.ns.yang.controller.config.distributed.datastore.provider.rev231229.DataStorePropertiesContainer cannot be cast to class org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.distributed.datastore.provider.rev231229.DataStorePropertiesContainer (org.opendaylight.yang.rt.v1.obj.urn.opendaylight.params.xml.ns.yang.controller.config.distributed.datastore.provider.rev231229.DataStorePropertiesContainer is in unnamed module of loader org.opendaylight.yangtools.binding.loader.LeafBindingClassLoader @7a467a7b; org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.distributed.datastore.provider.rev231229.DataStorePropertiesContainer is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @3e176b39)

Share Improve this question asked Jan 8 at 15:51 Michael JamesMichael James 1 New contributor Michael James is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
Add a comment  | 

1 Answer 1

Reset to default 0

I believe it is best if you ask this question at the OpenDaylight Discuss mailing list. You may find it here:

https://lf-opendaylight.atlassian.net/wiki/spaces/ODL/overview

Alternatively, you may try to send an email to: [email protected]

本文标签: opendaylightHow to develop an ODL plugin using the latest parent modulesStack Overflow