Module: Gitlab::Client::PipelineSchedules

Included in:
Gitlab::Client
Defined in:
lib/gitlab/client/pipeline_schedules.rb

Overview

Defines methods related to pipeline schedules.

Instance Method Summary collapse

Instance Method Details

#create_pipeline_schedule(project, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>

Create a pipeline schedule.

Examples:

Gitlab.create_pipeline_schedule(5, { description: 'example' })

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • options (Hash) (defaults to: {})

    A customizable set of options.

Options Hash (options):

  • :description (String)

    The description of pipeline scehdule.

  • :ref (String)

    The branch/tag name will be triggered.

  • :cron (String)

    The cron (e.g. 0 1 * * *).

  • :cron_timezone (String)

    The timezone supproted by ActiveSupport::TimeZone (e.g. Pacific Time (US & Canada)) (default: ‘UTC’).

  • :active (Boolean)

    The activation of pipeline schedule. If false is set, the pipeline schedule will deactivated initially (default: true).

Returns:



44
45
46
# File 'lib/gitlab/client/pipeline_schedules.rb', line 44

def create_pipeline_schedule(project, options={})
  post("/projects/#{url_encode project}/pipeline_schedules", query: options)
end

#create_pipeline_schedule_variable(project, pipeline_schedule_id, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>

Create a pipeline schedule variable.

Examples:

Gitlab.create_pipeline_schedule_variable(5, 1, { key: 'foo', value: 'bar' })

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • trigger_id (Integer)

    The pipeline schedule ID.

  • options (Hash) (defaults to: {})

    A customizable set of options.

Options Hash (options):

  • :key (String)

    The key of a variable; must have no more than 255 characters; only A-Z, a-z, 0-9, and _ are allowed.

  • :value (String)

    The value of a variable

Returns:



101
102
103
# File 'lib/gitlab/client/pipeline_schedules.rb', line 101

def create_pipeline_schedule_variable(project, pipeline_schedule_id, options={})
  post("/projects/#{url_encode project}/pipeline_schedules/#{pipeline_schedule_id}/variables", query: options)
end

#delete_pipeline_schedule(project, pipeline_schedule_id) ⇒ Gitlab::ObjectifiedHash

Delete a pipeline schedule.

Examples:

Gitlab.delete_pipeline_schedule(5, 1)

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • trigger_id (Integer)

    The pipeline schedule ID.

Returns:



86
87
88
# File 'lib/gitlab/client/pipeline_schedules.rb', line 86

def delete_pipeline_schedule(project, pipeline_schedule_id)
  delete("/projects/#{url_encode project}/pipeline_schedules/#{pipeline_schedule_id}")
end

#delete_pipeline_schedule_variable(project, pipeline_schedule_id, key, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>

Delete the variable of a pipeline schedule

Examples:

Gitlab.delete_pipeline_schedule_variable(3, 2, "foo")

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • The (Integer)

    pipeline schedule ID.

  • The (String)

    key of a variable.

Returns:



129
130
131
# File 'lib/gitlab/client/pipeline_schedules.rb', line 129

def delete_pipeline_schedule_variable(project, pipeline_schedule_id, key, options={})
  delete("/projects/#{url_encode project}/pipeline_schedules/#{pipeline_schedule_id}/variables/#{url_encode key}")
end

#edit_pipeline_schedule(project, pipeline_schedule_id, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>

Updates the pipeline schedule of a project.

Examples:

Gitlab.edit_pipeline_schedule(3, 2, { description: 'example2' })

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • The (Integer)

    pipeline schedule ID.

  • options (Hash) (defaults to: {})

    A customizable set of options.

Options Hash (options):

  • :description (String)

    The description of pipeline scehdule.

  • :ref (String)

    The branch/tag name will be triggered.

  • :cron (String)

    The cron (e.g. 0 1 * * *).

  • :cron_timezone (String)

    The timezone supproted by ActiveSupport::TimeZone (e.g. Pacific Time (US & Canada)) (default: ‘UTC’).

  • :active (Boolean)

    The activation of pipeline schedule. If false is set, the pipeline schedule will deactivated initially (default: true).

Returns:



62
63
64
# File 'lib/gitlab/client/pipeline_schedules.rb', line 62

def edit_pipeline_schedule(project, pipeline_schedule_id, options={})
  put("/projects/#{url_encode project}/pipeline_schedules/#{pipeline_schedule_id}", query: options)
end

#edit_pipeline_schedule_variable(project, pipeline_schedule_id, key, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>

Updates the variable of a pipeline schedule.

Examples:

Gitlab.edit_pipeline_schedule_variable(3, 2, "foo" { value: 'bar' })

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • The (Integer)

    pipeline schedule ID.

  • The (String)

    key of a variable.

  • options (Hash) (defaults to: {})

    A customizable set of options.

Options Hash (options):

  • :value (String)

    The value of a variable.

Returns:



116
117
118
# File 'lib/gitlab/client/pipeline_schedules.rb', line 116

def edit_pipeline_schedule_variable(project, pipeline_schedule_id, key, options={})
  put("/projects/#{url_encode project}/pipeline_schedules/#{pipeline_schedule_id}/variables/#{url_encode key}", query: options)
end

#pipeline_schedule(project, id) ⇒ Gitlab::ObjectifiedHash

Gets a single pipeline schedule.

Examples:

Gitlab.pipeline_schedule(5, 3)

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • id (Integer)

    The ID of the pipeline schedule.

Returns:



27
28
29
# File 'lib/gitlab/client/pipeline_schedules.rb', line 27

def pipeline_schedule(project, id)
  get("/projects/#{url_encode project}/pipeline_schedules/#{id}")
end

#pipeline_schedule_take_ownership(project, pipeline_schedule_id) ⇒ Gitlab::ObjectifiedHash

Take ownership of a pipeline schedule.

Examples:

Gitlab.pipeline_schedule_take_ownership(5, 1)

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • trigger_id (Integer)

    The pipeline schedule ID.

Returns:



74
75
76
# File 'lib/gitlab/client/pipeline_schedules.rb', line 74

def pipeline_schedule_take_ownership(project, pipeline_schedule_id)
  post("/projects/#{url_encode project}/pipeline_schedules/#{pipeline_schedule_id}/take_ownership")
end

#pipeline_schedules(project, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>

Gets a list of project pipeline schedules.

Examples:

Gitlab.pipeline_schedules(5)
Gitlab.pipeline_schedules(5, { scope: 'active' })

Parameters:

  • project (Integer, String)

    the ID or name of a project.

  • options (Hash) (defaults to: {})

    A customizable set of options.

Returns:



15
16
17
# File 'lib/gitlab/client/pipeline_schedules.rb', line 15

def pipeline_schedules(project, options={})
  get("/projects/#{url_encode project}/pipeline_schedules", query: options)
end