Skip to main content

New Relic SDK to interact with Nerdgraph API.

Project description

Community-Project

PyPI - Supported versions PyPI - Package version PyPI - Downloads PyPI - MIT License

Codacy Badge Codacy Badge pipeline status

New Relic SB SDK

New Relic SDK built by Dynova to automate common SRE tasks with New Relic API.

Requirements

  • Python 3.9.0 or higher

Install

Install from PyPI

pip install newrelic-sb-sdk

Usage

There is an example on how to use this module to make a simple requesto to New Relic GraphQL API.

from newrelic_sb_sdk.client import NewRelicGqlClient
from newrelic_sb_sdk.utils.response import print_response
from newrelic_sb_sdk.graphql import nerdgraph
from newrelic_sb_sdk.graphql.objects import RootQueryType, RootMutationType

from sgqlc.operation import Operation

nerdgraph.query_type = RootQueryType
nerdgraph.mutation_type = RootMutationType

newrelic = NewRelicGqlClient(new_relic_user_key=YOUR_NEW_RELIC_USER_KEY)

operation = Operation(nerdgraph.query_type)
operation.actor.user()

response = newrelic.execute(operation)

print_response(response)

# Output
# {
#     "data": {
#         "actor": {
#             "user": {
#                 "email": "admin@example.com",
#                 "id": 1234567890,
#                 "name": "Admin User",
#             }
#         }
#     }
# }

Docs

Changelog

All changes to versions of this library are listed in the change history.

Development

Check out our contribution guide.

Contributors

See the list of contributors here.

License

This project is licensed under the terms of the MIT license. See the LICENSE file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

newrelic_sb_sdk-0.42.0.tar.gz (223.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

newrelic_sb_sdk-0.42.0-py3-none-any.whl (218.6 kB view details)

Uploaded Python 3

File details

Details for the file newrelic_sb_sdk-0.42.0.tar.gz.

File metadata

  • Download URL: newrelic_sb_sdk-0.42.0.tar.gz
  • Upload date:
  • Size: 223.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.11.14 Linux/5.15.0-139-generic

File hashes

Hashes for newrelic_sb_sdk-0.42.0.tar.gz
Algorithm Hash digest
SHA256 0e01127e56e0b0d75e801fe12588e3a0d04490a9b2ddf2479c9fbca23f792dd8
MD5 7105c5878e0f744bdde9464aeec27c05
BLAKE2b-256 e376730cbb11aa9cd25ddd9f03430cd90885e2f118d5cc20f2fb4d2bf402ab2e

See more details on using hashes here.

File details

Details for the file newrelic_sb_sdk-0.42.0-py3-none-any.whl.

File metadata

  • Download URL: newrelic_sb_sdk-0.42.0-py3-none-any.whl
  • Upload date:
  • Size: 218.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.11.14 Linux/5.15.0-139-generic

File hashes

Hashes for newrelic_sb_sdk-0.42.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c8d2dc8efcb1c89e8e43fb951f9910f7d5b2ba785fe62d79c26ccd4318934cb3
MD5 d664b7fcab7d2aedb65721c928f9f9f3
BLAKE2b-256 59d3197e9a0b5ea92356c5c41f427571025fa54c4f3fb25cd41c5cfef32f85ee

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page