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.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.23.0.tar.gz (169.5 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.23.0-py3-none-any.whl (172.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: newrelic_sb_sdk-0.23.0.tar.gz
  • Upload date:
  • Size: 169.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.7 Linux/6.11.8-200.fc40.x86_64

File hashes

Hashes for newrelic_sb_sdk-0.23.0.tar.gz
Algorithm Hash digest
SHA256 c78870dd25fd0a72a4f82c71f5ab2368d4829acc54b7d9d2638adb2da7d96fd4
MD5 983434178fce6af1d0b014d3fe507f72
BLAKE2b-256 999ee64412c7c6f51d250e3ebca6066b4726343ba7d6d37d6aa1a80a0872ca85

See more details on using hashes here.

File details

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

File metadata

  • Download URL: newrelic_sb_sdk-0.23.0-py3-none-any.whl
  • Upload date:
  • Size: 172.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.7 Linux/6.11.8-200.fc40.x86_64

File hashes

Hashes for newrelic_sb_sdk-0.23.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a751016e3ad98c8755603192bbb499c57d20677bf08f4b62add1075e8017cdb5
MD5 2472aa4a74270e38f69b35f4c4f5f666
BLAKE2b-256 f897835e5593df93b9ceeee43182ae39bb927761218035a04beb3b5a95b23a8f

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