Rakuten Cloud Platform PoC

LoopBack

ENV file syntax

  • POSTGRES_USER=
  • POSTGRES_PASSWORD=
  • JFROG_APIKEY=
  • ARTIFACTORY_BASE_URL=
  • JFROG_USER=
  • VALID_ARTIFACTS=application/x-gzip,application/x-tar,application/x-gtar,application/x-tgz,application/gzip

Start a server

Install dependencies:

npm install

Start server

npm start

The JFrog test API exposed are as follows:

  • PUT /artifacts

    To upload a bundle

    Accepts: multipart/form-data:

    • file: Rakuten-bundle-file. eg. omnicare-v1.2.tar.gz
    • bundle: name of bundle, name of application or the application submitted by vendor e.g. omnicare
    • org: Organization. i.e. repository name
    • revision: The revision for testing purpose. It will be auto-managed after implementation
  • GET /artifacts/{org}/{bundle}/{revision}

    To download a bundle

    Accepts: */*

    example: http://localhost:3000/artifacts/rakuten-poc-bundle/omnicare/3.1 to fetch the v3.1 bundle of omnicare under rakuten-poc-bundle repository

Documentation

rakuten-jfrog-loopback v1.0.0

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

code

Base URLs:

ArtifactsController

ArtifactsController.downloadArtifact

Code samples

const headers = {
  'Accept':'application/octet-stream'
};

fetch('http://localhost:3000/artifacts/{org}/{bundle}/{revision}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');

const headers = {
  'Accept':'application/octet-stream'
};

fetch('http://localhost:3000/artifacts/{org}/{bundle}/{revision}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

GET /artifacts/{org}/{bundle}/{revision}

Parameters

Name In Type Required Description
org path string true none
bundle path string true none
revision path string true none

Example responses

200 Response

Responses

Status Meaning Description Schema
200 OK The file content string
This operation does not require authentication

ArtifactsController.uploadArtifact

Code samples

const inputBody = '{}';
const headers = {
  'Content-Type':'multipart/form-data'
};

fetch('http://localhost:3000/artifacts',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');
const inputBody = {};
const headers = {
  'Content-Type':'multipart/form-data'
};

fetch('http://localhost:3000/artifacts',
{
  method: 'PUT',
  body: JSON.stringify(inputBody),
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

PUT /artifacts

Body parameter

{}

Parameters

Name In Type Required Description
body body object true Upload an artifact

Responses

Status Meaning Description Schema
200 OK Return value of ArtifactsController.uploadArtifact None
This operation does not require authentication