{ "cells": [ { "cell_type": "markdown", "id": "e13084db-c69f-4e70-aa79-acfd2159093a", "metadata": {}, "source": [ "# List Clusters" ] }, { "cell_type": "code", "execution_count": 1, "id": "3698017d-42ed-4280-afa1-723f19ae398c", "metadata": { "tags": [] }, "outputs": [], "source": [ "import os\n", "import boto3\n", "import json\n", "import datetime\n", "\n", "from managed_kx import *\n", "from env_2 import *\n" ] }, { "cell_type": "code", "execution_count": 2, "id": "ed241efe-523e-4d2f-8e1b-94a09adf42e7", "metadata": { "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Using variables ...\n" ] } ], "source": [ "# triggers credential get\n", "session=None\n", "\n", "try:\n", " # aws: use ada for credentials\n", " subprocess.call([\"which\", \"ada\"])\n", " os.system(f\"ada credentials update --account={ACCOUNT_ID} --provider=isengard --role=Admin --once\")\n", "except: \n", " None\n", "\n", "if AWS_ACCESS_KEY_ID is None:\n", " print(\"Using Defaults ...\")\n", " # create AWS session: using access variables\n", " session = boto3.Session()\n", "else:\n", " print(\"Using variables ...\")\n", " session = boto3.Session(\n", " aws_access_key_id=AWS_ACCESS_KEY_ID,\n", " aws_secret_access_key=AWS_SECRET_ACCESS_KEY,\n", " aws_session_token=AWS_SESSION_TOKEN\n", " )\n", "\n", "# create finspace client\n", "client = session.client(service_name='finspace', endpoint_url=ENDPOINT_URL)" ] }, { "cell_type": "markdown", "id": "6b7294c7-d9a3-4fb2-b671-12ead3e17e83", "metadata": {}, "source": [ "# Clusters" ] }, { "cell_type": "code", "execution_count": 3, "id": "ccb6b824-4af8-447a-8b0a-ecd4d8136081", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
clusterNamestatusclusterTypecapacityConfigurationcommandLineArgumentsclusterDescriptionlastModifiedTimestampcreatedTimestampdatabaseNamecacheConfigurations
HDB_TAQ_2021H1CREATINGHDB{'nodeType': 'kx.s.32xlarge', 'nodeCount': 2}[{'key': 's', 'value': '32'}, {'key': 'dbname', 'value': 'TAQ_2021H1'}, {'key': 'codebase', 'value': 'taqcode'}]Created with create_cluster_TAQ_H1 notebook2023-05-30 23:11:36.953000+00:002023-05-30 23:11:20.394000+00:00TAQ_2021H1[{'cacheType': 'CACHE_1000', 'dbPaths': ['/2021.01.04/', '/2021.01.05/', '/2021.01.06/', '/2021.01.07/', '/2021.01.08/', '/2021.01.11/', '/2021.01.12/', '/2021.01.13/', '/2021.01.14/', '/2021.01.15/', '/2021.01.19/', '/2021.01.20/', '/2021.01.21/', '/2021.01.22/', '/2021.01.25/', '/2021.01.26/', '/2021.01.27/', '/2021.01.28/', '/2021.01.29/', '/2021.02.01/', '/2021.02.02/', '/2021.02.03/', '/2021.02.04/', '/2021.02.05/']}]
HDB_TAQ_2021_2DCREATINGHDB{'nodeType': 'kx.s.32xlarge', 'nodeCount': 2}[{'key': 's', 'value': '8'}, {'key': 'dbname', 'value': 'TAQ_2021_2D'}, {'key': 'codebase', 'value': 'taqcode'}]Created with create_cluster_TAQ_2D notebook2023-05-30 23:09:47.415000+00:002023-05-30 23:09:30.508000+00:00TAQ_2021_2D[{'cacheType': 'CACHE_1000', 'dbPaths': ['/2021.01.04/', '/2021.01.05/']}]
HDB_welcomedbRUNNINGHDB{'nodeType': 'kx.s.2xlarge', 'nodeCount': 3}[{'key': 's', 'value': '4'}, {'key': 'dbname', 'value': 'welcomedb'}, {'key': 'codebase', 'value': 'code'}]Created with create_cluster_HDB notebook2023-05-30 23:13:20.948000+00:002023-05-30 22:56:11.773000+00:00welcomedb[{'cacheType': 'CACHE_1000', 'dbPaths': ['/']}]
RDB_welcomedbRUNNINGRDB{'nodeType': 'kx.s.2xlarge', 'nodeCount': 1}[{'key': 's', 'value': '8'}, {'key': 'dbname', 'value': 'welcomedb'}, {'key': 'codebase', 'value': 'code'}]Created with create_cluster_RDB notebook2023-05-30 23:10:28.477000+00:002023-05-30 22:56:52.812000+00:00welcomedb[]
cluster_welcomedbRUNNINGHDB{'nodeType': 'kx.s.xlarge', 'nodeCount': 3}[{'key': 's', 'value': '4'}, {'key': 'dbname', 'value': 'welcomedb'}, {'key': 'codebase', 'value': 'welcomedb'}]Demo Cluster for database welcomedb2023-05-30 23:10:58.551000+00:002023-05-30 22:53:31.356000+00:00welcomedb[{'cacheType': 'CACHE_1000', 'dbPaths': ['/']}]
\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "Last Run: 2023-05-30 23:15:28.279462\n" ] } ], "source": [ "cl = get_clusters(client, ENV_ID)\n", "\n", "display(cl)\n", "\n", "print( f\"Last Run: {datetime.datetime.now()}\" )" ] }, { "cell_type": "code", "execution_count": null, "id": "38a33d24-7f09-4c4d-bc63-6af9386c996a", "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.9.12" } }, "nbformat": 4, "nbformat_minor": 5 }