New Relic SDK to interact with Nerdgraph API.
Project description
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
Release history Release notifications | RSS feed
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.14.0.tar.gz
(142.9 kB
view details)
Built Distribution
File details
Details for the file newrelic_sb_sdk-0.14.0.tar.gz
.
File metadata
- Download URL: newrelic_sb_sdk-0.14.0.tar.gz
- Upload date:
- Size: 142.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.5 Linux/5.15.0-78-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ebe29efabff9b2b3c011ea17c223c6f05928edc8689bc1b42173bfb561bee571 |
|
MD5 | 19ec178d087310cee30fc135082c1716 |
|
BLAKE2b-256 | f27f075a28a81cfa433bcc6f9db456d13dd049ce830cceadcf8086cb84e776c6 |
File details
Details for the file newrelic_sb_sdk-0.14.0-py3-none-any.whl
.
File metadata
- Download URL: newrelic_sb_sdk-0.14.0-py3-none-any.whl
- Upload date:
- Size: 149.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.5 Linux/5.15.0-78-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1aea06bc8c0ae9533b4f1456c99f4710f754daf42e08d0b872311e71cdbcead9 |
|
MD5 | e1c2675bc3a41214c6fc84bebcaa8077 |
|
BLAKE2b-256 | f1d71947f7d9b68bcda82bf973cf10d1c5cceff5bcd4f60707e42adeef668a1c |