ARV Service Interface
The ARV service is built using the gRPC framework, which means it differs in its design and implementation from other IDScan.net products that use a more "Restful" interface.
gRPC documentation
For more information on the gRPC framework and how it differs from a Rest based web service the link below can be followed.
https://grpc.io/docs/what-is-grpc/introduction/
Generation of Client Side Stub
The client side code that makes use of the gRPC service that runs server side can be autogenerated for many popular programming languages. This code is generated from the service defintiion file provided below.
Supported Languages
- C#/.NET
- C++
- Dart
- Go
- Java
- Kotlin
- Node
- Objective-C
- PHP
- Python
- Ruby
The method for creating client side code is described here in detail https://grpc.io/docs/languages/
ARV Validation Service Defintion
The gRPC service definition code below should be copied in to a file named ValidationServiceContract.proto and then used to auto generate the client side code used to call the gRPC service.
syntax = "proto3";
option csharp_namespace = "IDScanNet.ARV.Host.Protos";
package ValidationServiceContract;
service ValidationService {
rpc Execute(ValidationStartRequest) returns (ValidationStartResponse);
rpc SubscribeEvents(ValidationContext) returns (stream Event);
rpc SubscribeFrames(ValidationContext) returns (stream Frame);
}
message ValidationStartRequest {
bool frameInstruction = 1;
bool frameRaw = 2;
bool eventScan = 3;
bool eventTestResult = 4;
bool sendResultData = 5;
PresetType preset = 6;
// See: ValidationServiceContract.MD
enum PresetType {
Default = 0;
Preset1 = 1;
Preset2 = 2;
Preset3 = 3;
Preset4 = 4;
Preset5 = 5;
}
}
message ValidationStartResponse {
oneof payload {
ValidationContext context = 1;
Error error = 2;
}
message Error {
string message = 1;
}
}
message ValidationContext {
string guid = 1;
}
message ExecutionResult {
StatusType status = 1;
string data = 2;
string hash = 3;
enum StatusType {
Unknown = 0;
Success = 1;
Fail = 2;
}
}
message Event {
oneof payload {
ExecutionResult executionResult = 1;
PhaseStatus phaseStatus = 2;
Scan scan = 3;
TestResult testResult = 4;
}
message PhaseStatus {
string phaseCode = 1;
string state = 2;
int32 elapsed = 3;
}
message Scan {
string code = 1;
bytes image = 2;
}
message TestResult {
string name = 1;
string description = 2;
string status = 3;
int32 statusCode = 4;
}
}
message Frame {
oneof payload {
ExecutionResult executionResult = 1;
Instruction instruction = 2;
Raw raw = 3;
}
message Instruction {
bytes image = 1;
string templateKey = 2;
}
message Raw {
bytes image = 1;
string phaseCode = 2;
int32 phaseConfidence = 3;
}
}