8000 Add functionality for tierLicenseCapacity on sites by jorwoods · Pull Request #778 · tableau/server-client-python · GitHub
[go: up one dir, main page]

Skip to content

Add functionality for tierLicenseCapacity on sites #778

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

Conversation

jorwoods
Copy link
Contributor

This adds support to the SiteItems to allow it to be used to manage the license level specific counts.

@jorwoods jorwoods force-pushed the jorwoods/site_tiered_capacity branch from 6420e07 to 44ef0ed Compare January 19, 2021 18:16
@jorwoods jorwoods force-pushed the jorwoods/site_tiered_capacity branch from 44ef0ed to f124b9f Compare January 19, 2021 19:50
Copy link
Collaborator
@t8y8 t8y8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@shinchris
Copy link
Contributor

#777 covers tierLicenseCapacity support, though it doesn't include the property_is_int annotation and user-quota limitation. Do you mind waiting until that one is checked in?

Also I think the integer annotation on these are a bit tricky - I'm not sure if there is a limit to the value and -1 is a valid value to indicate reset

@jorwoods
Copy link
Contributor Author
jorwoods commented Feb 2, 2021

This can wait until #777 is in. I don't like having the hardcoded upper bound in there either. I can replace it with a sys.maxsize and replace the lower limit with -1.

@shinchris
Copy link
Contributor

That works! I would keep the lower limit at 0 and pass in -1 as the allowed parameter, to keep it consistent with how it's done in request_options.py.

@jorwoods
Copy link
Contributor Author
jorwoods commented Feb 2, 2021

@shinchris Question regarding the -1 to indicate reset: I had tested on my own server by passing None to the tiered capacities when I wanted to remove them. Should it be -1 instead? It seems that unittest doesn't like trying to evaluate a range with sys.maxsize as a bound (even though via ipython it has the same run time as any other range evaluation). I had to add a range to property_is_int to be able to add None to the allowed kwarg.

If you think it should be able to accept None, I can either:

  1. Modify property_is_int to evaluate in a different order to be able to remove the range restriction,
  2. Add a nullable_int type checker
  3. Remove None as an acceptable value, and change the check against user quota

@jorwoods jorwoods force-pushed the jorwoods/site_tiered_capacity branch from 56c8ceb to f41a717 Compare February 3, 2021 16:05
@shinchris
Copy link
Contributor

@jorwoods I think it should be -1 instead. Passing in None does remove the tier capacity limits, but it must be all 3 tiers at the same time. For example, if you just wanted to set tierViewerCapacity back to its default, you need to pass in -1 for that one value. Setting just the 1 tier to None (omitted from api request) will not be accepted by server.

For the property_is_int decorator, perhaps we can make it handle a no-max range. If the max value in the tuple is None or some specific value, we don't check the upper bound.

@@ -67,6 +67,14 @@ def update(self, site_item):
error = 'You cannot set admin_mode to ContentOnly and also set a user quota'
raise ValueError(error)

reset = (None, -1,)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this variable named "reset"? It could have always been empty, right?

@jorwoods jorwoods closed this Oct 10, 2021
@jorwoods jorwoods deleted the jorwoods/site_tiered_capacity branch March 25, 2022 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0