Skip to content
Snippets Groups Projects
Commit 6d9df6cb authored by Martin Weise's avatar Martin Weise
Browse files

Deleted publish notebook

parent 6ffeebee
No related branches found
No related tags found
2 merge requests!81New stable release,!80Multiple features connected with user management and ownership of databases
This commit is part of merge request !81. Comments created here will be created in the context of that merge request.
%% Cell type:code id: tags:
``` python
import uuid
import time
from api_broker.BrokerServiceClient import BrokerServiceClient
from api_authentication.api.authentication_endpoint_api import AuthenticationEndpointApi
from api_authentication.api.user_endpoint_api import UserEndpointApi
from api_container.api.container_endpoint_api import ContainerEndpointApi
from api_database.api.container_database_endpoint_api import ContainerDatabaseEndpointApi
from api_table.api.table_endpoint_api import TableEndpointApi
from api_query.api.table_data_endpoint_api import TableDataEndpointApi
from api_query.api.query_endpoint_api import QueryEndpointApi
from api_identifier.api.identifier_endpoint_api import IdentifierEndpointApi
from api_identifier.api.persistence_endpoint_api import PersistenceEndpointApi
authentication = AuthenticationEndpointApi()
user = UserEndpointApi()
container = ContainerEndpointApi()
database = ContainerDatabaseEndpointApi()
table = TableEndpointApi()
query = QueryEndpointApi()
data = TableDataEndpointApi()
identifier = IdentifierEndpointApi()
persistence = PersistenceEndpointApi()
exchange = "airquality"
routing_key = "airquality"
host = "localhost"
username = "mweise"
password = "V0f38ad2!"
broker = BrokerServiceClient(exchange=exchange, routing_key=routing_key, host=host, username=username, password=password)
```
%% Cell type:code id: tags:
``` python
response = authentication.authenticate_user1({
"username": "user",
"password": "user"
})
user_id = response.id
token = response.token
container.api_client.default_headers = {"Authorization": "Bearer " + token}
database.api_client.default_headers = {"Authorization": "Bearer " + token}
table.api_client.default_headers = {"Authorization": "Bearer " + token}
data.api_client.default_headers = {"Authorization": "Bearer " + token}
query.api_client.default_headers = {"Authorization": "Bearer " + token}
identifier.api_client.default_headers = {"Authorization": "Bearer " + token}
user.api_client.default_headers = {"Authorization": "Bearer " + token}
persistence.api_client.default_headers = {"Authorization": "Bearer " + token}
```
%% Cell type:code id: tags:
``` python
response = user.update({
"firstname": "Martin",
"lastname": "Weise"
}, user_id)
print(response)
```
%% Cell type:code id: tags:
``` python
response = container.create1({
"name": "ethmusmir " + str(uuid.uuid1()),
"repository": "mariadb",
"tag": "10.5"
})
container_id = response.id
print(response)
```
%% Cell type:code id: tags:
``` python
response = container.modify({
"action": "start"
}, container_id)
time.sleep(5)
print(response)
```
%% Cell type:code id: tags:
``` python
response = database.create({
"name": "ethmusmir " + str(uuid.uuid1()),
"description": "ethmusmir",
"is_public": False
}, container_id)
database_id = response.id
print(response)
```
%% Cell type:code id: tags:
``` python
response = database.update({
"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",
"publisher": "Technical University of Vienna",
"license": {
"identifier": "Apache-2.0",
"uri": "https://opensource.org/licenses/Apache-2.0"
},
"language": "en",
"is_public": False,
"publication": "2022-07-17"
}, container_id, database_id)
print(response)
```
%% Cell type:code id: tags:
``` python
response = table.create({
"name": "Feature Extraction",
"description": "SeFiRe",
"columns": [{
"name": "Content",
"type": "STRING",
"unique": False,
"primary_key": False,
"null_allowed": True,
}, {
"name": "Start",
"type": "NUMBER",
"unique": False,
"primary_key": False,
"null_allowed": True,
}, {
"name": "Duration",
"type": "NUMBER",
"unique": False,
"primary_key": False,
"null_allowed": True,
}]
}, container_id, database_id)
table_id = response.id
print(response)
```
%% Cell type:code id: tags:
``` python
response = broker.send({
"date": "2021-07-17",
"location": "Melaka",
"parameter": "CO",
"interval": "h1",
"unit": "mg/m3",
"value": 0.3,
"status": "tentative"
})
print(response)
```
%% Output
True
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment