/*
- * Copyright (C) 2017 "IoT.bzh"
+ * Copyright (C) 2017-2018 "IoT.bzh"
* Author Sebastien Douheret <sebastien@iot.bzh>
*
* Licensed under the Apache License, Version 2.0 (the "License");
import (
"net/http"
+ common "gerrit.automotivelinux.org/gerrit/src/xds/xds-common.git"
+ "gerrit.automotivelinux.org/gerrit/src/xds/xds-server.git/lib/xsapiv1"
"github.com/gin-gonic/gin"
- common "github.com/iotbzh/xds-common/golib"
- "github.com/iotbzh/xds-server/lib/xsapiv1"
)
// getSdks returns all SDKs configuration
return
}
+ //increment lock xds counter: it will be decremented,
+ //when SDK is installed in file sdk.go in function ExitCB
+ //at line 308 or when install is aborted in following function
+ LockXdsUpdateCounter(s.Context, true)
sdk, err := s.sdks.Install(id, args.Filename, args.Force, args.Timeout, args.InstallArgs, sess)
if err != nil {
+ LockXdsUpdateCounter(s.Context, false)
common.APIError(c, err.Error())
return
}
return
}
+ LockXdsUpdateCounter(s.Context, false)
c.JSON(http.StatusOK, sdk)
}
s.Log.Debugln("Remove SDK id ", id)
+ LockXdsUpdateCounter(s.Context, true)
delEntry, err := s.sdks.Remove(id, -1, sess)
if err != nil {
common.APIError(c, err.Error())
return
}
+ LockXdsUpdateCounter(s.Context, false)
c.JSON(http.StatusOK, delEntry)
}