Get Policy Type Instance

Api for Get Policy Type Instance

Signed-off-by: naman.gupta <naman.gupta@samsung.com>
Issue-ID: RIC-831
Change-Id: I649dd94059263244645e7a8236ad058c3f0bf86e
diff --git a/a1-go/pkg/restful/restful.go b/a1-go/pkg/restful/restful.go
index b494dab..deb2470 100644
--- a/a1-go/pkg/restful/restful.go
+++ b/a1-go/pkg/restful/restful.go
@@ -84,6 +84,17 @@
 
 	})
 
+	api.A1MediatorA1ControllerGetPolicyInstanceHandler = a1_mediator.A1ControllerGetPolicyInstanceHandlerFunc(func(params a1_mediator.A1ControllerGetPolicyInstanceParams) middleware.Responder {
+		a1.Logger.Debug("handler for get policy instance from policytypeID")
+		if resp, err := r.rh.GetPolicyInstance(models.PolicyTypeID(params.PolicyTypeID), models.PolicyInstanceID(params.PolicyInstanceID)); err == nil {
+			return a1_mediator.NewA1ControllerGetPolicyInstanceOK().WithPayload(resp)
+		}
+		if r.rh.IsPolicyInstanceNotFound(err) {
+			return a1_mediator.NewA1ControllerGetPolicyInstanceNotFound
+		}
+		return a1_mediator.NewA1ControllerGetPolicyInstanceServiceUnavailable
+	})
+
 	return api
 
 }