Sha256: d54d7dbb273e74e7dc141c30501048545515185f0069513eeaf1278b2e250d18

Contents?: true

Size: 1.68 KB

Versions: 2

Compression:

Stored size: 1.68 KB

Contents

# frozen_string_literal: true

module DroneCI
  module CronAPI
    # Create a new cron job.
    #
    # Please note this api requires write access to the repository.
    #
    # Reference: https://docs.drone.io/api/cron/cron_create/
    def cron_create(owner, repo, **body)
      api.post("repos/#{owner}/#{repo}/cron", body)
    end

    # Deletes a cron job.
    #
    # Please note this api requires write access to the repository.
    #
    # Reference: https://docs.drone.io/api/cron/cron_delete/
    def cron_delete(owner, repo, name)
      api.delete("repos/#{owner}/#{repo}/cron/#{name}")
    end

    # Returns the named cron job.
    #
    # Please note this api requires write access to the repository.
    #
    # Reference: https://docs.drone.io/api/cron/cron_info/
    def cron_info(owner, repo, name)
      api.get("repos/#{owner}/#{repo}/cron/#{name}")
    end

    # Returns the cron job list.
    #
    # Please note this api requires write access to the repository.
    #
    # Reference: https://docs.drone.io/api/cron/cron_list/
    def cron_list(owner, repo)
      api.get("repos/#{owner}/#{repo}/cron")
    end

    # Trigger an existing cron task.
    #
    # Please note this api requires write access to the repository.
    #
    # Reference: https://docs.drone.io/api/cron/cron_trigger/
    def cron_trigger(owner, repo, name)
      api.post("repos/#{owner}/#{repo}/cron/#{name}")
    end

    # Updates the named cron job.
    #
    # Please note this api requires write access to the repository.
    #
    # Reference: https://docs.drone.io/api/cron/cron_update/
    def cron_update(owner, repo, name, **body)
      api.patch("repos/#{owner}/#{repo}/cron/#{name}", body)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
drone-ci-0.2.0 lib/drone-ci/api/cron.rb
drone-ci-0.1.1 lib/drone-ci/api/cron.rb