summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
5143e92)
Issue-ID: INF-258
Signed-off-by: Bin Yang <bin.yang@windriver.com>
Change-Id: I8c8891c4236272f273fc66446770e02857728853
# See the License for the specific language governing permissions and\r
# limitations under the License.\r
\r
# See the License for the specific language governing permissions and\r
# limitations under the License.\r
\r
from sqlalchemy import select\r
import uuid\r
from o2common.service import unit_of_work\r
from sqlalchemy import select\r
import uuid\r
from o2common.service import unit_of_work\r
id, input['name'], deploymentManagerId, input['description'],\r
input['inputParams'], input['outputParams'],\r
input['artifactRepoUrl'], input['artifactName'])\r
id, input['name'], deploymentManagerId, input['description'],\r
input['inputParams'], input['outputParams'],\r
input['artifactRepoUrl'], input['artifactName'])\r
+ _nfdeploymentdesc_validate(entity)\r
uow.nfdeployment_descs.add(entity)\r
uow.commit()\r
return id\r
\r
\r
uow.nfdeployment_descs.add(entity)\r
uow.commit()\r
return id\r
\r
\r
+def _nfdeploymentdesc_validate(desc: NfDeploymentDesc):\r
+ try:\r
+ json.loads(\r
+ desc['inputParams']) if desc['inputParams'] else None\r
+ json.loads(\r
+ desc['outputParams']) if desc['outputParams'] else None\r
+ return\r
+ except json.decoder.JSONDecodeError as e:\r
+ logger.debug("NfDeploymentDesc validate error with: %s" % (str(e)))\r
+ raise e\r
+ except Exception as e:\r
+ logger.debug("NfDeploymentDesc validate error with: %s" % (str(e)))\r
+ raise e\r
+\r
+\r
def lcm_nfdeploymentdesc_update(\r
nfdeploymentdescriptorid: str,\r
input: DmsLcmNfDeploymentDescriptorDTO.NfDeploymentDescriptor_update,\r
def lcm_nfdeploymentdesc_update(\r
nfdeploymentdescriptorid: str,\r
input: DmsLcmNfDeploymentDescriptorDTO.NfDeploymentDescriptor_update,\r