Commit ecf83caa authored by Mudassar Khan's avatar Mudassar Khan
Browse files

add all of uri related to OCF

parent 13d2023b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -213,7 +213,7 @@ func Run() (err error) {
		}
		// Register CAPIF as a MEC service once onboarded
		cfg := capifClient.GetConfig()
		sm.RegisterCapifService(cfg.CapifHostname, cfg.RegisterPort)
		sm.RegisterCapifService(cfg.CapifHostname, cfg.RegisterPort, cfg.CapifPort)
	}()

	// Start Swagger API Manager (provider)
+7 −3
Original line number Diff line number Diff line
@@ -1807,13 +1807,17 @@ func deleteCapifMapping(localId string) {
// Called during scenario termination / service shutdown.
// RegisterCapifService registers the CAPIF Register API as a MEC service in MEC011.
// capifHostname is CAPIF_HOSTNAME and capifRegisterPort is CAPIF_REGISTER_PORT.
func RegisterCapifService(capifHostname string, capifRegisterPort string) {
func RegisterCapifService(capifHostname string, capifRegisterPort string, capifPort string) {
	if capifClient == nil || !capifClient.IsReady() {
		log.Warn("Cannot register CAPIF service: CAPIF client not ready")
		return
	}
	//TODO: Append all of the endpoints which are required for the CCF discovery process, currently only the createUser endpoint is added for simplicity.
	// Register endpoints: login/createUser/getAuth use CAPIF_REGISTER_PORT, discover/onboard use CAPIF_PORT
	login_url := "https://" + capifHostname + ":" + capifRegisterPort + "/login"
	createUserUrl := "https://" + capifHostname + ":" + capifRegisterPort + "/createUser"
	getAuthUrl := "https://" + capifHostname + ":" + capifRegisterPort + "/getauth"
	discover_url := "https://" + capifHostname + ":" + capifPort + "/discover"
	onboarding_url := "https://" + capifHostname + ":" + capifPort + "/onboard"
	state := ACTIVE_ServiceState
	tType := REST_HTTP_TransportType
	serializer := JSON
@@ -1838,7 +1842,7 @@ func RegisterCapifService(capifHostname string, capifRegisterPort string) {
			Version:  "2.0",
			Endpoint: &OneOfTransportInfoEndpoint{
				EndPointInfoUris: EndPointInfoUris{
					Uris: []string{createUserUrl},
					Uris: []string{login_url, createUserUrl, getAuthUrl, discover_url, onboarding_url},
				},
			},
			Security: &SecurityInfo{},