Help in running a macro.
Asked by aravind:

Hi ,

I need to run the CLI plugin and fetch the confluence details from UI , refered the CLI plugin , [https://bobswift.atlassian.net/wiki/display/CCLI/Documentatio](https://bobswift.atlassian.net/wiki/display/CCLI/Documentation)

Could any one please help in understanding how to run the plugin , I create a macro but didn get how to invoke same.

Thanks,

Aravind


Answers:
author: aravind
body: I have actually replaced the username/pwd , Also replaced the URL properly .

-=-

unable to log in to server: <http://myIP/rpc/soap-axis/confluenceservice-v1> with user: XXXX.  
Cause: (404)Not Found

-=-=

Any idea why the "404 not found error " is coming .When i launch <http://myIP/rpc/soap-axis/confluenceservice-v1> in Browser same error is seen

Do i have to run any service in confluence server .

comments: author: Bob Swift (personal)
body: 1. Make sure the server address is correct :)
2. Yes, Confluence must be configured to accept remote requests. By default, it is usually on, but you may have turned it off. Go to Confluence administration -\> General Configuration and make sure Remote API is checked.


author: aravind
body: Iam trying to rad and update the confluence details using CLI .,

Below are the approach tried,

1.Refered the below link

<https://bobswift.atlassian.net/wiki/display/CCLI/CLI+Macro>.But i am not getting how to call this whether we have to wrirte a Macro or some other means , If macro how to run it .

2.As per mentioned in the link <http://ffeathers.wordpress.com/2011/10/20/confluence-cli-for-bulk-actions-like-deleting-or-publishing-pages/>

tried downloading the CLI ( atlassian-cli-3.4.0 )in the desktop and ran the command ./atlassian.sh confluence --action getServerInfo

it gave below error

*Unable to log in to server: [http://myIP:Port](http://myIPPort)/rpc/soap-axis/confluenceservice-v1 with user: confluence.*   
*Cause: (404)Not Found*

Firing [http://myIP:Port](http://myIPPort)/rpc/soap-axis/confluenceservice-v1 in Browser also gives same result

Confluence version : 4.3.2

Please let me know if more details required also correct if my understanding is wrong.

comments: author: Nic Brough -Adaptavist-
body: Ok, that's making more sense - there are two questions here.

1) The macro enables you to run things that will be executed by the CLI and the results returned as part of the text of the page you put the macro on to.

My recommendation here is to forget this until you've got the CLI to do what you want. It's powerful and helpful, but worth understanding what it's doing from the ground up

2) The CLI runs \*outside\* your Atlassian products. You're not telling it what to connect to, so it's using a default, which is wrong, so it's failing (The default is intended to try to show you an error message that makes it clear what you're missing)

Try

/atlassian.sh confluence --server <http://yourconfluenceurl.yourorganisation> --action getServerInfo


author: Bob Swift (personal)
body: Agree with Nick, always start with something simple until you get a grasp of the tool and what it provides including how to configure it. Installation and Use tells you how to customize the bat/sh file to make it easier to use.

[What is the difference between CLI clients and CLI plugins?](https://bobswift.atlassian.net/wiki/pages/viewpage.action?pageId=34406872) will help you understand the differences in the tools and capabilities.


author: aravind
body: Thanks for your suggestions ,

I made sure that the IP is proper by firing it in browser and also Remote API is checked in confluence UI .

Could you please let me know if there is any other setting missing , which is causing 404 error when i fire [http://myIP/rpc/soap-axis/confluenceservice-v1](http://myip/rpc/soap-axis/confluenceservice-v1) from browser.


author: aravind
body: Tried below

/atlassian.sh confluence --server [http://yourconfluenceurl.yourorganisation](http://yourconfluenceurl.yourorganisation/) --action getServerInfo

getting the **Error: Parameter 'server' cannot be declared more than once.**

Looks like this error is coming as the params are already specied in atlassain .sh

-=-

if \[ "$application" = "confluence" \]; then  
string="confluence-cli-3.4.0.jar --server <http://myIP/> --user $user --password $password"  
-=-=  

comments: author: Nic Brough -Adaptavist-
body: My apologies, I wasn't looking at atlassian.sh, I was looking at confluence.sh, so I missed the point that atlassian.sh already specifies a --server string

However, it does clearly say "edit this and use your server's url" in there, and the error is clearly showing that you're using the default. Could you try swapping the default myIP for your actual Confluence url?


author: Nic Brough -Adaptavist-
body: Could you clarify this a little?

The CLI is a command line interface for interacting with Confluence

A macro is something you add to a page to do something clever in that page.

The two things are not really related, other than they both get used in Confluence, so could you explain what the question is? Are you stuck on using the CLI? Or with macros? Or are you trying to do somthing sneaky with both?