Example #1
0
 def show(self, request, volume_type, brief=False):
     """Trim away extraneous volume type attributes."""
     context = request.environ['cinder.context']
     trimmed = dict(id=volume_type.get('id'),
                    name=volume_type.get('name'),
                    is_public=volume_type.get('is_public'),
                    description=volume_type.get('description'))
     if common.validate_policy(context,
                               'volume_extension:access_types_extra_specs'):
         trimmed['extra_specs'] = volume_type.get('extra_specs')
     if common.validate_policy(
             context, 'volume_extension:access_types_qos_specs_id'):
         trimmed['qos_specs_id'] = volume_type.get('qos_specs_id')
     return trimmed if brief else dict(volume_type=trimmed)
Example #2
0
 def show(self, request, volume_type, brief=False):
     """Trim away extraneous volume type attributes."""
     context = request.environ['cinder.context']
     trimmed = dict(id=volume_type.get('id'),
                    name=volume_type.get('name'),
                    is_public=volume_type.get('is_public'),
                    description=volume_type.get('description'))
     if common.validate_policy(
        context,
        'volume_extension:access_types_extra_specs'):
         trimmed['extra_specs'] = volume_type.get('extra_specs')
     if common.validate_policy(
        context,
        'volume_extension:access_types_qos_specs_id'):
         trimmed['qos_specs_id'] = volume_type.get('qos_specs_id')
     return trimmed if brief else dict(volume_type=trimmed)
Example #3
0
 def show(self, request, group_type, brief=False):
     """Trim away extraneous group type attributes."""
     context = request.environ['cinder.context']
     trimmed = dict(id=group_type.get('id'),
                    name=group_type.get('name'),
                    description=group_type.get('description'),
                    is_public=group_type.get('is_public'))
     if common.validate_policy(context, 'group:access_group_types_specs'):
         trimmed['group_specs'] = group_type.get('group_specs')
     return trimmed if brief else dict(group_type=trimmed)
Example #4
0
 def show(self, request, group_type, brief=False):
     """Trim away extraneous group type attributes."""
     context = request.environ['cinder.context']
     trimmed = dict(id=group_type.get('id'),
                    name=group_type.get('name'),
                    description=group_type.get('description'),
                    is_public=group_type.get('is_public'))
     if common.validate_policy(
             context,
             'group:access_group_types_specs'):
         trimmed['group_specs'] = group_type.get('group_specs')
     return trimmed if brief else dict(group_type=trimmed)