In regards to the REST API, what does the "account-id" parameter refer to, and how can I find it in my environment? I'm trying to follow the instructions listed in the documenation (https://docs.appdynamics.com/display/PRO39/Use+the+AppDynamics+REST+API) so that I can create action suppressions remotely, but I don't know what to put in for account-id.
Hi Jordan,
What is the controller version ? we tried in one of our demo site running on 3.9.5.2 and it shown fine, the same did not work for us in older controller version:
Regards,
Arun
Try Customer1. If you have installed an on-premise Controller on a single-tenant platform or if you are using the AppDynamics SaaS Controller, your default account is "customer1".
I tried customer1... it didn't work. I did have that in my authentication credentials, but it seems to be expecting something else entirely for this account-id parameter. In the example that they give, the account-id was just the number 2 (which, of course, I tried but had no success).
You can get a list of your applications and their IDs using this rest call:
URI: /controller/rest/applications
That gives me the application IDs, but not the account-id.....
Hi Jordan,
Can you run the following query at controller mysql db prompt and see if that helps:
shell> cd <Controller_install_dir>\bin
shell> controller.bat/sh login-db
mysql> select name,account_id from user \G;
mysql> select id,name from account \G;
First query will give users and there account ids and account table list the details of account.
Regards,
Arun
I ran the queries you suggested and only get two IDs: 1 and 2. Looks like 1 refers to the local AppDynamics accounts and 2 refers to the Active Directory accounts. However, no matter whether I use 1 or 2 as the account-id, I still can't get a response from the REST call. I get a "HTTP Status 400 - Unsupported URI is specified" HTML response.
It doesn't help that the documentation specifies two different URIs for the same action (I've tried both, but neither work):
/controller/rest/accounts/<account-name>/applications/<application-name | application-id>/actionsuppressions
/controller/api/accounts/<account-name>/applications/<application-name | application-id>/actionsuppressions
Hi Jordan,
GET HTTP method is for retrieve any action supression list and POST is for create supression lists, Can you provide the exact URL you tried and error you got on browser for GET requests and also the output of following queries issued at controller db:
mysql> select * from application \G;
mysql> select * from account \G;
This information helps us to see whether valid id passed or not.
Regards,
Arun
Right now I'm just attempting to do a GET request to retrieve all existing action suppressions. The URL I am trying is:
http://s-appdynamics01.janus.cap:8090/controller/rest/accounts/2/applications/2/actionsuppressions
The error I get when trying the URL is:
type Status report
messageUnsupported URI is specified
descriptionThe request sent by the client was syntactically incorrect (Unsupported URI is specified).
I have attached a screenshot of the output from the mysql queries you asked for.
Hi Jordan.
Can you try the following URI format and see if that helps ?
Ex:
/controller/api/accounts/2/applications/9/actionsuppressions
Regards,
Arun
When I try that format, I get the following HTML error:
type Status report
messageNot Found
descriptionThe requested resource (Not Found) is not available.
Hi Jordan,
What is the controller version ? we tried in one of our demo site running on 3.9.5.2 and it shown fine, the same did not work for us in older controller version:
Regards,
Arun
Ah, maybe that's it...... looks like we're running on 3.9.4.0 build 7. Can you confirm that that version does not have this capability?
Ah, I just found the missing detail in the documentation. It says "New in 3.9.4.1". We're 0.0.0.1 version off! >_<
Thanks for all your help on this.