Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to delete an aggregate using Aggregates API - Sensu 0.20.3 #1070

Closed
hpio opened this issue Oct 12, 2015 · 6 comments

Comments

Projects
None yet
3 participants
@hpio
Copy link

commented Oct 12, 2015

Hi,
I'm using Sensu 0.20.3 version.

I currently have a list of aggregates on my server as below. Using Aggregates API I am not able to delete aggregates that are upper case like JAVA, APACHE etc - the API returns 404 Not Found. The same DELETE request works ok (returning 204) on lower case aggregates.

[
  {
    "check": "check_mounts",
    "issued": []
  },
  {
    "check": "cron",
    "issued": []
  },
  {
    "check": "apache",
    "issued": []
  },
  {
    "check": "check_cron",
    "issued": []
  },
  {
    "check": "check_ssh",
    "issued": []
  },
  {
    "check": "JAVA",
    "issued": []
  },
  {
    "check": "mounts",
    "issued": []
  },
  {
    "check": "APACHE",
    "issued": []
  },
  {
    "check": "java",
    "issued": []
  },
  {
    "check": "MOUNTS",
    "issued": []
  },
  {
    "check": "tomcat",
    "issued": []
  },
  {
    "check": "updates",
    "issued": []
  },
  {
    "check": "SSH",
    "issued": []
  },
  {
    "check": "check_java",
    "issued": []
  },
  {
    "check": "CRON",
    "issued": []
  },
  {
    "check": "check_apache",
    "issued": []
  },
  {
    "check": "ssh",
    "issued": []
  },
  {
    "check": "check_updates",
    "issued": []
  },
  {
    "check": "UPDATES",
    "issued": []
  }
]

@portertech portertech added the Bug label Oct 16, 2015

@portertech

This comment has been minimized.

Copy link
Member

commented Oct 16, 2015

@JackBauer8301 Thank you for reporting this bug 👍

Perhaps the endpoint regex - https://github.com/sensu/sensu/blob/master/lib/sensu/api/process.rb#L607

@hpio

This comment has been minimized.

Copy link
Author

commented Oct 16, 2015

hi @portertech ,
that was my initial idea so I played with the regex a bit so that it matches both lower-case and upper-case characters but I couldn't make it work

Things I've tried:

%r{^(i?)/aggregates/([\w\.-]+)/?$} do |check_name| 
%r{^/aggregates/([\A-Za-z\.-]+)/?$} do |check_name|   - although that's covered by \w

What seems weird to me is that I manually deleted all keys related to those aggregates from Redis but they still appear in Uchiwa.

@portertech

This comment has been minimized.

Copy link
Member

commented Oct 19, 2015

Let's add a Sensu API spec for this and see if it is due to the API itself and guard against regressions. 👍

@portertech portertech self-assigned this Oct 19, 2015

@portertech portertech added the Small label Oct 19, 2015

@calebhailey calebhailey added this to the 0.24 milestone Apr 7, 2016

@calebhailey

This comment has been minimized.

Copy link
Member

commented Apr 7, 2016

Tagging for 0.24.

@portertech

This comment has been minimized.

Copy link
Member

commented May 30, 2016

@portertech

This comment has been minimized.

Copy link
Member

commented May 30, 2016

#1301 has been merged, tests pass with the 0.24 Aggregates 2.0 implementation 👍

@portertech portertech closed this May 30, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.