How to remotely set Space Status via XML-RPC

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問


プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Fisheye および Crucible は除く

目的


This guide demonstrates a way to change your space status from "Current" to "Archived", or vice versa. We will be utilizing the setSpaceStatus from Remote Confluence methods to change the status of the target space.

(warning) Please do keep in mind that the XML-RPC and SOAP APIs are deprecated since Confluence 5.5. However, the setSpaceStatus will work for us in this particular case.


ソリューション

On the Confluence server, open up command-line interface and execute the following cURL command:

curl --user $USRNAME:$USRPWD -H "Content-Type: application/json" -H "Accept: application/json" -X POST -d "{ \"jsonrpc\" : \"2.0\", \"method\" : \"setSpaceStatus\", \"params\" : [ \"$SPACEKEY\", \"$STATUS\"] , \"id\": 1 }" $CONFURL/rpc/json-rpc/confluenceservice-v2?os_authType=basic 2>/dev/null | python -mjson.tool 

(info) You will need to fill in the following argument according to your environment:

  • $USRNAME:$USRPWD as the username and password (seperated by a colon) of an administrator user
  • $SPACEKEY as the target space key 
  • $STATUS as either "CURRENT" and "ARCHIVED". (Set "CURRENT" to have the space in active state, Set "ARCHIEVED" to archive the space)
  • $CONFURL as the URL of your Confluence Server

Example and expected result:

最終更新日 2021 年 6 月 17 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.