seba-343 - added preprovision api
Change-Id: I5760e059154e2966ea2545b48306fce78cbe4daf
diff --git a/api/abstract_olt_api.proto b/api/abstract_olt_api.proto
index 6c5304b..f592b38 100644
--- a/api/abstract_olt_api.proto
+++ b/api/abstract_olt_api.proto
@@ -78,16 +78,28 @@
int32 OntNumber=4;
string SerialNumber=5;
}
+message PreProvisionOntMessage{
+ string CLLI=1;
+ int32 SlotNumber=2;
+ int32 PortNumber=3;
+ int32 OntNumber=4;
+ uint32 STag=5;
+ uint32 CTag=6;
+ string NasPortID=7;
+ string CircuitID=8;
+ string TechProfile=9;
+ string SpeedProfile=10;
+}
message AddOntFullMessage{
string CLLI=1;
int32 SlotNumber=2;
int32 PortNumber=3;
int32 OntNumber=4;
string SerialNumber=5;
- uint32 STag=7;
- uint32 CTag=8;
- string NasPortID=9;
- string CircuitID=10;
+ uint32 STag=6;
+ uint32 CTag=7;
+ string NasPortID=8;
+ string CircuitID=9;
}
message AddOntReturn{
bool Success=1;
@@ -147,6 +159,18 @@
body:"*"
};
}
+ rpc PreProvisionOnt(PreProvisionOntMessage) returns (AddOntReturn) {
+ option(google.api.http) = {
+ post:"/v1/PreProvsionOnt"
+ body:"*"
+ };
+ }
+ rpc ActivateSerial(AddOntMessage) returns (AddOntReturn) {
+ option(google.api.http) = {
+ post:"/v1/ActivateSerial"
+ body:"*"
+ };
+ }
rpc ProvisionOnt(AddOntMessage) returns (AddOntReturn) {
option(google.api.http) = {
post:"/v1/ProvsionOnt"
diff --git a/api/handler.go b/api/handler.go
index 4e1ef61..76d637e 100644
--- a/api/handler.go
+++ b/api/handler.go
@@ -148,6 +148,37 @@
}
/*
+PreProvisionOnt - provisions ont using sTag,cTag,NasPortID, and CircuitID passed in
+*/
+func (s *Server) PreProvisionOnt(ctx context.Context, in *PreProvisionOntMessage) (*AddOntReturn, error) {
+ clli := in.GetCLLI()
+ slotNumber := int(in.GetSlotNumber())
+ portNumber := int(in.GetPortNumber())
+ ontNumber := int(in.GetOntNumber())
+ cTag := in.GetCTag()
+ sTag := in.GetSTag()
+ nasPortID := in.GetNasPortID()
+ circuitID := in.GetCircuitID()
+ techProfile := in.GetTechProfile()
+ speedProfile := in.GetSpeedProfile()
+ success, err := impl.PreProvisionOnt(clli, slotNumber, portNumber, ontNumber, cTag, sTag, nasPortID, circuitID, techProfile, speedProfile)
+ return &AddOntReturn{Success: success}, err
+}
+
+/*
+ActivateSerial provisions an ONT on a specific Chassis/LineCard/Port
+*/
+func (s *Server) ActivateSerial(ctx context.Context, in *AddOntMessage) (*AddOntReturn, error) {
+ clli := in.GetCLLI()
+ slotNumber := int(in.GetSlotNumber())
+ portNumber := int(in.GetPortNumber())
+ ontNumber := int(in.GetOntNumber())
+ serialNumber := in.GetSerialNumber()
+ success, err := impl.ActivateSerial(clli, slotNumber, portNumber, ontNumber, serialNumber)
+ return &AddOntReturn{Success: success}, err
+}
+
+/*
DeleteOnt - deletes a previously provision ont
*/
func (s *Server) DeleteOnt(ctx context.Context, in *DeleteOntMessage) (*DeleteOntReturn, error) {