Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Many Confluence CLI calls take a long time to fail if the space ID is invalid

Ryan Hammond July 23, 2021

We LOVE the Confluence CLI / ACLI.  However, one frustration is that the CLI will take a long time to fail when the provided space key does not exist.

 

Example for an existing space:

$ time ../atlassian-cli/confluence.sh --action getSpace --space "IISC"

Space key . . . . . . . . . . : IISC
Id . . . . . . . . . . . . . : 123412341234
Name . . . . . . . . . . . . : IISC
Description . . . . . . . . . :
Home page title . . . . . . . : foo
Home page id . . . . . . . . : 12341234
Type . . . . . . . . . . . . : global
Categories . . . . . . . . . :
URL . . . . . . . . . . . . . : https://confluence.foo.bar/display/IISC


real 0m0.937s
user 0m1.250s
sys 0m0.185s


Example for a non-existant space:

$ time ../atlassian-cli/confluence.sh --action getSpace --space "IISC2"

...zzz...

...many minutes go by...

 

Our Confluence Server instance has many thousands of spaces.  When using the debug and verbose options, the call seems to be iterating over all of them in batches of 25, looking for the space key.  Is there a way to make this call (or any other space-related call) fail faster when the key does not exist?

1 answer

0 votes
Kishan Sharma
Community Champion
August 8, 2021

Hi Ryan, by CLI I hope you mean this app ?I do not have experience with it, but I would use REST API method instead to check space existence.

Ryan Hammond August 9, 2021

Hi, Kishan.  Yes, that is the Confluence CLI I was referring to.  I am wondering if they could enhance their product to work as you had described (call the REST API /rest/api/space/{spaceKey} method as an early failsafe) or if there was another way using only the Confluence CLI to get that fail-fast behavior.  We may just need to use /rest/api/space/{spaceKey} in our own toolchain before attempting potentially slow calls to the Confluence CLI.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events