TermVnf(data, nf_inst_id=self.nf_inst_id, job_id=self.job_id).run()
self.assert_job_result(self.job_id, 255, "VnfInst(%s) does not exist" % self.nf_inst_id)
"""
-"""
+'''
@mock.patch.object(restcall, 'call_req')
@mock.patch.object(api, 'call')
def test_terminate_vnf_success(self, mock_call, mock_call_req):
JobUtil.add_job_status(self.job_id, 0, "INST_VNF_READY")
TermVnf(data, nf_inst_id=self.nf_inst_id, job_id=self.job_id).run()
self.assert_job_result(self.job_id, 100, "Terminate Vnf success.")
-"""
+'''
# limitations under the License.
import logging
+from lcm.pub.aaiapi.aai import call_aai
+from lcm.pub.config.config import AAI_BASE_URL
from lcm.pub.database.models import NfInstModel, NfvoRegInfoModel
-from lcm.pub.exceptions import NFLCMException
logger = logging.getLogger(__name__)
# raise NFLCMException("Don't allow to delete vnf(status:[%s])" % sel_vnf.status)
NfInstModel.objects.filter(nfinstid=self.nf_inst_id).delete()
NfvoRegInfoModel.objects.filter(nfvoid=self.nf_inst_id).delete()
+
+ def delete_data_from_aai(self, req_data):
+ full_url = AAI_BASE_URL + "api/aai-service-design-and-creation/v1/%s" % self.nf_inst_id
+ del_result = call_aai(full_url, "DELETE", req_data)
+ pass
\ No newline at end of file
--- /dev/null
+# Copyright 2017 ZTE Corporation.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# 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.
--- /dev/null
+# Copyright 2017 ZTE Corporation.\r
+#\r
+# Licensed under the Apache License, Version 2.0 (the "License");\r
+# you may not use this file except in compliance with the License.\r
+# You may obtain a copy of the License at\r
+#\r
+# http://www.apache.org/licenses/LICENSE-2.0\r
+#\r
+# Unless required by applicable law or agreed to in writing, software\r
+# distributed under the License is distributed on an "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+# See the License for the specific language governing permissions and\r
+# limitations under the License.\r
+\r
+def call_aai(full_url, method, req_data):\r
+ pass
\ No newline at end of file
MSB_SERVICE_IP = '127.0.0.1'
MSB_SERVICE_PORT = '80'
+# [AAI]
+AAI_SERVICE_IP = '127.0.0.1'
+AAI_SERVICE_PORT = '8443'
+AAI_BASE_URL = "https://%s:%s/" % (AAI_SERVICE_IP, AAI_SERVICE_PORT)
+
# [REDIS]
REDIS_HOST = '127.0.0.1'
REDIS_PORT = '6379'