Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dynamic fq_name setting based on the parent obj and request json #81

Open
cijohnson opened this issue Feb 20, 2018 · 0 comments
Open

dynamic fq_name setting based on the parent obj and request json #81

cijohnson opened this issue Feb 20, 2018 · 0 comments
Assignees

Comments

@cijohnson
Copy link
Contributor

cijohnson commented Feb 20, 2018

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 cijohnson self-assigned this Feb 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant