Estrutura do Arquivo .yaml de Plano (comando apply)

apiVersion: api-management.sensedia.com/v1
kind: Plan
metadata:
  # Descrição de texto aberto apenas com valores de exemplo
  type: production
  owner: engineering
spec:
  # Campos de identificação
  name: "Basic Plan"
  apiRef:
     name: "Open Banking API"
     version: "1.0.0"
  # Outros campos
  description: descrição do plano
  default: true
  flows:
  - context:
      revision: 1
      resourceRef:
        name: employees
      operationRef:
        method: GET
        path: /employees
    requestInterceptors:
    - ipFiltering:
        ips: ["192.168.10.1", "10.1.1.0"]
        type: "Allow"
    - log:
        encryptContent: true
        encryptParams: false
    - oauth:
        allowedGrantTypes: ["AuthorizationCode", "Implicit"]
    - rateLimit:
        calls: 100
        interval: Second
        softLimit:
          enabled: true
          percentage: 5
        returnQuotaHeader: true
    - restrictAccess:
        environmentRefs:
        - name: Production
        type: Allow
    - header:
         headers:
         - name: "myHeader"
           type: "App"
           extraField: "myExtraField"
    - httpMethod:
        method: "PUT"
    - logObfuscation:
        location: Header
        attribute: MyAttribute
        customRegex: "[A-Z]+"
        replaceWith: "*****"
    - spikeArrest:
        limit: 10
        interval: Second
    - jsonToText: {}
    - jsonToXml: {}
    - textToJson: {}
    - xmlToJson:
        forceValueAsString: true

Schema de Plano (comando apply)

