aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--catalog/pub/database/models.py47
-rw-r--r--resources/dbscripts/mysql/vfc-nfvo-catalog-createobj.sql91
2 files changed, 48 insertions, 90 deletions
diff --git a/catalog/pub/database/models.py b/catalog/pub/database/models.py
index d53e45f6..5b73d512 100644
--- a/catalog/pub/database/models.py
+++ b/catalog/pub/database/models.py
@@ -15,18 +15,18 @@ from django.db import models
class NSPackageModel(models.Model):
- nsPackageId = models.CharField(db_column='NSPACKAGEID', primary_key=True, max_length=200)
+ nsPackageId = models.CharField(db_column='NSPACKAGEID', primary_key=True, max_length=50)
nsPackageUri = models.CharField(db_column='NSPACKAGEURI', max_length=300, null=True, blank=True)
- checksum = models.CharField(db_column='CHECKSUM', max_length=300, null=True, blank=True) # checksum
- sdcCsarId = models.CharField(db_column='SDCCSARID', max_length=300, null=True, blank=True) # SdcCSARUri
- operationalState = models.TextField(db_column='OPERATIONALSTATE', max_length=20, blank=True,null=True) # operationalState
- usageState = models.TextField(db_column='USAGESTATE', max_length=20, blank=True, null=True) # usageState
- deletionPending = models.TextField(db_column='DELETIONPENDING', max_length=20, blank=True, null=True) # deletionPending
- nsdId = models.CharField(db_column='NSDID', max_length=200)
- nsdName = models.CharField(db_column='NSDNAME', max_length=200)
- nsdDesginer = models.CharField(db_column='NSDDESIGNER', max_length=200, null=True, blank=True)
- nsdDescription = models.CharField(db_column='NSDDESCRIPTION', max_length=200, null=True, blank=True)
- nsdVersion = models.CharField(db_column='NSDVERSION', max_length=200, null=True, blank=True)
+ checksum = models.CharField(db_column='CHECKSUM', max_length=50, null=True, blank=True) # checksum
+ sdcCsarId = models.CharField(db_column='SDCCSARID', max_length=50, null=True, blank=True) # SdcCSARUri
+ operationalState = models.CharField(db_column='OPERATIONALSTATE', max_length=20, blank=True,null=True) # operationalState
+ usageState = models.CharField(db_column='USAGESTATE', max_length=20, blank=True, null=True) # usageState
+ deletionPending = models.CharField(db_column='DELETIONPENDING', max_length=20, blank=True, null=True) # deletionPending
+ nsdId = models.CharField(db_column='NSDID', max_length=50,blank=True, null=True)
+ nsdName = models.CharField(db_column='NSDNAME', max_length=50,blank=True, null=True)
+ nsdDesginer = models.CharField(db_column='NSDDESIGNER', max_length=50, null=True, blank=True)
+ nsdDescription = models.CharField(db_column='NSDDESCRIPTION', max_length=100, null=True, blank=True)
+ nsdVersion = models.CharField(db_column='NSDVERSION', max_length=20, null=True, blank=True)
userDefinedData = models.TextField(db_column='USERDEFINEDDATA', max_length=1024, blank=True, null=True) # userDefinedData
localFilePath = models.CharField(db_column='LOCALFILEPATH', max_length=300, null=True, blank=True)
nsdModel = models.TextField(db_column='NSDMODEL', max_length=65535, null=True, blank=True)
@@ -35,18 +35,18 @@ class NSPackageModel(models.Model):
class VnfPackageModel(models.Model):
#uuid = models.CharField(db_column='UUID', primary_key=True, max_length=255)
- vnfPackageId = models.CharField(db_column='VNFPACKAGEID', max_length=200) #onboardedVnfPkgInfoId
+ vnfPackageId = models.CharField(db_column='VNFPACKAGEID', primary_key=True, max_length=50) #onboardedVnfPkgInfoId
vnfPackageUri = models.CharField(db_column='VNFPACKAGEURI', max_length=300, null=True, blank=True) # downloadUri
SdcCSARUri = models.CharField(db_column='SDCCSARURI', max_length=300, null=True, blank=True) # SdcCSARUri
- checksum = models.CharField(db_column='CHECKSUM', max_length=300, null=True, blank=True) # checksum
- operationalState = models.TextField(db_column='OPERATIONALSTATE', max_length=20, blank=True,null=True) # operationalState
- usageState = models.TextField(db_column='USAGESTATE', max_length=20, blank=True, null=True) # usageState
- deletionPending = models.TextField(db_column='DELETIONPENDING', max_length=20, blank=True, null=True) # deletionPending
- vnfdId = models.CharField(db_column='VNFDID', max_length=255) #vnfdId
- vnfVendor = models.CharField(db_column='VENDOR', max_length=255) # vnfProvider
- vnfdProductName = models.CharField(db_column='vnfdProductName', max_length=200) #vnfProductName
- vnfdVersion = models.CharField(db_column='VNFDVERSION', max_length=255) #vnfdVersion
- vnfSoftwareVersion = models.CharField(db_column='VNFSOFTWAREVERSION', max_length=255) #vnfSoftwareVersion
+ checksum = models.CharField(db_column='CHECKSUM', max_length=50, null=True, blank=True) # checksum
+ operationalState = models.CharField(db_column='OPERATIONALSTATE', max_length=20, blank=True,null=True) # operationalState
+ usageState = models.CharField(db_column='USAGESTATE', max_length=20, blank=True, null=True) # usageState
+ deletionPending = models.CharField(db_column='DELETIONPENDING', max_length=20, blank=True, null=True) # deletionPending
+ vnfdId = models.CharField(db_column='VNFDID', max_length=50,blank=True, null=True) #vnfdId
+ vnfVendor = models.CharField(db_column='VENDOR', max_length=50,blank=True, null=True) # vnfProvider
+ vnfdProductName = models.CharField(db_column='VNFDPRODUCTNAME', max_length=50,blank=True, null=True) #vnfProductName
+ vnfdVersion = models.CharField(db_column='VNFDVERSION', max_length=20,blank=True, null=True) #vnfdVersion
+ vnfSoftwareVersion = models.CharField(db_column='VNFSOFTWAREVERSION', max_length=20,blank=True, null=True) #vnfSoftwareVersion
userDefinedData = models.TextField(db_column='USERDEFINEDDATA', max_length=1024, blank=True, null=True) # userDefinedData
localFilePath = models.CharField(db_column='LOCALFILEPATH', max_length=300, null=True, blank=True)
vnfdModel = models.TextField(db_column='VNFDMODEL', max_length=65535, blank=True, null=True) # vnfd
@@ -55,7 +55,7 @@ class VnfPackageModel(models.Model):
class SoftwareImageModel(models.Model):
- id = models.AutoField(db_column='ID', primary_key=True)
+ imageid = models.CharField(db_column='IMAGEID', primary_key=True, max_length=50)
diskFormat = models.CharField(db_column='DISKFORMAT', max_length=10)
containerFormat = models.CharField(db_column='CONTAINERFORMAT', max_length=20)
diskFormat = models.CharField(db_column='DISKFORMAT', max_length=20)
@@ -63,9 +63,8 @@ class SoftwareImageModel(models.Model):
minram = models.CharField(db_column='MINRAM', max_length=20)
usermetadata = models.CharField(db_column='USAERMETADATA', max_length=1024)
vnfPackageId = models.CharField(db_column='VNFPACKAGEID', max_length=50)
- filePath = models.CharField(db_column='FILEPATH', max_length=100)
+ filePath = models.CharField(db_column='FILEPATH', max_length=300)
status = models.CharField(db_column='STATUS', max_length=10)
- imageid = models.CharField(db_column='IMAGEID', max_length=50)
vimid = models.CharField(db_column='VIMID', max_length=50)
#filetype = models.CharField(db_column='FILETYPE', max_length=2)
#vimuser = models.CharField(db_column='VIMUSER', max_length=50)
diff --git a/resources/dbscripts/mysql/vfc-nfvo-catalog-createobj.sql b/resources/dbscripts/mysql/vfc-nfvo-catalog-createobj.sql
index 6aba3eee..34130acb 100644
--- a/resources/dbscripts/mysql/vfc-nfvo-catalog-createobj.sql
+++ b/resources/dbscripts/mysql/vfc-nfvo-catalog-createobj.sql
@@ -16,70 +16,29 @@
use nfvocatalog;
-DROP TABLE IF EXISTS NFVO_JOB;
-CREATE TABLE NFVO_JOB (
- `JOBID` varchar(255) NOT NULL PRIMARY KEY,
- `JOBTYPE` varchar (255) NOT NULL,
- `JOBACTION` varchar(255) NOT NULL,
- `RESID` varchar(255) NOT NULL,
- `STATUS` integer NULL,
- `STARTTIME` varchar(255) NULL,
- `ENDTIME` varchar(255) NULL,
- `PROGRESS` integer NULL,
- `USER` varchar(255) NULL,
- `PARENTJOBID` varchar(255) NULL,
- `RESNAME` varchar(255) NULL
-);
-
-DROP TABLE IF EXISTS NFVO_JOB_STATUS;
-CREATE TABLE NFVO_JOB_STATUS (
- `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
- `INDEXID` integer NOT NULL,
- `JOBID` varchar(255) NOT NULL,
- `STATUS` varchar(255) NOT NULL,
- `PROGRESS` integer NULL,
- `DESCP` longtext NOT NULL,
- `ERRCODE` varchar(255) NULL,
- `ADDTIME` varchar(255) NULL
-);
-
-
-DROP TABLE IF EXISTS NFVO_NFPACKAGE;
-CREATE TABLE NFVO_NFPACKAGE (
- `UUID` varchar(255) NOT NULL PRIMARY KEY,
- `NFPACKAGEID` varchar(200) NOT NULL,
- `VNFDID` varchar(255) NOT NULL,
- `VENDOR` varchar(255) NOT NULL,
- `VNFDVERSION` varchar(255) NOT NULL,
- `VNFVERSION` varchar(255) NOT NULL,
- `VNFDMODEL` longtext NULL,
- `VNFDPATH` varchar(300) NULL
-);
-
-DROP TABLE IF EXISTS NFVO_NSPACKAGE;
-CREATE TABLE NFVO_NSPACKAGE (
- `ID` varchar(200) NOT NULL PRIMARY KEY,
- `NSDID` varchar(200) NOT NULL,
- `NAME` varchar(200) NOT NULL,
- `VENDOR` varchar(200) NULL,
- `DESCRIPTION` varchar(200) NULL,
- `VERSION` varchar(200) NULL,
- `NSDMODEL` longtext NULL,
- `NSDPATH` varchar(300) NULL
-);
-
-
-DROP TABLE IF EXISTS NFVO_NFPACKAGEFILE;
-CREATE TABLE NFVO_NFPACKAGEFILE (
- `ID` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
- `NFPACKAGEID` varchar(50) NOT NULL,
- `FILENAME` varchar(100) NOT NULL,
- `FILETYPE` varchar(2) NOT NULL,
- `IMAGEID` varchar(50) NOT NULL,
- `VIMID` varchar(50) NOT NULL,
- `VIMUSER` varchar(50) NOT NULL,
- `TENANT` varchar(50) NOT NULL,
- `PURPOSE` varchar(1000) NOT NULL,
- `STATUS` varchar(10) NOT NULL
-);
+DROP TABLE IF EXISTS CATALOG_JOB;
+DROP TABLE IF EXISTS CATALOG_JOB_STATUS;
+DROP TABLE IF EXISTS CATALOG_NSPACKAGE;
+DROP TABLE IF EXISTS CATALOG_SOFTWAREIMAGEMODEL;
+DROP TABLE IF EXISTS CATALOG_VNFPACKAGE;
+--
+-- Create model JobModel
+--
+CREATE TABLE `CATALOG_JOB` (`JOBID` varchar(255) NOT NULL PRIMARY KEY, `JOBTYPE` varchar(255) NOT NULL, `JOBACTION` varchar(255) NOT NULL, `RESID` varchar(255) NOT NULL, `STATUS` integer NULL, `STARTTIME` varchar(255) NULL, `ENDTIME` varchar(255) NULL, `PROGRESS` integer NULL, `USER` varchar(255) NULL, `PARENTJOBID` varchar(255) NULL, `RESNAME` varchar(255) NULL);
+--
+-- Create model JobStatusModel
+--
+CREATE TABLE `CATALOG_JOB_STATUS` (`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, `INDEXID` integer NOT NULL, `JOBID` varchar(255) NOT NULL, `STATUS` varchar(255) NOT NULL, `PROGRESS` integer NULL, `DESCP` longtext NOT NULL, `ERRCODE` varchar(255) NULL, `ADDTIME` varchar(255) NULL);
+--
+-- Create model NSPackageModel
+--
+CREATE TABLE `CATALOG_NSPACKAGE` (`NSPACKAGEID` varchar(50) NOT NULL PRIMARY KEY, `NSPACKAGEURI` varchar(300) NULL, `CHECKSUM` varchar(50) NULL, `SDCCSARID` varchar(50) NULL, `OPERATIONALSTATE` varchar(20) NULL, `USAGESTATE` varchar(20) NULL, `DELETIONPENDING` varchar(20) NULL, `NSDID` varchar(50) NULL, `NSDNAME` varchar(50) NULL, `NSDDESIGNER` varchar(50) NULL, `NSDDESCRIPTION` varchar(100) NULL, `NSDVERSION` varchar(20) NULL, `USERDEFINEDDATA` longtext NULL, `LOCALFILEPATH` varchar(300) NULL, `NSDMODEL` longtext NULL);
+--
+-- Create model SoftwareImageModel
+--
+CREATE TABLE `CATALOG_SOFTWAREIMAGEMODEL` (`IMAGEID` varchar(50) NOT NULL PRIMARY KEY, `CONTAINERFORMAT` varchar(20) NOT NULL, `DISKFORMAT` varchar(20) NOT NULL, `MINDISK` varchar(20) NOT NULL, `MINRAM` varchar(20) NOT NULL, `USAERMETADATA` varchar(1024) NOT NULL, `VNFPACKAGEID` varchar(50) NOT NULL, `FILEPATH` varchar(300) NOT NULL, `STATUS` varchar(10) NOT NULL, `VIMID` varchar(50) NOT NULL);
+--
+-- Create model VnfPackageModel
+--
+CREATE TABLE `CATALOG_VNFPACKAGE` (`VNFPACKAGEID` varchar(50) NOT NULL PRIMARY KEY, `VNFPACKAGEURI` varchar(300) NULL, `SDCCSARURI` varchar(300) NULL, `CHECKSUM` varchar(50) NULL, `OPERATIONALSTATE` varchar(20) NULL, `USAGESTATE` varchar(20) NULL, `DELETIONPENDING` varchar(20) NULL, `VNFDID` varchar(50) NULL, `VENDOR` varchar(50) NULL, `VNFDPRODUCTNAME` varchar(50) NULL, `VNFDVERSION` varchar(20) NULL, `VNFSOFTWAREVERSION` varchar(20) NULL, `USERDEFINEDDATA` longtext NULL, `LOCALFILEPATH` varchar(300) NULL, `VNFDMODEL` longtext NULL);