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 SoftButterfly to automate common New Relic One observability platform tasks

Requirements

  • Python 3.8.1 or higher
  • enforce-typing
  • python-dotenv
  • requests
  • semver
  • sgqlc

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()

operation = operation.__to_graphql__()

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

Uploaded Source

Built Distribution

newrelic_sb_sdk-0.20.0-py3-none-any.whl (171.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: newrelic_sb_sdk-0.20.0.tar.gz
  • Upload date:
  • Size: 164.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.11.10 Linux/5.15.0-122-generic

File hashes

Hashes for newrelic_sb_sdk-0.20.0.tar.gz
Algorithm Hash digest
SHA256 503a84cf103799a8b81cf40d199ee96a4f33ab673a3e5608ebd89e3cd35f67d4
MD5 9b4fcebb972de2d53045780ebccc6efd
BLAKE2b-256 7fd9fa4fbf8836b4bc78d43768b6b5258a5156a56bd919cd1f843f2ba51f348d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: newrelic_sb_sdk-0.20.0-py3-none-any.whl
  • Upload date:
  • Size: 171.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.11.10 Linux/5.15.0-122-generic

File hashes

Hashes for newrelic_sb_sdk-0.20.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8e2b2b8b15ad043f9131b920847c11fefb3bfa46910bdc7878d39c16735f1fac
MD5 408b21cdc0c872a63444b7a2363b6e3e
BLAKE2b-256 b4c160667c3d82a1863e26da36ec7452771e91aef90915aab1137f7bbf3168c9

See more details on using hashes here.

Supported by

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