Notebooks >> Scripts
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

130 lines
5.5 KiB

{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "e3fe9fc8",
"metadata": {},
"outputs": [],
"source": [
"import json\n",
"import os\n",
"import pprint\n",
"import urllib.parse\n",
"import sys\n",
"import requests\n",
"\n",
"my_headers = {\n",
" \"Content-Type\": \"application/json\",\n",
" \"Accept\": \"application/json\",\n",
"}\n",
"\n",
"\n",
"url = \"https://donavanaldrich.com/api/metrics/netdata/charts\"\n",
"\n",
"response = requests.get(url, headers=my_headers)\n",
"\n",
"print(response.text)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a59e77d5",
"metadata": {},
"outputs": [],
"source": [
"!curl 'https://donavanaldrich.com/api/metrics/netdata/charts'\n",
" "
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "6745302c",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease\n",
"Hit:2 http://security.ubuntu.com/ubuntu focal-security InRelease\n",
"Hit:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease\n",
"Hit:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease\n",
"Reading package lists... Done\u001b[33m\u001b[33m\n",
"Building dependency tree \n",
"Reading state information... Done\n",
"All packages are up to date.\n",
"Reading package lists... Done\n",
"Building dependency tree \n",
"Reading state information... Done\n",
"Calculating upgrade... Done\n",
"0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.\n",
"Reading package lists... Done\n",
"Building dependency tree \n",
"Reading state information... Done\n",
"The following additional packages will be installed:\n",
" libcurl4\n",
"The following NEW packages will be installed:\n",
" curl libcurl4\n",
"0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.\n",
"Need to get 396 kB of archives.\n",
"After this operation, 1,121 kB of additional disk space will be used.\n",
"Get:1 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libcurl4 amd64 7.68.0-1ubuntu2.12 [235 kB]\n",
"Get:2 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 curl amd64 7.68.0-1ubuntu2.12 [161 kB]\n",
"Fetched 396 kB in 0s (812 kB/s)[0m\u001b[33m\n",
"debconf: delaying package configuration, since apt-utils is not installed\n",
"\n",
"\u001b7\u001b[0;23r\u001b8\u001b[1A\u001b[1;31mE: \u001b[0mCan not write log (Is /dev/pts mounted?) - open (1: Operation not permitted)\u001b[0m\n",
"Selecting previously unselected package libcurl4:amd64.\n",
"(Reading database ... 147435 files and directories currently installed.)\n",
"Preparing to unpack .../libcurl4_7.68.0-1ubuntu2.12_amd64.deb ...\n",
"\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 0%]\u001b[49m\u001b[39m [..........................................................] \u001b8\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 11%]\u001b[49m\u001b[39m [######....................................................] \u001b8Unpacking libcurl4:amd64 (7.68.0-1ubuntu2.12) ...\n",
"\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 22%]\u001b[49m\u001b[39m [############..............................................] \u001b8Selecting previously unselected package curl.\n",
"Preparing to unpack .../curl_7.68.0-1ubuntu2.12_amd64.deb ...\n",
"\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 33%]\u001b[49m\u001b[39m [###################.......................................] \u001b8Unpacking curl (7.68.0-1ubuntu2.12) ...\n",
"\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 44%]\u001b[49m\u001b[39m [#########################.................................] \u001b8\u001b[1;31mE: \u001b[0mCan not write log (Is /dev/pts mounted?) - open (1: Operation not permitted)\u001b[0m\n",
"Setting up libcurl4:amd64 (7.68.0-1ubuntu2.12) ...\n",
"\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 56%]\u001b[49m\u001b[39m [################################..........................] \u001b8\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 67%]\u001b[49m\u001b[39m [######################################....................] \u001b8Setting up curl (7.68.0-1ubuntu2.12) ...\n",
"\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 78%]\u001b[49m\u001b[39m [#############################################.............] \u001b8\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 89%]\u001b[49m\u001b[39m [###################################################.......] \u001b8Processing triggers for libc-bin (2.31-0ubuntu9.9) ...\n",
"\n",
"\u001b7\u001b[0;24r\u001b8\u001b[1A\u001b[J"
]
}
],
"source": [
"!sudo apt update && sudo apt upgrade -y && sudo apt install curl -y"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "54f37a3a",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.5"
}
},
"nbformat": 4,
"nbformat_minor": 5
}