diff options
author | Achilleas Pipinellis <axilleas@axilleas.me> | 2016-01-21 22:59:15 +0100 |
---|---|---|
committer | Achilleas Pipinellis <axilleas@axilleas.me> | 2016-01-21 22:59:15 +0100 |
commit | 308abc8db05f75da8f1cc66facb5e85bee5c69c4 (patch) | |
tree | 6b0acf3cbcf7036fb831381cfe195ad572d6a3c8 /lib/api/entities.rb | |
parent | a42fe49c8c953c0aa8ca20c8fb5a141447128894 (diff) | |
parent | c176fb40a52d32edc54843a5b54884cbab1e67e1 (diff) | |
download | gitlab-ce-308abc8db05f75da8f1cc66facb5e85bee5c69c4.tar.gz |
Merge branch 'master' into housekeeping-doc
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r-- | lib/api/entities.rb | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 26e7c956e8f..82a75734de0 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -71,6 +71,7 @@ module API expose :avatar_url expose :star_count, :forks_count expose :open_issues_count, if: lambda { |project, options| project.issues_enabled? && project.default_issues_tracker? } + expose :runners_token, if: lambda { |_project, options| options[:user_can_admin_project] } end class ProjectMember < UserBasic @@ -365,5 +366,40 @@ module API class TriggerRequest < Grape::Entity expose :id, :variables end + + class Runner < Grape::Entity + expose :id + expose :description + expose :active + expose :is_shared + expose :name + end + + class Build < Grape::Entity + expose :id, :status, :stage, :name, :ref, :tag, :coverage + expose :created_at, :started_at, :finished_at + expose :user, with: User + # TODO: download_url in Ci:Build model is an GitLab Web Interface URL, not API URL. We should think on some API + # for downloading of artifacts (see: https://gitlab.com/gitlab-org/gitlab-ce/issues/4255) + expose :download_url do |repo_obj, options| + if options[:user_can_download_artifacts] + repo_obj.download_url + end + end + expose :commit, with: RepoCommit do |repo_obj, _options| + if repo_obj.respond_to?(:commit) + repo_obj.commit.commit_data + end + end + expose :runner, with: Runner + end + + class Trigger < Grape::Entity + expose :token, :created_at, :updated_at, :deleted_at, :last_used + end + + class Variable < Grape::Entity + expose :key, :value + end end end |