device, vnf: name column support
Change-Id: Idfe5dc951b0cac24e5c5a8997d5c0bf2b2b976e4
This commit is contained in:
@@ -48,6 +48,9 @@ class CreateDevice(tackerV10.CreateCommand):
|
|||||||
resource = _DEVICE
|
resource = _DEVICE
|
||||||
|
|
||||||
def add_known_arguments(self, parser):
|
def add_known_arguments(self, parser):
|
||||||
|
parser.add_argument(
|
||||||
|
'--name',
|
||||||
|
help='Set a name for the devicef')
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--device-template-id',
|
'--device-template-id',
|
||||||
required=True,
|
required=True,
|
||||||
|
@@ -45,6 +45,9 @@ class CreateVNF(tackerV10.CreateCommand):
|
|||||||
resource = _VNF
|
resource = _VNF
|
||||||
|
|
||||||
def add_known_arguments(self, parser):
|
def add_known_arguments(self, parser):
|
||||||
|
parser.add_argument(
|
||||||
|
'--name',
|
||||||
|
help='Set a name for the vnf')
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--vnfd-id',
|
'--vnfd-id',
|
||||||
required=True,
|
required=True,
|
||||||
@@ -66,7 +69,7 @@ class CreateVNF(tackerV10.CreateCommand):
|
|||||||
body[self.resource]['config'] = parsed_args.config
|
body[self.resource]['config'] = parsed_args.config
|
||||||
|
|
||||||
tackerV10.update_dict(parsed_args, body[self.resource],
|
tackerV10.update_dict(parsed_args, body[self.resource],
|
||||||
['tenant_id', 'vnfd_id'])
|
['tenant_id', 'name', 'vnfd_id'])
|
||||||
return body
|
return body
|
||||||
|
|
||||||
|
|
||||||
|
@@ -461,8 +461,9 @@ class Client(ClientBase):
|
|||||||
arg_ = {
|
arg_ = {
|
||||||
'template_id': arg['vnfd_id'],
|
'template_id': arg['vnfd_id'],
|
||||||
}
|
}
|
||||||
if 'tenant_id' in arg:
|
for key in ('tenant_id', 'name'):
|
||||||
arg_['tenant_id'] = arg['tenant_id']
|
if key in arg:
|
||||||
|
arg_[key] = arg[key]
|
||||||
if 'config' in arg:
|
if 'config' in arg:
|
||||||
arg_['attributes'] = {'config': arg['config']}
|
arg_['attributes'] = {'config': arg['config']}
|
||||||
body_ = {self._DEVICE: arg_}
|
body_ = {self._DEVICE: arg_}
|
||||||
|
Reference in New Issue
Block a user