diff --git a/.jupyter/publish.ipynb b/.jupyter/publish.ipynb deleted file mode 100644 index eca8c634e991660ba3a1afef6e73f85db972433c..0000000000000000000000000000000000000000 --- a/.jupyter/publish.ipynb +++ /dev/null @@ -1,265 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 1, - "metadata": { - "collapsed": true, - "pycharm": { - "name": "#%%\n" - } - }, - "outputs": [], - "source": [ - "import uuid\n", - "import time\n", - "from api_broker.BrokerServiceClient import BrokerServiceClient\n", - "from api_authentication.api.authentication_endpoint_api import AuthenticationEndpointApi\n", - "from api_authentication.api.user_endpoint_api import UserEndpointApi\n", - "from api_container.api.container_endpoint_api import ContainerEndpointApi\n", - "from api_database.api.container_database_endpoint_api import ContainerDatabaseEndpointApi\n", - "from api_table.api.table_endpoint_api import TableEndpointApi\n", - "from api_query.api.table_data_endpoint_api import TableDataEndpointApi\n", - "from api_query.api.query_endpoint_api import QueryEndpointApi\n", - "from api_identifier.api.identifier_endpoint_api import IdentifierEndpointApi\n", - "from api_identifier.api.persistence_endpoint_api import PersistenceEndpointApi\n", - "\n", - "authentication = AuthenticationEndpointApi()\n", - "user = UserEndpointApi()\n", - "container = ContainerEndpointApi()\n", - "database = ContainerDatabaseEndpointApi()\n", - "table = TableEndpointApi()\n", - "query = QueryEndpointApi()\n", - "data = TableDataEndpointApi()\n", - "identifier = IdentifierEndpointApi()\n", - "persistence = PersistenceEndpointApi()\n", - "\n", - "exchange = \"airquality\"\n", - "routing_key = \"airquality\"\n", - "host = \"localhost\"\n", - "username = \"mweise\"\n", - "password = \"V0f38ad2!\"\n", - "\n", - "broker = BrokerServiceClient(exchange=exchange, routing_key=routing_key, host=host, username=username, password=password)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "outputs": [], - "source": [ - "response = authentication.authenticate_user1({\n", - " \"username\": \"user\",\n", - " \"password\": \"user\"\n", - "})\n", - "user_id = response.id\n", - "token = response.token\n", - "container.api_client.default_headers = {\"Authorization\": \"Bearer \" + token}\n", - "database.api_client.default_headers = {\"Authorization\": \"Bearer \" + token}\n", - "table.api_client.default_headers = {\"Authorization\": \"Bearer \" + token}\n", - "data.api_client.default_headers = {\"Authorization\": \"Bearer \" + token}\n", - "query.api_client.default_headers = {\"Authorization\": \"Bearer \" + token}\n", - "identifier.api_client.default_headers = {\"Authorization\": \"Bearer \" + token}\n", - "user.api_client.default_headers = {\"Authorization\": \"Bearer \" + token}\n", - "persistence.api_client.default_headers = {\"Authorization\": \"Bearer \" + token}" - ], - "metadata": { - "collapsed": false, - "pycharm": { - "name": "#%%\n" - } - } - }, - { - "cell_type": "code", - "execution_count": null, - "outputs": [], - "source": [ - "response = user.update({\n", - " \"firstname\": \"Martin\",\n", - " \"lastname\": \"Weise\"\n", - "}, user_id)\n", - "print(response)" - ], - "metadata": { - "collapsed": false, - "pycharm": { - "name": "#%%\n" - } - } - }, - { - "cell_type": "code", - "execution_count": null, - "outputs": [], - "source": [ - "response = container.create1({\n", - " \"name\": \"ethmusmir \" + str(uuid.uuid1()),\n", - " \"repository\": \"mariadb\",\n", - " \"tag\": \"10.5\"\n", - "})\n", - "container_id = response.id\n", - "print(response)" - ], - "metadata": { - "collapsed": false, - "pycharm": { - "name": "#%%\n" - } - } - }, - { - "cell_type": "code", - "execution_count": null, - "outputs": [], - "source": [ - "response = container.modify({\n", - " \"action\": \"start\"\n", - "}, container_id)\n", - "time.sleep(5)\n", - "print(response)" - ], - "metadata": { - "collapsed": false, - "pycharm": { - "name": "#%%\n" - } - } - }, - { - "cell_type": "code", - "execution_count": null, - "outputs": [], - "source": [ - "response = database.create({\n", - " \"name\": \"ethmusmir \" + str(uuid.uuid1()),\n", - " \"description\": \"ethmusmir\",\n", - " \"is_public\": False\n", - "}, container_id)\n", - "database_id = response.id\n", - "print(response)" - ], - "metadata": { - "collapsed": false, - "pycharm": { - "name": "#%%\n" - } - } - }, - { - "cell_type": "code", - "execution_count": null, - "outputs": [], - "source": [ - "response = database.update({\n", - " \"description\": \"Feature Vectors extracted with the EthMusMIR Analysis Server https://github.com/ketchupok/ethmusmir applied on a remixed recording of the SeFiRe field recordings dataset https://github.com/matijama/field-recording-db\",\n", - " \"publisher\": \"Technical University of Vienna\",\n", - " \"license\": {\n", - " \"identifier\": \"Apache-2.0\",\n", - " \"uri\": \"https://opensource.org/licenses/Apache-2.0\"\n", - " },\n", - " \"language\": \"en\",\n", - " \"is_public\": False,\n", - " \"publication\": \"2022-07-17\"\n", - "}, container_id, database_id)\n", - "print(response)" - ], - "metadata": { - "collapsed": false, - "pycharm": { - "name": "#%%\n" - } - } - }, - { - "cell_type": "code", - "execution_count": null, - "outputs": [], - "source": [ - "response = table.create({\n", - " \"name\": \"Feature Extraction\",\n", - " \"description\": \"SeFiRe\",\n", - " \"columns\": [{\n", - " \"name\": \"Content\",\n", - " \"type\": \"STRING\",\n", - " \"unique\": False,\n", - " \"primary_key\": False,\n", - " \"null_allowed\": True,\n", - " }, {\n", - " \"name\": \"Start\",\n", - " \"type\": \"NUMBER\",\n", - " \"unique\": False,\n", - " \"primary_key\": False,\n", - " \"null_allowed\": True,\n", - " }, {\n", - " \"name\": \"Duration\",\n", - " \"type\": \"NUMBER\",\n", - " \"unique\": False,\n", - " \"primary_key\": False,\n", - " \"null_allowed\": True,\n", - " }]\n", - "}, container_id, database_id)\n", - "table_id = response.id\n", - "print(response)" - ], - "metadata": { - "collapsed": false, - "pycharm": { - "name": "#%%\n" - } - } - }, - { - "cell_type": "code", - "execution_count": 2, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "True\n" - ] - } - ], - "source": [ - "response = broker.send({\n", - " \"date\": \"2021-07-17\",\n", - " \"location\": \"Melaka\",\n", - " \"parameter\": \"CO\",\n", - " \"interval\": \"h1\",\n", - " \"unit\": \"mg/m3\",\n", - " \"value\": 0.3,\n", - " \"status\": \"tentative\"\n", - "})\n", - "print(response)" - ], - "metadata": { - "collapsed": false, - "pycharm": { - "name": "#%%\n" - } - } - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 2 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.6" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} \ No newline at end of file