Method: Gitlab::Client::Projects#create_deploy_key

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

#create_deploy_key(project, title, key, options = {}) ⇒ Gitlab::ObjectifiedHash

Creates a new deploy key.

Examples:

Gitlab.create_deploy_key(42, 'My Key', 'Key contents', can_push: true)

Parameters:

  • project (Integer, String)

    The ID or path of a project.

  • title (String)

    The title of a deploy key.

  • key (String)

    The content of a deploy key.

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

    A customizable set of options.

Returns:

[View source]

374
375
376
# File 'lib/gitlab/client/projects.rb', line 374

def create_deploy_key(project, title, key, options = {})
  post("/projects/#{url_encode project}/deploy_keys", body: { title: title, key: key }.merge(options))
end