@@ -758,12 +758,14 @@ def get_all_templates_from_space(self, space, start=0, limit=20, expand=None):
758
758
759
759
return response .get ("results" ) or []
760
760
761
- def get_all_spaces (self , start = 0 , limit = 500 , expand = None ):
761
+ def get_all_spaces (self , start = 0 , limit = 500 , expand = None , space_type = None , space_status = None ):
762
762
"""
763
763
Get all spaces with provided limit
764
764
:param start: OPTIONAL: The start point of the collection to return. Default: None (0).
765
765
:param limit: OPTIONAL: The limit of the number of pages to return, this may be restricted by
766
766
fixed system limits. Default: 500
767
+ :param space_type: OPTIONAL: Filter the list of spaces returned by type (global, personal)
768
+ :param space_status: OPTIONAL: Filter the list of spaces returned by status (current, archived)
767
769
:param expand: OPTIONAL: additional info, e.g. metadata, icon, description, homepage
768
770
"""
769
771
url = "rest/api/space"
@@ -774,7 +776,11 @@ def get_all_spaces(self, start=0, limit=500, expand=None):
774
776
params ["limit" ] = limit
775
777
if expand :
776
778
params ["expand" ] = expand
777
- return (self .get (url , params = params ) or {}).get ("results" )
779
+ if space_type :
780
+ params ["type" ] = space_type
781
+ if space_status :
782
+ params ["status" ] = space_status
783
+ return self .get (url , params = params )
778
784
779
785
def add_comment (self , page_id , text ):
780
786
"""
0 commit comments