{
  "$schema": "https://json-schema.org/draft/2019-09/schema",
  "$id": "https://sensedia.com/cli/api-management/plan/apply",
  "type": "object",
  "properties": {
    "apiVersion": {
      "type": "string",
      "enum": [
        "api-management.sensedia.com/v1"
      ]
    },
    "kind": {
      "type": "string",
      "enum": [
        "Plan"
      ]
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "spec": {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "name",
        "apiRef"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "apiRef": {
          "$ref": "#/$defs/apiRef"
        },
        "default": {
          "type": "boolean"
        },
        "flows": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/flow"
          }
        }
      }
    }
  },
  "required": [
    "apiVersion",
    "kind",
    "spec"
  ],
  "$defs": {
    "apiRef": {
      "additionalProperties": false,
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "version": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "version"
      ]
    },
    "namedRef": {
      "additionalProperties": false,
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        }
      },
      "required": [
        "name"
      ]
    },
    "requestInterceptor": {
      "type": "object",
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "ipFiltering": {
              "$ref": "#/$defs/ipFilteringInterceptor"
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "log": {
              "$ref": "#/$defs/logInterceptor"
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "oauth": {
              "$ref": "#/$defs/oauthInterceptor"
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "rateLimit": {
              "$ref": "#/$defs/rateLimitInterceptor"
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "restrictAccess": {
              "$ref": "#/$defs/restrictAccessInterceptor"
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "header": {
              "$ref": "#/$defs/headerInterceptor"
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "httpMethod": {
              "$ref": "#/$defs/httpMethodInterceptor"
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "logObfuscation": {
              "$ref": "#/$defs/logObfuscationInterceptor"
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "spikeArrest": {
              "$ref": "#/$defs/spikeArrestInterceptor"
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "jsonToText": {
              "$ref": "#/$defs/jsonToTextInterceptor"
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "jsonToXml": {
              "$ref": "#/$defs/jsonToXmlInterceptor"
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "textToJson": {
              "$ref": "#/$defs/textToJsonInterceptor"
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "xmlToJson": {
              "$ref": "#/$defs/xmlToJsonInterceptor"
            }
          }
        }
      ]
    },
    "responseInterceptor": {
      "type": "object",
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "log": {
              "$ref": "#/$defs/logInterceptor"
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "header": {
              "$ref": "#/$defs/headerInterceptor"
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "logObfuscation": {
              "$ref": "#/$defs/logObfuscationInterceptor"
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "jsonToText": {
              "$ref": "#/$defs/jsonToTextInterceptor"
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "jsonToXml": {
              "$ref": "#/$defs/jsonToXmlInterceptor"
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "textToJson": {
              "$ref": "#/$defs/textToJsonInterceptor"
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "xmlToJson": {
              "$ref": "#/$defs/xmlToJsonInterceptor"
            }
          }
        }
      ]
    },
    "flow": {
      "additionalProperties": false,
      "type": "object",
      "properties": {
        "context": {
          "oneOf": [
            {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "revision": {
                  "type": "integer"
                },
                "resourceRef": {
                  "$ref": "#/$defs/namedRef"
                },
                "operationRef": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "method": {
                      "type": "string",
                      "enum": [
                        "GET",
                        "POST",
                        "PATCH",
                        "PUT",
                        "DELETE",
                        "OPTIONS"
                      ]
                    },
                    "path": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "method",
                    "path"
                  ]
                }
              },
              "required": [
                "revision",
                "resourceRef",
                "operationRef"
              ]
            },
            {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "revision": {
                  "type": "number",
                  "format": "int"
                },
                "resourceRef": {
                  "$ref": "#/$defs/namedRef"
                }
              },
              "required": [
                "revision",
                "resourceRef"
              ]
            },
            {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "revision": {
                  "type": "number",
                  "format": "int"
                }
              },
              "required": [
                "revision"
              ]
            }
          ]
        },
        "requestInterceptors": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/requestInterceptor"
          }
        },
        "responseInterceptors": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/responseInterceptor"
          }
        }
      }
    },
    "ipFilteringInterceptor": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "ips": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "type": {
          "type": "string",
          "enum": [
            "Allow",
            "Block"
          ]
        }
      },
      "required": [
        "ips",
        "type"
      ]
    },
    "logInterceptor": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "encryptContent": {
          "type": "boolean"
        },
        "encryptParams": {
          "type": "boolean"
        }
      }
    },
    "oauthInterceptor": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "allowedGrantTypes": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "AuthorizationCode",
              "Implicit",
              "ClientCredentials",
              "Password"
            ]
          }
        }
      }
    },
    "rateLimitInterceptor": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "calls": {
          "type": "integer"
        },
        "interval": {
          "type": "string",
          "enum": [
            "Second",
            "Minute",
            "Hour",
            "Day",
            "Month"
          ]
        },
        "softLimit": {
          "type": "object",
          "properties": {
            "enabled": {
              "type": "boolean"
            },
            "percentage": {
              "type": "integer"
            }
          }
        },
        "returnQuotaHeader": {
          "type": "boolean"
        }
      },
      "required": [
        "calls",
        "interval"
      ]
    },
    "restrictAccessInterceptor": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "environmentRefs": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/namedRef"
          }
        },
        "type": {
          "type": "string",
          "enum": [
            "Allow",
            "Deny"
          ]
        }
      },
      "required": [
        "environmentRefs",
        "type"
      ]
    },
    "headerInterceptor": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "headers": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "App",
                  "AccessToken",
                  "Custom"
                ]
              },
              "extraField": {
                "type": "string"
              }
            },
            "required": [
              "name",
              "type",
              "extraField"
            ]
          }
        }
      }
    },
    "httpMethodInterceptor": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "method": {
          "type": "string",
          "enum": [
            "GET",
            "POST",
            "PUT",
            "DELETE"
          ]
        }
      },
      "required": [
        "method"
      ]
    },
    "logObfuscationInterceptor": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "location": {
          "type": "string",
          "enum": [
            "Header",
            "Body"
          ]
        },
        "attribute": {
          "type": "string"
        },
        "customRegex": {
          "type": "string"
        },
        "replaceWith": {
          "type": "string"
        }
      },
      "required": [
        "location",
        "replaceWith"
      ]
    },
    "spikeArrestInterceptor": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "limit": {
          "type": "integer"
        },
        "interval": {
          "type": "string",
          "enum": [
            "Second",
            "Minute",
            "Hour"
          ]
        }
      },
      "required": [
        "limit",
        "interval"
      ]
    },
    "jsonToTextInterceptor": {
      "type": "object",
      "additionalProperties": false,
      "properties": {}
    },
    "jsonToXmlInterceptor": {
      "type": "object",
      "additionalProperties": false,
      "properties": {}
    },
    "textToJsonInterceptor": {
      "type": "object",
      "additionalProperties": false,
      "properties": {}
    },
    "xmlToJsonInterceptor": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "forceValueAsString": {
          "type": "boolean"
        }
      }
    }
  }
}
Thanks for your feedback!
EDIT
How useful was this article to you?