summaryrefslogtreecommitdiff
path: root/spec/contracts/consumer/resources/api/pipeline_schedules.js
blob: ad04e59b9cd3a582d06741d4c2712584e73f5d04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import axios from 'axios';

export async function updatePipelineSchedule(endpoint) {
  const { url } = endpoint;

  return axios({
    method: 'PUT',
    baseURL: url,
    url: '/gitlab-org/gitlab-qa/-/pipeline_schedules/25',
    headers: {
      Accept: '*/*',
      'Content-Type': 'application/json; charset=utf-8',
    },
    data: {
      schedule: {
        description: 'bar',
        cron: '0 1 * * *',
        cron_timezone: 'UTC',
        active: true,
      },
    },
    validateStatus: (status) => {
      return status === 302;
    },
  });
}