### Run Local Development Server Source: https://context7.com/cloudfoundry/api-docs/llms.txt Install dependencies and start the Sinatra application locally using Rack. ```bash # Install dependencies bundle install ``` -------------------------------- ### Start the local development server Source: https://context7.com/cloudfoundry/api-docs/llms.txt Launches the application locally using rackup. The server defaults to port 9292. ```bash bundle exec rackup ``` ```bash curl http://localhost:9292/ ``` -------------------------------- ### Add Docs for New Release Source: https://github.com/cloudfoundry/api-docs/blob/main/README.md Use this script to add documentation for a new release of the Cloud Controller. It fetches version information and can be piped to the clipboard for easy insertion into JSON files. ```shell ./getversion_release.sh v270 | pbcopy ``` -------------------------------- ### Access Release Candidate Documentation Source: https://context7.com/cloudfoundry/api-docs/llms.txt Fetch unreleased API documentation from the release candidate branch via the /release-candidate/ path. ```bash # Access release candidate documentation (unreleased features) curl http://localhost:9292/release-candidate/ # Access specific page in release candidate docs curl http://localhost:9292/release-candidate/apps/create.html # The release candidate appears in the version dropdown menu # with a divider separating it from stable versions ``` -------------------------------- ### Access Version-Specific Documentation Source: https://context7.com/cloudfoundry/api-docs/llms.txt Retrieve documentation for specific CF Deployment or legacy CF Release versions by including the version number in the URL path. ```bash # Access documentation for CF Deployment version 39.2.0 (latest) curl http://localhost:9292/39.2.0/ # Access documentation for an older CF Deployment version curl http://localhost:9292/25.0.0/ # Access a specific API page for a version curl http://localhost:9292/39.2.0/apps/list.html # Access legacy CF Release version (192-287) curl http://localhost:9292/287/ # Access documentation with CC API version 2.100.0 curl http://localhost:9292/286/ # Example response includes version dropdown header: # ``` -------------------------------- ### Access Root and Latest Documentation Source: https://context7.com/cloudfoundry/api-docs/llms.txt Use the root endpoint to automatically redirect to the latest stable documentation version. The latest-release endpoint provides a stable URL for bookmarking current documentation. ```bash # Request the root URL - automatically redirects to latest version curl -I http://localhost:9292/ # Response: # HTTP/1.1 302 Found # Location: /39.2.0/ # Follow redirect to get the actual documentation curl -L http://localhost:9292/ ``` ```bash # Access latest release documentation curl -I http://localhost:9292/latest-release/ # Response: # HTTP/1.1 302 Found # Location: /39.2.0/ # Access a specific page within latest release curl -I http://localhost:9292/latest-release/apps/get.html # Response: # HTTP/1.1 302 Found # Location: /39.2.0/apps/get.html # Follow the redirect to get documentation content curl -L http://localhost:9292/latest-release/organizations/list.html ``` -------------------------------- ### Deploy to Cloud Foundry Source: https://context7.com/cloudfoundry/api-docs/llms.txt Commands to authenticate, target the organization, and push the application to Pivotal Web Services. ```bash # Login to Pivotal Web Services cf api api.run.pivotal.io cf login # Use credentials from LastPass - PWS user (Runtime) # Target the cfcommunity organization cf target -o cfcommunity # Deploy the application cf push apidocs # The application will be available at: # https://apidocs.cfapps.io/ # Verify deployment curl https://apidocs.cfapps.io/ ``` -------------------------------- ### Configure version data Source: https://context7.com/cloudfoundry/api-docs/llms.txt JSON configuration files map CF versions to commit SHAs or build IDs. New entries should be added at the beginning of the array. ```json // data/cf-deployment-api-versions.json - Modern versions using GitHub SHAs [ { "CF_VERSION": "39.2.0", "CC_SHA": "fca7638dc1e7f92e3161a9523a387de843eef275", "CC_API_VERSION": "2.224.0" }, { "CF_VERSION": "39.1.0", "CC_SHA": "fca7638dc1e7f92e3161a9523a387de843eef275", "CC_API_VERSION": "2.224.0" } ] // data/cf-release-api-versions.json - Legacy versions // Newer entries use CC_SHA (fetches from GitHub) [ { "CF_VERSION": "287", "CC_SHA": "1429549d039d414fc6a3db82106a83926de28eb4", "CC_API_VERSION": "2.102.0" } ] // Older entries use BUILD_ID (fetches from S3) [ { "CF_VERSION": "237", "BUILD_ID": 129583505, "CC_API_VERSION": "2.56.0" } ] ``` -------------------------------- ### Generate Version Metadata Source: https://context7.com/cloudfoundry/api-docs/llms.txt Use helper scripts to extract version metadata from CF Deployment or legacy CF Release repositories for inclusion in the application's data files. ```bash # Generate version entry for CF Deployment v39.2.0 ./getversion.sh v39.2.0 # Output: # {"CF_VERSION": "39.2.0", "CC_SHA": "fca7638dc1e7f92e3161a9523a387de843eef275", "CC_API_VERSION": "2.224.0"}, # Copy output directly to clipboard for pasting into JSON file ./getversion.sh v38.0.0 | pbcopy # Add the JSON output to data/cf-deployment-api-versions.json: # [ # {"CF_VERSION": "39.2.0", "CC_SHA": "fca7638dc1e7f92e3161a9523a387de843eef275", "CC_API_VERSION": "2.224.0"}, # {"CF_VERSION": "39.1.0", "CC_SHA": "fca7638dc1e7f92e3161a9523a387de843eef275", "CC_API_VERSION": "2.224.0"}, # ... # ] ``` ```bash # Generate version entry for CF Release v270 ./getversion_release.sh v270 # Output: # {"CF_VERSION": "270", "CC_SHA": "d2dbae2838ec0aa8d8b26e8918d4036405177716", "CC_API_VERSION": "2.92.0"}, # Copy output directly to clipboard ./getversion_release.sh v270 | pbcopy # Add to data/cf-release-api-versions.json for legacy versions ``` -------------------------------- ### Execute the RSpec test suite Source: https://context7.com/cloudfoundry/api-docs/llms.txt Runs the full test suite to verify routing, content fetching, and version lookup functionality. ```bash bundle exec rspec spec ``` -------------------------------- ### Login to Cloud Foundry API Source: https://github.com/cloudfoundry/api-docs/blob/main/README.md Command to log in to the Cloud Foundry API. Ensure you have the correct credentials from LastPass for PWS user (Runtime). ```shell cf api api.run.pivotal.io ``` ```shell cf login ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.