Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • tfs/controller
1 result
Show changes
Showing
with 783 additions and 109522 deletions
package automation;
import io.quarkus.grpc.runtime.MutinyService;
@javax.annotation.Generated(
value = "by Mutiny Grpc generator",
comments = "Source: automation.proto")
public interface AutomationService extends MutinyService {
io.smallrye.mutiny.Uni<automation.Automation.DeviceRole> ztpGetDeviceRole(automation.Automation.DeviceRoleId request);
io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleList> ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request);
io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleState> ztpAdd(automation.Automation.DeviceRole request);
io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleState> ztpUpdate(automation.Automation.DeviceRoleConfig request);
io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleState> ztpDelete(automation.Automation.DeviceRole request);
io.smallrye.mutiny.Uni<automation.Automation.DeviceDeletionResult> ztpDeleteAll(context.ContextOuterClass.Empty request);
}
\ No newline at end of file
package automation;
import io.grpc.BindableService;
import io.quarkus.grpc.GrpcService;
import io.quarkus.grpc.runtime.MutinyBean;
@javax.annotation.Generated(
value = "by Mutiny Grpc generator",
comments = "Source: automation.proto")
public class AutomationServiceBean extends MutinyAutomationServiceGrpc.AutomationServiceImplBase implements BindableService, MutinyBean {
private final AutomationService delegate;
AutomationServiceBean(@GrpcService AutomationService delegate) {
this.delegate = delegate;
}
@Override
public io.smallrye.mutiny.Uni<automation.Automation.DeviceRole> ztpGetDeviceRole(automation.Automation.DeviceRoleId request) {
try {
return delegate.ztpGetDeviceRole(request);
} catch (UnsupportedOperationException e) {
throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED);
}
}
@Override
public io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleList> ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request) {
try {
return delegate.ztpGetDeviceRolesByDeviceId(request);
} catch (UnsupportedOperationException e) {
throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED);
}
}
@Override
public io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleState> ztpAdd(automation.Automation.DeviceRole request) {
try {
return delegate.ztpAdd(request);
} catch (UnsupportedOperationException e) {
throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED);
}
}
@Override
public io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleState> ztpUpdate(automation.Automation.DeviceRoleConfig request) {
try {
return delegate.ztpUpdate(request);
} catch (UnsupportedOperationException e) {
throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED);
}
}
@Override
public io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleState> ztpDelete(automation.Automation.DeviceRole request) {
try {
return delegate.ztpDelete(request);
} catch (UnsupportedOperationException e) {
throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED);
}
}
@Override
public io.smallrye.mutiny.Uni<automation.Automation.DeviceDeletionResult> ztpDeleteAll(context.ContextOuterClass.Empty request) {
try {
return delegate.ztpDeleteAll(request);
} catch (UnsupportedOperationException e) {
throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED);
}
}
}
\ No newline at end of file
package automation;
import java.util.function.BiFunction;
import io.quarkus.grpc.runtime.MutinyClient;
@javax.annotation.Generated(
value = "by Mutiny Grpc generator",
comments = "Source: automation.proto")
public class AutomationServiceClient implements AutomationService, MutinyClient<MutinyAutomationServiceGrpc.MutinyAutomationServiceStub> {
private final MutinyAutomationServiceGrpc.MutinyAutomationServiceStub stub;
public AutomationServiceClient(String name, io.grpc.Channel channel, BiFunction<String, MutinyAutomationServiceGrpc.MutinyAutomationServiceStub, MutinyAutomationServiceGrpc.MutinyAutomationServiceStub> stubConfigurator) {
this.stub = stubConfigurator.apply(name,MutinyAutomationServiceGrpc.newMutinyStub(channel));
}
@Override
public MutinyAutomationServiceGrpc.MutinyAutomationServiceStub getStub() {
return stub;
}
@Override
public io.smallrye.mutiny.Uni<automation.Automation.DeviceRole> ztpGetDeviceRole(automation.Automation.DeviceRoleId request) {
return stub.ztpGetDeviceRole(request);
}
@Override
public io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleList> ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request) {
return stub.ztpGetDeviceRolesByDeviceId(request);
}
@Override
public io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleState> ztpAdd(automation.Automation.DeviceRole request) {
return stub.ztpAdd(request);
}
@Override
public io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleState> ztpUpdate(automation.Automation.DeviceRoleConfig request) {
return stub.ztpUpdate(request);
}
@Override
public io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleState> ztpDelete(automation.Automation.DeviceRole request) {
return stub.ztpDelete(request);
}
@Override
public io.smallrye.mutiny.Uni<automation.Automation.DeviceDeletionResult> ztpDeleteAll(context.ContextOuterClass.Empty request) {
return stub.ztpDeleteAll(request);
}
}
\ No newline at end of file
package automation;
import static automation.AutomationServiceGrpc.getServiceDescriptor;
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
@javax.annotation.Generated(
value = "by Mutiny Grpc generator",
comments = "Source: automation.proto")
public final class MutinyAutomationServiceGrpc implements io.quarkus.grpc.runtime.MutinyGrpc {
private MutinyAutomationServiceGrpc() {}
public static MutinyAutomationServiceStub newMutinyStub(io.grpc.Channel channel) {
return new MutinyAutomationServiceStub(channel);
}
public static final class MutinyAutomationServiceStub extends io.grpc.stub.AbstractStub<MutinyAutomationServiceStub> implements io.quarkus.grpc.runtime.MutinyStub {
private AutomationServiceGrpc.AutomationServiceStub delegateStub;
private MutinyAutomationServiceStub(io.grpc.Channel channel) {
super(channel);
delegateStub = AutomationServiceGrpc.newStub(channel);
}
private MutinyAutomationServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
delegateStub = AutomationServiceGrpc.newStub(channel).build(channel, callOptions);
}
@Override
protected MutinyAutomationServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new MutinyAutomationServiceStub(channel, callOptions);
}
public io.smallrye.mutiny.Uni<automation.Automation.DeviceRole> ztpGetDeviceRole(automation.Automation.DeviceRoleId request) {
return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::ztpGetDeviceRole);
}
public io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleList> ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request) {
return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::ztpGetDeviceRolesByDeviceId);
}
public io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleState> ztpAdd(automation.Automation.DeviceRole request) {
return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::ztpAdd);
}
public io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleState> ztpUpdate(automation.Automation.DeviceRoleConfig request) {
return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::ztpUpdate);
}
public io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleState> ztpDelete(automation.Automation.DeviceRole request) {
return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::ztpDelete);
}
public io.smallrye.mutiny.Uni<automation.Automation.DeviceDeletionResult> ztpDeleteAll(context.ContextOuterClass.Empty request) {
return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::ztpDeleteAll);
}
}
public static abstract class AutomationServiceImplBase implements io.grpc.BindableService {
private String compression;
/**
* Set whether the server will try to use a compressed response.
*
* @param compression the compression, e.g {@code gzip}
*/
public AutomationServiceImplBase withCompression(String compression) {
this.compression = compression;
return this;
}
public io.smallrye.mutiny.Uni<automation.Automation.DeviceRole> ztpGetDeviceRole(automation.Automation.DeviceRoleId request) {
throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED);
}
public io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleList> ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request) {
throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED);
}
public io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleState> ztpAdd(automation.Automation.DeviceRole request) {
throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED);
}
public io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleState> ztpUpdate(automation.Automation.DeviceRoleConfig request) {
throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED);
}
public io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleState> ztpDelete(automation.Automation.DeviceRole request) {
throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED);
}
public io.smallrye.mutiny.Uni<automation.Automation.DeviceDeletionResult> ztpDeleteAll(context.ContextOuterClass.Empty request) {
throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED);
}
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
.addMethod(
automation.AutomationServiceGrpc.getZtpGetDeviceRoleMethod(),
asyncUnaryCall(
new MethodHandlers<
automation.Automation.DeviceRoleId,
automation.Automation.DeviceRole>(
this, METHODID_ZTP_GET_DEVICE_ROLE, compression)))
.addMethod(
automation.AutomationServiceGrpc.getZtpGetDeviceRolesByDeviceIdMethod(),
asyncUnaryCall(
new MethodHandlers<
context.ContextOuterClass.DeviceId,
automation.Automation.DeviceRoleList>(
this, METHODID_ZTP_GET_DEVICE_ROLES_BY_DEVICE_ID, compression)))
.addMethod(
automation.AutomationServiceGrpc.getZtpAddMethod(),
asyncUnaryCall(
new MethodHandlers<
automation.Automation.DeviceRole,
automation.Automation.DeviceRoleState>(
this, METHODID_ZTP_ADD, compression)))
.addMethod(
automation.AutomationServiceGrpc.getZtpUpdateMethod(),
asyncUnaryCall(
new MethodHandlers<
automation.Automation.DeviceRoleConfig,
automation.Automation.DeviceRoleState>(
this, METHODID_ZTP_UPDATE, compression)))
.addMethod(
automation.AutomationServiceGrpc.getZtpDeleteMethod(),
asyncUnaryCall(
new MethodHandlers<
automation.Automation.DeviceRole,
automation.Automation.DeviceRoleState>(
this, METHODID_ZTP_DELETE, compression)))
.addMethod(
automation.AutomationServiceGrpc.getZtpDeleteAllMethod(),
asyncUnaryCall(
new MethodHandlers<
context.ContextOuterClass.Empty,
automation.Automation.DeviceDeletionResult>(
this, METHODID_ZTP_DELETE_ALL, compression)))
.build();
}
}
private static final int METHODID_ZTP_GET_DEVICE_ROLE = 0;
private static final int METHODID_ZTP_GET_DEVICE_ROLES_BY_DEVICE_ID = 1;
private static final int METHODID_ZTP_ADD = 2;
private static final int METHODID_ZTP_UPDATE = 3;
private static final int METHODID_ZTP_DELETE = 4;
private static final int METHODID_ZTP_DELETE_ALL = 5;
private static final class MethodHandlers<Req, Resp> implements
io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
private final AutomationServiceImplBase serviceImpl;
private final int methodId;
private final String compression;
MethodHandlers(AutomationServiceImplBase serviceImpl, int methodId, String compression) {
this.serviceImpl = serviceImpl;
this.methodId = methodId;
this.compression = compression;
}
@java.lang.Override
@java.lang.SuppressWarnings("unchecked")
public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
switch (methodId) {
case METHODID_ZTP_GET_DEVICE_ROLE:
io.quarkus.grpc.runtime.ServerCalls.oneToOne((automation.Automation.DeviceRoleId) request,
(io.grpc.stub.StreamObserver<automation.Automation.DeviceRole>) responseObserver,
compression,
serviceImpl::ztpGetDeviceRole);
break;
case METHODID_ZTP_GET_DEVICE_ROLES_BY_DEVICE_ID:
io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.DeviceId) request,
(io.grpc.stub.StreamObserver<automation.Automation.DeviceRoleList>) responseObserver,
compression,
serviceImpl::ztpGetDeviceRolesByDeviceId);
break;
case METHODID_ZTP_ADD:
io.quarkus.grpc.runtime.ServerCalls.oneToOne((automation.Automation.DeviceRole) request,
(io.grpc.stub.StreamObserver<automation.Automation.DeviceRoleState>) responseObserver,
compression,
serviceImpl::ztpAdd);
break;
case METHODID_ZTP_UPDATE:
io.quarkus.grpc.runtime.ServerCalls.oneToOne((automation.Automation.DeviceRoleConfig) request,
(io.grpc.stub.StreamObserver<automation.Automation.DeviceRoleState>) responseObserver,
compression,
serviceImpl::ztpUpdate);
break;
case METHODID_ZTP_DELETE:
io.quarkus.grpc.runtime.ServerCalls.oneToOne((automation.Automation.DeviceRole) request,
(io.grpc.stub.StreamObserver<automation.Automation.DeviceRoleState>) responseObserver,
compression,
serviceImpl::ztpDelete);
break;
case METHODID_ZTP_DELETE_ALL:
io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.Empty) request,
(io.grpc.stub.StreamObserver<automation.Automation.DeviceDeletionResult>) responseObserver,
compression,
serviceImpl::ztpDeleteAll);
break;
default:
throw new java.lang.AssertionError();
}
}
@java.lang.Override
@java.lang.SuppressWarnings("unchecked")
public io.grpc.stub.StreamObserver<Req> invoke(io.grpc.stub.StreamObserver<Resp> responseObserver) {
switch (methodId) {
default:
throw new java.lang.AssertionError();
}
}
}
}
\ No newline at end of file
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: kpi_sample_types.proto
package kpi_sample_types;
public final class KpiSampleTypes {
private KpiSampleTypes() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLite registry) {
}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions(
(com.google.protobuf.ExtensionRegistryLite) registry);
}
/**
* Protobuf enum {@code kpi_sample_types.KpiSampleType}
*/
public enum KpiSampleType
implements com.google.protobuf.ProtocolMessageEnum {
/**
* <code>KPISAMPLETYPE_UNKNOWN = 0;</code>
*/
KPISAMPLETYPE_UNKNOWN(0),
/**
* <code>KPISAMPLETYPE_PACKETS_TRANSMITTED = 101;</code>
*/
KPISAMPLETYPE_PACKETS_TRANSMITTED(101),
/**
* <code>KPISAMPLETYPE_PACKETS_RECEIVED = 102;</code>
*/
KPISAMPLETYPE_PACKETS_RECEIVED(102),
/**
* <code>KPISAMPLETYPE_PACKETS_DROPPED = 103;</code>
*/
KPISAMPLETYPE_PACKETS_DROPPED(103),
/**
* <code>KPISAMPLETYPE_BYTES_TRANSMITTED = 201;</code>
*/
KPISAMPLETYPE_BYTES_TRANSMITTED(201),
/**
* <code>KPISAMPLETYPE_BYTES_RECEIVED = 202;</code>
*/
KPISAMPLETYPE_BYTES_RECEIVED(202),
/**
* <code>KPISAMPLETYPE_BYTES_DROPPED = 203;</code>
*/
KPISAMPLETYPE_BYTES_DROPPED(203),
/**
* <pre>
*. can be used by both optical and L3 without any issue
* </pre>
*
* <code>KPISAMPLETYPE_ML_CONFIDENCE = 401;</code>
*/
KPISAMPLETYPE_ML_CONFIDENCE(401),
/**
* <pre>
*. can be used by both optical and L3 without any issue
* </pre>
*
* <code>KPISAMPLETYPE_OPTICAL_SECURITY_STATUS = 501;</code>
*/
KPISAMPLETYPE_OPTICAL_SECURITY_STATUS(501),
/**
* <code>KPISAMPLETYPE_L3_UNIQUE_ATTACK_CONNS = 601;</code>
*/
KPISAMPLETYPE_L3_UNIQUE_ATTACK_CONNS(601),
/**
* <code>KPISAMPLETYPE_L3_TOTAL_DROPPED_PACKTS = 602;</code>
*/
KPISAMPLETYPE_L3_TOTAL_DROPPED_PACKTS(602),
/**
* <code>KPISAMPLETYPE_L3_UNIQUE_ATTACKERS = 603;</code>
*/
KPISAMPLETYPE_L3_UNIQUE_ATTACKERS(603),
/**
* <code>KPISAMPLETYPE_L3_UNIQUE_COMPROMISED_CLIENTS = 604;</code>
*/
KPISAMPLETYPE_L3_UNIQUE_COMPROMISED_CLIENTS(604),
/**
* <code>KPISAMPLETYPE_L3_SECURITY_STATUS_CRYPTO = 605;</code>
*/
KPISAMPLETYPE_L3_SECURITY_STATUS_CRYPTO(605),
/**
* <code>KPISAMPLETYPE_SERVICE_LATENCY_MS = 701;</code>
*/
KPISAMPLETYPE_SERVICE_LATENCY_MS(701),
UNRECOGNIZED(-1),
;
/**
* <code>KPISAMPLETYPE_UNKNOWN = 0;</code>
*/
public static final int KPISAMPLETYPE_UNKNOWN_VALUE = 0;
/**
* <code>KPISAMPLETYPE_PACKETS_TRANSMITTED = 101;</code>
*/
public static final int KPISAMPLETYPE_PACKETS_TRANSMITTED_VALUE = 101;
/**
* <code>KPISAMPLETYPE_PACKETS_RECEIVED = 102;</code>
*/
public static final int KPISAMPLETYPE_PACKETS_RECEIVED_VALUE = 102;
/**
* <code>KPISAMPLETYPE_PACKETS_DROPPED = 103;</code>
*/
public static final int KPISAMPLETYPE_PACKETS_DROPPED_VALUE = 103;
/**
* <code>KPISAMPLETYPE_BYTES_TRANSMITTED = 201;</code>
*/
public static final int KPISAMPLETYPE_BYTES_TRANSMITTED_VALUE = 201;
/**
* <code>KPISAMPLETYPE_BYTES_RECEIVED = 202;</code>
*/
public static final int KPISAMPLETYPE_BYTES_RECEIVED_VALUE = 202;
/**
* <code>KPISAMPLETYPE_BYTES_DROPPED = 203;</code>
*/
public static final int KPISAMPLETYPE_BYTES_DROPPED_VALUE = 203;
/**
* <pre>
*. can be used by both optical and L3 without any issue
* </pre>
*
* <code>KPISAMPLETYPE_ML_CONFIDENCE = 401;</code>
*/
public static final int KPISAMPLETYPE_ML_CONFIDENCE_VALUE = 401;
/**
* <pre>
*. can be used by both optical and L3 without any issue
* </pre>
*
* <code>KPISAMPLETYPE_OPTICAL_SECURITY_STATUS = 501;</code>
*/
public static final int KPISAMPLETYPE_OPTICAL_SECURITY_STATUS_VALUE = 501;
/**
* <code>KPISAMPLETYPE_L3_UNIQUE_ATTACK_CONNS = 601;</code>
*/
public static final int KPISAMPLETYPE_L3_UNIQUE_ATTACK_CONNS_VALUE = 601;
/**
* <code>KPISAMPLETYPE_L3_TOTAL_DROPPED_PACKTS = 602;</code>
*/
public static final int KPISAMPLETYPE_L3_TOTAL_DROPPED_PACKTS_VALUE = 602;
/**
* <code>KPISAMPLETYPE_L3_UNIQUE_ATTACKERS = 603;</code>
*/
public static final int KPISAMPLETYPE_L3_UNIQUE_ATTACKERS_VALUE = 603;
/**
* <code>KPISAMPLETYPE_L3_UNIQUE_COMPROMISED_CLIENTS = 604;</code>
*/
public static final int KPISAMPLETYPE_L3_UNIQUE_COMPROMISED_CLIENTS_VALUE = 604;
/**
* <code>KPISAMPLETYPE_L3_SECURITY_STATUS_CRYPTO = 605;</code>
*/
public static final int KPISAMPLETYPE_L3_SECURITY_STATUS_CRYPTO_VALUE = 605;
/**
* <code>KPISAMPLETYPE_SERVICE_LATENCY_MS = 701;</code>
*/
public static final int KPISAMPLETYPE_SERVICE_LATENCY_MS_VALUE = 701;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static KpiSampleType valueOf(int value) {
return forNumber(value);
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
*/
public static KpiSampleType forNumber(int value) {
switch (value) {
case 0: return KPISAMPLETYPE_UNKNOWN;
case 101: return KPISAMPLETYPE_PACKETS_TRANSMITTED;
case 102: return KPISAMPLETYPE_PACKETS_RECEIVED;
case 103: return KPISAMPLETYPE_PACKETS_DROPPED;
case 201: return KPISAMPLETYPE_BYTES_TRANSMITTED;
case 202: return KPISAMPLETYPE_BYTES_RECEIVED;
case 203: return KPISAMPLETYPE_BYTES_DROPPED;
case 401: return KPISAMPLETYPE_ML_CONFIDENCE;
case 501: return KPISAMPLETYPE_OPTICAL_SECURITY_STATUS;
case 601: return KPISAMPLETYPE_L3_UNIQUE_ATTACK_CONNS;
case 602: return KPISAMPLETYPE_L3_TOTAL_DROPPED_PACKTS;
case 603: return KPISAMPLETYPE_L3_UNIQUE_ATTACKERS;
case 604: return KPISAMPLETYPE_L3_UNIQUE_COMPROMISED_CLIENTS;
case 605: return KPISAMPLETYPE_L3_SECURITY_STATUS_CRYPTO;
case 701: return KPISAMPLETYPE_SERVICE_LATENCY_MS;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap<KpiSampleType>
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
KpiSampleType> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap<KpiSampleType>() {
public KpiSampleType findValueByNumber(int number) {
return KpiSampleType.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalStateException(
"Can't get the descriptor of an unrecognized enum value.");
}
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return kpi_sample_types.KpiSampleTypes.getDescriptor().getEnumTypes().get(0);
}
private static final KpiSampleType[] VALUES = values();
public static KpiSampleType valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private KpiSampleType(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:kpi_sample_types.KpiSampleType)
}
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n\026kpi_sample_types.proto\022\020kpi_sample_typ" +
"es*\327\004\n\rKpiSampleType\022\031\n\025KPISAMPLETYPE_UN" +
"KNOWN\020\000\022%\n!KPISAMPLETYPE_PACKETS_TRANSMI" +
"TTED\020e\022\"\n\036KPISAMPLETYPE_PACKETS_RECEIVED" +
"\020f\022!\n\035KPISAMPLETYPE_PACKETS_DROPPED\020g\022$\n" +
"\037KPISAMPLETYPE_BYTES_TRANSMITTED\020\311\001\022!\n\034K" +
"PISAMPLETYPE_BYTES_RECEIVED\020\312\001\022 \n\033KPISAM" +
"PLETYPE_BYTES_DROPPED\020\313\001\022 \n\033KPISAMPLETYP" +
"E_ML_CONFIDENCE\020\221\003\022*\n%KPISAMPLETYPE_OPTI" +
"CAL_SECURITY_STATUS\020\365\003\022)\n$KPISAMPLETYPE_" +
"L3_UNIQUE_ATTACK_CONNS\020\331\004\022*\n%KPISAMPLETY" +
"PE_L3_TOTAL_DROPPED_PACKTS\020\332\004\022&\n!KPISAMP" +
"LETYPE_L3_UNIQUE_ATTACKERS\020\333\004\0220\n+KPISAMP" +
"LETYPE_L3_UNIQUE_COMPROMISED_CLIENTS\020\334\004\022" +
",\n\'KPISAMPLETYPE_L3_SECURITY_STATUS_CRYP" +
"TO\020\335\004\022%\n KPISAMPLETYPE_SERVICE_LATENCY_M" +
"S\020\275\005b\006proto3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
});
}
// @@protoc_insertion_point(outer_class_scope)
}
# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Build, tag, and push the Docker image to the GitLab Docker registry
build bgpls_speaker:
variables:
IMAGE_NAME: 'bgpls_speaker' # name of the microservice
IMAGE_TAG: 'latest' # tag of the container image (production, development, etc)
stage: build
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile .
- docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG"
- docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG"
after_script:
- docker images --filter="dangling=true" --quiet | xargs -r docker rmi
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)'
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"'
- changes:
- src/common/**/*.py
- proto/*.proto
- src/$IMAGE_NAME/**/*.{py,in,yml}
- src/$IMAGE_NAME/Dockerfile
- src/$IMAGE_NAME/tests/*.py
- manifests/${IMAGE_NAME}service.yaml
- .gitlab-ci.yml
## Apply unit test to the component
#unit_test bgpls_speaker:
# variables:
# IMAGE_NAME: 'bgpls_speaker' # name of the microservice
# IMAGE_TAG: 'latest' # tag of the container image (production, development, etc)
# stage: unit_test
# needs:
# - build bgpls_speaker
# before_script:
# - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
# - if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create --driver=bridge teraflowbridge; fi
# - if docker container ls | grep $IMAGE_NAME; then docker rm -f $IMAGE_NAME; else echo "$IMAGE_NAME image is not in the system"; fi
# script:
# - docker pull "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG"
# - docker run --name $IMAGE_NAME -d -p 20030:20030 -v "$PWD/src/$IMAGE_NAME/tests:/opt/results" --network=teraflowbridge $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG
# - sleep 5
# - docker ps -a
# - docker logs $IMAGE_NAME
# - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml"
# - docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing"
# coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/'
# after_script:
# - docker rm -f $IMAGE_NAME
# - docker network rm teraflowbridge
# rules:
# - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)'
# - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"'
# - changes:
# - src/common/**/*.py
# - proto/*.proto
# - src/$IMAGE_NAME/**/*.{py,in,yml}
# - src/$IMAGE_NAME/Dockerfile
# - src/$IMAGE_NAME/tests/*.py
# - manifests/${IMAGE_NAME}service.yaml
# - .gitlab-ci.yml
# artifacts:
# when: always
# reports:
# junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml
## Deployment of the service in Kubernetes Cluster
#deploy bgpls_speaker:
# variables:
# IMAGE_NAME: 'bgpls_speaker' # name of the microservice
# IMAGE_TAG: 'latest' # tag of the container image (production, development, etc)
# stage: deploy
# needs:
# - unit test bgpls_speaker
# # - integ_test execute
# script:
# - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/${IMAGE_NAME}service.yaml'
# - kubectl version
# - kubectl get all
# - kubectl apply -f "manifests/${IMAGE_NAME}service.yaml"
# - kubectl get all
# # environment:
# # name: test
# # url: https://example.com
# # kubernetes:
# # namespace: test
# rules:
# - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)'
# when: manual
# - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"'
# when: manual
# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Maven install stage
#
# ----------------------------------------------
# FROM alpine/git:latest AS repo
# WORKDIR /usr/src/app
# RUN git clone https://github.com/telefonicaid/netphony-network-protocols.git .
FROM maven:3.8.8-eclipse-temurin-17 AS build
WORKDIR /
COPY src/bgpls_speaker/service/java/netphony-topology/ netphony-topology/
COPY src/bgpls_speaker/service/java/netphony-topology/pom.xml netphony-topology/pom.xml
WORKDIR /netphony-topology/
RUN mvn clean compile -DskipTests -X
RUN mvn package assembly:single -P bgp-ls-speaker -DskipTests
WORKDIR /netphony-topology/target/
# ENTRYPOINT [ "ls" ,"-a"]
# -------------------------------------------
# jar created in /netphony-topology/target/bgp-ls-speaker-jar-with-dependencies.jar
#
# Stage 2
#
FROM python:3.9-slim
# Install dependencies
RUN apt-get --yes --quiet --quiet update && \
apt-get --yes --quiet --quiet install wget g++ && \
rm -rf /var/lib/apt/lists/*
# Set Python to show logs as they occur
ENV PYTHONUNBUFFERED=0
# Download the gRPC health probe
RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \
wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \
chmod +x /bin/grpc_health_probe
# Get generic Python packages
RUN python3 -m pip install --upgrade pip
RUN python3 -m pip install --upgrade setuptools wheel
RUN python3 -m pip install --upgrade pip-tools
# Install OpenJDK-11
RUN apt-get update && \
apt-get install -y openjdk-17-jre && \
apt-get clean;
# Get common Python packages
# Note: this step enables sharing the previous Docker build steps among all the Python components
WORKDIR /var/teraflow
COPY common_requirements.in common_requirements.in
RUN pip-compile --quiet --output-file=common_requirements.txt common_requirements.in
RUN python3 -m pip install -r common_requirements.txt
# Add common files into working directory
WORKDIR /var/teraflow/common
COPY src/common/. ./
RUN rm -rf proto
# Create proto sub-folder, copy .proto files, and generate Python code
RUN mkdir -p /var/teraflow/common/proto
WORKDIR /var/teraflow/common/proto
RUN touch __init__.py
COPY proto/*.proto ./
RUN python3 -m grpc_tools.protoc -I=. --python_out=. --grpc_python_out=. *.proto
RUN rm *.proto
RUN find . -type f -exec sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' {} \;
# Create component sub-folders, get specific Python packages
RUN mkdir -p /var/teraflow/bgpls_speaker
WORKDIR /var/teraflow/bgpls_speaker
COPY src/bgpls_speaker/requirements.in requirements.in
RUN pip-compile --quiet --output-file=requirements.txt requirements.in
RUN python3 -m pip install -r requirements.txt
# Java module necessary config files
WORKDIR /var/teraflow/bgpls_speaker
RUN mkdir -p /java
COPY src/bgpls_speaker/service/java/* /java/
COPY --from=build /netphony-topology/target/bgp-ls-speaker-jar-with-dependencies.jar /var/teraflow/bgpls_speaker/service/java/bgp_ls.jar
# Add component files into working directory
WORKDIR /var/teraflow
COPY src/context/__init__.py context/__init__.py
COPY src/context/client/. context/client/
COPY src/bgpls_speaker/. bgpls_speaker/
# Start the service
ENTRYPOINT ["python", "-m", "bgpls_speaker.service"]
# ENTRYPOINT [ "ls","-R" ]
\ No newline at end of file
# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
This diff is collapsed.
# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
This diff is collapsed.