{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/oracle/json-schema/oracle-cost-anomaly-monitor-schema.json",
  "title": "CostAnomalyMonitor",
  "description": "A CostAnomalyMonitor.",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/oracle-costad-api-openapi.yml#/components/schemas/CostAnomalyMonitor",
  "properties": {
    "compartmentId": {
      "description": "The OCID of the compartment.",
      "maxLength": 255,
      "minLength": 1,
      "type": "string"
    },
    "costAlertSubscriptionMap": {
      "$ref": "#/$defs/CostAlertSubscriptionMap"
    },
    "definedTags": {
      "additionalProperties": {
        "additionalProperties": {
          "description": "The value of the tag. Only the String type is supported.\n",
          "type": "object"
        },
        "description": "Key-value pair representing a defined tag key and value, scoped to a namespace.\n\nExample: `{\"CostCenter\": \"42\"}`\n",
        "type": "object"
      },
      "description": "Defined tags for this resource. Each key is predefined and scoped to a\nnamespace. For more information, see [Resource Tags](/Content/General/Concepts/resourcetags.htm).\n\nExample: `{\"Operations\": {\"CostCenter\": \"42\"}}`\n",
      "type": "object"
    },
    "description": {
      "description": "The description of the budget.",
      "maxLength": 255,
      "minLength": 1,
      "type": "string"
    },
    "freeformTags": {
      "additionalProperties": {
        "type": "string"
      },
      "description": "Free-form tags for this resource. Each tag is a simple key-value pair with no\npredefined name, type, or namespace. For more information, see [Resource Tags](/Content/General/Concepts/resourcetags.htm).\n\nExample: `{\"Department\": \"Finance\"}`\n",
      "type": "object"
    },
    "id": {
      "description": "The OCID of the Cost Anomaly Monitor.",
      "maxLength": 255,
      "minLength": 1,
      "type": "string"
    },
    "lifecycleDetails": {
      "description": "The current state details of the cost monitor.\n",
      "maxLength": 255,
      "minLength": 1,
      "type": "string"
    },
    "lifecycleState": {
      "description": "The current state of the cost monitor.",
      "enum": [
        "ACTIVE",
        "INACTIVE",
        "DELETED"
      ],
      "type": "string"
    },
    "name": {
      "description": "The name of the cost anomaly monitor. Avoid entering confidential information.",
      "maxLength": 255,
      "minLength": 1,
      "type": "string"
    },
    "systemTags": {
      "additionalProperties": {
        "additionalProperties": {
          "description": "The value of the tag. Only the String type is supported.\n",
          "type": "object"
        },
        "description": "Key-value pair representing a defined tag key and value, scoped to a namespace.\nExample: `{\"free-tier-retained\": \"true\"}`\n",
        "type": "object"
      },
      "description": "System tags for this resource. Each key is predefined and scoped to a namespace.\nFor more information, see [Resource Tags](/Content/General/Concepts/resourcetags.htm).\nSystem tags can be viewed by users, but can only be created by the system.\n\nExample: `{\"orcl-cloud\": {\"free-tier-retained\": \"true\"}}`\n",
      "type": "object"
    },
    "targetResourceFilter": {
      "$ref": "#/$defs/TargetResourceFilter"
    },
    "timeCreated": {
      "description": "The time that the cost monitor was created.",
      "format": "date-time",
      "type": "string"
    },
    "timeUpdated": {
      "description": "The time that the cost monitor was last updated.",
      "format": "date-time",
      "type": "string"
    },
    "type": {
      "description": "Type of cost monitor",
      "enum": [
        "DEFAULT",
        "CUSTOM"
      ],
      "type": "string",
      "x-obmcs-top-level-enum": "#/definitions/MonitorType"
    }
  },
  "required": [
    "id",
    "compartmentId",
    "name",
    "lifecycleState",
    "targetResourceFilter",
    "timeCreated",
    "timeUpdated"
  ],
  "$defs": {
    "CostAlertSubscriptionMap": {
      "description": "The mapping of cost monitor to alert subscription along with thresholds.",
      "properties": {
        "costAlertSubscriptionId": {
          "description": "The costAlertSubscription ocid which the cost monitor alert maps to.",
          "type": "string"
        },
        "operator": {
          "description": "The filter operator. Example: 'AND', 'OR', 'NOT'.",
          "enum": [
            "AND",
            "NOT",
            "OR"
          ],
          "type": "string"
        },
        "thresholdAbsoluteValue": {
          "description": "The absolute threshold value.",
          "minimum": 0,
          "type": "integer"
        },
        "thresholdRelativePercent": {
          "description": "The relative percentage threshold value.",
          "minimum": 0,
          "type": "integer"
        }
      },
      "type": "object"
    },
    "Dimension": {
      "description": "The dimension used for filtering. Available dimensions are: \"service\", \"skuName\", \"skuPartNumber\", \"unit\", \"compartmentName\", \"compartmentPath\", \"compartmentId\", \"tenantName, \"tenantId\", \"platform\", \"region\", \"logicalAd\", \"resourceId\".\nFor example:\n`[{value: \"COMPUTE\", key: \"service\"}]`\n",
      "properties": {
        "key": {
          "description": "The dimension key.",
          "maxLength": 255,
          "minLength": 1,
          "type": "string"
        },
        "value": {
          "description": "The dimension value.",
          "maxLength": 255,
          "minLength": 1,
          "type": "string"
        }
      },
      "required": [
        "key",
        "value"
      ],
      "type": "object"
    },
    "Tag": {
      "description": "The tag used for filtering.",
      "properties": {
        "key": {
          "description": "The tag key.",
          "maxLength": 255,
          "minLength": 1,
          "type": "string"
        },
        "namespace": {
          "description": "The tag namespace.",
          "maxLength": 255,
          "minLength": 1,
          "type": "string"
        },
        "value": {
          "description": "The tag value.",
          "maxLength": 100,
          "minLength": 1,
          "type": "string"
        }
      },
      "type": "object"
    },
    "TargetResourceFilter": {
      "description": "The filter object to target resources for cost monitor. \nCost generated by one or more resources identified by this \nfilter is monitored for anomalous deviations.\n",
      "properties": {
        "dimensions": {
          "description": "The dimensions to filter on.",
          "items": {
            "$ref": "#/$defs/Dimension"
          },
          "maxItems": 100,
          "type": "array"
        },
        "filters": {
          "description": "The nested filter object.",
          "items": {
            "$ref": "#/$defs/TargetResourceFilter"
          },
          "maxItems": 100,
          "type": "array"
        },
        "operator": {
          "description": "The filter operator. Example: 'AND', 'OR', 'NOT'.",
          "enum": [
            "AND",
            "NOT",
            "OR"
          ],
          "type": "string"
        },
        "tags": {
          "description": "The tags to filter on.",
          "items": {
            "$ref": "#/$defs/Tag"
          },
          "maxItems": 100,
          "type": "array"
        }
      },
      "type": "object"
    }
  }
}