You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-66Lines changed: 21 additions & 66 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,81 +45,36 @@ import databox
45
45
46
46
Execute `pytest` to run the tests.
47
47
48
-
## Getting Started
48
+
## Basic example
49
49
50
50
Please follow the [installation procedure](#installation--usage) and then run the following:
51
51
52
52
```python
53
53
54
-
import databox
55
-
from databox.rest import ApiException
56
-
from pprint import pprint
57
-
58
-
# Defining the host is optional and defaults to https://push.databox.com
59
-
# See configuration.py for a list of all supported configuration parameters.
60
-
configuration = databox.Configuration(
61
-
host="https://push.databox.com"
62
-
)
63
-
64
-
# The client must configure the authentication and authorization parameters
65
-
# in accordance with the API server security policy.
66
-
# Examples for each auth method are provided below, use the example that
67
-
# satisfies your auth use case.
68
-
69
-
# Configure HTTP basic authorization: basicAuth
54
+
# Configuration setup for the Databox API client
55
+
# The API token is used as the username for authentication
56
+
# It's recommended to store your API token securely, e.g., in an environment variable
70
57
configuration = databox.Configuration(
71
-
username= os.environ["USERNAME"],
72
-
password= os.environ["PASSWORD"]
73
-
)
58
+
host="https://push.databox.com",
59
+
username="<YOUR-CUSTOM-DATA-TOKEN>",
60
+
password=""
61
+
)
74
62
63
+
# It's crucial to specify the correct Accept header for the API request
64
+
with databox.ApiClient(configuration, "Accept", "application/vnd.databox.v2+json",) as api_client:
65
+
api_instance = databox.DefaultApi(api_client)
75
66
76
-
# Enter a context with an instance of the API client
77
-
with databox.ApiClient(configuration) as api_client:
78
-
# Create an instance of the API class
79
-
api_instance = databox.DefaultApi(api_client)
67
+
# Define the data to be pushed to the Databox Push API# Prepare the data you want to push to Databox
68
+
# The 'key' should match a metric in your Databox account, 'value' is the data point, 'unit' is optional, and 'date' is the timestamp of the data point
# Define the data to be pushed to the Databox Push API# Prepare the data you want to push to Databox
19
+
# The 'key' should match a metric in your Databox account, 'value' is the data point, 'unit' is optional, and 'date' is the timestamp of the data point
Copy file name to clipboardExpand all lines: src/README.md
+21-66Lines changed: 21 additions & 66 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,81 +45,36 @@ import databox
45
45
46
46
Execute `pytest` to run the tests.
47
47
48
-
## Getting Started
48
+
## Basic example
49
49
50
50
Please follow the [installation procedure](#installation--usage) and then run the following:
51
51
52
52
```python
53
53
54
-
import databox
55
-
from databox.rest import ApiException
56
-
from pprint import pprint
57
-
58
-
# Defining the host is optional and defaults to https://push.databox.com
59
-
# See configuration.py for a list of all supported configuration parameters.
60
-
configuration = databox.Configuration(
61
-
host="https://push.databox.com"
62
-
)
63
-
64
-
# The client must configure the authentication and authorization parameters
65
-
# in accordance with the API server security policy.
66
-
# Examples for each auth method are provided below, use the example that
67
-
# satisfies your auth use case.
68
-
69
-
# Configure HTTP basic authorization: basicAuth
54
+
# Configuration setup for the Databox API client
55
+
# The API token is used as the username for authentication
56
+
# It's recommended to store your API token securely, e.g., in an environment variable
70
57
configuration = databox.Configuration(
71
-
username= os.environ["USERNAME"],
72
-
password= os.environ["PASSWORD"]
73
-
)
58
+
host="https://push.databox.com",
59
+
username="<YOUR-CUSTOM-DATA-TOKEN>",
60
+
password=""
61
+
)
74
62
63
+
# It's crucial to specify the correct Accept header for the API request
64
+
with databox.ApiClient(configuration, "Accept", "application/vnd.databox.v2+json",) as api_client:
65
+
api_instance = databox.DefaultApi(api_client)
75
66
76
-
# Enter a context with an instance of the API client
77
-
with databox.ApiClient(configuration) as api_client:
78
-
# Create an instance of the API class
79
-
api_instance = databox.DefaultApi(api_client)
67
+
# Define the data to be pushed to the Databox Push API# Prepare the data you want to push to Databox
68
+
# The 'key' should match a metric in your Databox account, 'value' is the data point, 'unit' is optional, and 'date' is the timestamp of the data point
0 commit comments