pulp :: server :: webservices :: controllers :: consumers :: Consumer :: Class Consumer
[hide private]
[frames] | no frames]

Class Consumer

source code

         object --+    
                  |    
base.JSONController --+
                      |
                     Consumer

Instance Methods [hide private]
 
GET(self, id)
Get a consumer's meta data.
source code
 
PUT(self, id)
Update consumer
source code
 
DELETE(self, id)
Delete a consumer.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

    Inherited from base.JSONController
 
_output(self, data)
JSON encode the response and set the appropriate headers
source code
 
bad_request(self, msg=None)
Return a not found error.
source code
 
conflict(self, msg=None)
Return a conflict error.
source code
 
created(self, location, data)
Return a created response.
source code
 
filter_results(self, results, filters)
Returns: list of model instances that meat the criteria in the filters
source code
 
filters(self, valid)
Fetch any parameters passed on the url
source code
 
internal_server_error(self, msg=None)
Return an internal server error.
source code
 
method_not_allowed(self, msg=None)
Return a method not allowed error.
source code
 
no_content(self) source code
 
not_acceptable(self, msg=None)
Return a not acceptable error.
source code
 
not_found(self, msg=None)
Return a not found error.
source code
 
ok(self, data)
Return an ok response.
source code
 
params(self)
JSON decode the objects in the requests body and return them
source code
 
unauthorized(self, msg=None) source code
Static Methods [hide private]
    Inherited from base.JSONController
 
error_handler(method)
Static controller method wrapper that catches internal errors and reports them as JSON serialized trace back strings
source code
 
user_auth_required(roles=())
Static Controller method to check user permissions on web service calls
source code
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

GET(self, id)

source code 

Get a consumer's meta data.

Parameters:
  • id - consumer id
Returns:
consumer meta data
Decorators:
  • @JSONController.error_handler
  • @RoleCheck(consumer_id= True, admin= True)

PUT(self, id)

source code 

Update consumer

Parameters:
  • id (str) - The consumer id
Decorators:
  • @JSONController.error_handler
  • @RoleCheck(admin= True)

DELETE(self, id)

source code 

Delete a consumer.

Parameters:
  • id - consumer id
Returns:
True on successful deletion of consumer
Decorators:
  • @JSONController.error_handler
  • @RoleCheck(consumer_id= True, admin= True)