8000 Update a group · Issue #277 · tableau/server-client-python · GitHub
[go: up one dir, main page]

Skip to content

Update a group #277

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

Closed
sotnich opened this issue Mar 15, 2018 · 10 comments
Closed

Update a group #277

sotnich opened this issue Mar 15, 2018 · 10 comments

Comments

@sotnich
Copy link
Contributor
sotnich commented Mar 15, 2018

What about method Update group?
There is no one in groups_endpoind.
I can create a PR if needed.

@t8y8
Copy link
Collaborator
t8y8 commented Mar 15, 2018

We'd be happy to take a look at a PR.

I suspect the reason it wasn't added was because it's a little complex with AD vs Local auth Servers.

Could you post your proposed API design (Signatures in both cases, maybe types) here before you spend too much time building out a PR?

@sotnich
Copy link
Contributor Author
sotnich commented Mar 16, 2018

I think that I need to add function update to groups_endpoint.py:

def update(self, group_item, default_site_role=UserItem.Roles.Unlicensed):
  url = "{0}/{1}".format(self.baseurl, group_item.id)
  update_req = RequestFactory.Group.update_req(group_item, default_site_role)
  server_response = self.put_request(url, update_req)
  logger.info('Updated group item (ID: {0})'.format(group_item.id))

@sotnich
Copy link
Contributor Author
sotnich commented Mar 16, 2018

And define in request_factiory.GroupRequest something like this:

def update_req(self, group_item, default_site_role):
  xml_request = ET.Element('tsRequest')
  group_element = ET.SubElement(xml_request, 'group')
  group_element.attrib['name'] = group_item.name
  if group_item.domain_name != 'local':
    project_element = ET.SubElement(group_element, 'import')
    project_element.attrib['source'] = "ActiveDirectory"
    project_element.attrib['domainName'] = group_item.domain_name
    project_element.attrib['siteRole'] = default_site_role
  return ET.tostring(xml_request)

@sotnich
Copy link
Contributor Author
sotnich commented Mar 20, 2018

@t8y8, what would you say about my design?
I'm ready to make a PR)

@t8y8
Copy link
Collaborator
t8y8 commented Mar 21, 2018

I'm on vacation so this is just a quick glance but it looks like a reasonable direction!

We want the request to be able to handle the local auth case as well... (I'm a but fuzzy on details for what that case even allows...) Any ideas there?

@t8y8
Copy link
Collaborator
t8y8 commented Mar 21, 2018

Ignore that last comment. Your code handles that.

Would you be able to implement the j 8000 obId and status tracking code as well (I think it's ok if that's a second PR, but wondering if you'd like to)

@sotnich
Copy link
Contributor Author
sotnich commented Mar 21, 2018

@t8y8, ok, sure, no problem, I'll implement jobId and status!

@t8y8
Copy link
Collaborator
t8y8 commented Mar 21, 2018

Cool, thanks!

You should implement the "synchronous" case first and submit a PR, then do the jobId stuff in a second PR, I suspect it would require more discussion/iteration so may as well land the other stuff first.

@sotnich
Copy link
Contributor Author
sotnich commented Mar 23, 2018

Created #279

@irwando
Copy link
Contributor
irwando commented Jul 25, 2019

Closing as the merge was completed.

@irwando irwando closed this as completed Jul 25, 2019
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

3 participants
0