ZettaIO / cachet-client

A python 3.6+ client for the Cachet API : https://cachet-client.readthedocs.io/
MIT License
14 stars 8 forks source link

Parameter "components" does not work. #27

Closed UllenBullen closed 3 weeks ago

UllenBullen commented 3 weeks ago

Hello There. Got a little question. I wanted to use the cachet-client in a python script to add multiple subscribers to cachet. The goal is that this subscribers only got one specific component.

In some descriptions they mentioned to use the "components" for this. But when i run the script. Nothing happens and the subscribers is setted global

image

import cachetclient

client = cachetclient.Client(
    endpoint='Link',
    api_token='token',
)

sub = client.subscribers.create(
    email='user@test.test', 
    components=[2],
    verify=True)

The id from the component is correct. I've checked it.

Here is my reference Link: https://cachet-client.readthedocs.io/_/downloads/en/latest/pdf/

UllenBullen commented 3 weeks ago

I found the solution. If you set the component parameter, it will set it in the PostgreSQL database. In my case, with the prefix, it is in the table: chq_subscriptions.

image

But there is another field that sets it to global in the table: chq_subscribers. This global column has to be set to false.

image