brynq-sdk-newrelic 1.0.0__tar.gz → 1.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {brynq_sdk_newrelic-1.0.0 → brynq_sdk_newrelic-1.0.1}/PKG-INFO +1 -1
- {brynq_sdk_newrelic-1.0.0 → brynq_sdk_newrelic-1.0.1}/brynq_sdk_newrelic.egg-info/PKG-INFO +1 -1
- {brynq_sdk_newrelic-1.0.0 → brynq_sdk_newrelic-1.0.1}/brynq_sdk_newrelic.egg-info/SOURCES.txt +0 -2
- brynq_sdk_newrelic-1.0.1/brynq_sdk_newrelic.egg-info/requires.txt +2 -0
- brynq_sdk_newrelic-1.0.1/brynq_sdk_newrelic.egg-info/top_level.txt +1 -0
- {brynq_sdk_newrelic-1.0.0 → brynq_sdk_newrelic-1.0.1}/setup.py +4 -4
- brynq_sdk_newrelic-1.0.0/brynq_sdk/newrelic/__init__.py +0 -1
- brynq_sdk_newrelic-1.0.0/brynq_sdk/newrelic/newrelic_interface.py +0 -35
- brynq_sdk_newrelic-1.0.0/brynq_sdk_newrelic.egg-info/requires.txt +0 -2
- brynq_sdk_newrelic-1.0.0/brynq_sdk_newrelic.egg-info/top_level.txt +0 -1
- {brynq_sdk_newrelic-1.0.0 → brynq_sdk_newrelic-1.0.1}/brynq_sdk_newrelic.egg-info/dependency_links.txt +0 -0
- {brynq_sdk_newrelic-1.0.0 → brynq_sdk_newrelic-1.0.1}/brynq_sdk_newrelic.egg-info/not-zip-safe +0 -0
- {brynq_sdk_newrelic-1.0.0 → brynq_sdk_newrelic-1.0.1}/setup.cfg +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
from setuptools import setup
|
|
1
|
+
from setuptools import setup, find_namespace_packages
|
|
2
2
|
|
|
3
3
|
setup(
|
|
4
4
|
name='brynq_sdk_newrelic',
|
|
5
|
-
version='1.0.
|
|
5
|
+
version='1.0.1',
|
|
6
6
|
description='Newrelic wrapper from BrynQ',
|
|
7
7
|
long_description='Newrelic wrapper from BrynQ',
|
|
8
8
|
author='BrynQ',
|
|
9
9
|
author_email='support@brynq.com',
|
|
10
|
-
packages=[
|
|
10
|
+
packages=find_namespace_packages(include=['brynq_sdk*']),
|
|
11
11
|
license='BrynQ License',
|
|
12
12
|
install_requires=[
|
|
13
|
-
'brynq-sdk-brynq>=
|
|
13
|
+
'brynq-sdk-brynq>=2',
|
|
14
14
|
'pandas>=2,<3'
|
|
15
15
|
],
|
|
16
16
|
zip_safe=False,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
from brynq_sdk.newrelic.newrelic_interface import NewRelicAPI
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
from typing import Union, List
|
|
2
|
-
import requests
|
|
3
|
-
from brynq_sdk.brynq import BrynQ
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class NewRelicAPI(BrynQ):
|
|
7
|
-
|
|
8
|
-
def __init__(self, label: Union[str, List], debug: bool = False):
|
|
9
|
-
"""
|
|
10
|
-
For the full documentation, see: https://docs.newrelic.com/docs/apis/nerdgraph/get-started/introduction-new-relic-nerdgraph/
|
|
11
|
-
"""
|
|
12
|
-
super().__init__()
|
|
13
|
-
self.headers = self._set_credentials(label)
|
|
14
|
-
self.url = "https://api.newrelic.com/graphql"
|
|
15
|
-
|
|
16
|
-
def _set_credentials(self, label):
|
|
17
|
-
"""
|
|
18
|
-
Get the credentials from BrynQ and get the username and private key from there
|
|
19
|
-
"""
|
|
20
|
-
credentials = self.get_system_credential(system='newrelic-api', label=label)
|
|
21
|
-
api_key = credentials['api_key']
|
|
22
|
-
headers = {
|
|
23
|
-
'API-Key': f'{api_key}',
|
|
24
|
-
'Content-Type': 'application/json'
|
|
25
|
-
}
|
|
26
|
-
return headers
|
|
27
|
-
|
|
28
|
-
def execute_query(self, query: dict):
|
|
29
|
-
response = requests.post(self.url, headers=self.headers, json=query)
|
|
30
|
-
if response.status_code == 200:
|
|
31
|
-
return response.json()
|
|
32
|
-
else:
|
|
33
|
-
response.raise_for_status()
|
|
34
|
-
|
|
35
|
-
return response
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
brynq_sdk
|
|
File without changes
|
{brynq_sdk_newrelic-1.0.0 → brynq_sdk_newrelic-1.0.1}/brynq_sdk_newrelic.egg-info/not-zip-safe
RENAMED
|
File without changes
|
|
File without changes
|