Cloud Foundry Create Policy API V1 API

The Create Policy API V1 API from Cloud Foundry — 1 operation(s) for create policy api v1.

Operations 1

PUT /v1/apps/{guid}/policy Create the Policy #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/cloud-foundry-create-policy-api-v1-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

cloud-foundry-create-policy-api-v1-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Create Policy API V1 API
  description: This API is used to create, delete, retrieve the policy
  version: 1.0.0
  license:
    name: Apache License Version 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
security:
- bearerAuth: []
tags:
- name: Create Policy API V1
paths:
  /v1/apps/{guid}/policy:
    parameters:
    - name: guid
      in: path
      required: true
      description: 'The GUID identifying the application for which the scaling policy is fetched.


        It can be found in the `application_id` property of the JSON object stored in the

        `VCAP_APPLICATION` environment variable.

        '
      schema:
        $ref: ./shared_definitions.yaml#/schemas/GUID
    put:
      summary: Create the Policy
      description: This API is used to create the policy
      tags:
      - Create Policy API V1
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Policy'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Policy'
        default:
          $ref: ./shared_definitions.yaml#/responses/Error
      x-codegen-request-body-name: body
      operationId: putV1AppsByGuidPolicy
      x-operation-id-source: derived
components:
  schemas:
    Schedules:
      type: object
      required:
      - timezone
      properties:
        timezone:
          description: Using timezone definition of Java
          type: string
          example: Asia/Shanghai
        recurring_schedule:
          type: array
          items:
            $ref: '#/components/schemas/RecurringSchedule'
    Policy:
      description: Object containing policy and optional configuration
      type: object
      required:
      - instance_min_count
      - instance_max_count
      properties:
        instance_min_count:
          type: integer
          format: int64
          description: minimal number of instance count
          example: 2
        instance_max_count:
          type: integer
          format: int64
          description: maximal number of instance count
          example: 4
        scaling_rules:
          type: array
          items:
            $ref: '#/components/schemas/ScalingRule'
        configuration:
          type: object
          properties:
            custom_metrics:
              type: object
              properties:
                metric_submission_strategy:
                  type: object
                  properties:
                    allow_from:
                      type: string
                      enum:
                      - bound_app
                  required:
                  - allow_from
              required:
              - metric_submission_strategy
    ScalingRule:
      type: object
      required:
      - threshold
      - operator
      - adjustment
      properties:
        metric_type:
          $ref: ./shared_definitions.yaml#/schemas/metric_type
        threshold:
          description: 'The boundary when metric value exceeds is considered as a breach

            '
          type: integer
          format: int64
          example: 30
        operator:
          description: Used for standard operting signs - ">", "<", ">=", "<="
          type: string
          enum:
          - '>'
          - <
          - '>='
          - <=
          example: <
        adjustment:
          description: 'The adjustment approach for instance count with each scaling.


            +5 means adding 5 instances, -50% means shrinking to the half of current size.

            '
          type: string
          pattern: ^[-+][1-9]+[0-9]*[%]?$
          example: -1
        breach_duration_secs:
          description: 'Time duration(in seconds) to fire scaling event if it keeps breaching

            '
          type: integer
          format: int64
          example: 600
        cool_down_secs:
          description: 'The time duration (in seconds) to wait before the next scaling kicks in

            '
          type: integer
          format: int64
          example: 300
        schedules:
          type: array
          items:
            $ref: '#/components/schemas/Schedules'
    SpecificDate:
      type: object
      required:
      - start_date_time
      - end_date_time
      - instance_min_count
      - instance_max_count
      properties:
        start_date_time:
          description: the start time of the schedule. Must be a future time
          type: string
          pattern: /[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1]) (2[0-3]|[01][0-9]):[0-5][0-9]/
          example: 2015-01-04T20:00
        end_date_time:
          description: the start time of the schedule. Must be a future time
          type: string
          pattern: /[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1]) (2[0-3]|[01][0-9]):[0-5][0-9]/
          example: 2015-01-04T20:00
        instance_min_count:
          description: minimal number of instance count for this schedule
          type: integer
          format: int64
          example: 2
        instance_max_count:
          description: maximal number of instance count for this schedule
          type: integer
          format: int64
          example: 5
        instance_min_instance_count:
          description: the initial minimal number of instance count for this schedule
          type: integer
          format: int64
          example: 3
    RecurringSchedule:
      type: object
      required:
      - start_time
      - end_time
      - instance_min_count
      - instance_max_count
      properties:
        start_date:
          description: the start date of the schedule. Must be a future time
          type: string
          format: date
          example: 2016-06-27
        end_date:
          description: the end date of the schedule. Must be a future time.
          type: string
          format: date
          example: 2016-07-23
        start_time:
          description: the start time of the schedule in HH:MM format
          type: string
          pattern: ^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$
          example: 660
        end_time:
          description: the end time of the schedule in HH:MM format
          type: string
          pattern: ^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$
          example: 1170
        end time of the schedule:
          description: 'recurring days of a week or month. Use [1,2,..,7] or [1,2,...,31] to define it

            '
          type: array
          items:
            type: integer
          example:
          - 5
          - 15
          - 25
        instance_min_count:
          description: minimal number of instance count for this schedule
          type: integer
          format: int64
          example: 3
        instance_max_count:
          description: maximal number of instance count for this schedule
          type: integer
          format: int64
          example: 10
        instance_min_instance_count:
          description: the initial minimal number of instance count for this schedule
          type: integer
          format: int64
          example: 5
        specific_date:
          type: array
          items:
            $ref: '#/components/schemas/SpecificDate'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT