Ask Your Question

remove resource

asked 2013-08-01 07:36:37 -0600

Arteal gravatar image

Hello, how can i remove specific resource from Puppetdb?

We have definedtype for creating graphs. I've created graph and then deleted it, but resource is still in puppetdb.

[arteal@john ~]$ curl -G -H "Accept: application/json" 'http://puppetmaster:8080/resources' --data-urlencode 'query=["and", ["=", "type", "File"], ["=", "title", "/etc/gdash/elasticsearch/es2/elastic-threads-completed.graph"]]'
[ {
  "parameters" : {
    "ensure" : "present",
    "group" : "root",
    "tag" : "gdash",
    "owner" : "root",
    "content" : "title \"es2 elastic-threads-completed\"\ndescription \"ElasticSearch completed threads growth\"\nvtitle \"threads completed\"\n\narea :none\nlinemode :slope\nlinewidth 2\nyunit_system :si\nfontname \"DroidSansMono\"\nfontsize 9\n\nfield :completed,\n  :scale => \"1\",\n  :scale_to_second => false,\n  :color => \"blue\",\n ...
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-08-06 21:58:24 -0600

GregLarkin gravatar image

Instead of manually deleting the graph file, thereby stranding the resource in PuppetDB, why not create a defined class that you can use to delete both items when you are finished with the graph? The primary feature of the class would be an "ensure => absent" attribute. You would also need to pass in enough other parameters to uniquely identify the resource in order to delete it.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2013-08-01 07:36:37 -0600

Seen: 898 times

Last updated: Aug 06 '13