Hello,
I'm running into a small problem when querying the Bill Analysis costs/select end point. I'm specifying the `resource_id` as a dimension to be returned but when looking at the data received from the endpoint, the `resource_id` for each item in the `rows` array is an empty string ( "" ). Is there some request parameter that I need to include to have this value returned? Any help would be much appreciated.
Thanks in advance!
Ryan
May 26, 2020 12:21 PM
May 26, 2020 01:15 PM
Hi egonzalez,
Ok, so that certainly explains why including the `resource_id` to the dimensions didn't produce the result that it used to. It looks like that's no longer a valid dimension. So previously `resource_id` used to, for AWS EC2 instances, provide an id for a given instance. It looked something like:
EC2 Instance: i-[\w\d]{17} # which basically "i-" followed by 17 letters and / or numbers
EC2 Volume: vol-[\w\d]{17} # "vol-" followed by 17 letters and / or numbers
Would you happen to know where else I could access this information?
Thanks!
Ryan
May 26, 2020 01:52 PM
Hello,
Just wanted to touch bases and see if any progress had been made on whether or not it was still possible to get the information contained in the previously available "resource_id" dimension via some other mechanism or API?
Thanks in advance!
Ryan
May 29, 2020 10:21 AM
Hi @egonzalez ,
Not sure if I was doing the replies right or not, but I wanted to reach out and see if the information that was previously provided by the `resource_id` dimension is available in some other way?
Thanks!
Ryan
Jun 01, 2020 12:43 PM
Hi Ryan
Are you trying to retrieve the cost for a specific resource ? Please let me know what you are trying to accomplish and I'll be able to better guide you in retrieving the data or use an existing feature.
Thanks
Jun 01, 2020 12:50 PM
Hi @egonzalez ,
Ultimately we're trying to retrieve the amount of time that a specific resource has run. Eventually we'll be concerned with how much was charged for a particular resource, but for now we're just looking at getting just the up time for AWS EC2 instances.
Thanks,
Ryan
Jun 01, 2020 01:13 PM
Hi Ryan
Are you familiar with the Flexera Policy Engine ? You may have learned about it during discussing additional cost savings opportunities.
Policy Engine
https://docs.rightscale.com/policies/
We have a policy that provides the data you mentioned, also provides a nice report and the ability to eventually apply an action (stop/terminate) . It reports backs on instances that have been running X number of days.
https://github.com/flexera/policy_templates/tree/master/operational/aws/long_running_instances/
Let me know if this helps.
Jun 01, 2020 01:48 PM
Hi @egonzalez ,
Thanks so much for the additional information. It definitely looks like we would have access to the information we're looking for in a Policy Template, the last bit that I'm trying to figure out is how we could export / receive that information when the policy is run. Ideally we'd like to receive a json file daily that has information about each amazon EC2 instance run / running / stopped etc. that day. I see that we can trigger an email and have that email populated via a template, are there other methods of exporting information?
Thanks!
Ryan
Jun 01, 2020 02:18 PM
Hi Ryan
We have an api that allows you to manage policies and retrieve incident information for each policy.
https://reference.rightscale.com/governance-policies/
I recommend you run it manually, confirm you're getting the required data, then look into polling for incidents via the api.
Depending on the client you're using you might be able to integrate it directly with the API to generate the json it expects. How are you planning to use the data once you have it available?
Hope that helps.
Jun 01, 2020 04:49 PM
Hi @egonzalez ,
This certainly looks promising, quick question, are policies available in Optima? I ask because at the moment Optima is all I have access to.
Thanks again!
Ryan
Jun 02, 2020 01:23 PM
Jun 03, 2020 02:13 AM
Jun 03, 2020 08:58 AM
This has me thinking it'd be nice to do a virtual meet-up where @cwilhelm could walk through the most popular policies (he's well-versed and could share some of the exciting new ones.) @CCRDev - would y'all be interested in attending? If so, I'll get some wheels moving.
Jun 04, 2020 11:11 AM
Hi @KPBussey ,
That sounds like it could be really beneficial, I would definitely be interested.
Thanks!
Jun 04, 2020 01:01 PM