### Clone and Install Dependencies Source: https://github.com/cloudfoundry/cf-openapi/blob/main/README.md Initial setup commands to clone the repository and install required Node.js dependencies. ```bash git clone https://github.com/cloudfoundry/cf-openapi.git cd cf-openapi ``` ```bash yarn install ``` -------------------------------- ### Install Go (if not installed) Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/build-scripts.md These commands demonstrate how to check for a Go installation and how to download and install Go if it is not already present on the system. This is a prerequisite for running Wiretap. ```bash # Check Go installation go version # If not installed wget https://golang.org/dl/go1.21.0.linux-amd64.tar.gz tar -C /usr/local -xzf go1.21.0.linux-amd64.tar.gz ``` -------------------------------- ### Buildpack Lifecycle Example Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/types.md Example JSON configuration for a buildpack lifecycle, specifying the buildpacks and stack to be used. ```json { "type": "buildpack", "data": { "buildpacks": ["python_buildpack"], "stack": "cflinuxfs4" } } ``` -------------------------------- ### Get Usage Summary Response Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/endpoints.md Example of a successful response when retrieving the platform-wide resource usage summary. ```json { "usage_summary": { "organizations": { "total": 10 }, "spaces": { "total": 50 }, "apps": { "total": 100 }, "memory_in_mb": { "total": 5120 } } } ``` -------------------------------- ### Common Workflows with yarn Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/build-scripts.md Examples of common development workflows using yarn, including installation, building, previewing, version management, and testing. ```bash # Full development cycle yarn install # Install dependencies yarn build # Bundle specifications yarn preview # Start documentation server # Version management yarn create-version 3.131.0 # Create new version yarn build # Rebuild with new version # Testing yarn lint # Check spec validity yarn test:mockserver http://localhost:3000 dist/latest/openapi.yaml yarn test:compliance # Validate against live API ``` -------------------------------- ### Docker Lifecycle Example Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/types.md Example JSON configuration for a Docker lifecycle, indicating that a pre-built Docker image will be used. ```json { "type": "docker", "data": {} } ``` -------------------------------- ### Check Go Installation Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/build-scripts.md Verifies if the Go programming language is installed and accessible in the system's PATH. Exits the process if Go is not found. ```javascript async function checkGoExists() { try { await runCommand('go', ['version'], { captureOutput: true }); } catch (error) { console.error('Go is not installed or not in PATH'); process.exit(1); } } ``` -------------------------------- ### Best Practice: Build before Preview Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/build-scripts.md Ensures that the project is built before starting the preview server. ```bash yarn build && yarn preview ``` -------------------------------- ### Start Application Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/endpoints.md Starts a stopped application. The endpoint returns the updated application object upon successful start. ```text POST /v3/apps/{guid}/actions/start ``` -------------------------------- ### Start Application Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/endpoints.md Starts a stopped application. ```APIDOC ## Start Application ### Description Starts a stopped application. ### Method POST ### Endpoint /v3/apps/{guid}/actions/start ### Parameters #### Path Parameters - **guid** (UUID) - Required - The unique identifier of the application to start. ### Response #### Success Response (200 OK) Returns the updated App object. ``` -------------------------------- ### Best Practice: Use Mock Server for Iteration Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/build-scripts.md Command to start a mock server for quick iteration during development. ```bash # Fast feedback loop yarn test:mockserver http://localhost:3000 dist/latest/openapi.yaml ``` -------------------------------- ### Get Buildpack Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/endpoints.md Retrieve the details of a specific buildpack using its GUID. ```APIDOC ## GET /v3/buildpacks/{guid} ### Description Retrieve a specific buildpack. ### Method GET ### Endpoint /v3/buildpacks/{guid} ### Path Parameters - **guid** (UUID) - Required - The GUID of the buildpack to retrieve. ### Response #### Success Response (200 OK) - **Buildpack** (object) - The details of the buildpack. ``` -------------------------------- ### Label Selector Syntax Example Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/types.md Illustrates the syntax for filtering resources based on their labels. ```plaintext env=production,team!=frontend team in (backend,frontend) !deprecated ``` -------------------------------- ### Get and Use Access Token with cURL Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/authentication-security.md Obtain an access token using client credentials and then use it to make an API request. Ensure you have `jq` installed for parsing JSON responses. ```bash TOKEN=$(curl -s -X POST https://uaa.example.local/oauth/token \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "Accept: application/json" \ -d "grant_type=client_credentials" \ -d "client_id=$CLIENT_ID" \ -d "client_secret=$CLIENT_SECRET" \ | jq -r '.access_token') curl -H "Authorization: Bearer $TOKEN" \ https://api.example.local/v3/apps ``` -------------------------------- ### Get Application Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/endpoints.md Retrieve a specific application by its GUID. Supports including related resources like space and organization. ```APIDOC ## GET /v3/apps/{guid} ### Description Retrieve a specific application. ### Method GET ### Endpoint /v3/apps/{guid} ### Parameters #### Path Parameters - **guid** (string (UUID)) - Yes - Application GUID #### Query Parameters - **include** (string) - No - space, space.organization ### Response #### Success Response (200 OK) (same schema as creation response) **Error Responses:** - 401 Unauthorized - 403 Forbidden - 404 Not Found ``` -------------------------------- ### HTTP CORS Headers Example Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/authentication-security.md Example HTTP headers demonstrating Cross-Origin Resource Sharing (CORS) configuration. These headers allow requests from specified origins and specify allowed methods and headers. ```http Access-Control-Allow-Origin: * Access-Control-Allow-Methods: GET, POST, PATCH, DELETE, OPTIONS Access-Control-Allow-Headers: Content-Type, Authorization Access-Control-Max-Age: 3600 ``` -------------------------------- ### Create Domain Request Body Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/endpoints.md Example request body for creating a new domain. ```json { "name": "example.com", "internal": false, "relationships": { "organization": { "data": { "guid": "org-guid" } } } } ``` -------------------------------- ### Example Curl Request with Bearer Token Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/authentication-security.md Demonstrates how to include the Bearer token in a curl request for authentication. ```bash curl -H "Authorization: Bearer $TOKEN" https://api.example.local/v3/some/resource ``` -------------------------------- ### Restart Application Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/endpoints.md Synchronously stops and then starts an application. Errors if the app fails to stop. ```APIDOC ## Restart Application ### Description Synchronously stops and then starts an application. Errors if the app fails to stop. ### Method POST ### Endpoint /v3/apps/{guid}/actions/restart ### Parameters #### Path Parameters - **guid** (UUID) - Required - The unique identifier of the application to restart. ### Response #### Success Response (200 OK) Returns the updated App object. ``` -------------------------------- ### Restart Application Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/endpoints.md Synchronously stops and then starts an application. This operation will error if the application fails to stop within the runtime. ```text POST /v3/apps/{guid}/actions/restart ``` -------------------------------- ### Get API Info Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/endpoints.md Retrieves Cloud Foundry deployment information, including title, version, and build details. ```APIDOC ## GET /v3/info ### Description Retrieve Cloud Foundry deployment information. ### Method GET ### Endpoint /v3/info ### Response #### Success Response (200 OK) - **title** (string) - **description** (string) - **version** (string) - **build** (string) - **deprecations** (array) ### Response Example ```json { "title": "Cloud Foundry", "description": "...", "version": "...", "build": "...", "deprecations": [...] } ``` ``` -------------------------------- ### Get Task Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/endpoints.md Retrieve details of a specific task by its GUID. ```APIDOC ## Get Task ### Description Retrieve a specific task. ### Method GET ### Endpoint /v3/tasks/{guid} ### Parameters #### Path Parameters - **guid** (UUID) - Required - The GUID of the task to retrieve. ``` -------------------------------- ### Get Process Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/endpoints.md Retrieve details of a specific process by its GUID. ```APIDOC ## Get Process ### Description Retrieve a specific process. ### Method GET ### Endpoint /v3/processes/{guid} ### Parameters #### Path Parameters - **guid** (UUID) - Required - The GUID of the process to retrieve. ``` -------------------------------- ### Get Droplet Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/endpoints.md Retrieve details of a specific droplet by its GUID. ```APIDOC ## Get Droplet ### Description Retrieve a specific droplet. ### Method GET ### Endpoint /v3/droplets/{guid} ### Parameters #### Path Parameters - **guid** (UUID) - Required - The GUID of the droplet to retrieve. ### Query Parameters - **include** (string) - Optional - Include related resources. ``` -------------------------------- ### Get User Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/endpoints.md Retrieve a specific user using their GUID. ```APIDOC ## GET /v3/users/{guid} ### Description Retrieve a specific user. ### Method GET ### Endpoint /v3/users/{guid} ### Path Parameters - **guid** (UUID) - The GUID of the user to retrieve ### Response #### Success Response (200) User ``` -------------------------------- ### Get Security Group Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/endpoints.md Retrieves a specific security group by its GUID. ```APIDOC ## GET /v3/security_groups/{guid} ### Description Retrieve a specific security group. ### Method GET ### Endpoint /v3/security_groups/{guid} ### Parameters #### Path Parameters - **guid** (UUID) - Required ### Response #### Success Response (200 OK) - **SecurityGroup** (object) ``` -------------------------------- ### Example: Create Version 3.131.0 Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/build-scripts.md This command demonstrates how to create a new API version using the `create-version` script. It shows the expected output messages during the process. ```bash $ yarn create-version 3.131.0 Creating version 3.131.0... Copied 'latest' to '3.131.0' Updated redocly.yaml with version 3.131.0 Updated openapi.yaml in '3.131.0' directory with new version Version creation complete. ``` -------------------------------- ### Best Practice: Create Version Snapshots Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/build-scripts.md Steps for creating version snapshots for releases, including building and committing changes. ```bash yarn create-version X.Y.Z yarn build git add apis redocly.yaml && git commit -m "Add CAPI X.Y.Z" ``` -------------------------------- ### Get Deployment Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/endpoints.md Retrieve the details of a specific deployment using its GUID. ```APIDOC ## GET /v3/deployments/{guid} ### Description Retrieve a specific deployment. ### Method GET ### Endpoint /v3/deployments/{guid} ### Path Parameters - **guid** (UUID) - Required - The GUID of the deployment to retrieve. ### Response #### Success Response (200 OK) - **Deployment** (object) - The details of the deployment. ``` -------------------------------- ### Get Service Instance Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/endpoints.md Retrieve details of a specific service instance by its GUID. ```APIDOC ## Get Service Instance ### Description Retrieve a specific service instance. ### Method GET ### Endpoint /v3/service_instances/{guid} ### Parameters #### Path Parameters - **guid** (UUID) - Required - The GUID of the service instance to retrieve. ### Response #### Success Response (200 OK) - **ManagedServiceInstance** or **UserProvidedServiceInstance** (object) - Details of the service instance. ``` -------------------------------- ### Application Lifecycle Stages Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/README.md Illustrates the sequential stages an application goes through from creation to running. ```text Create → Package → Build → Droplet → Deploy → Processes → Routes → Running ``` -------------------------------- ### Test Prism Mock Server Workflow Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/build-scripts.md Demonstrates the two-terminal workflow for testing a Prism mock server. First, start the Prism mock server, then run the validation command against its endpoint. ```bash # Terminal 1: Start Prism mock server npx @stoplight/prism-cli@latest mock dist/latest/openapi.yaml --port 4010 # Terminal 2: Validate against mock yarn test:mockserver http://localhost:4010 dist/latest/openapi.yaml ``` -------------------------------- ### Get Role Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/endpoints.md Retrieve the details of a specific role assignment using its GUID. ```APIDOC ## GET /v3/roles/{guid} ### Description Retrieve a specific role assignment. ### Method GET ### Endpoint /v3/roles/{guid} ### Path Parameters - **guid** (UUID) - Required - The GUID of the role to retrieve. ### Response #### Success Response (200 OK) - **Role** (object) - The details of the role assignment. ``` -------------------------------- ### Get Job Response Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/endpoints.md Example of a successful response when retrieving the status of an asynchronous job. ```json { "guid": "job-guid", "created_at": "2024-01-01T12:00:00Z", "updated_at": "2024-01-01T12:00:15Z", "state": "COMPLETE", "operation": "delete", "resource_type": "app", "resource_guid": "app-guid", "errors": [], "warnings": [] } ``` -------------------------------- ### Get Service Credential Binding Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/endpoints.md Retrieves a specific service credential binding by its GUID. ```APIDOC ## GET /v3/service_credential_bindings/{guid} ### Description Retrieve a specific credential binding. ### Method GET ### Endpoint /v3/service_credential_bindings/{guid} ### Parameters #### Path Parameters - **guid** (UUID) - Required ### Response #### Success Response (200 OK) - **CredentialBinding** (object) ``` -------------------------------- ### Get Space Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/endpoints.md Retrieve a specific space using its GUID. Supports including related resources. ```APIDOC ## GET /v3/spaces/{guid} ### Description Retrieve a specific space. ### Method GET ### Endpoint /v3/spaces/{guid} ### Path Parameters - **guid** (UUID) - The GUID of the space to retrieve ### Query Parameters - **include** (string) - Comma-delimited list of related resources to include ### Response #### Success Response (200) Space ``` -------------------------------- ### Create Buildpack Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/endpoints.md Create a new buildpack with specified properties. ```APIDOC ## POST /v3/buildpacks ### Description Create a new buildpack. ### Method POST ### Endpoint /v3/buildpacks ### Request Body - **name** (string) - Required - The name of the buildpack. - **stack** (string) - Required - The stack the buildpack is compatible with. - **position** (integer) - Optional - The position of the buildpack in the order of detection. - **enabled** (boolean) - Optional - Whether the buildpack is enabled. - **locked** (boolean) - Optional - Whether the buildpack is locked. ### Request Example ```json { "name": "python_buildpack", "stack": "cflinuxfs4", "position": 1, "enabled": true, "locked": false } ``` ### Response #### Success Response (201 Created) - **Buildpack** (object) - The created buildpack. ``` -------------------------------- ### Get Route Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/endpoints.md Retrieve the details of a specific route using its GUID. Optionally include related resources. ```APIDOC ## GET /v3/routes/{guid} ### Description Retrieve a specific route. ### Method GET ### Endpoint /v3/routes/{guid} ### Path Parameters - **guid** (UUID) - Required - The GUID of the route to retrieve. ### Query Parameters - **include** (string) - Optional - Comma-separated list of related resources to include (e.g., space, space.organization, domain). ### Response #### Success Response (200 OK) - **Route** (object) - The details of the route. ``` -------------------------------- ### List Apps with Standard Read Access Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/authentication-security.md Example of how to list applications using curl with standard read access. Requires a Bearer token. ```bash curl -H "Authorization: Bearer $TOKEN" \ -X GET https://api.example.local/v3/apps ``` -------------------------------- ### Get Organization Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/endpoints.md Retrieve a specific organization using its GUID. Supports including related resources like spaces, domains, and users. ```APIDOC ## GET /v3/organizations/{guid} ### Description Retrieve a specific organization. ### Method GET ### Endpoint /v3/organizations/{guid} ### Path Parameters - **guid** (UUID) - The GUID of the organization to retrieve ### Query Parameters - **include** (string) - Comma-delimited list of related resources to include (e.g., spaces, space_quotas, domains, users) ### Response #### Success Response (200) Organization ``` -------------------------------- ### Create Application Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/endpoints.md Creates a new application with specified name, environment variables, lifecycle, relationships, and metadata. ```APIDOC ## POST /v3/apps ### Description Creates a new application. ### Method POST ### Endpoint /v3/apps ### Parameters #### Request Body - **name** (string) - Required - The name of the application. - **environment_variables** (object) - Optional - Environment variables for the application. - **lifecycle** (object) - Required - Defines the application's lifecycle type and data. - **type** (string) - Required - Type of lifecycle (e.g., buildpack, cnb, docker). - **data** (object) - Required - Lifecycle-specific data. - **buildpacks** (array) - Optional - List of buildpacks to use. - **stack** (string) - Optional - The stack to use. - **relationships** (object) - Required - Relationships to other resources. - **space** (object) - Required - The space the application belongs to. - **data** (object) - Required. - **guid** (string) - Required - The GUID of the space. - **metadata** (object) - Optional - Metadata for the application. - **labels** (object) - Optional - Key-value pairs for labels. - **annotations** (object) - Optional - Key-value pairs for annotations. ### Request Example ```json { "name": "my-app", "environment_variables": { "DEBUG": "true", "LOG_LEVEL": "info" }, "lifecycle": { "type": "buildpack", "data": { "buildpacks": ["python_buildpack"], "stack": "cflinuxfs4" } }, "relationships": { "space": { "data": { "guid": "space-guid" } } }, "metadata": { "labels": { "environment": "production" }, "annotations": { "description": "My application" } } } ``` ### Response #### Success Response (201 Created) - **guid** (string) - The GUID of the created application. - **created_at** (string) - Timestamp of creation. - **updated_at** (string) - Timestamp of last update. - **name** (string) - The name of the application. - **state** (string) - The current state of the application. - **lifecycle** (object) - Application lifecycle details. - **relationships** (object) - Relationships to other resources. - **metadata** (object) - Metadata for the application. - **links** (object) - Links to related resources. ### Response Example ```json { "guid": "app-guid-1", "created_at": "2024-01-01T12:00:00Z", "updated_at": "2024-01-01T12:00:00Z", "name": "my-app", "state": "STOPPED", "lifecycle": {...}, "relationships": {...}, "metadata": {...}, "links": {...} } ``` **Error Responses:** - 400 Bad Request - 401 Unauthorized - 403 Forbidden - 422 Unprocessable Entity (app name already taken, feature disabled) - 500 Internal Server Error - 503 Service Unavailable ``` -------------------------------- ### Redocly Configuration for New API Version Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/build-scripts.md Example of how a new API version is registered in the root redocly.yaml configuration file. This ensures the new version is recognized by Redocly. ```yaml apis: cf@{version}: root: apis/cf/{version}/openapi.yaml ``` -------------------------------- ### Create Application Response Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/endpoints.md Confirms the successful creation of a new application. Returns the application's details, including its GUID and initial state. ```json { "guid": "app-guid-1", "created_at": "2024-01-01T12:00:00Z", "updated_at": "2024-01-01T12:00:00Z", "name": "my-app", "state": "STOPPED", "lifecycle": {...}, "relationships": {...}, "metadata": {...}, "links": {...} } ``` -------------------------------- ### Troubleshoot Go Not Found Error Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/build-scripts.md Provides a command to add the Go binary directory to the system's PATH environment variable. Use this when encountering 'Go not found' errors. ```bash # Install Go or add to PATH export PATH=$PATH:/usr/local/go/bin ``` -------------------------------- ### Create Service Instance Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/endpoints.md Creates a new service instance. Requires name, service plan, and space relationship. Optional parameters can be provided for service configuration. ```APIDOC ## POST /v3/service_instances ### Description Create a new service instance. ### Method POST ### Endpoint /v3/service_instances ### Request Body - **type** (string) - Required - **name** (string) - Required - **service_plan_guid** (string) - Required - **relationships** (object) - Required - **space** (object) - Required - **data** (object) - Required - **guid** (string) - Required - **parameters** (object) - Optional ### Request Example ```json { "type": "managed", "name": "my-database", "service_plan_guid": "plan-guid", "relationships": { "space": { "data": { "guid": "space-guid" } } }, "parameters": { "backup_location": "us-west" } } ``` ### Response #### Success Response (201 Created) - **ServiceInstance** (object) ``` -------------------------------- ### Example Error Response Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/types.md An example of a JSON object representing an error response from the API. ```json { "errors": [ { "code": 10016, "title": "CF-UniquenessError", "detail": "The given app name is already taken in the targeted space" } ] } ``` -------------------------------- ### Build Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/types.md Represents the application staging process, including its state, lifecycle, and associated packages or droplets. ```APIDOC ## Build Type ### Description Application staging process. ``` -------------------------------- ### Create Deployment Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/endpoints.md Create a new zero-downtime deployment for an application. ```APIDOC ## Create Deployment ### Description Create a new zero-downtime deployment. ### Method POST ### Endpoint /v3/deployments ### Request Body - **droplet** (object) - Required - The droplet to deploy. - **guid** (string) - Required - The GUID of the droplet. - **relationships** (object) - Required - Relationships for the deployment. - **app** (object) - Required - The application to deploy to. - **data** (object) - Required. - **guid** (string) - Required - The GUID of the app. ### Request Example { "droplet": { "guid": "droplet-guid" }, "relationships": { "app": { "data": { "guid": "app-guid" } } } } ### Response #### Success Response (201 Created) - **Deployment** (object) - Details of the created deployment. ``` -------------------------------- ### List Spaces Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/endpoints.md Retrieve all spaces the user has access to. Supports pagination and filtering by GUIDs, names, organization GUIDs, and label selectors. ```APIDOC ## GET /v3/spaces ### Description Retrieve all spaces the user has access to. ### Method GET ### Endpoint /v3/spaces ### Query Parameters - **page** (integer) - Page number - **per_page** (integer) - Results per page - **order_by** (string) - Sort field - **guids** (string) - Comma-delimited space GUIDs - **names** (string) - Comma-delimited space names - **organization_guids** (string) - Comma-delimited org GUIDs - **label_selector** (string) - Label selector filter ### Response #### Success Response (200) SpaceList ``` -------------------------------- ### Workflow After Version Creation Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/build-scripts.md This sequence of commands outlines the typical workflow after creating a new API version. It includes building artifacts, previewing locally, testing compliance, and committing changes. ```bash # 1. Create new version yarn create-version 3.131.0 # 2. Build artifacts yarn build # 3. Preview locally yarn preview # 4. Test compliance yarn test:compliance dist/3.131.0/openapi.yaml # 5. Commit and push git add apis/cf/3.131.0 redocly.yaml git commit -m "Add CAPI 3.131.0 specification" git push ``` -------------------------------- ### Test Custom API Implementation Workflow Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/build-scripts.md Illustrates the workflow for validating a custom API implementation against an OpenAPI spec. Start your API server, then run the validation command pointing to your API's endpoint. ```bash # Terminal 1: Start your API npm start # Listens on localhost:3000 # Terminal 2: Validate yarn test:mockserver http://localhost:3000 dist/latest/openapi.yaml ``` -------------------------------- ### Create User Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/endpoints.md Create a new user account. Requires username, origin, password, and optionally email and name details. ```APIDOC ## POST /v3/users ### Description Create a new user account. ### Method POST ### Endpoint /v3/users ### Request Body ```json { "username": "user@example.com", "origin": "uaa", "password": "secure-password", "emails": [{ "value": "user@example.com" }], "name": { "givenName": "John", "familyName": "Doe" } } ``` ### Response #### Success Response (201) User ``` -------------------------------- ### Token Validation Response Example Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/authentication-security.md Example of a successful response from the token validation endpoint, indicating the token's active status, expiration, user ID, and scopes. ```json { "resource_ids": [], "active": true, "exp": 1704114000, "user_id": "user-guid", "user_name": "user@example.com", "scope": [ "cloud_controller.read", "cloud_controller.write" ] } ``` -------------------------------- ### HTTP Rate Limit Response Example Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/authentication-security.md An example of an HTTP response indicating that a rate limit has been exceeded. The response includes headers detailing the limit, remaining requests, and when the limit resets. ```http HTTP/1.1 429 Too Many Requests X-RateLimit-Limit: 1000 X-RateLimit-Remaining: 0 X-RateLimit-Reset: 1704110460 ``` -------------------------------- ### List Buildpacks Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/endpoints.md Retrieve all available buildpacks. Supports filtering and pagination. ```APIDOC ## GET /v3/buildpacks ### Description Retrieve all buildpacks. ### Method GET ### Endpoint /v3/buildpacks ### Query Parameters - **page** (integer) - Optional - The page number to retrieve. - **per_page** (integer) - Optional - The number of buildpacks to return per page. - **order_by** (string) - Optional - The field to sort by. - **guids** (string) - Optional - Filter by buildpack GUIDs. - **names** (string) - Optional - Filter by buildpack names. - **stacks** (string) - Optional - Filter by buildpack stacks. - **label_selector** (string) - Optional - Filter by label selector. ### Response #### Success Response (200 OK) - **BuildpackList** (object) - A list of buildpacks. ``` -------------------------------- ### List Service Instances Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/endpoints.md Retrieve all service instances in the system. ```APIDOC ## List Service Instances ### Description Retrieve all service instances. ### Method GET ### Endpoint /v3/service_instances ### Query Parameters - **page** (integer) - Optional - The page number to retrieve. - **per_page** (integer) - Optional - The number of service instances per page. - **order_by** (string) - Optional - The field to order the results by. - **guids** (string) - Optional - Filter by service instance GUIDs. - **names** (string) - Optional - Filter by service instance names. - **service_plan_guids** (string) - Optional - Filter by service plan GUIDs. - **space_guids** (string) - Optional - Filter by space GUIDs. - **organization_guids** (string) - Optional - Filter by organization GUIDs. - **type** (string) - Optional - Filter by service instance type. - **label_selector** (string) - Optional - Filter by label selector. ### Response #### Success Response (200 OK) - **ServiceInstanceList** (object) - A list of service instances. ``` -------------------------------- ### Create Buildpack Request Body Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/endpoints.md Use this JSON to create a new buildpack. Include the buildpack name, stack, position, and whether it is enabled or locked. ```json { "name": "python_buildpack", "stack": "cflinuxfs4", "position": 1, "enabled": true, "locked": false } ``` -------------------------------- ### Cloud Controller Admin Scope - Example Request Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/authentication-security.md An example request demonstrating the use of the `cloud_controller.admin` scope to perform a DELETE operation on an application resource. This scope grants full administrative access. ```APIDOC ## DELETE /v3/apps/{guid} ### Description An example request demonstrating the use of the `cloud_controller.admin` scope to perform a DELETE operation on an application resource. This scope grants full administrative access. ### Method DELETE ### Endpoint /v3/apps/{guid} ### Parameters #### Path Parameters - **guid** (string) - Required - The unique identifier of the application to delete. #### Header Parameters - **Authorization** (string) - Required - The access token with the `cloud_controller.admin` scope. ``` -------------------------------- ### Create Task Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/endpoints.md Create and run a one-off task on a specified application. ```APIDOC ## Create Task ### Description Create and run a one-off task on an app. ### Method POST ### Endpoint /v3/apps/{guid}/tasks ### Parameters #### Path Parameters - **guid** (UUID) - Required - The GUID of the app to run the task on. ### Request Body - **command** (string) - Required - The command to execute for the task. - **name** (string) - Optional - The name of the task. - **memory_in_mb** (integer) - Optional - The memory in MB to allocate for the task. - **disk_in_mb** (integer) - Optional - The disk in MB to allocate for the task. ### Response #### Success Response (202 Accepted) - **Task** (object) - Details of the created task. ``` -------------------------------- ### Delete Route Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/endpoints.md Delete a specific route by its GUID. ```APIDOC ## DELETE /v3/routes/{guid} ### Description Delete a route. ### Method DELETE ### Endpoint /v3/routes/{guid} ### Path Parameters - **guid** (UUID) - Required - The GUID of the route to delete. ### Response #### Success Response (204 No Content) ``` -------------------------------- ### Get Feature Flag Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/endpoints.md Retrieves a specific feature flag by its name. ```APIDOC ## GET /v3/feature_flags/{name} ### Description Retrieve a specific feature flag. ### Method GET ### Endpoint /v3/feature_flags/{name} ### Parameters #### Path Parameters - **name** (string) - Required ### Response #### Success Response (200 OK) - **FeatureFlag** (object) ``` -------------------------------- ### Upload Buildpack Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/endpoints.md Upload the binary content for a specific buildpack. ```APIDOC ## POST /v3/buildpacks/{guid}/upload ### Description Upload buildpack bits (binary content). ### Method POST ### Endpoint /v3/buildpacks/{guid}/upload ### Path Parameters - **guid** (UUID) - Required - The GUID of the buildpack to upload bits for. ### Headers - **Content-Type**: `multipart/form-data` ### Request Body - **buildpack** (file) - Required - The binary file content of the buildpack. ### Response #### Success Response (202 Accepted) - **Job** (object) - Returns a job object representing the upload process. ``` -------------------------------- ### Get Current Droplet Source: https://github.com/cloudfoundry/cf-openapi/blob/main/_autodocs/endpoints.md Retrieves the currently deployed droplet for an application. ```APIDOC ## Get Current Droplet ### Description Retrieves the currently deployed droplet for an application. ### Method GET ### Endpoint /v3/apps/{guid}/droplets/current ### Parameters #### Path Parameters - **guid** (UUID) - Required - The unique identifier of the application. ### Response #### Success Response (200 OK) Returns the current Droplet object. ```