contrail icon indicating copy to clipboard operation
contrail copied to clipboard

dynamic fq_name setting based on the parent obj and request json

Open cijohnson opened this issue 7 years ago • 0 comments

Current implementation of vnc api client library, frames fq_name of the object based on the following criteria

  1. parent obj
  2. fq_name set in request body
  3. No parent

we need to do similar thing in go-api-server as well.

code snippet:

if parent_obj: self.parent_type = parent_obj._type # copy parent's fq_name self.fq_name = list(parent_obj.fq_name) self.fq_name.append(name) elif kwargs_parent_type and kwargs_fq_name: self.parent_type = kwargs_parent_type self.fq_name = kwargs_fq_name else: # No parent obj specified self.parent_type = 'project' self.fq_name = [u'default-domain', u'default-project'] self.fq_name.append(name)

cijohnson avatar Feb 20 '18 23:02 cijohnson