Module: Gitlab::Client::Packages

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

Overview

Defines methods related to GitLab Packages.

Instance Method Summary collapse

Instance Method Details

#delete_project_package(project, id) ⇒ void

This method returns an undefined value.

Deletes a project package.

Examples:

Gitlab.delete_project_package(5, 3)

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • id (Integer)

    ID of a package.



78
79
80
# File 'lib/gitlab/client/packages.rb', line 78

def delete_project_package(project, id)
  delete("/projects/#{url_encode project}/packages/#{id}")
end

#delete_project_package_file(project, package_id, file_id) ⇒ void

This method returns an undefined value.

Delete a package file.

Examples:

Gitlab.delete_project_file(5, 3, 1)

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • package_id (Integer)

    ID of a package.

  • file_id (Integer)

    ID of a package file.



91
92
93
# File 'lib/gitlab/client/packages.rb', line 91

def delete_project_package_file(project, package_id, file_id)
  delete("/projects/#{url_encode project}/packages/#{package_id}/package_files/#{file_id}")
end

#group_packages(group, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>

Gets a list of project packages.

Examples:

Gitlab.group_packages(5)
Gitlab.group_packages(5, { package_type: 'npm', sort: 'desc' })

Parameters:

  • project (Integer, String)

    the ID or name of a project.

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

    A customizable set of options.

Returns:



42
43
44
# File 'lib/gitlab/client/packages.rb', line 42

def group_packages(group, options = {})
  get("/groups/#{url_encode group}/packages", query: options)
end

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

Get a single project package.

Examples:

Gitlab.project_package(5, 3)

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • id (Integer)

    ID of a package.

Returns:



54
55
56
# File 'lib/gitlab/client/packages.rb', line 54

def project_package(project, id)
  get("/projects/#{url_encode project}/packages/#{id}")
end

#project_package_files(project, id) ⇒ Array<Gitlab::ObjectifiedHash>

Get a list of package files of a single package.

Examples:

Gitlab.project_package_files(5, 3)

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • id (Integer)

    ID of a package.

Returns:



66
67
68
# File 'lib/gitlab/client/packages.rb', line 66

def project_package_files(project, id)
  get("/projects/#{url_encode project}/packages/#{id}/package_files")
end

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

Gets a list of project packages.

Examples:

Gitlab.project_packages(5)
Gitlab.project_packages(5, { package_type: 'npm', sort: 'desc' })

Parameters:

  • :project (Integer, String)

    the ID or name of a project.

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

    A customizable set of options.

Returns:



22
23
24
# File 'lib/gitlab/client/packages.rb', line 22

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