Exemple #1
0
class OsdSerializer(ValidatingSerializer):
    class Meta:
        fields = ('uuid', 'up', 'in', 'id', 'reweight', 'server', 'pools',
                  'valid_commands', 'public_addr', 'cluster_addr',
                  'crush_node_ancestry', 'backend_partition_path',
                  'backend_device_node', 'osd_data', 'osd_journal')
        create_allowed = ()
        create_required = ()
        modify_allowed = ('up', 'in', 'reweight')
        modify_required = ()

    id = serializers.IntegerField(
        read_only=True,
        source='osd',
        help_text="ID of this OSD within this cluster")
    uuid = fields.UuidField(read_only=True,
                            help_text="Globally unique ID for this OSD")
    up = fields.BooleanField(
        required=False,
        help_text=
        "Whether the OSD is running from the point of view of the rest of the cluster"
    )
    _in = fields.BooleanField(
        required=False,
        help_text=
        "Whether the OSD is 'in' the set of OSDs which will be used to store data"
    )
    reweight = serializers.FloatField(required=False,
                                      help_text="CRUSH weight factor")
    server = serializers.CharField(
        read_only=True,
        help_text="FQDN of server this OSD was last running on")
    pools = serializers.Field(
        help_text="List of pool IDs which use this OSD for storage")
    valid_commands = serializers.CharField(
        read_only=True,
        help_text="List of commands that can be applied to this OSD")

    public_addr = serializers.CharField(read_only=True,
                                        help_text="Public/frontend IP address")
    cluster_addr = serializers.CharField(
        read_only=True, help_text="Cluster/backend IP address")
    crush_node_ancestry = serializers.Field(
        help_text=
        "An ordered list of CRUSH node ids that represent a path from the parent node of this OSD up to the root of the tree"
    )
    backend_partition_path = serializers.CharField(
        read_only=True,
        help_text="Full path to the storage partition targeted by this OSD")
    backend_device_node = serializers.CharField(
        read_only=True,
        help_text=
        "Physical device node that the OSD's targeted partition is provisioned from"
    )
    osd_data = serializers.CharField(
        read_only=True, help_text="Full path to the OSD data mountpoint")
    osd_journal = serializers.CharField(
        read_only=True, help_text="Full path to the OSD journal mountpoint")
Exemple #2
0
class OsdSerializer(ValidatingSerializer):
    class Meta:
        fields = ('uuid', 'up', 'in', 'id', 'reweight', 'server', 'pools',
                  'valid_commands', 'public_addr', 'cluster_addr')
        create_allowed = ()
        create_required = ()
        modify_allowed = ('up', 'in', 'reweight')
        modify_required = ()

    id = serializers.IntegerField(
        read_only=True,
        source='osd',
        help_text="ID of this OSD within this cluster")
    uuid = fields.UuidField(read_only=True,
                            help_text="Globally unique ID for this OSD")
    up = fields.BooleanField(
        required=False,
        help_text=
        "Whether the OSD is running from the point of view of the rest of the cluster"
    )
    _in = fields.BooleanField(
        required=False,
        help_text=
        "Whether the OSD is 'in' the set of OSDs which will be used to store data"
    )
    reweight = serializers.FloatField(required=False,
                                      help_text="CRUSH weight factor")
    server = serializers.CharField(
        read_only=True,
        help_text="FQDN of server this OSD was last running on")
    pools = serializers.Field(
        help_text="List of pool IDs which use this OSD for storage")
    valid_commands = serializers.CharField(
        read_only=True,
        help_text="List of commands that can be applied to this OSD")

    public_addr = serializers.CharField(read_only=True,
                                        help_text="Public/frontend IP address")
    cluster_addr = serializers.CharField(
        read_only=True, help_text="Cluster/backend IP address")