Open
Description
name: Add Purge-delete method to the package
about: Adding method to delete data from dataset cubes at cortexintelligence
title: "[FEATURE] Few words to describe the feature"
labels: question
assignees: undefined
Is your feature request related to a problem? Please describe.
None
Describe the solution you'd like
Add the full stack of endpoints to be used at Cortex. The endpoint is basically the same to be used for downloading files at Cortex, with the notable exception that for deleting data from datasets is mandatory a key argument to be pointed which in this case is the column related to dataset with a value do delete the data.
An example of this application:
def cortex_cube_data_remove(plataform_url, plataform_username, plataform_password, cube, delete_tag):
"""
Chamada para efetuar a exclusão de dados de dentro da plataforma
Arguments:
plataform_url (str): url da plataforma a ser deletado os dados.
headers (dict): headers com autorização e informações complementares do post
tag (str): Campo Index para deletar os dados.
"""
url_post = 'https://'+plataform_url + \
'/service/integration-authorization-service.login'
json = {"login": plataform_username, "password": plataform_password}
response = requests.post(url_post, json=json)
response_json = response.json()
headers = {
"x-authorization-user-id": response_json['userId'],
"x-authorization-token": response_json['key']
}
url = """https://{plataform_url}/service/integration-cube-service.delete?cube={{"id":"{cube}"}}&filters=[{{"name":"tag_reprocess","type":"SIMPLE","value":"{delete_tag}"}}]"""
url = url.format(
plataform_url=plataform_url, cube=cube, delete_tag=delete_tag)
print(url)
response = requests.get(url, headers=headers)
print(response)
return response
Describe alternatives you've considered
None
Additional context
None