1 # Copyright 2018 ZTE Corporation.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 from lcm.workflows.graphflow.task.async_task import AsyncTask
16 from lcm.workflows.graphflow.task.sync_task import SyncTask
17 from lcm.workflows.graphflow.task.lcm_async_rest_task import LcmASyncRestTask
20 logger = logging.getLogger(__name__)
23 class CreateSynVNF(SyncTask):
24 def __init__(self, *args):
25 super(CreateSynVNF, self).__init__(*args)
28 logger.debug("test CreateSynVNF %s" % self.key)
29 return self.FINISHED, {}
32 class CreateAsynVNF(AsyncTask):
33 def __init__(self, *args):
34 super(CreateAsynVNF, self).__init__(*args)
37 logger.debug("test CreateAsynVNF %s" % self.key)
38 return self.PROCESSING, None
40 def get_ext_status(self):
44 class CreateASynRestVNF(LcmASyncRestTask):
46 def __init__(self, *args):
47 super(CreateASynRestVNF, self).__init__(*args)
48 self.url = "/api/nslcm/v1/vnfs"
49 self.method = self.POST