summaryrefslogtreecommitdiff
path: root/lib/api/services.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/services.rb')
-rw-r--r--lib/api/services.rb25
1 files changed, 20 insertions, 5 deletions
diff --git a/lib/api/services.rb b/lib/api/services.rb
index 4e0c9cb1f63..cb07df9e249 100644
--- a/lib/api/services.rb
+++ b/lib/api/services.rb
@@ -356,7 +356,7 @@ module API
name: :ca_pem,
type: String,
desc: 'A custom certificate authority bundle to verify the Kubernetes cluster with (PEM format)'
- },
+ }
],
'mattermost-slash-commands' => [
{
@@ -488,6 +488,14 @@ module API
desc: 'The channel name'
}
],
+ 'microsoft-teams' => [
+ {
+ required: true,
+ name: :webhook,
+ type: String,
+ desc: 'The Microsoft Teams webhook. e.g. https://outlook.office.com/webhook/…'
+ }
+ ],
'mattermost' => [
{
required: true,
@@ -550,7 +558,8 @@ module API
RedmineService,
SlackService,
MattermostService,
- TeamcityService,
+ MicrosoftTeamsService,
+ TeamcityService
]
if Rails.env.development?
@@ -562,8 +571,14 @@ module API
desc: 'URL to the mock service'
}
]
+ services['mock-deployment'] = []
+ services['mock-monitoring'] = []
- service_classes << MockCiService
+ service_classes += [
+ MockCiService,
+ MockDeploymentService,
+ MockMonitoringService
+ ]
end
trigger_services = {
@@ -627,7 +642,7 @@ module API
service_params = declared_params(include_missing: false).merge(active: true)
if service.update_attributes(service_params)
- present service, with: Entities::ProjectService, include_passwords: current_user.is_admin?
+ present service, with: Entities::ProjectService, include_passwords: current_user.admin?
else
render_api_error!('400 Bad Request', 400)
end
@@ -658,7 +673,7 @@ module API
end
get ":id/services/:service_slug" do
service = user_project.find_or_initialize_service(params[:service_slug].underscore)
- present service, with: Entities::ProjectService, include_passwords: current_user.is_admin?
+ present service, with: Entities::ProjectService, include_passwords: current_user.admin?
end
end