Customerole with api and curl command

Hello
I am trying create a custom role with curl -v -XGET -u username:password -H 'Content-Type: application/json' -H 'X-Requested-By: cli' '{"read_only": false,"permissions":["inputs:create", "inputs:delete", "inputs:edit"], "name": "inputs_extractor_editors","description": "Users assigned this role willbe able to edit inputs and extractors"}' 'https://graylog-nonprod.moodagent.io/api/roles.

Command is successful, returns json. but role is not created. it does not appear in returned json and nor on Graylog UI. Any pointers pls ?

Following is the output of above command.

{"roles":[{"name":"GRAYLOG-APP-EDITOR","description":"All editors from APP team","permissions":["streams:read:5f3698bbe5c65e7c820d096b","streams:read:5f478767fd9764295c373e37","streams:read:000000000000000000000001","streams:read:5fc962b1ab00665b62df4dde","streams:read:5f36a13476fa73586756a6f9"],"read_only":false},{"name":"GRAYLOG-WEB-READ","description":"All readers from WEB  team","permissions":["streams:read:5f3698bbe5c65e7c820d096b","streams:read:5f478767fd9764295c373e37","streams:read:000000000000000000000003","streams:read:000000000000000000000001","streams:read:5fc962b1ab00665b62df4dde","dashboards:read:5f37055eb374af220036571e","streams:read:5f36a13476fa73586756a6f9","dashboards:read:5f368b2f9042c11067f3fe64","dashboards:read:5f3d19e633d98201340c4ddc","dashboards:read:5f478d0dfd9764295c374406"],"read_only":false},{"name":"Create Dashboards","description":"Permission to create dashboards","permissions":["dashboards:create","dashboards:read:5fa3e44fd71124c88ea9df79","dashboards:read:5f37055eb374af220036571e","dashboards:read:5f478d0dfd9764295c374406"],"read_only":false},{"name":"Sidecar System (Internal)","description":"Internal technical role. Grants access to register and pull configurations for a Sidecar node (built-in)","permissions":["sidecar_collectors:read","sidecars:update","sidecar_collector_configurations:read"],"read_only":true},{"name":"GRAYLOG-DATA-READ","description":"All readers from DATA team","permissions":["streams:read:5f7c5fa3a41a9a09feac3847","dashboards:read:5fa3e44fd71124c88ea9df79","streams:read:5fa3e368da79cd2f788c0d19","dashboards:read:5ffd8846c02560d44db12842"],"read_only":false},{"name":"GRAYLOG-WEB-EDITOR","description":"All editors from WEB team","permissions":["streams:read:5f3698bbe5c65e7c820d096b","streams:read:5f478767fd9764295c373e37","streams:read:000000000000000000000001","dashboards:read:5f37055eb374af220036571e","streams:read:5fc962b1ab00665b62df4dde","streams:read:5f36a13476fa73586756a6f9","dashboards:read:5f478d0dfd9764295c374406"],"read_only":false},{"name":"Alerts Manager","description":"Allows reading and writing all event definitions and event notifications (built-in)","permissions":["eventnotifications:edit","eventdefinitions:read","eventdefinitions:create","eventdefinitions:delete","eventdefinitions:execute","eventdefinitions:edit","eventnotifications:create","eventnotifications:delete","eventnotifications:read"],"read_only":true},{"name":"Temporaryadmins","description":"temp admins","permissions":["streams:read:5f3698bbe5c65e7c820d096b","streams:read:5f478767fd9764295c373e37","streams:read:5fa3e368da79cd2f788c0d19","streams:read:000000000000000000000002","streams:read:000000000000000000000001","streams:read:5fc962b1ab00665b62df4dde","streams:edit:5f36a13476fa73586756a6f9","streams:edit:5f7c5fa3a41a9a09feac3847","streams:read:5f7c5fa3a41a9a09feac3847","streams:edit:5f478767fd9764295c373e37","streams:edit:5fa3e368da79cd2f788c0d19","streams:edit:5f733de9fdb7010abf8e049a","streams:edit:5f3698bbe5c65e7c820d096b","streams:read:000000000000000000000003","streams:edit:000000000000000000000003","streams:read:5f36a13476fa73586756a6f9","streams:edit:5fc962b1ab00665b62df4dde","streams:edit:000000000000000000000002","streams:edit:000000000000000000000001","streams:read:5f733de9fdb7010abf8e049a"],"read_only":false},{"name":"Reader","description":"Grants basic permissions for every Graylog user (built-in)","permissions":["clusterconfigentry:read","indexercluster:read","messagecount:read","journal:read","messages:analyze","inputs:read","metrics:read","savedsearches:edit","fieldnames:read","buffers:read","system:read","savedsearches:create","jvmstats:read","decorators:read","throughput:read","savedsearches:read","messages:read"],"read_only":true},{"name":"GRAYLOG-API-READ","description":"All readers in API team","permissions":["streams:read:5f3698bbe5c65e7c820d096b","streams:read:5f478767fd9764295c373e37","streams:read:5fa3e368da79cd2f788c0d19","streams:read:000000000000000000000001","streams:read:5fc962b1ab00665b62df4dde","dashboards:read:5f37055eb374af220036571e","streams:read:5f36a* Connection #0 to host graylog.moodagent.io left intact
13476fa73586756a6f9","dashboards:read:5f368b2f9042c11067f3fe64","dashboards:read:5f3d19e633d98201340c4ddc","dashboards:read:5f478d0dfd9764295c374406"],"read_only":false},{"name":"GRAYLOG-API-EDITOR","description":"All editors in API team","permissions":["streams:read:5f3698bbe5c65e7c820d096b","streams:read:5f478767fd9764295c373e37","dashboards:edit:5f368b2f9042c11067f3fe64","streams:read:5fa3e368da79cd2f788c0d19","dashboards:edit:5f37055eb374af220036571e","streams:read:000000000000000000000002","streams:read:000000000000000000000001","streams:read:5fc962b1ab00665b62df4dde","dashboards:read:5f3d19e633d98201340c4ddc","streams:edit:5f36a13476fa73586756a6f9","dashboards:read:5f478d0dfd9764295c374406","streams:edit:5f478767fd9764295c373e37","streams:edit:5fa3e368da79cd2f788c0d19","streams:edit:5f3698bbe5c65e7c820d096b","dashboards:edit:5f478d0dfd9764295c374406","streams:read:000000000000000000000003","dashboards:edit:5f3d19e633d98201340c4ddc","streams:edit:000000000000000000000003","dashboards:read:5f37055eb374af220036571e","streams:read:5f36a13476fa73586756a6f9","dashboards:read:5f368b2f9042c11067f3fe64","streams:edit:5fc962b1ab00665b62df4dde","streams:edit:000000000000000000000002","streams:edit:000000000000000000000001"],"read_only":false},{"name":"Views Manager","description":"Allows reading and writing all views and extended searches (built-in)","permissions":["view:edit","view:read"],"read_only":true},{"name":"Admin","description":"Grants all permissions for Graylog administrators (built-in)","permissions":["*"],"read_only":true},{"name":"GRAYLOG-APP-READ","description":"All readers from APP  team","permissions":["dashboards:read:5fa3e44fd71124c88ea9df79","streams:read:5f3698bbe5c65e7c820d096b","streams:read:5f478767fd9764295c373e37","streams:read:000000000000000000000001","streams:read:5fc962b1ab00665b62df4dde","dashboards:read:5f37055eb374af220036571e","streams:read:5f36a13476fa73586756a6f9","dashboards:read:5f368b2f9042c11067f3fe64","dashboards:read:5f3d19e633d98201340c4ddc","dashboards:read:5f478d0dfd9764295c374406"],"read_only":false},{"name":"GRAYLOG-DATA-EDITOR","description":"All editors from DATA team","permissions":["streams:read:5f7c5fa3a41a9a09feac3847","streams:edit:5fa3e368da79cd2f788c0d19","streams:read:5fa3e368da79cd2f788c0d19","streams:edit:5f7c5fa3a41a9a09feac3847"],"read_only":false}],"total":15}*

If course, it’s not working, you need to use POST and not GET.

1 Like

Thank you so much. What a silly mistake.

been there… done that…will probably be there again… no shame… good luck

:pray: :pray: :pray: thanks

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.