Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Importing account aliases #6

Closed
wwsean08 opened this issue Oct 17, 2017 · 2 comments
Closed

Question: Importing account aliases #6

wwsean08 opened this issue Oct 17, 2017 · 2 comments

Comments

@wwsean08
Copy link

Is there an API or way to automate importing account aliases? Even if I could pass in a csv file with account number to alias that would make life so much easier. I haven't looked thru the code yet to determine the underlying API in order to automate it but was wondering if there is an officially supported way to automate importing it as importing one or two manually is fine, when you have over 100 accounts it gets a bit tedious.

@jessesuen
Copy link
Contributor

There is no formal API, but you can follow what the UI is doing via REST:

  1. Login with your admin and password, and retrieve a session cookie:
curl 'http://claudiaurl.com/v1/auth/login' --data-binary $'{\n  "username": "admin",\n  "password": "<your_password>"\n}'
  1. Get the report ID:
curl 'http://claudiaurl.com/v1/reports' -H 'Cookie: session=<your session cookie>'
  1. Update a single account:
curl 'http://claudiaurl.com/v1/reports/<your report id>/accounts/<aws_account_id>' -H 'Cookie: session=<your session cookie>' -H --data-binary $'{\n  "name": "<account alias name>"\n}'

@wwsean08
Copy link
Author

Thanks, that's what I figured

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants