All Projects → rakutentech → cf-tools

rakutentech / cf-tools

Licence: GPL-3.0 license
Useful shell scripts for Cloud Foundry API v2

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to cf-tools

antifreeze
Cloud Foundry CLI plugin to detect if an app doesn't match the manifest
Stars: ✭ 21 (-4.55%)
Mutual labels:  cloud-foundry, cloudfoundry
heroku-buildpack-deno
Heroku Buildpack for Deno
Stars: ✭ 72 (+227.27%)
Mutual labels:  cloud-foundry, cloudfoundry
mssql-server-broker
Cloud Foundry service broker for Microsoft SQL Server
Stars: ✭ 13 (-40.91%)
Mutual labels:  cloudfoundry
swift-buildpack
IBM Cloud buildpack for Swift
Stars: ✭ 33 (+50%)
Mutual labels:  cloud-foundry
overview-broker
A service broker that provides an overview of its service instances and bindings. Conforms to the Open Service Broker API standard.
Stars: ✭ 18 (-18.18%)
Mutual labels:  cloud-foundry
minio-boshrelease
MinIO release for http://bosh.io/
Stars: ✭ 31 (+40.91%)
Mutual labels:  cloud-foundry
cloud-cf-espm
A reference application showcasing an end-to-end development scenario in Java on SAP BTP, Cloud Foundry environment.
Stars: ✭ 14 (-36.36%)
Mutual labels:  cloud-foundry
bosh-kubernetes-cpi-release
The goal for this project is to provide a fully functional BOSH CPI. It will eventually allow to deploy any BOSH release to any Kubernetes cluster.
Stars: ✭ 29 (+31.82%)
Mutual labels:  cloud-foundry
cf exporter
Cloud Foundry Prometheus Exporter
Stars: ✭ 21 (-4.55%)
Mutual labels:  cloud-foundry
loggregator
Archived: Now bundled in https://github.com/cloudfoundry/loggregator-release
Stars: ✭ 61 (+177.27%)
Mutual labels:  cloudfoundry
credhub
CredHub centralizes and secures credential generation, storage, lifecycle management, and access
Stars: ✭ 203 (+822.73%)
Mutual labels:  cloudfoundry
paas-aiven-broker
A service broker to provide Aiven Elasticsearch and InfluxDB services to Cloud Foundry users
Stars: ✭ 15 (-31.82%)
Mutual labels:  cloud-foundry
cloud-cap-risk-management
The SAP Risk Management example applications show how to deploy a CAP (SAP Cloud Application Programming model) application to Cloud Foundry and Kyma.
Stars: ✭ 36 (+63.64%)
Mutual labels:  cloud-foundry
vault-boshrelease
No description or website provided.
Stars: ✭ 29 (+31.82%)
Mutual labels:  cloud-foundry
starter-kit
Starter kit for full-stack JavaScript projects
Stars: ✭ 21 (-4.55%)
Mutual labels:  cloud-foundry
cf-sample-app-spring
Introduction to Cloud Foundry app deployment and management concepts.
Stars: ✭ 30 (+36.36%)
Mutual labels:  cloudfoundry
cf-python-client
Small cloudfoundry client implemented in python
Stars: ✭ 50 (+127.27%)
Mutual labels:  cloudfoundry
stackdriver-tools
Stackdriver Nozzle for Cloud Foundry Loggregator, Host Monitoring Agents BOSH Release
Stars: ✭ 22 (+0%)
Mutual labels:  cloud-foundry
cloud-cf-helloworld-nodejs
A "Hello World" application for Cloud Foundry using a simple RESTful API in Node.js with persistency in PostgreSQL and SAPUI5 UIs.
Stars: ✭ 45 (+104.55%)
Mutual labels:  cloud-foundry
bosh-softlayer-cpi-release
An external BOSH CPI for the SoftLayer cloud written in Golang
Stars: ✭ 14 (-36.36%)
Mutual labels:  cloud-foundry

Useful shell scripts for Cloud Foundry API v2 and v3

Dependencies:

  • jq (>=1.5) and cf (>=v6.43) commands must be installed
  • you must be logged in using "cf login"

How to install

Make sure you have git installed before continue

Linux 64-bit

mkdir -p ~/bin

which cf || { wget -q "https://packages.cloudfoundry.org/stable?release=linux64-binary&source=github" -O - | tar -xzC ~/bin cf && chmod +x ~/bin/cf; }
which jq || { wget -q "https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64" -O ~/bin/jq && chmod +x ~/bin/jq; }

git clone https://github.com/rakutentech/cf-tools ~/cf-tools

echo 'PATH="$PATH:$HOME/cf-tools"' >> ~/.profile
source ~/.profile

macOS

mkdir -p ~/bin

which cf || { curl -sL "https://packages.cloudfoundry.org/stable?release=macosx64-binary&source=github" | tar -zxC ~/bin cf && chmod +x ~/bin/cf; }
which jq || { curl -sL "https://github.com/stedolan/jq/releases/download/jq-1.6/jq-osx-amd64" -o ~/bin/jq && chmod +x ~/bin/jq; }

echo 'PATH="$HOME/bin:$PATH"' >> ~/.profile

git clone https://github.com/rakutentech/cf-tools ~/cf-tools

echo 'PATH="$PATH:$HOME/cf-tools"' >> ~/.profile
source ~/.profile

How to use

cf-curl.sh

Same as cf curl but fetches all pages at once.

Examples:

./cf-curl.sh /v2/users

# Get all events within the last hour (use gdate instead of date on macOS)
./cf-curl.sh -v "/v2/events?results-per-page=100&q=timestamp>$(date -u +%FT%TZ --date="1 hour ago")"

cf-instances.sh

Show list of instances (ip, port and some stats) for a particular application.

Examples:

./cf-instances.sh myapp

cf-target-app.sh

Set target org and space using application name

Examples:

./cf-target-app.sh myapp

cf-target-route.sh

Set target org and space using route

Examples:

./cf-target-route.sh myroute

cf-applist.sh

Show all applications running on Cloud Foundry.

Examples:

./cf-applist.sh -S Memory
./cf-applist.sh -c60 -f "#,Name,State,Memory,Instances,Organization,Created"

cf-routelist.sh

Show all routes for applications running on Cloud Foundry.

Examples:

./cf-routelist.sh -s Created
./cf-routelist.sh -c60 -f "#,Host,Domain,Path,Organization,Space,Created"

cf-orglist.sh

Show all organizations created on Cloud Foundry.

Examples:

./cf-orglist.sh
./cf-orglist.sh -c10080 -f "#,Name,Status,Created"

cf-routemappings.sh

Show all Route Mappings for Applications running on Cloud Foundry.

Examples:

./cf-routemappings.sh

# Add Organizations and Spaces to the output (works well only when application names across organizations and spaces are unique)
join --header -t$'\t' <(./cf-routemappings.sh -Nf App,Route -s App) <(./cf-applist.sh -Nf Name,Organization,Space -s Name) | column -ts$'\t' | less

cf-bg-restart.sh

Restart or restage an application without downtime (blue-green restart / restage).

WARNING: It is recommended to do simulation in test environment before using this command.

What you also should keep in mind when using this command:

  • GUID of application changes (which also means that cf events are lost)
  • Specific to restart only (not restage): droplet will lose information about which bits were used for its generation (cf curl /v3/apps/$(cf app MY_APP --guid)/droplets/current | jq .links.package will be null), which is not a problem unless you use other tools relying on this information

Examples:

./cf-bg-restart.sh APP_NAME
./cf-bg-restart.sh -r -s cflinuxfs3 APP_NAME

See also

Author

Stanislav German-Evtushenko

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].