ballerinax/gitlab Ballerina library

1.5.2

Overview

The GitLab GitLab REST API v4 connector(https://about.gitlab.com/) OpenAPI specification.

Client endpoint for GitLab API currently supports operations related to access requests and access tokens in GitLab.

Key Features

  • Programmatic access to create and manage resources via REST API
  • Manage user accounts and profiles
  • Secure authentication with API key or OAuth support

Prerequisites

  • Create a GitLab account
  • Obtain tokens
    • Use this guide to obtain the PAT tokens related to your account

Quickstart

To use the GitLab connector in your Ballerina application, update the .bal file as follows:

Step 1 - Import connector

First, import the ballerinax/gitlab module into the Ballerina project.

Copy
import ballerinax/gitlab;

Step 2 - Create a new connector instance

You can now make the connection configuration using the PAT token

Copy
gitlab:ApiKeysConfig apiKeyConfig = {
    "privateToken": <GITLAB_PAT_TOKEN>
};

gitlab:Client baseClient = check new Client(apiKeyConfig);

Step 3 - Invoke connector operation

  1. Get Version Information
Copy
public function main() {
    gitlab:VersionResponse|error gitVersion = baseClient->getVersion();
    if (gitVersion is gitlab:VersionResponse) {
        log:printInfo("Git version " + gitVersion?.'version.toString());
    }
}
  1. Use bal run command to compile and run the Ballerina program

Import

import ballerinax/gitlab;Copy

Other versions

See more...

Metadata

Released date: 3 days ago

Version: 1.5.2

License: Apache-2.0


Compatibility

Platform: any

Ballerina version: 2201.8.0

GraalVM compatible: Yes


Pull count

Total: 45

Current verison: 0


Weekly downloads


Source repository


Keywords

Type/Connector

Vendor/GitLab

Area/Developer Tools

IT Operations/Source Control

Cost/Freemium


Contributors