Search in sources :

Example 1 with K8sApiConfigCodec

use of org.onosproject.k8snode.codec.K8sApiConfigCodec in project onos by opennetworkinglab.

the class K8sNodeCodecRegister method activate.

@Activate
protected void activate() {
    codecService.registerCodec(K8sNode.class, new K8sNodeCodec());
    codecService.registerCodec(K8sApiConfig.class, new K8sApiConfigCodec());
    codecService.registerCodec(HostNodesInfo.class, new HostNodesInfoCodec());
    codecService.registerCodec(K8sHost.class, new K8sHostCodec());
    log.info("Started");
}
Also used : K8sApiConfigCodec(org.onosproject.k8snode.codec.K8sApiConfigCodec) K8sNodeCodec(org.onosproject.k8snode.codec.K8sNodeCodec) K8sHostCodec(org.onosproject.k8snode.codec.K8sHostCodec) HostNodesInfoCodec(org.onosproject.k8snode.codec.HostNodesInfoCodec) Activate(org.osgi.service.component.annotations.Activate)

Example 2 with K8sApiConfigCodec

use of org.onosproject.k8snode.codec.K8sApiConfigCodec in project onos by opennetworkinglab.

the class K8sNodeWebResourceTest method setUpTest.

/**
 * Sets up the global values for all the tests.
 */
@Before
public void setUpTest() {
    final CodecManager codecService = new CodecManager();
    codecService.activate();
    codecService.registerCodec(K8sNode.class, new K8sNodeCodec());
    codecService.registerCodec(K8sApiConfig.class, new K8sApiConfigCodec());
    codecService.registerCodec(HostNodesInfo.class, new HostNodesInfoCodec());
    ServiceDirectory testDirectory = new TestServiceDirectory().add(K8sNodeAdminService.class, mockK8sNodeAdminService).add(K8sApiConfigAdminService.class, mockK8sApiConfigAdminService).add(CodecService.class, codecService);
    setServiceDirectory(testDirectory);
    k8sNode = DefaultK8sNode.builder().clusterName("kubernetes").hostname("minion-node").type(K8sNode.Type.MINION).dataIp(IpAddress.valueOf("10.134.34.222")).managementIp(IpAddress.valueOf("10.134.231.30")).nodeInfo(new K8sNodeInfo(IpAddress.valueOf("30.30.30.3"), null)).intgBridge(DeviceId.deviceId("of:00000000000000a1")).extBridge(DeviceId.deviceId("of:00000000000000b1")).state(K8sNodeState.INIT).build();
    k8sApiConfig = DefaultK8sApiConfig.builder().clusterName("kubernetes").segmentId(1).mode(K8sApiConfig.Mode.NORMAL).scheme(K8sApiConfig.Scheme.HTTPS).ipAddress(IpAddress.valueOf("10.134.34.223")).port(6443).state(DISCONNECTED).token("tokenMod").caCertData("caCertData").clientCertData("clientCertData").clientKeyData("clientKeyData").build();
}
Also used : K8sNodeInfo(org.onosproject.k8snode.api.K8sNodeInfo) K8sApiConfigCodec(org.onosproject.k8snode.codec.K8sApiConfigCodec) ServiceDirectory(org.onlab.osgi.ServiceDirectory) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) K8sNodeCodec(org.onosproject.k8snode.codec.K8sNodeCodec) K8sApiConfigAdminService(org.onosproject.k8snode.api.K8sApiConfigAdminService) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) CodecManager(org.onosproject.codec.impl.CodecManager) HostNodesInfoCodec(org.onosproject.k8snode.codec.HostNodesInfoCodec) Before(org.junit.Before)

Aggregations

HostNodesInfoCodec (org.onosproject.k8snode.codec.HostNodesInfoCodec)2 K8sApiConfigCodec (org.onosproject.k8snode.codec.K8sApiConfigCodec)2 K8sNodeCodec (org.onosproject.k8snode.codec.K8sNodeCodec)2 Before (org.junit.Before)1 ServiceDirectory (org.onlab.osgi.ServiceDirectory)1 TestServiceDirectory (org.onlab.osgi.TestServiceDirectory)1 CodecManager (org.onosproject.codec.impl.CodecManager)1 K8sApiConfigAdminService (org.onosproject.k8snode.api.K8sApiConfigAdminService)1 K8sNodeInfo (org.onosproject.k8snode.api.K8sNodeInfo)1 K8sHostCodec (org.onosproject.k8snode.codec.K8sHostCodec)1 Activate (org.osgi.service.component.annotations.Activate)1