Esempio n. 1
0
class NetworkResponse(NetworkIDSerializer):
    status = serializers.ChoiceField(
        help_text=NetworkStatus.get_info("Network Status:", list_str=True),
        choices=NetworkStatus.to_choices(True),
    )
    created_at = serializers.DateTimeField(help_text="Network create time")
    updated_at = serializers.DateTimeField(help_text="Network update time")
Esempio n. 2
0
class AgentUpdateBody(AgentPatchBody):
    status = serializers.ChoiceField(
        required=False,
        allow_null=True,
        help_text=NetworkStatus.get_info(),
        choices=NetworkStatus.to_choices(),
    )
Esempio n. 3
0
class HostResponse(HostIDSerializer, HostCreateBody):
    status = serializers.ChoiceField(
        help_text=NetworkStatus.get_info(), choices=NetworkStatus.to_choices()
    )
    created_at = serializers.DateTimeField(help_text="Create time")
    schedulable = serializers.BooleanField(
        help_text="Whether hos can be schedulable"
    )
Esempio n. 4
0
class NetworkQuery(serializers.Serializer):
    page = serializers.IntegerField(
        required=False, help_text="Page of filter", default=1, min_value=1
    )
    per_page = serializers.IntegerField(
        required=False,
        help_text="Per Page of filter",
        default=10,
        max_value=100,
    )
    status = serializers.ChoiceField(
        required=False,
        help_text=NetworkStatus.get_info(),
        choices=NetworkStatus.to_choices(),
    )
Esempio n. 5
0
class NetworkQuery(serializers.Serializer):
    page = serializers.IntegerField(required=False,
                                    help_text="Page of filter",
                                    default=1,
                                    min_value=1)
    per_page = serializers.IntegerField(
        required=False,
        help_text="Per Page of filter",
        default=10,
        max_value=100,
    )
    status = serializers.ChoiceField(
        required=False,
        help_text=NetworkStatus.get_info("Network Status:", list_str=True),
        choices=NetworkStatus.to_choices(True),
    )

    class Meta:
        model = Network
        fields = ("page", "per_page", "name")
        extra_kwargs = {"name": {"required": False}}
Esempio n. 6
0
class NetworkResponse(serializers.Serializer):
    status = serializers.ChoiceField(
        help_text=NetworkStatus.get_info(), choices=NetworkStatus.to_choices()
    )
Esempio n. 7
0
class AgentQuery(PageQuerySerializer):
    status = serializers.ChoiceField(
        required=False,
        help_text=NetworkStatus.get_info(),
        choices=NetworkStatus.to_choices(),
    )