You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Code:
with ZIA(api_key=api_key, cloud=cloud, username=username, password=password) as zia:
end = 0
out = [] #100 record per call limit
while end <= len(Qurl()):
start = end
end=end+100
print("POSITION:%s:%s" % (start,end))
result = zia.url_categories.delete_urls_from_category('CUSTOM_30',urls=Qurl()[start:end])
out.append(result)
else:
print("POSITION:%s:%s" % (5900,5921))
result = zia.url_categories.delete_urls_from_category('CUSTOM_30', urls=Qurl()[5900:5921])
out.append(result)
URL in "Custom URLs" reserved.
The text was updated successfully, but these errors were encountered:
I'll take a look at this tonight to try and replicate first and then look at what we need to do to get a fix in place. Seeing as this is breaking functionality as far as I'm concerned, you can expect a fix release as soon as it's resolved.
@shuangqingliCN I was able to replicate this successfully and I've fixed this issue in the zia.url_categories.delete_urls_from_category() method.
I've also implemented a new endpoint zia.url_categories.delete_from_category() that allows you to specify any combination of the following for removal:
keywords
keywords retaining parent category
urls
urls retaining parent category
I think you'll find this a more flexible solution going forward so I'll likely look to deprecate the delete_urls_from_category() method.
This is already in the develop branch, so you're welcome to pull that branch directly to test but I have two other bugs that are quick fixes that I want to slot into the next release so I'll push this fix back with them. I should have it out in 2-3 days.
mitchos
changed the title
zia.url_categories.delete_urls_from_category will empty urls in "URLs Retaining Parent Category"
[BUG] zia.url_categories.delete_urls_from_category will empty urls in "URLs Retaining Parent Category"
Feb 20, 2023
… custom category fields
feat: implements a new ZIA URL category method that allows selective deletion of URLs and keywords
test: updates test suite and adds new test
v 1.4
Tested in:
zscaler
zscalerbeta
Code:
with ZIA(api_key=api_key, cloud=cloud, username=username, password=password) as zia:
end = 0
out = []
#100 record per call limit
while end <= len(Qurl()):
start = end
end=end+100
print("POSITION:%s:%s" % (start,end))
result = zia.url_categories.delete_urls_from_category('CUSTOM_30',urls=Qurl()[start:end])
out.append(result)
else:
print("POSITION:%s:%s" % (5900,5921))
result = zia.url_categories.delete_urls_from_category('CUSTOM_30', urls=Qurl()[5900:5921])
out.append(result)
URL in "Custom URLs" reserved.
The text was updated successfully, but these errors were encountered: