Azure API Reference Guide

Below is the list of CloudCheckr API calls specific to Microsoft Azure.

Click here for additional information about CloudCheckr API methods


Other API methods

alert/add_cost_alert*
alert/delete_cost_alert*

* these calls are not compatible with Multi-Account Views.

USING ACCESS KEYS

CloudCheckr requires an Access Key to be passed as a parameter to all API calls.

IMPORTANT: An Admin-Level Access Key is needed to make calls which affect any account functions. A General Access Key will not be able to authorize these types of calls and will result in an error.

Click here for details on creating and managing Access Keys.

Example of using an Access Key:

https://api.cloudcheckr.com/api/change_monitoring.json/get_changes?access_key=[access_key]

Access Keys are 64 bytes long and have the following format.

56422A55E6B340239D6F472537128F979A86766B738C4BD1AC29F1F42DFEF55A

Putting it all together:

https://api.cloudcheckr.com/api/change_monitoring.json/get_changes?access_key=56422A55E6B340239D6F472537128F979A86766B738C4BD1AC29F1F42DFEF55A

API PAGINATION

When you select from the API, it returns up to 100 results. If the output of your call contains more than 100 results, CloudCheckr will pass back a token allowing you to get the next 100 results, which you should pass to the API to get the next set of 100 results.

For more information on using pagination with the CloudCheckr API please go here: http://support.cloudcheckr.com/cloudcheckr-api-userguide/#api_pagination


PREFERRED HTTP METHODS

When using libraries such as curl, you may need to indicate the HTTP method to use (POST or GET). The CloudCheckr API accepts both POST and GET in most API calls. However, we recommend you use the preferred HTTP Method when possible.

The preferred HTTP method for each call is GET unless specifically note in the API CALLS section.

For more information on HTTP methods, click here: http://www.w3schools.com/tags/ref_httpmethods.asp


OPTIONAL DATE PARAMETER FOR INVENTORY-RELATED API CALLS

For all inventory-related calls, you can use the option parameter “date”. By passing in “date” you can select the day for which to return the inventory. If date is not defined, the most recent inventory will be returned. If there is not a specific inventory for the date, CloudCheckr will attempt to use the last previous inventory to the date passed in.

XML call:

https://api.cloudcheckr.com/api/best_practice.xml/get_best_practices?access_key=[access_key]&date=2015-10-23

JSON call:

https://api.cloudcheckr.com/api/best_practice.json/get_best_practices?access_key=[access_key]&date=2015-10-23

The API response will include “DateOfResults”:”2015-11-23T20:13:03″ which will allow you to determine what specific date the inventory is for.


TROUBLESHOOTING

For help with troubleshooting common API issues, click here.


API CALLS

GET ALL API ENDPOINTS

The API method “get_all_api_endpoints” is used to return a complete list of all available CloudCheckr API calls and their parameters.

The preferred HTTP method for this call is GET.

XML call:

https://api.cloudcheckr.com/api/help.xml/get_all_api_endpoints?access_key=[access_key]

JSON call:

https://api.cloudcheckr.com/api/help.json/get_all_api_endpoints?access_key=[access_key]

INPUT PARAMETERS

This call accepts these parameters:

  • access_key (required) – Either a General or Admin-Level Access Key is required for this call.

OUTPUT

XML Example:

<ArrayOfControllerContainer
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <ControllerContainer>
        <controller_name>best_practice</controller_name>
        <api_calls>
            <ApiCall>
                <method_name>get_best_practices</method_name>
                <param_names>
                    <string>(admin level)access_key</string>
                    <string>date</string>
                    <string>aws_account_ids</string>
                    <string>all_result</string>
                    <string>importance</string>
                    <string>category</string>
                </param_names>
            </ApiCall>
        </api_calls>
    </ControllerContainer>
    <ControllerContainer>
        <controller_name>help</controller_name>
        <api_calls>
            <ApiCall>
                <method_name>get_resources_cloudformation_details</method_name>
                <param_names>
                    <string>date</string>
                    <string>aws_account_ids</string>
                    <string>max_results</string>
                </param_names>
            </ApiCall>
        </api_calls>
    </ControllerContainer>
</ArrayOfControllerContainer>

JSON Example:

[
  {
    "controller_name": "best_practice",
    "api_calls": [
      {
        "method_name": "get_best_practices",
        "param_names": [
          "(admin level)access_key",
          "date",
          "aws_account_ids",
          "all_result",
          "importance",
          "category"
        ]
      }
    ]
  },
  {
    "controller_name": "inventory",
    "api_calls": [
      {
        "method_name": "get_resources_cloudformation_details",
        "param_names": [
          "date",
          "aws_account_ids",
          "max_results"
        ]
      }
    ]
  }
]