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.37.0.tar.gz (202.4 kB view details)

Uploaded Source

Built Distribution

newrelic_sb_sdk-0.37.0-py3-none-any.whl (199.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: newrelic_sb_sdk-0.37.0.tar.gz
  • Upload date:
  • Size: 202.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.13 Linux/5.15.0-134-generic

File hashes

Hashes for newrelic_sb_sdk-0.37.0.tar.gz
Algorithm Hash digest
SHA256 debac4e397b7ba59e500e7cd6f1849aff8822499af72d20ddd722982d7b30d8d
MD5 91fb48ab532f1a763b9b2649759f33d1
BLAKE2b-256 c2632de09252df5ec1811de48a668f92bf0a071b3bacfc08942c6b3bb41a67ab

See more details on using hashes here.

File details

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

File metadata

  • Download URL: newrelic_sb_sdk-0.37.0-py3-none-any.whl
  • Upload date:
  • Size: 199.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.13 Linux/5.15.0-134-generic

File hashes

Hashes for newrelic_sb_sdk-0.37.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6705bc6726f574d71ff0181dbfc1fed056096f0935a4538477ef87ad2bcf6a60
MD5 30adf567e7f6cbd031c058f989984ced
BLAKE2b-256 af1023262598b837cf381e7f5c85a6e96ada5b7b4ef5077583937af2446b5f16

See more details on using hashes here.

Supported by

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