Dockerized Cloud Foundry Restfull API
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
Please follow the steps below before you build the code;
git clone https://github.com/haidouks/cloud_foundry_python_api.git
cd cloud_foundry_python_api
Then you need to edit Dockerfile for the following environment variables
ENV user="[email protected]"
ENV password="MyPass"
ENV api_endpoint="https://api.run.pivotal.io"
Build dockerfile
docker build . -t cloud_foundry_python_api
Python Api listens port 8081, run container on port 8080
docker run cloud_foundry_python_api -d -p 8080:8080
Browse url http://localhost:8080 on your favorite browser.
GET /buildpacksGET /spacesGET /spaces/<space_name>GET /spaces/<space_name>/service_instancesGET /spaces/<space_name>/appsGET /spaces/<space_name>/apps/<app_name>/summaryGET /spaces/<space_name>/apps/<app_name>/statsGET /spaces/<space_name>/apps/<app_name>/metricsGET /spaces/<space_name>/apps/<app_name>/buildpacksGET /spaces/<space_name>/apps/<app_name>/service_bindingsGET /spaces/<space_name>/apps/<app_name>/service_bindings/<service_binding_name>DELETE /spaces/<space_name>/apps/<app_name>/service_bindings/<service_binding_name>GET /metrics_urls/<org_name>GET /organizationsGET /organizations/<org_name>GET /buildpacksGET /spaces/<space_name>/service_bindings/<service_binding_name>GET /service_keysPOST /api_urlFor the secure methods, token should be specified in header.
curl http://localhost:8080/spaces/mySpace/apps/myApp/summary -H "Authorization : token DevOps123"
For getting any CF Api Url, full path of the api should be provided.
curl http://localhost:8080/api_url -d "url=http://api.run.pivotal.io/v2/spaces/add2e0a1-afbd-4166-a515-78f4fbf3279d" -X POST -H "Authorization : token DevOps123"
Content type
Image
Digest
Size
345.4 MB
Last updated
over 7 years ago
docker pull cnsn/pcf_python_api