Plugins

newrelic_api.plugins

class newrelic_api.plugins.Plugins(api_key=None)

An interface for interacting with the NewRelic Plugins API.

__init__(api_key=None)
Parameters:api_key (str) – The API key. If no key is passed, the environment variable NEW_RELIC_API_KEY is used.
Raises:If the api_key parameter is not present, and no environment variable is present, a newrelic_api.exceptions.ConfigurationException is raised.
list(filter_guid=None, filter_ids=None, detailed=None, page=None)

This API endpoint returns a paginated list of the plugins associated with your New Relic account.

Plugins can be filtered by their name or by a list of IDs.

Parameters:
  • filter_guid (str) – Filter by name
  • filter_ids (list of ints) – Filter by user ids
  • detailed (bool) – Include all data about a plugin
  • page (int) – Pagination index
Return type:

dict

Returns:

The JSON response of the API

{
    "plugins": [
        {
            "id": "integer",
            "name": "string",
            "guid": "string",
            "publisher": "string",
            "details": {
                "description": "integer",
                "is_public": "string",
                "created_at": "time",
                "updated_at": "time",
                "last_published_at": "time",
                "has_unpublished_changes": "boolean",
                "branding_image_url": "string",
                "upgraded_at": "time",
                "short_name": "string",
                "publisher_about_url": "string",
                "publisher_support_url": "string",
                "download_url": "string",
                "first_edited_at": "time",
                "last_edited_at": "time",
                "first_published_at": "time",
                "published_version": "string"
            },
            "summary_metrics": [
                {
                    "id": "integer",
                    "name": "string",
                    "metric": "string",
                    "value_function": "string",
                    "thresholds": {
                        "caution": "float",
                        "critical": "float"
                    },
                    "values": {
                        "raw": "float",
                        "formatted": "string"
                    }
                }
            ]
        }
    ]
}
show(id, detailed=None)

This API endpoint returns a single Key transaction, identified its ID.

Parameters:
  • id (int) – Key transaction ID
  • detailed (bool) –
Return type:

dict

Returns:

The JSON response of the API

{
    "plugin": {
        "id": "integer",
        "name": "string",
        "guid": "string",
        "publisher": "string",
        "details": {
            "description": "integer",
            "is_public": "string",
            "created_at": "time",
            "updated_at": "time",
            "last_published_at": "time",
            "has_unpublished_changes": "boolean",
            "branding_image_url": "string",
            "upgraded_at": "time",
            "short_name": "string",
            "publisher_about_url": "string",
            "publisher_support_url": "string",
            "download_url": "string",
            "first_edited_at": "time",
            "last_edited_at": "time",
            "first_published_at": "time",
            "published_version": "string"
        },
        "summary_metrics": [
            {
                "id": "integer",
                "name": "string",
                "metric": "string",
                "value_function": "string",
                "thresholds": {
                    "caution": "float",
                    "critical": "float"
                },
                "values": {
                    "raw": "float",
                    "formatted": "string"
                }
            }
        ]
    }
}