All URIs are relative to http://log.ano.yumimobi.com/api
Method | HTTP request | Description |
---|---|---|
add_member | PUT /roles/{rolename}/members/{username} | Add a user to a role |
create | POST /roles | Create a new role |
delete | DELETE /roles/{rolename} | Remove the named role and dissociate any users from it |
get_members | GET /roles/{rolename}/members | Retrieve the role's members |
list_all | GET /roles | List all roles |
read | GET /roles/{rolename} | Retrieve permissions for a single role |
remove_member | DELETE /roles/{rolename}/members/{username} | Remove a user from a role |
update | PUT /roles/{rolename} | Update an existing role |
add_member(rolename, username, json_body=json_body)
Add a user to a role
import time
import graylog
from graylog.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = graylog.RolesApi()
rolename = graylog.Object() # Object |
username = graylog.Object() # Object |
json_body = 'json_body_example' # String | Placeholder because PUT requests should have a body. Set to '{}', the content will be ignored. (optional)
try:
# Add a user to a role
api_instance.add_member(rolename, username, json_body=json_body)
except ApiException as e:
print "Exception when calling RolesApi->add_member: %s\n" % e
Name | Type | Description | Notes |
---|---|---|---|
rolename | Object | ||
username | Object | ||
json_body | String | Placeholder because PUT requests should have a body. Set to '{}', the content will be ignored. | [optional] |
void (empty response body)
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
create(json_body)
Create a new role
import time
import graylog
from graylog.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = graylog.RolesApi()
json_body = graylog.RoleResponse() # RoleResponse | The new role to create
try:
# Create a new role
api_instance.create(json_body)
except ApiException as e:
print "Exception when calling RolesApi->create: %s\n" % e
Name | Type | Description | Notes |
---|---|---|---|
json_body | RoleResponse | The new role to create |
void (empty response body)
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
delete(rolename)
Remove the named role and dissociate any users from it
import time
import graylog
from graylog.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = graylog.RolesApi()
rolename = graylog.Object() # Object |
try:
# Remove the named role and dissociate any users from it
api_instance.delete(rolename)
except ApiException as e:
print "Exception when calling RolesApi->delete: %s\n" % e
Name | Type | Description | Notes |
---|---|---|---|
rolename | Object |
void (empty response body)
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RoleMembershipResponse get_members(rolename)
Retrieve the role's members
import time
import graylog
from graylog.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = graylog.RolesApi()
rolename = graylog.Object() # Object |
try:
# Retrieve the role's members
api_response = api_instance.get_members(rolename)
pprint(api_response)
except ApiException as e:
print "Exception when calling RolesApi->get_members: %s\n" % e
Name | Type | Description | Notes |
---|---|---|---|
rolename | Object |
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RolesResponse list_all()
List all roles
import time
import graylog
from graylog.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = graylog.RolesApi()
try:
# List all roles
api_response = api_instance.list_all()
pprint(api_response)
except ApiException as e:
print "Exception when calling RolesApi->list_all: %s\n" % e
This endpoint does not need any parameter.
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RoleResponse read(rolename)
Retrieve permissions for a single role
import time
import graylog
from graylog.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = graylog.RolesApi()
rolename = graylog.Object() # Object |
try:
# Retrieve permissions for a single role
api_response = api_instance.read(rolename)
pprint(api_response)
except ApiException as e:
print "Exception when calling RolesApi->read: %s\n" % e
Name | Type | Description | Notes |
---|---|---|---|
rolename | Object |
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
remove_member(rolename, username)
Remove a user from a role
import time
import graylog
from graylog.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = graylog.RolesApi()
rolename = graylog.Object() # Object |
username = graylog.Object() # Object |
try:
# Remove a user from a role
api_instance.remove_member(rolename, username)
except ApiException as e:
print "Exception when calling RolesApi->remove_member: %s\n" % e
Name | Type | Description | Notes |
---|---|---|---|
rolename | Object | ||
username | Object |
void (empty response body)
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RoleResponse update(rolename, json_body)
Update an existing role
import time
import graylog
from graylog.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = graylog.RolesApi()
rolename = graylog.Object() # Object |
json_body = graylog.RoleResponse() # RoleResponse | The new representation of the role
try:
# Update an existing role
api_response = api_instance.update(rolename, json_body)
pprint(api_response)
except ApiException as e:
print "Exception when calling RolesApi->update: %s\n" % e
Name | Type | Description | Notes |
---|---|---|---|
rolename | Object | ||
json_body | RoleResponse | The new representation of the role |
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]