magpie.api.management.service.service_formats

Module Contents

magpie.api.management.service.service_formats.format_service(service, permissions=None, show_private_url=False, show_resources_allowed=False) → JSON[source]

Formats the service information into JSON.

Note:
Automatically finds permissions of the service if not specified. To preserve empty permissions such as during listing of user/group resource permissions, an empty list should be specified.
magpie.api.management.service.service_formats.format_service_resources(service, db_session, service_perms=None, resources_perms_dict=None, show_all_children=False, show_private_url=True) → JSON[source]

Formats the service and its resource tree as a JSON body.

Parameters:
  • service – service for which to display details with sub-resources
  • db_session – database session
  • service_perms – permissions to display instead of specific service-type ones
  • resources_perms_dict – permission(s) of resource(s) id(s) to preserve if resources_perms_dict = False
  • show_all_children – display all children resources recursively, or only ones matching resources_perms_dict
  • show_private_url – displays the
Returns:

JSON body representation of the service resource tree

magpie.api.management.service.service_formats.format_service_resource_type(resource_class, service_class) → JSON[source]