[Conflence] List for the names of all confluence spaces
Hi, Thanks for the project !!! Is it possible to get list of names of all spaces in confluence. I could not find the function for this.
I think we should block this account. But, just for clarification. I thought of this solution, too, but it takes unnecessarily long since it downloads the entire space content instead of just the space name, which is exactly what I want.
Edit: There was a bot spamming PR in response to issues, which now seems to be banned (Good Job Github Support Team !!!!)
So, I want to only the names to be downloaded
It turns oout that there is an endpoint that gives this: ``../rest/spacedirectory/1/search"`. If you want I can implement PR for this.
def get_spaces(confluence, url:str):
spaces = confluence.get_all_spaces(start=0, limit=500, expand=None) # get spaces, select global spaces
test_spaces = []
global_spaces = []
personal_spaces = []
for spc in spaces["results"]:
space_dict = {
"name": spc['name'],
"key": spc["key"],
"url": url + spc["_links"]["webui"],
}
if spc["type"] == "personal":
space_dict["type"] = "personal"
personal_spaces.append(space_dict)
if spc["type"] == "global":
# space_path = path + spc['key']
# if not os.path.exists(space_path):
# os.mkdir(space_path)
space_dict["type"] = "global"
personal_spaces.append(space_dict)
global_spaces.append(space_dict)
if spc['key'] == "LLMTest":
test_spaces.append(space_dict)
spaces = [] # empty
return global_spaces, personal_spaces, test_spaces
@mert-kurttutan @MonoMarkor feel free to send as PR