Skip to content

Evref-BL/Gitlab-Pharo-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gitlab-Pharo-API

Continuous Coverage Status

This is a Pharo client for the Gitlab REST API

Usage

Installation

From playground

Metacello new
  githubUser: 'Evref-BL' project: 'Gitlab-Pharo-API' commitish: 'main' path: 'src';
  baseline: 'GitlabAPI';
  onConflict: [ :ex | ex useIncoming ];
  load

Baseline dependency

spec baseline: 'GitlabAPI' with: [
	spec repository: 'github://Evref-BL/Gitlab-Pharo-API:main' ];

Client

To start using the API, you need to create a client instance with your GitLab host URL and a private token for authentication. Here’s an example:

gitlabApi := GitlabApi new
	privateToken: '<your token>';
	hostUrl: 'https://<your gitlab domain>.com/api/v4';
	yourself.

Replace <your token> with your actual GitLab private token and replace <your gitlab domain> with the appropriate domain.

Ressources

The API provides different resource classes to interact with various GitLab entities. These resources include:

  • branches
  • commits
  • discussions
  • groups
  • jobs
  • mergeRequests
  • notes
  • pipelines
  • projects
  • repositories
  • users

Each resource provides methods for interacting with the corresponding GitLab resource. You can access them like this:

gitlabApi projects <method>

Example

Here are a few examples of how to interact with the API:

Fetch All Projects

This example retrieves all projects from GitLab:

| projects |
projects := gitlabApi projects all

Fetch All Projects Sorted in Ascending Order

This example demonstrates how to fetch all projects sorted in ascending order, using parameters:

| projects params |
params := {
  #sort -> 'asc'
} asDictionary.

projects := gitlabApi projects allWithParams: params.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 5