Esempio n. 1
0
class SaveReleaseSchema(CSRFProtectedSchema, colander.MappingSchema):
    """An API schema for bodhi.server.services.releases.save_release()."""

    name = colander.SchemaNode(
        colander.String(),
    )
    long_name = colander.SchemaNode(
        colander.String(),
    )
    version = colander.SchemaNode(
        colander.String(),
        missing=None,
    )
    branch = colander.SchemaNode(
        colander.String(),
    )
    id_prefix = colander.SchemaNode(
        colander.String(),
    )
    dist_tag = colander.SchemaNode(
        colander.String(),
    )
    stable_tag = colander.SchemaNode(
        colander.String(),
    )
    testing_tag = colander.SchemaNode(
        colander.String(),
    )
    candidate_tag = colander.SchemaNode(
        colander.String(),
    )
    pending_signing_tag = colander.SchemaNode(
        colander.String(),
        missing="",
    )
    pending_testing_tag = colander.SchemaNode(
        colander.String(),
        missing="",
    )
    pending_stable_tag = colander.SchemaNode(
        colander.String(),
        missing="",
    )
    override_tag = colander.SchemaNode(
        colander.String(),
    )
    state = colander.SchemaNode(
        colander.String(),
        validator=colander.OneOf(list(ReleaseState.values())),
        missing="disabled",
    )
    edited = colander.SchemaNode(
        colander.String(),
        missing=None,
    )
    mail_template = colander.SchemaNode(
        colander.String(),
        missing="fedora_errata_template",
        validator=colander.OneOf(MAIL_TEMPLATES)
    )
Esempio n. 2
0
class SaveReleaseSchema(CSRFProtectedSchema, colander.MappingSchema):
    """An API schema for bodhi.server.services.releases.save_release()."""

    name = colander.SchemaNode(colander.String(), )
    long_name = colander.SchemaNode(colander.String(), )
    version = colander.SchemaNode(
        colander.String(),
        missing=None,
    )
    branch = colander.SchemaNode(colander.String(), )
    id_prefix = colander.SchemaNode(colander.String(), )
    dist_tag = colander.SchemaNode(colander.String(), )
    stable_tag = colander.SchemaNode(colander.String(), )
    testing_tag = colander.SchemaNode(colander.String(), )
    candidate_tag = colander.SchemaNode(colander.String(), )
    pending_signing_tag = colander.SchemaNode(
        colander.String(),
        missing="",
    )
    pending_testing_tag = colander.SchemaNode(
        colander.String(),
        missing="",
    )
    pending_stable_tag = colander.SchemaNode(
        colander.String(),
        missing="",
    )
    override_tag = colander.SchemaNode(colander.String(), )
    state = colander.SchemaNode(
        colander.String(),
        validator=colander.OneOf(list(ReleaseState.values())),
        missing="disabled",
    )
    edited = colander.SchemaNode(
        colander.String(),
        missing=None,
    )
    mail_template = colander.SchemaNode(
        colander.String(),
        missing="fedora_errata_template",
        validator=colander.OneOf(MAIL_TEMPLATES))
    composed_by_bodhi = colander.SchemaNode(
        colander.Boolean(true_choices=('true', '1')),
        missing=True,
    )
    create_automatic_updates = colander.SchemaNode(
        colander.Boolean(true_choices=('true', '1')),
        missing=False,
    )
    package_manager = colander.SchemaNode(
        colander.String(),
        validator=colander.OneOf(list(PackageManager.values())),
        missing="unspecified",
    )
    testing_repository = colander.SchemaNode(
        colander.String(),
        missing=None,
    )
Esempio n. 3
0
class ListReleaseSchema(PaginatedSchema):
    """
    An API schema for listing releases.

    This schema is used by bodhi.server.services.releases.query_releases_html() and
    bodhi.server.services.releases.query_releases_json().
    """

    ids = ReleaseIds(
        colander.Sequence(accept_scalar=True),
        location="querystring",
        missing=None,
        preparer=[util.splitter],
    )

    name = colander.SchemaNode(
        colander.String(),
        location="querystring",
        missing=None,
    )

    updates = Updates(
        colander.Sequence(accept_scalar=True),
        location="querystring",
        missing=None,
        preparer=[util.splitter],
    )

    packages = Packages(
        colander.Sequence(accept_scalar=True),
        location="querystring",
        missing=None,
        preparer=[util.splitter],
    )

    state = colander.SchemaNode(
        colander.String(),
        validator=colander.OneOf(list(ReleaseState.values())),
        missing=None,
    )

    exclude_archived = colander.SchemaNode(
        colander.Boolean(true_choices=('true', '1')),
        location="querystring",
        missing=None,
    )