Module: Gitlab::Client::ProjectReleaseLinks

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

Overview

Defines methods related to project release links.

Instance Method Summary collapse

Instance Method Details

Create an asset as a link from a Release.

Examples:

Gitlab.create_project_release_link(5, 'v0.1', { name: 'awesome-v0.2.dmg', url: 'http://192.168.10.15:3000' })

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • tag_name (String)

    The tag associated with the Release.

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

    A customizable set of options.

Options Hash (options):

  • :name(required) (String)

    The name of the link.

  • :url(required) (String)

    The URL of the link.

Returns:


43
44
45
# File 'lib/gitlab/client/project_release_links.rb', line 43

def create_project_release_link(project, tag_name, options = {})
  post("/projects/#{url_encode project}/releases/#{tag_name}/assets/links", body: options)
end

Delete an asset as a link from a Release.

Examples:

Gitlab.delete_project_release_link(5, 'v0.3', 1)

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • tag_name (String)

    The tag where the release will be created from.

  • link_id (Integer)

    The id of the link.

Returns:


72
73
74
# File 'lib/gitlab/client/project_release_links.rb', line 72

def delete_project_release_link(project, tag_name, link_id)
  delete("/projects/#{url_encode project}/releases/#{tag_name}/assets/links/#{link_id}")
end

Get an asset as link from a Release.

Examples:

Gitlab.project_release_link(5, 'v0.3', 1)

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • tag_name (String)

    The tag associated with the Release.

  • link_id (Integer)

    The id of the link.

Returns:


28
29
30
# File 'lib/gitlab/client/project_release_links.rb', line 28

def project_release_link(project, tag_name, link_id)
  get("/projects/#{url_encode project}/releases/#{tag_name}/assets/links/#{link_id}")
end

Get assets as links from a Release.

Examples:

Gitlab.project_release_links(5, 'v0.3')

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • tag_name (String)

    The tag associated with the Release.

Returns:


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

def project_release_links(project, tag_name)
  get("/projects/#{url_encode project}/releases/#{tag_name}/assets/links")
end

Update an asset as a link from a Release. You have to specify at least one of name or url

Examples:

Gitlab.update_project_release_link(5, 'v0.3', 1, { name: 'awesome-v0.2.dmg', url: 'http://192.168.10.15:3000' })

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • tag_name (String)

    The tag where the release will be created from.

  • link_id (Integer)

    The id of the link.

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

    A customizable set of options.

Options Hash (options):

  • :name(optional) (String)

    The name of the link.

  • :url(optional) (String)

    The URL of the link.

Returns:


59
60
61
# File 'lib/gitlab/client/project_release_links.rb', line 59

def update_project_release_link(project, tag_name, link_id, options = {})
  put("/projects/#{url_encode project}/releases/#{tag_name}/assets/links/#{link_id}", body: options)
end