项目作者: SAP

项目描述 :
This package provides a set of APIs for easy application development with Cloud Foundry. You can use these APIs to manage apps, service instances, orgs, spaces, and users in your environment.
高级语言: TypeScript
项目地址: git://github.com/SAP/cloud-foundry-tools-api.git
创建时间: 2020-03-24T16:59:31Z
项目社区:https://github.com/SAP/cloud-foundry-tools-api

开源协议:Apache License 2.0

下载


GitHub package.json version
CircleCI
Coverage Status
Commitizen friendly
REUSE status

Overview

This package provides a set of APIs to help you develop applications in Cloud Foundry. You can use these APIs to manage apps, service instances, orgs, spaces, and users in your environment. Mostly, this is a wrapper of the CF command line client, which runs a particular command and parses the output to the suitable JSON file. If an error or failure occurs, the runtime exception throws with relevant problem information.

API Reference Guide

API guide

Prerequisite

Make sure you have installed the CF CLI v8 tool in your environment.

Examples of usage

Example 1

  1. try {
  2. const result = await cfLogin("https://api.cf.....com", "user", "password");
  3. if (result === "OK") {
  4. // successful
  5. }
  6. } catch (e) {
  7. // display or/and log error
  8. }

Example 2

  1. try {
  2. const spaces = await cfGetAvailableSpaces("myOrg");
  3. for (const space of spaces) {
  4. console.log("Space label is " + space.label + " guid is " + space.guid);
  5. }
  6. } catch (e) {
  7. // display or/and log error
  8. }

Contributing

Contributing information can be found in the CONTRIBUTING.md file.