diff --git a/tackerclient/tacker/v1_0/vm/vnf.py b/tackerclient/tacker/v1_0/vm/vnf.py index 5c0f2eba..12b42e6c 100644 --- a/tackerclient/tacker/v1_0/vm/vnf.py +++ b/tackerclient/tacker/v1_0/vm/vnf.py @@ -61,6 +61,10 @@ class CreateVNF(tackerV10.CreateCommand): parser.add_argument( '--config', help='specify config yaml file') + parser.add_argument( + '--param-file', + help='specify parameter yaml file' + ) def args2body(self, parsed_args): body = {self.resource: {}} @@ -79,6 +83,10 @@ class CreateVNF(tackerV10.CreateCommand): parsed_args.vnfd_name) parsed_args.vnfd_id = _id + if parsed_args.param_file: + with open(parsed_args.param_file) as f: + param_yaml = f.read() + body[self.resource]['param_values'] = param_yaml tackerV10.update_dict(parsed_args, body[self.resource], ['tenant_id', 'name', 'vnfd_id']) diff --git a/tackerclient/v1_0/client.py b/tackerclient/v1_0/client.py index 27d9f5d1..9a91ca16 100644 --- a/tackerclient/v1_0/client.py +++ b/tackerclient/v1_0/client.py @@ -469,6 +469,8 @@ class Client(ClientBase): arg_[key] = arg[key] if 'config' in arg: arg_['attributes'] = {'config': arg['config']} + if 'param_values' in arg: + arg_['attributes'] = {'param_values': arg['param_values']} body_ = {self._DEVICE: arg_} ret = self.create_device(body_) return {self._VNF: ret[self._DEVICE]}