ManagedkdbInsights/boto/list_clusters.ipynb (99 lines of code) (raw):

{ "cells": [ { "cell_type": "markdown", "id": "e13084db-c69f-4e70-aa79-acfd2159093a", "metadata": {}, "source": [ "# List Clusters" ] }, { "cell_type": "code", "execution_count": null, "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 import *" ] }, { "cell_type": "code", "execution_count": null, "id": "ed241efe-523e-4d2f-8e1b-94a09adf42e7", "metadata": { "tags": [] }, "outputs": [], "source": [ "# Using credentials and create service client\n", "session = boto3.Session()\n", "\n", "# create finspace client\n", "client = session.client(service_name='finspace')" ] }, { "cell_type": "markdown", "id": "6b7294c7-d9a3-4fb2-b671-12ead3e17e83", "metadata": {}, "source": [ "# Clusters" ] }, { "cell_type": "code", "execution_count": null, "id": "ccb6b824-4af8-447a-8b0a-ecd4d8136081", "metadata": { "tags": [] }, "outputs": [], "source": [ "cl = get_clusters(client, environmentId=ENV_ID)\n", "\n", "display(cl)" ] }, { "cell_type": "code", "execution_count": null, "id": "38a33d24-7f09-4c4d-bc63-6af9386c996a", "metadata": {}, "outputs": [], "source": [ "print( f\"Last Run: {datetime.datetime.now()}\" )" ] } ], "metadata": { "kernelspec": { "display_name": "conda_python3", "language": "python", "name": "conda_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.15" } }, "nbformat": 4, "nbformat_minor": 5 }