[gerrit]
host=gerrit.onap.org
port=29418
-project=vfc/gvnfm/vnflcm
\ No newline at end of file
+project=vfc/gvnfm/vnflcm
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
-# limitations under the License.
\ No newline at end of file
+# limitations under the License.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+
import logging
from lcm.pub.utils.jobutil import JobUtil
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+
from django.test import TestCase, Client
from rest_framework import status
JobModel(jobid=self.job_id, jobtype='VNF', jobaction='INST', resid='1').save()
JobStatusModel(indexid=1, jobid=self.job_id, status='inst', progress=20, descp='inst').save()
response = self.client.get("/api/vnflcm/v1/vnf_lc_ops/%s?responseId=123456jhj" % self.job_id)
- self.failUnlessEqual(status.HTTP_200_OK, response.status_code)
\ No newline at end of file
+ self.failUnlessEqual(status.HTTP_200_OK, response.status_code)
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+
from django.conf.urls import patterns, url
from rest_framework.urlpatterns import format_suffix_patterns
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+
import logging
from rest_framework.response import Response
"flavourId": "flavour_1",
"instantiationLevelId": "instantiationLevel_1",
"extVirtualLinks": [
- # {
- # "vlInstanceId": "1",
- # "vim": {
- # "vimInfoId": "1",
- # "vimId": "1",
- # "interfaceInfo": {
- # "vimType": "vim",
- # "apiVersion": "v2",
- # "protocolType": "http"
- # },
- # "accessInfo": {
- # "tenant": "tenant_vCPE",
- # "username": "vCPE",
- # "password": "vCPE_321"
- # },
- # "interfaceEndpoint": "http://10.43.21.105:80/"
- # },
- # "resourceId": "1246",
- # "extCps": [
- # {
- # "cpdId": "11",
- # "addresses": [
- # {
- # "addressType": "MAC",
- # "l2AddressData": "00:f3:43:20:a2:a3"
- # },
- # {
- # "addressType": "IP",
- # "l3AddressData": {
- # "iPAddressType": "IPv4",
- # "iPAddress": "192.168.104.2"
- # }
- # }
- # ],
- # "numDynamicAddresses": 0
- # }
- # ]
- # },
+ {
+ "vlInstanceId": "1",
+ "vim": {
+ "vimInfoId": "1",
+ "vimId": "1",
+ "interfaceInfo": {
+ "vimType": "vim",
+ "apiVersion": "v2",
+ "protocolType": "http"
+ },
+ "accessInfo": {
+ "tenant": "tenant_vCPE",
+ "username": "vCPE",
+ "password": "vCPE_321"
+ },
+ "interfaceEndpoint": "http://10.43.21.105:80/"
+ },
+ "resourceId": "1246",
+ "extCps": [
+ {
+ "cpdId": "11",
+ "addresses": [
+ {
+ "addressType": "MAC",
+ "l2AddressData": "00:f3:43:20:a2:a3"
+ },
+ {
+ "addressType": "IP",
+ "l3AddressData": {
+ "iPAddressType": "IPv4",
+ "iPAddress": "192.168.104.2"
+ }
+ }
+ ],
+ "numDynamicAddresses": 0
+ }
+ ]
+ },
{
"vlInstanceId": '55',
"resourceId": '55_network',
}
],
"localizationLanguage": "en_US",
- "additionalParams": {"inputs": {"key1":"test1","key2":"test2"},
- "extVirtualLinks": [{
- "vlInstanceId": '55',
- "resourceId": '55_network',
- "resourceSubnetId": '55_subnet',
- "cpdId": 'cpId1',
- "vim": {
- "vimid": '55_vimid'
- }
- }]}
+ "additionalParams": {
+ "inputs": {
+ "key1": "test1",
+ "key2": "test2"
+ },
+ "extVirtualLinks": [
+ {
+ "vlInstanceId": '55',
+ "resourceId": '55_network',
+ "resourceSubnetId": '55_subnet',
+ "cpdId": 'cpId1',
+ "vim": {
+ "vimid": '55_vimid'
+ }
+ }
+ ]
+ }
}
DeleteVnfAndQueryVnf.as_view()),
url(r'^api/vnflcm/v1/vnf_instances/(?P<instanceid>[0-9a-zA-Z_-]+)/terminate$',
TerminateVnf.as_view()),
- url(r'^api/vnflcm/v1/swagger.json$', SwaggerJsonView.as_view()),
+ url(r'^api/vnflcm/v1/swagger.json$', SwaggerJsonView.as_view())
)
urlpatterns = format_suffix_patterns(urlpatterns)
# See the License for the specific language governing permissions and
# limitations under the License.
-import os
-
# [MSB]
MSB_SERVICE_IP = '127.0.0.1'
MSB_SERVICE_PORT = '80'
AAI_PASSWORD = "AAI"
REPORT_TO_AAI = True
-
# [REDIS]
REDIS_HOST = '127.0.0.1'
REDIS_PORT = '6379'
vnfConfigurableProperties = models.TextField(db_column='VNFCONFIGURABLEPROPERTIES', max_length=20000, blank=True, null=True)
localizationLanguage = models.CharField(db_column='LOCALIZATIONLANGUAGE', max_length=255, null=True)
+
class JobModel(models.Model):
class Meta:
db_table = 'JOB'
import json
return json.dumps(dict([(attr, getattr(self, attr)) for attr in [f.name for f in self._meta.fields]]))
+
class JobStatusModel(models.Model):
class Meta:
db_table = 'JOB_STATUS'
import json
return json.dumps(dict([(attr, getattr(self, attr)) for attr in [f.name for f in self._meta.fields]]))
+
class NfvoRegInfoModel(models.Model):
class Meta:
db_table = 'NFVOREGINFO'
servercert = models.CharField(max_length=255, db_column='SERVERCERT', null=True)
regtime = models.CharField(max_length=255, db_column='REGTIME')
+
class StorageInstModel(models.Model):
class Meta:
db_table = 'STORAGEINST'
create_time = models.CharField(db_column='CREATETIME', max_length=200, null=True, blank=True)
nodeId = models.CharField(db_column='NODEID', max_length=255, null=True)
+
class VmInstModel(models.Model):
class Meta:
db_table = 'VMINST'
instid = models.CharField(db_column='INSTID', max_length=255)
nodeId = models.CharField(db_column='NODEID', max_length=255, null=True)
+
class VNFCInstModel(models.Model):
class Meta:
db_table = 'VNFCINST'
vmid = models.CharField(db_column='VMID', max_length=255)
is_predefined = models.IntegerField(db_column='ISPREDEFINED', default=0, null=True)
+
class FlavourInstModel(models.Model):
class Meta:
db_table = 'FLAVOURINST'
create_time = models.CharField(db_column='CREATETIME', max_length=200, null=True, blank=True)
is_predefined = models.IntegerField(db_column='ISPREDEFINED', default=0, null=True)
+
class NetworkInstModel(models.Model):
class Meta:
db_table = 'NETWORKINST'
routerExternal = models.IntegerField(db_column='ROUTEREXTERNAL', default=0, null=True)
nodeId = models.CharField(db_column='NODEID', max_length=255, null=True)
+
class SubNetworkInstModel(models.Model):
class Meta:
db_table = 'SUBNETWORKINST'
hostRoutes = models.TextField(db_column='HOSTROUTES', max_length=1024)
allocationPools = models.TextField(db_column='ALLOCATIONPOOLS', max_length=1024)
+
class VLInstModel(models.Model):
class Meta:
db_table = 'VLINST'
vimid = models.CharField(db_column='VIMID', max_length=255)
tenant = models.CharField(db_column='TENANT', max_length=50)
+
class PortInstModel(models.Model):
class Meta:
db_table = 'PORTINST'
is_predefined = models.IntegerField(db_column='ISPREDEFINED', default=0, null=True)
nodeId = models.CharField(db_column='NODEID', max_length=255, null=True)
+
class CPInstModel(models.Model):
class Meta:
db_table = 'CPINST'
# See the License for the specific language governing permissions and
# limitations under the License.
-
class NFLCMException(Exception):
pass
def get_packageinfo_by_vnfdid(vnfdid):
- ret = req_by_msb("api/gvnfmdriver/v1/vnfpackages", "GET") # TODO
+ ret = req_by_msb("api/gvnfmdriver/v1/vnfpackages", "GET")
if ret[0] != 0:
logger.error("Status code is %s, detail is %s.", ret[2], ret[1])
raise NFLCMException("Failed to query package_info of vnfdid(%s) from nslcm." % vnfdid)
return args[old_key]
return def_val
+
def set_opt_val(param, key, val):
if val or val is False:
param[key] = val
+
def get_none(val, def_val=""):
return val if val else def_val
+
def get_boolean(val, def_val=0):
return 1 if val else 0
+
def get_integer(val, def_val=0):
return val if val else 0
# See the License for the specific language governing permissions and
# limitations under the License.
-
import os
from django.core.wsgi import get_wsgi_application