Create a traffic filter

View as Markdown
POST /api/v1/serverless/traffic-filters

Creates a traffic filter that consists of a set of rules.

application/json

Body Required

The specification for traffic filter.

  • name string Required

    Name of the traffic filter

    Minimum length is 1, maximum length is 128.

  • description string

    Description of the traffic filter

    Minimum length is 0, maximum length is 512.

  • type string Required

    Type of the traffic filter

    Minimum length is 1, maximum length is 32. Values are ip or vpce.

  • include_by_default boolean

    Should the traffic filter be automatically included in the new projects

  • region string Required

    The traffic filter can be attached only to projects in the specific region

    Minimum length is 1, maximum length is 32.

  • rules array[object]

    List of rules

    The container for a traffic filter rule.

    Hide rules attributes Show rules attributes object
    • description string

      Description of the rule.

    • source string Required

      Allowed traffic filter source: IP address, CIDR mask, or VPC endpoint ID

Responses

  • 201 application/json

    The traffic filter definition is valid and the creation has started.

    Hide headers attribute Show headers attribute
    • ETag string
    Hide response attributes Show response attributes object
    • id string Required

      The traffic filter ID

      Minimum length is 32, maximum length is 32.

    • name string Required

      Name of the traffic filter

      Minimum length is 1, maximum length is 128.

    • description string

      Description of the traffic filter

      Minimum length is 0, maximum length is 512.

    • type string Required

      Type of the traffic filter

      Minimum length is 1, maximum length is 32. Values are ip or vpce.

    • include_by_default boolean Required

      Should the traffic filter be automatically included in the new projects

    • region string Required

      The traffic filter can be attached only to projects in the specific region

      Minimum length is 1, maximum length is 32.

    • rules array[object] Required

      List of rules

      The container for a traffic filter rule.

      Hide rules attributes Show rules attributes object
      • description string

        Description of the rule.

      • source string Required

        Allowed traffic filter source: IP address, CIDR mask, or VPC endpoint ID

  • 400 application/json

    Bad request

    Hide response attribute Show response attribute object
    • errors array[object] Required

      An error response returned by the API.

      Hide errors attributes Show errors attributes object
      • message string Required

        A human-readable message of the error.

      • code string Required

        An identifier for this type of error.

  • 401 application/json

    Unauthorized

    Hide response attribute Show response attribute object
    • errors array[object] Required

      An error response returned by the API.

      Hide errors attributes Show errors attributes object
      • message string Required

        A human-readable message of the error.

      • code string Required

        An identifier for this type of error.

  • 500 application/json

    Internal server error

    Hide response attribute Show response attribute object
    • errors array[object] Required

      An error response returned by the API.

      Hide errors attributes Show errors attributes object
      • message string Required

        A human-readable message of the error.

      • code string Required

        An identifier for this type of error.

POST /api/v1/serverless/traffic-filters
curl \
 --request POST 'https://api.elastic-cloud.com/api/v1/serverless/traffic-filters' \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '{"name":"string","description":"string","type":"ip","include_by_default":true,"region":"string","rules":[{"description":"string","source":"string"}]}'