add api endpoint: /build/<id>/constituents

Returns a list of constituent builds
This commit is contained in:
Graham Christensen
2021-09-24 15:52:46 -04:00
parent 99161c7c53
commit c60c8d10ea
4 changed files with 111 additions and 0 deletions

View File

@ -104,6 +104,19 @@ sub build_GET {
$c->stash->{binaryCachePublicUri} = $c->config->{binary_cache_public_uri};
}
sub constituents :Chained('buildChain') :PathPart('constituents') :Args(0) :ActionClass('REST') { }
sub constituents_GET {
my ($self, $c) = @_;
my $build = $c->stash->{build};
$self->status_ok(
$c,
entity => [$build->constituents_->search({}, {order_by => ["job"]})]
);
}
sub view_nixlog : Chained('buildChain') PathPart('nixlog') {
my ($self, $c, $stepnr, $mode) = @_;