Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Latest commit

 

History

History
144 lines (108 loc) · 4.08 KB

api.md

File metadata and controls

144 lines (108 loc) · 4.08 KB

CF K8s API Endpoint Documentation

This document captures API endpoints currently supported by the shim

Resources

Root

Docs: https://v3-apidocs.cloudfoundry.org/version/3.107.0/index.html#root

Resource Endpoint
Global API Root GET /
V3 API Root GET /v3

Resource Matches

Docs: https://v3-apidocs.cloudfoundry.org/version/3.107.0/index.html#resource-matches

Resource Endpoint
Create a Resource Match POST /v3/resource_matches
curl "http://localhost:9000/v3/resource_matches" \
  -X POST \
  -d '{}'

Apps

Docs: https://v3-apidocs.cloudfoundry.org/version/3.107.0/index.html#apps

Resource Endpoint
List Apps GET /v3/apps
Get App GET /v3/apps/<guid>
Create App POST /v3/apps
Set App's Current Droplet PATCH /v3/apps/<guid>/relationships/current_droplet
Start App POST /v3/apps/<guid>/actions/start
Stop App POST /v3/apps/<guid>/actions/stop
List App Processes GET /v3/apps/<guid>/processes
List App Routes GET /v3/apps/<guid>/routes

Note : namespace needs to exist before creating the app.

curl "http://localhost:9000/v3/apps" \
  -X POST \
  -d '{"name":"my-app","relationships":{"space":{"data":{"guid":"<namespace-name>"}}}}'
curl "http://localhost:9000/v3/apps/<app-guid>/relationships/current_droplet" \
  -X PATCH \
  -d '{"data":{"guid":"<droplet-guid>"}}'
curl "http://localhost:9000/v3/apps/<app-guid>/actions/start" \
  -X POST
curl "http://localhost:9000/v3/apps/<app-guid>/actions/stop" \
  -X POST

Packages

Resource Endpoint
Create Package POST /v3/packages
Upload Package Bits POST /v3/packages//upload
curl "http://localhost:9000/v3/packages" \
  -X POST \
  -d '{"type":"bits","relationships":{"app":{"data":{"guid":"<app-guid-goes-here>"}}}}'
curl "http://localhost:9000/v3/packages/<guid>/upload" \
  -X POST \
  -F bits=@"<path-to-app-source.zip>"

Builds

Docs: https://v3-apidocs.cloudfoundry.org/version/3.100.0/index.html#builds

Resource Endpoint
Get Build GET /v3/builds/<guid>
Create Build POST /v3/builds
curl "http://localhost:9000/v3/builds" \
  -X POST \
  -d '{"package":{"guid":"<package-guid-goes-here>"}}'

Droplet

Docs: https://v3-apidocs.cloudfoundry.org/version/3.100.0/index.html#droplets

Resource Endpoint
Get Droplet GET /v3/droplets/<guid>

Process

Docs: https://v3-apidocs.cloudfoundry.org/version/3.100.0/index.html#processes

Resource Endpoint
Get Process GET /v3/processes/<guid>/sidecars
Get Process Sidecars GET /v3/processes/<guid>/sidecars

Routes

Resource Endpoint
Get Route GET /v3/routes/<guid>
Get Route List GET /v3/routes
Get Route Destinations GET /v3/routes/<guid>\destinations
Create Route POST /v3/routes
curl "http://localhost:9000/v3/routes" \
  -X POST \
  -d '{"host": "hostname","path": "/path","relationships": {"domain": {"data": { "guid": "<domain-guid-goes-here>" }},"space": {"data": { "guid": "<namespace-name>" }}}}'