Skip to content

silence action does not work with sensu v0.29+ #7

Open

Description

@autumnw

Sensu API was changed, the old api "/stashes" does not work any more.
Instead, should use "/silenced". It was already implemented in https://github.com/sangoma/pysensu/blob/master/pysensu/api.py

Activity

  1. LindsayHill commented on Aug 5, 2017

    @LindsayHill
    Contributor

    Their docs seem to indicate it is still supported? https://sensuapp.org/docs/latest/api/stashes-api.html

    I can't quite figure it out though, as some older docs talk about migrating from stash-based silencing https://sensuapp.org/docs/0.26/reference/silencing.html#migrating-from-stash-based-silencing

    Looks like it should be pretty straightforward to change the actions if we need to though. Don't even need to change the names.

  2. pietervogelaar commented on Nov 28, 2017

    @pietervogelaar

    +1 Silence action doesn't work. I'm running Sensu version 1.0.2 and stackstorm-sensu pack v0.5.0

  3. LindsayHill commented on Nov 28, 2017

    @LindsayHill
    Contributor

    @pietervogelaar so what changes need to be made? When I looked at this earlier, it seemed that they did still support /stashes - is that no longer the case? Can you submit a PR to make calls to a different Sensu API, if that is what is required?

  4. arunsr2015 commented on May 6, 2019

    @arunsr2015

    @LindsayHill I hit the same issue, looks like stashes for silence does not work, i modified the action a bit and i can see the check silenced in sensu ui

    `
    class SilenceAction(SensuAction):
    def run(self, check, client, expiration, message):
    path = 'silence/{}'.format(client)
    if check:
    path = "{}/{}".format(path, check)

        payload = {}
        payload['message'] = message
    
        if expiration:
            payload['expire'] = expiration
    
        if check:
            payload['check'] = check
    
        if client:
            payload['subscription'] = client
    
    
        #return self.api.create_stash(payload, path)
        return self.api.post_silence_request(payload)
    

    `

  5. LindsayHill commented on May 6, 2019

    @LindsayHill
    Contributor

    Please submit a PR with that change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions