Method: Gitlab::Client::Projects#project_template

Defined in:
lib/gitlab/client/projects.rb

#project_template(project, type, key, options = {}) ⇒ Gitlab::ObjectifiedHash

Get one project template of a particular type

Examples:

Gitlab.project_template(1, 'dockerfiles', 'dockey')
Gitlab.project_template(1, 'licenses', 'gpl', { project: 'some project', fullname: 'Holder Holding' })

Parameters:

  • project (Integer, String)

    The ID or URL-encoded path of the project.

  • type (String)

    The type (dockerfiles|gitignores|gitlab_ci_ymls|licenses) of the template

  • key (String)

    The key of the template, as obtained from the collection endpoint

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

    A customizable set of options.

Options Hash (options):

  • project(optional) (String)

    The project name to use when expanding placeholders in the template. Only affects licenses

  • fullname(optional) (String)

    The full name of the copyright holder to use when expanding placeholders in the template. Only affects licenses

Returns:

See Also:


621
622
623
# File 'lib/gitlab/client/projects.rb', line 621

def project_template(project, type, key, options = {})
  get("/projects/#{url_encode project}/templates/#{type}/#{key}", query: options)
end