Aggregate entities
POST/v1/entities/aggregate
This route allows you to perform an aggregation function on a blueprint's entities based on a given set of rules.
To learn more about entities, check out the documentation.
For more details about Port's search mechanism, rules, and operators - see the search & query documentation.
Request
Request body schema (JSON)
{
"title": "Body",
"body": {
"content": {
"application/json": {
"schema": {
"type": "object",
"oneOf": [
{
"type": "object",
"title": "Count entities",
"properties": {
"func": {
"type": "string",
"enum": [
"average",
"count"
]
},
"averageOf": {
"type": "string",
"enum": [
"hour",
"day",
"week",
"month",
"total"
]
},
"measureTimeBy": {
"type": "string",
"description": "A property of type `datetime`, by which the average will be calculated. Relevant only for the `average` function."
},
"calculationBy": {
"type": "string"
},
"query": {
"title": "Entities query",
"type": "object",
"properties": {
"combinator": {
"enum": [
"and",
"or"
],
"description": "The combinator to use for the rules."
},
"rules": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"title": "Date Rule",
"properties": {
"property": {
"title": "Contexted property",
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
},
"operator": {
"enum": [
"between",
"notBetween",
"="
]
},
"value": {
"type": "object",
"oneOf": [
{
"type": "object",
"title": "Date Range",
"properties": {
"from": {
"type": "string",
"format": "date-time"
},
"to": {
"type": "string",
"format": "date-time"
}
},
"required": [
"from",
"to"
]
},
{
"type": "object",
"title": "Date Preset",
"properties": {
"preset": {
"type": "string",
"enum": [
"today",
"tomorrow",
"yesterday",
"lastDay",
"lastWeek",
"last2Weeks",
"lastMonth",
"last3Months",
"last6Months",
"last12Months",
"last2Years",
"last3Years",
"nextDay",
"nextWeek",
"next2Weeks",
"nextMonth",
"next3Months",
"next6Months",
"next12Months"
]
}
},
"required": [
"preset"
]
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
}
},
"required": [
"property",
"operator",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"title": "Empty Rule",
"oneOf": [
{
"type": "object",
"title": "Empty Rule",
"properties": {
"operator": {
"enum": [
"isEmpty",
"isNotEmpty"
]
},
"property": {
"type": "string"
}
},
"required": [
"operator",
"property"
],
"additionalProperties": false
}
]
},
{
"type": "object",
"title": "Number Rule",
"properties": {
"property": {
"title": "Contexted property",
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
},
"operator": {
"enum": [
">",
">=",
"<",
"<="
]
},
"value": {
"anyOf": [
{
"type": "number",
"title": "number"
},
{
"type": "string",
"format": "date-time",
"title": "date-time"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
}
},
"required": [
"property",
"operator",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"title": "Expired Rule",
"oneOf": [
{
"type": "object",
"title": "Expired Rule",
"properties": {
"operator": {
"enum": [
"isExpired",
"isNotExpired"
]
},
"property": {
"type": "string"
}
},
"required": [
"operator",
"property"
],
"additionalProperties": false
}
]
},
{
"type": "object",
"title": "String Rule",
"oneOf": [
{
"type": "object",
"title": "String Rule",
"properties": {
"property": {
"title": "Contexted property",
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
},
"operator": {
"enum": [
"=",
"!=",
"containsAny",
"contains",
"doesNotContains",
"beginsWith",
"doesNotBeginsWith",
"endsWith",
"doesNotEndsWith",
"in",
"notIn"
]
},
"value": {
"anyOf": [
{
"type": "null",
"title": "null"
},
{
"type": "string",
"title": "string"
},
{
"type": "number",
"title": "number"
},
{
"type": "boolean",
"title": "boolean"
},
{
"type": "string",
"format": "date-time",
"title": "date-time"
},
{
"type": "array",
"items": {
"type": "string"
},
"title": "array"
},
{
"type": "array",
"items": {
"type": "number"
},
"title": "array"
},
{
"type": "array",
"items": {
"type": "boolean"
},
"title": "array"
},
{
"type": "array",
"items": {
"type": "string",
"format": "date-time"
},
"title": "array"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
}
},
"additionalProperties": false,
"required": [
"property",
"operator",
"value"
]
}
]
},
{
"type": "object",
"title": "Relation Rule",
"properties": {
"operator": {
"enum": [
"relatedTo"
]
},
"blueprint": {
"type": "string"
},
"value": {
"anyOf": [
{
"type": "string",
"title": "string"
},
{
"type": "array",
"items": {
"type": "string"
},
"title": "array"
}
]
},
"direction": {
"enum": [
"upstream",
"downstream"
]
},
"required": {
"type": "boolean"
}
},
"additionalProperties": false,
"required": [
"operator",
"value",
"blueprint"
]
},
{
"type": "object",
"title": "Property schema rule",
"properties": {
"propertySchema": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"format": {
"type": "string"
},
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"format": {
"type": "string"
}
},
"required": [
"type"
]
}
},
"required": [
"type"
],
"additionalProperties": false
},
"operator": {
"enum": [
"=",
"!=",
"contains"
]
},
"value": {
"anyOf": [
{
"type": "null",
"title": "null"
},
{
"type": "string",
"title": "string"
},
{
"type": "number",
"title": "number"
},
{
"type": "boolean",
"title": "boolean"
}
]
}
},
"required": [
"operator",
"propertySchema"
],
"additionalProperties": false
},
{
"type": "object",
"title": "matchAny Rule",
"anyOf": [
{
"type": "object",
"title": "Property matchAny rule",
"properties": {
"property": {
"oneOf": [
{
"type": "object",
"title": "Path filter property",
"properties": {
"path": {
"type": "array",
"minItems": 1,
"items": {
"anyOf": [
{
"type": "string",
"title": "Relation identifier"
},
{
"type": "object",
"title": "Relation with max hops",
"properties": {
"relation": {
"type": "string"
},
"maxHops": {
"type": "number",
"minimum": 1,
"maximum": 15
}
}
}
]
}
},
"fromBlueprint": {
"type": "string"
}
},
"required": [
"path"
],
"additionalProperties": false
},
{
"title": "Contexted property",
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
}
]
},
"operator": {
"type": "string",
"enum": [
"matchAny"
]
},
"value": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"title": "Contexted property",
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
}
]
}
},
"required": [
"property",
"operator",
"value"
],
"additionalProperties": false
}
]
},
{
"allOf": [
"circular(Entities query)",
{
"title": "Nested query"
}
]
}
]
}
}
},
"required": [
"combinator",
"rules"
],
"additionalProperties": false,
"example": {
"combinator": "and",
"rules": [
{
"property": "$blueprint",
"operator": "=",
"value": "service"
},
{
"combinator": "or",
"rules": [
{
"property": "environment",
"operator": "=",
"value": "production"
},
{
"property": "environment",
"operator": "=",
"value": "staging"
}
]
}
]
}
}
},
"additionalProperties": false,
"required": [
"func",
"query"
]
},
{
"type": "object",
"title": "Aggregate by property",
"properties": {
"property": {
"type": "string",
"description": "A property of type `number`, by which the aggregation will be calculated."
},
"func": {
"type": "string",
"enum": [
"sum",
"average",
"min",
"max",
"median"
]
},
"averageOf": {
"type": "string",
"enum": [
"hour",
"day",
"week",
"month",
"total"
]
},
"measureTimeBy": {
"type": "string",
"description": "A property of type `datetime`, by which the average will be calculated. Relevant only for the `average` function."
},
"calculationBy": {
"type": "string"
},
"query": {
"title": "Entities query",
"type": "object",
"properties": {
"combinator": {
"enum": [
"and",
"or"
],
"description": "The combinator to use for the rules."
},
"rules": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"title": "Date Rule",
"properties": {
"property": {
"title": "Contexted property",
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
},
"operator": {
"enum": [
"between",
"notBetween",
"="
]
},
"value": {
"type": "object",
"oneOf": [
{
"type": "object",
"title": "Date Range",
"properties": {
"from": {
"type": "string",
"format": "date-time"
},
"to": {
"type": "string",
"format": "date-time"
}
},
"required": [
"from",
"to"
]
},
{
"type": "object",
"title": "Date Preset",
"properties": {
"preset": {
"type": "string",
"enum": [
"today",
"tomorrow",
"yesterday",
"lastDay",
"lastWeek",
"last2Weeks",
"lastMonth",
"last3Months",
"last6Months",
"last12Months",
"last2Years",
"last3Years",
"nextDay",
"nextWeek",
"next2Weeks",
"nextMonth",
"next3Months",
"next6Months",
"next12Months"
]
}
},
"required": [
"preset"
]
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
}
},
"required": [
"property",
"operator",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"title": "Empty Rule",
"oneOf": [
{
"type": "object",
"title": "Empty Rule",
"properties": {
"operator": {
"enum": [
"isEmpty",
"isNotEmpty"
]
},
"property": {
"type": "string"
}
},
"required": [
"operator",
"property"
],
"additionalProperties": false
}
]
},
{
"type": "object",
"title": "Number Rule",
"properties": {
"property": {
"title": "Contexted property",
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
},
"operator": {
"enum": [
">",
">=",
"<",
"<="
]
},
"value": {
"anyOf": [
{
"type": "number",
"title": "number"
},
{
"type": "string",
"format": "date-time",
"title": "date-time"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
}
},
"required": [
"property",
"operator",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"title": "Expired Rule",
"oneOf": [
{
"type": "object",
"title": "Expired Rule",
"properties": {
"operator": {
"enum": [
"isExpired",
"isNotExpired"
]
},
"property": {
"type": "string"
}
},
"required": [
"operator",
"property"
],
"additionalProperties": false
}
]
},
{
"type": "object",
"title": "String Rule",
"oneOf": [
{
"type": "object",
"title": "String Rule",
"properties": {
"property": {
"title": "Contexted property",
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
},
"operator": {
"enum": [
"=",
"!=",
"containsAny",
"contains",
"doesNotContains",
"beginsWith",
"doesNotBeginsWith",
"endsWith",
"doesNotEndsWith",
"in",
"notIn"
]
},
"value": {
"anyOf": [
{
"type": "null",
"title": "null"
},
{
"type": "string",
"title": "string"
},
{
"type": "number",
"title": "number"
},
{
"type": "boolean",
"title": "boolean"
},
{
"type": "string",
"format": "date-time",
"title": "date-time"
},
{
"type": "array",
"items": {
"type": "string"
},
"title": "array"
},
{
"type": "array",
"items": {
"type": "number"
},
"title": "array"
},
{
"type": "array",
"items": {
"type": "boolean"
},
"title": "array"
},
{
"type": "array",
"items": {
"type": "string",
"format": "date-time"
},
"title": "array"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
}
},
"additionalProperties": false,
"required": [
"property",
"operator",
"value"
]
}
]
},
{
"type": "object",
"title": "Relation Rule",
"properties": {
"operator": {
"enum": [
"relatedTo"
]
},
"blueprint": {
"type": "string"
},
"value": {
"anyOf": [
{
"type": "string",
"title": "string"
},
{
"type": "array",
"items": {
"type": "string"
},
"title": "array"
}
]
},
"direction": {
"enum": [
"upstream",
"downstream"
]
},
"required": {
"type": "boolean"
}
},
"additionalProperties": false,
"required": [
"operator",
"value",
"blueprint"
]
},
{
"type": "object",
"title": "Property schema rule",
"properties": {
"propertySchema": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"format": {
"type": "string"
},
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"format": {
"type": "string"
}
},
"required": [
"type"
]
}
},
"required": [
"type"
],
"additionalProperties": false
},
"operator": {
"enum": [
"=",
"!=",
"contains"
]
},
"value": {
"anyOf": [
{
"type": "null",
"title": "null"
},
{
"type": "string",
"title": "string"
},
{
"type": "number",
"title": "number"
},
{
"type": "boolean",
"title": "boolean"
}
]
}
},
"required": [
"operator",
"propertySchema"
],
"additionalProperties": false
},
{
"type": "object",
"title": "matchAny Rule",
"anyOf": [
{
"type": "object",
"title": "Property matchAny rule",
"properties": {
"property": {
"oneOf": [
{
"type": "object",
"title": "Path filter property",
"properties": {
"path": {
"type": "array",
"minItems": 1,
"items": {
"anyOf": [
{
"type": "string",
"title": "Relation identifier"
},
{
"type": "object",
"title": "Relation with max hops",
"properties": {
"relation": {
"type": "string"
},
"maxHops": {
"type": "number",
"minimum": 1,
"maximum": 15
}
}
}
]
}
},
"fromBlueprint": {
"type": "string"
}
},
"required": [
"path"
],
"additionalProperties": false
},
{
"title": "Contexted property",
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
}
]
},
"operator": {
"type": "string",
"enum": [
"matchAny"
]
},
"value": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"title": "Contexted property",
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
}
]
}
},
"required": [
"property",
"operator",
"value"
],
"additionalProperties": false
}
]
},
{
"allOf": [
"circular(Entities query)",
{
"title": "Nested query"
}
]
}
]
}
}
},
"required": [
"combinator",
"rules"
],
"additionalProperties": false,
"example": {
"combinator": "and",
"rules": [
{
"property": "$blueprint",
"operator": "=",
"value": "service"
},
{
"combinator": "or",
"rules": [
{
"property": "environment",
"operator": "=",
"value": "production"
},
{
"property": "environment",
"operator": "=",
"value": "staging"
}
]
}
]
}
}
},
"additionalProperties": false,
"required": [
"func",
"property",
"query"
]
},
{
"type": "object",
"title": "Count values",
"oneOf": [
{
"type": "object",
"title": "Group by property",
"properties": {
"func": {
"enum": [
"countValues"
]
},
"query": {
"title": "Entities query",
"type": "object",
"properties": {
"combinator": {
"enum": [
"and",
"or"
],
"description": "The combinator to use for the rules."
},
"rules": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"title": "Date Rule",
"properties": {
"property": {
"title": "Contexted property",
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
},
"operator": {
"enum": [
"between",
"notBetween",
"="
]
},
"value": {
"type": "object",
"oneOf": [
{
"type": "object",
"title": "Date Range",
"properties": {
"from": {
"type": "string",
"format": "date-time"
},
"to": {
"type": "string",
"format": "date-time"
}
},
"required": [
"from",
"to"
]
},
{
"type": "object",
"title": "Date Preset",
"properties": {
"preset": {
"type": "string",
"enum": [
"today",
"tomorrow",
"yesterday",
"lastDay",
"lastWeek",
"last2Weeks",
"lastMonth",
"last3Months",
"last6Months",
"last12Months",
"last2Years",
"last3Years",
"nextDay",
"nextWeek",
"next2Weeks",
"nextMonth",
"next3Months",
"next6Months",
"next12Months"
]
}
},
"required": [
"preset"
]
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
}
},
"required": [
"property",
"operator",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"title": "Empty Rule",
"oneOf": [
{
"type": "object",
"title": "Empty Rule",
"properties": {
"operator": {
"enum": [
"isEmpty",
"isNotEmpty"
]
},
"property": {
"type": "string"
}
},
"required": [
"operator",
"property"
],
"additionalProperties": false
}
]
},
{
"type": "object",
"title": "Number Rule",
"properties": {
"property": {
"title": "Contexted property",
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
},
"operator": {
"enum": [
">",
">=",
"<",
"<="
]
},
"value": {
"anyOf": [
{
"type": "number",
"title": "number"
},
{
"type": "string",
"format": "date-time",
"title": "date-time"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
}
},
"required": [
"property",
"operator",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"title": "Expired Rule",
"oneOf": [
{
"type": "object",
"title": "Expired Rule",
"properties": {
"operator": {
"enum": [
"isExpired",
"isNotExpired"
]
},
"property": {
"type": "string"
}
},
"required": [
"operator",
"property"
],
"additionalProperties": false
}
]
},
{
"type": "object",
"title": "String Rule",
"oneOf": [
{
"type": "object",
"title": "String Rule",
"properties": {
"property": {
"title": "Contexted property",
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
},
"operator": {
"enum": [
"=",
"!=",
"containsAny",
"contains",
"doesNotContains",
"beginsWith",
"doesNotBeginsWith",
"endsWith",
"doesNotEndsWith",
"in",
"notIn"
]
},
"value": {
"anyOf": [
{
"type": "null",
"title": "null"
},
{
"type": "string",
"title": "string"
},
{
"type": "number",
"title": "number"
},
{
"type": "boolean",
"title": "boolean"
},
{
"type": "string",
"format": "date-time",
"title": "date-time"
},
{
"type": "array",
"items": {
"type": "string"
},
"title": "array"
},
{
"type": "array",
"items": {
"type": "number"
},
"title": "array"
},
{
"type": "array",
"items": {
"type": "boolean"
},
"title": "array"
},
{
"type": "array",
"items": {
"type": "string",
"format": "date-time"
},
"title": "array"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
}
},
"additionalProperties": false,
"required": [
"property",
"operator",
"value"
]
}
]
},
{
"type": "object",
"title": "Relation Rule",
"properties": {
"operator": {
"enum": [
"relatedTo"
]
},
"blueprint": {
"type": "string"
},
"value": {
"anyOf": [
{
"type": "string",
"title": "string"
},
{
"type": "array",
"items": {
"type": "string"
},
"title": "array"
}
]
},
"direction": {
"enum": [
"upstream",
"downstream"
]
},
"required": {
"type": "boolean"
}
},
"additionalProperties": false,
"required": [
"operator",
"value",
"blueprint"
]
},
{
"type": "object",
"title": "Property schema rule",
"properties": {
"propertySchema": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"format": {
"type": "string"
},
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"format": {
"type": "string"
}
},
"required": [
"type"
]
}
},
"required": [
"type"
],
"additionalProperties": false
},
"operator": {
"enum": [
"=",
"!=",
"contains"
]
},
"value": {
"anyOf": [
{
"type": "null",
"title": "null"
},
{
"type": "string",
"title": "string"
},
{
"type": "number",
"title": "number"
},
{
"type": "boolean",
"title": "boolean"
}
]
}
},
"required": [
"operator",
"propertySchema"
],
"additionalProperties": false
},
{
"type": "object",
"title": "matchAny Rule",
"anyOf": [
{
"type": "object",
"title": "Property matchAny rule",
"properties": {
"property": {
"oneOf": [
{
"type": "object",
"title": "Path filter property",
"properties": {
"path": {
"type": "array",
"minItems": 1,
"items": {
"anyOf": [
{
"type": "string",
"title": "Relation identifier"
},
{
"type": "object",
"title": "Relation with max hops",
"properties": {
"relation": {
"type": "string"
},
"maxHops": {
"type": "number",
"minimum": 1,
"maximum": 15
}
}
}
]
}
},
"fromBlueprint": {
"type": "string"
}
},
"required": [
"path"
],
"additionalProperties": false
},
{
"title": "Contexted property",
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
}
]
},
"operator": {
"type": "string",
"enum": [
"matchAny"
]
},
"value": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"title": "Contexted property",
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
}
]
}
},
"required": [
"property",
"operator",
"value"
],
"additionalProperties": false
}
]
},
{
"allOf": [
"circular(Entities query)",
{
"title": "Nested query"
}
]
}
]
}
}
},
"required": [
"combinator",
"rules"
],
"additionalProperties": false,
"example": {
"combinator": "and",
"rules": [
{
"property": "$blueprint",
"operator": "=",
"value": "service"
},
{
"combinator": "or",
"rules": [
{
"property": "environment",
"operator": "=",
"value": "production"
},
{
"property": "environment",
"operator": "=",
"value": "staging"
}
]
}
]
}
},
"property": {
"type": "string"
}
},
"required": [
"func",
"query",
"property"
],
"additionalProperties": false
},
{
"type": "object",
"title": "Group by relation",
"properties": {
"func": {
"enum": [
"countValues"
]
},
"query": {
"title": "Entities query",
"type": "object",
"properties": {
"combinator": {
"enum": [
"and",
"or"
],
"description": "The combinator to use for the rules."
},
"rules": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"title": "Date Rule",
"properties": {
"property": {
"title": "Contexted property",
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
},
"operator": {
"enum": [
"between",
"notBetween",
"="
]
},
"value": {
"type": "object",
"oneOf": [
{
"type": "object",
"title": "Date Range",
"properties": {
"from": {
"type": "string",
"format": "date-time"
},
"to": {
"type": "string",
"format": "date-time"
}
},
"required": [
"from",
"to"
]
},
{
"type": "object",
"title": "Date Preset",
"properties": {
"preset": {
"type": "string",
"enum": [
"today",
"tomorrow",
"yesterday",
"lastDay",
"lastWeek",
"last2Weeks",
"lastMonth",
"last3Months",
"last6Months",
"last12Months",
"last2Years",
"last3Years",
"nextDay",
"nextWeek",
"next2Weeks",
"nextMonth",
"next3Months",
"next6Months",
"next12Months"
]
}
},
"required": [
"preset"
]
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
}
},
"required": [
"property",
"operator",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"title": "Empty Rule",
"oneOf": [
{
"type": "object",
"title": "Empty Rule",
"properties": {
"operator": {
"enum": [
"isEmpty",
"isNotEmpty"
]
},
"property": {
"type": "string"
}
},
"required": [
"operator",
"property"
],
"additionalProperties": false
}
]
},
{
"type": "object",
"title": "Number Rule",
"properties": {
"property": {
"title": "Contexted property",
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
},
"operator": {
"enum": [
">",
">=",
"<",
"<="
]
},
"value": {
"anyOf": [
{
"type": "number",
"title": "number"
},
{
"type": "string",
"format": "date-time",
"title": "date-time"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
}
},
"required": [
"property",
"operator",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"title": "Expired Rule",
"oneOf": [
{
"type": "object",
"title": "Expired Rule",
"properties": {
"operator": {
"enum": [
"isExpired",
"isNotExpired"
]
},
"property": {
"type": "string"
}
},
"required": [
"operator",
"property"
],
"additionalProperties": false
}
]
},
{
"type": "object",
"title": "String Rule",
"oneOf": [
{
"type": "object",
"title": "String Rule",
"properties": {
"property": {
"title": "Contexted property",
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
},
"operator": {
"enum": [
"=",
"!=",
"containsAny",
"contains",
"doesNotContains",
"beginsWith",
"doesNotBeginsWith",
"endsWith",
"doesNotEndsWith",
"in",
"notIn"
]
},
"value": {
"anyOf": [
{
"type": "null",
"title": "null"
},
{
"type": "string",
"title": "string"
},
{
"type": "number",
"title": "number"
},
{
"type": "boolean",
"title": "boolean"
},
{
"type": "string",
"format": "date-time",
"title": "date-time"
},
{
"type": "array",
"items": {
"type": "string"
},
"title": "array"
},
{
"type": "array",
"items": {
"type": "number"
},
"title": "array"
},
{
"type": "array",
"items": {
"type": "boolean"
},
"title": "array"
},
{
"type": "array",
"items": {
"type": "string",
"format": "date-time"
},
"title": "array"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
}
},
"additionalProperties": false,
"required": [
"property",
"operator",
"value"
]
}
]
},
{
"type": "object",
"title": "Relation Rule",
"properties": {
"operator": {
"enum": [
"relatedTo"
]
},
"blueprint": {
"type": "string"
},
"value": {
"anyOf": [
{
"type": "string",
"title": "string"
},
{
"type": "array",
"items": {
"type": "string"
},
"title": "array"
}
]
},
"direction": {
"enum": [
"upstream",
"downstream"
]
},
"required": {
"type": "boolean"
}
},
"additionalProperties": false,
"required": [
"operator",
"value",
"blueprint"
]
},
{
"type": "object",
"title": "Property schema rule",
"properties": {
"propertySchema": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"format": {
"type": "string"
},
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"format": {
"type": "string"
}
},
"required": [
"type"
]
}
},
"required": [
"type"
],
"additionalProperties": false
},
"operator": {
"enum": [
"=",
"!=",
"contains"
]
},
"value": {
"anyOf": [
{
"type": "null",
"title": "null"
},
{
"type": "string",
"title": "string"
},
{
"type": "number",
"title": "number"
},
{
"type": "boolean",
"title": "boolean"
}
]
}
},
"required": [
"operator",
"propertySchema"
],
"additionalProperties": false
},
{
"type": "object",
"title": "matchAny Rule",
"anyOf": [
{
"type": "object",
"title": "Property matchAny rule",
"properties": {
"property": {
"oneOf": [
{
"type": "object",
"title": "Path filter property",
"properties": {
"path": {
"type": "array",
"minItems": 1,
"items": {
"anyOf": [
{
"type": "string",
"title": "Relation identifier"
},
{
"type": "object",
"title": "Relation with max hops",
"properties": {
"relation": {
"type": "string"
},
"maxHops": {
"type": "number",
"minimum": 1,
"maximum": 15
}
}
}
]
}
},
"fromBlueprint": {
"type": "string"
}
},
"required": [
"path"
],
"additionalProperties": false
},
{
"title": "Contexted property",
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
}
]
},
"operator": {
"type": "string",
"enum": [
"matchAny"
]
},
"value": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"title": "Contexted property",
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
}
]
}
},
"required": [
"property",
"operator",
"value"
],
"additionalProperties": false
}
]
},
{
"allOf": [
"circular(Entities query)",
{
"title": "Nested query"
}
]
}
]
}
}
},
"required": [
"combinator",
"rules"
],
"additionalProperties": false,
"example": {
"combinator": "and",
"rules": [
{
"property": "$blueprint",
"operator": "=",
"value": "service"
},
{
"combinator": "or",
"rules": [
{
"property": "environment",
"operator": "=",
"value": "production"
},
{
"property": "environment",
"operator": "=",
"value": "staging"
}
]
}
]
}
},
"relation": {
"type": "string"
}
},
"required": [
"func",
"query",
"relation"
],
"additionalProperties": false
},
{
"type": "object",
"title": "Group by scorecard",
"properties": {
"func": {
"enum": [
"countValues"
]
},
"query": {
"title": "Entities query",
"type": "object",
"properties": {
"combinator": {
"enum": [
"and",
"or"
],
"description": "The combinator to use for the rules."
},
"rules": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"title": "Date Rule",
"properties": {
"property": {
"title": "Contexted property",
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
},
"operator": {
"enum": [
"between",
"notBetween",
"="
]
},
"value": {
"type": "object",
"oneOf": [
{
"type": "object",
"title": "Date Range",
"properties": {
"from": {
"type": "string",
"format": "date-time"
},
"to": {
"type": "string",
"format": "date-time"
}
},
"required": [
"from",
"to"
]
},
{
"type": "object",
"title": "Date Preset",
"properties": {
"preset": {
"type": "string",
"enum": [
"today",
"tomorrow",
"yesterday",
"lastDay",
"lastWeek",
"last2Weeks",
"lastMonth",
"last3Months",
"last6Months",
"last12Months",
"last2Years",
"last3Years",
"nextDay",
"nextWeek",
"next2Weeks",
"nextMonth",
"next3Months",
"next6Months",
"next12Months"
]
}
},
"required": [
"preset"
]
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
}
},
"required": [
"property",
"operator",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"title": "Empty Rule",
"oneOf": [
{
"type": "object",
"title": "Empty Rule",
"properties": {
"operator": {
"enum": [
"isEmpty",
"isNotEmpty"
]
},
"property": {
"type": "string"
}
},
"required": [
"operator",
"property"
],
"additionalProperties": false
}
]
},
{
"type": "object",
"title": "Number Rule",
"properties": {
"property": {
"title": "Contexted property",
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
},
"operator": {
"enum": [
">",
">=",
"<",
"<="
]
},
"value": {
"anyOf": [
{
"type": "number",
"title": "number"
},
{
"type": "string",
"format": "date-time",
"title": "date-time"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
}
},
"required": [
"property",
"operator",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"title": "Expired Rule",
"oneOf": [
{
"type": "object",
"title": "Expired Rule",
"properties": {
"operator": {
"enum": [
"isExpired",
"isNotExpired"
]
},
"property": {
"type": "string"
}
},
"required": [
"operator",
"property"
],
"additionalProperties": false
}
]
},
{
"type": "object",
"title": "String Rule",
"oneOf": [
{
"type": "object",
"title": "String Rule",
"properties": {
"property": {
"title": "Contexted property",
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
},
"operator": {
"enum": [
"=",
"!=",
"containsAny",
"contains",
"doesNotContains",
"beginsWith",
"doesNotBeginsWith",
"endsWith",
"doesNotEndsWith",
"in",
"notIn"
]
},
"value": {
"anyOf": [
{
"type": "null",
"title": "null"
},
{
"type": "string",
"title": "string"
},
{
"type": "number",
"title": "number"
},
{
"type": "boolean",
"title": "boolean"
},
{
"type": "string",
"format": "date-time",
"title": "date-time"
},
{
"type": "array",
"items": {
"type": "string"
},
"title": "array"
},
{
"type": "array",
"items": {
"type": "number"
},
"title": "array"
},
{
"type": "array",
"items": {
"type": "boolean"
},
"title": "array"
},
{
"type": "array",
"items": {
"type": "string",
"format": "date-time"
},
"title": "array"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
}
},
"additionalProperties": false,
"required": [
"property",
"operator",
"value"
]
}
]
},
{
"type": "object",
"title": "Relation Rule",
"properties": {
"operator": {
"enum": [
"relatedTo"
]
},
"blueprint": {
"type": "string"
},
"value": {
"anyOf": [
{
"type": "string",
"title": "string"
},
{
"type": "array",
"items": {
"type": "string"
},
"title": "array"
}
]
},
"direction": {
"enum": [
"upstream",
"downstream"
]
},
"required": {
"type": "boolean"
}
},
"additionalProperties": false,
"required": [
"operator",
"value",
"blueprint"
]
},
{
"type": "object",
"title": "Property schema rule",
"properties": {
"propertySchema": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"format": {
"type": "string"
},
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"format": {
"type": "string"
}
},
"required": [
"type"
]
}
},
"required": [
"type"
],
"additionalProperties": false
},
"operator": {
"enum": [
"=",
"!=",
"contains"
]
},
"value": {
"anyOf": [
{
"type": "null",
"title": "null"
},
{
"type": "string",
"title": "string"
},
{
"type": "number",
"title": "number"
},
{
"type": "boolean",
"title": "boolean"
}
]
}
},
"required": [
"operator",
"propertySchema"
],
"additionalProperties": false
},
{
"type": "object",
"title": "matchAny Rule",
"anyOf": [
{
"type": "object",
"title": "Property matchAny rule",
"properties": {
"property": {
"oneOf": [
{
"type": "object",
"title": "Path filter property",
"properties": {
"path": {
"type": "array",
"minItems": 1,
"items": {
"anyOf": [
{
"type": "string",
"title": "Relation identifier"
},
{
"type": "object",
"title": "Relation with max hops",
"properties": {
"relation": {
"type": "string"
},
"maxHops": {
"type": "number",
"minimum": 1,
"maximum": 15
}
}
}
]
}
},
"fromBlueprint": {
"type": "string"
}
},
"required": [
"path"
],
"additionalProperties": false
},
{
"title": "Contexted property",
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
}
]
},
"operator": {
"type": "string",
"enum": [
"matchAny"
]
},
"value": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"title": "Contexted property",
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
}
]
}
},
"required": [
"property",
"operator",
"value"
],
"additionalProperties": false
}
]
},
{
"allOf": [
"circular(Entities query)",
{
"title": "Nested query"
}
]
}
]
}
}
},
"required": [
"combinator",
"rules"
],
"additionalProperties": false,
"example": {
"combinator": "and",
"rules": [
{
"property": "$blueprint",
"operator": "=",
"value": "service"
},
{
"combinator": "or",
"rules": [
{
"property": "environment",
"operator": "=",
"value": "production"
},
{
"property": "environment",
"operator": "=",
"value": "staging"
}
]
}
]
}
},
"scorecard": {
"type": "string"
}
},
"required": [
"func",
"query",
"scorecard"
],
"additionalProperties": false
},
{
"type": "object",
"title": "Group by scorecard rule",
"properties": {
"func": {
"enum": [
"countValues"
]
},
"query": {
"title": "Entities query",
"type": "object",
"properties": {
"combinator": {
"enum": [
"and",
"or"
],
"description": "The combinator to use for the rules."
},
"rules": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"title": "Date Rule",
"properties": {
"property": {
"title": "Contexted property",
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
},
"operator": {
"enum": [
"between",
"notBetween",
"="
]
},
"value": {
"type": "object",
"oneOf": [
{
"type": "object",
"title": "Date Range",
"properties": {
"from": {
"type": "string",
"format": "date-time"
},
"to": {
"type": "string",
"format": "date-time"
}
},
"required": [
"from",
"to"
]
},
{
"type": "object",
"title": "Date Preset",
"properties": {
"preset": {
"type": "string",
"enum": [
"today",
"tomorrow",
"yesterday",
"lastDay",
"lastWeek",
"last2Weeks",
"lastMonth",
"last3Months",
"last6Months",
"last12Months",
"last2Years",
"last3Years",
"nextDay",
"nextWeek",
"next2Weeks",
"nextMonth",
"next3Months",
"next6Months",
"next12Months"
]
}
},
"required": [
"preset"
]
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
}
},
"required": [
"property",
"operator",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"title": "Empty Rule",
"oneOf": [
{
"type": "object",
"title": "Empty Rule",
"properties": {
"operator": {
"enum": [
"isEmpty",
"isNotEmpty"
]
},
"property": {
"type": "string"
}
},
"required": [
"operator",
"property"
],
"additionalProperties": false
}
]
},
{
"type": "object",
"title": "Number Rule",
"properties": {
"property": {
"title": "Contexted property",
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
},
"operator": {
"enum": [
">",
">=",
"<",
"<="
]
},
"value": {
"anyOf": [
{
"type": "number",
"title": "number"
},
{
"type": "string",
"format": "date-time",
"title": "date-time"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
}
},
"required": [
"property",
"operator",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"title": "Expired Rule",
"oneOf": [
{
"type": "object",
"title": "Expired Rule",
"properties": {
"operator": {
"enum": [
"isExpired",
"isNotExpired"
]
},
"property": {
"type": "string"
}
},
"required": [
"operator",
"property"
],
"additionalProperties": false
}
]
},
{
"type": "object",
"title": "String Rule",
"oneOf": [
{
"type": "object",
"title": "String Rule",
"properties": {
"property": {
"title": "Contexted property",
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
},
"operator": {
"enum": [
"=",
"!=",
"containsAny",
"contains",
"doesNotContains",
"beginsWith",
"doesNotBeginsWith",
"endsWith",
"doesNotEndsWith",
"in",
"notIn"
]
},
"value": {
"anyOf": [
{
"type": "null",
"title": "null"
},
{
"type": "string",
"title": "string"
},
{
"type": "number",
"title": "number"
},
{
"type": "boolean",
"title": "boolean"
},
{
"type": "string",
"format": "date-time",
"title": "date-time"
},
{
"type": "array",
"items": {
"type": "string"
},
"title": "array"
},
{
"type": "array",
"items": {
"type": "number"
},
"title": "array"
},
{
"type": "array",
"items": {
"type": "boolean"
},
"title": "array"
},
{
"type": "array",
"items": {
"type": "string",
"format": "date-time"
},
"title": "array"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
}
},
"additionalProperties": false,
"required": [
"property",
"operator",
"value"
]
}
]
},
{
"type": "object",
"title": "Relation Rule",
"properties": {
"operator": {
"enum": [
"relatedTo"
]
},
"blueprint": {
"type": "string"
},
"value": {
"anyOf": [
{
"type": "string",
"title": "string"
},
{
"type": "array",
"items": {
"type": "string"
},
"title": "array"
}
]
},
"direction": {
"enum": [
"upstream",
"downstream"
]
},
"required": {
"type": "boolean"
}
},
"additionalProperties": false,
"required": [
"operator",
"value",
"blueprint"
]
},
{
"type": "object",
"title": "Property schema rule",
"properties": {
"propertySchema": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"format": {
"type": "string"
},
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"format": {
"type": "string"
}
},
"required": [
"type"
]
}
},
"required": [
"type"
],
"additionalProperties": false
},
"operator": {
"enum": [
"=",
"!=",
"contains"
]
},
"value": {
"anyOf": [
{
"type": "null",
"title": "null"
},
{
"type": "string",
"title": "string"
},
{
"type": "number",
"title": "number"
},
{
"type": "boolean",
"title": "boolean"
}
]
}
},
"required": [
"operator",
"propertySchema"
],
"additionalProperties": false
},
{
"type": "object",
"title": "matchAny Rule",
"anyOf": [
{
"type": "object",
"title": "Property matchAny rule",
"properties": {
"property": {
"oneOf": [
{
"type": "object",
"title": "Path filter property",
"properties": {
"path": {
"type": "array",
"minItems": 1,
"items": {
"anyOf": [
{
"type": "string",
"title": "Relation identifier"
},
{
"type": "object",
"title": "Relation with max hops",
"properties": {
"relation": {
"type": "string"
},
"maxHops": {
"type": "number",
"minimum": 1,
"maximum": 15
}
}
}
]
}
},
"fromBlueprint": {
"type": "string"
}
},
"required": [
"path"
],
"additionalProperties": false
},
{
"title": "Contexted property",
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
}
]
},
"operator": {
"type": "string",
"enum": [
"matchAny"
]
},
"value": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"title": "Contexted property",
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"title": "User-context field",
"properties": {
"property": {
"type": "string"
},
"context": {
"type": "string",
"enum": [
"user",
"userTeams"
]
}
},
"required": [
"property",
"context"
]
}
]
}
]
}
},
"required": [
"property",
"operator",
"value"
],
"additionalProperties": false
}
]
},
{
"allOf": [
"circular(Entities query)",
{
"title": "Nested query"
}
]
}
]
}
}
},
"required": [
"combinator",
"rules"
],
"additionalProperties": false,
"example": {
"combinator": "and",
"rules": [
{
"property": "$blueprint",
"operator": "=",
"value": "service"
},
{
"combinator": "or",
"rules": [
{
"property": "environment",
"operator": "=",
"value": "production"
},
{
"property": "environment",
"operator": "=",
"value": "staging"
}
]
}
]
}
},
"rule": {
"type": "string"
},
"scorecard": {
"type": "string"
}
},
"required": [
"func",
"query",
"rule",
"scorecard"
],
"additionalProperties": false
}
]
}
]
}
}
}
}
}Responses
- 200
- 401
- 404
- 413
- 422
Retrieved successfully (this response can be compressed).
Default Response
A resource with the provided identifier was not found
Request body is too large (limit is 1MiB)
The json provided does not match the route's schema
Responses (JSON)
{
"responses": {
"200": {
"description": "Retrieved successfully (this response can be compressed).",
"content": {
"application/json": {
"schema": {
"description": "Retrieved successfully (this response can be compressed).",
"type": "object",
"properties": {
"ok": {
"enum": [
true
]
},
"matchingBlueprints": {
"type": "array",
"items": {
"type": "string"
}
},
"failedBlueprints": {
"type": "array",
"items": {
"type": "string"
}
},
"entities": {
"type": "array",
"items": {
"type": "object",
"properties": {
"identifier": {
"oneOf": [
{
"type": [
"string"
],
"pattern": "^(?!\\.{1,2}$)[\\p{L}0-9@_.+:\\\\/='-]+$",
"maxLength": 1000,
"title": "String identifier",
"description": "The identifier of the entity."
},
{
"title": "Search identifier query",
"type": "object",
"properties": {
"combinator": {
"enum": [
"and",
"or"
]
},
"rules": {
"type": "array",
"description": "A search query to define the entity's identifier based on a property of the entity.<br/>Read more [here](https://docs.port.io/context-lake/ingestion/configure-mapping/overview#map-by-property).",
"items": {
"anyOf": [
{
"type": "object",
"title": "`=` rule",
"properties": {
"property": {
"type": "string"
},
"operator": {
"enum": [
"="
]
},
"value": {
"anyOf": [
{
"type": "string",
"title": "String"
},
{
"type": "number",
"title": "Number"
},
{
"type": "null"
}
]
}
},
"additionalProperties": false,
"required": [
"property",
"operator",
"value"
]
},
{
"type": "object",
"title": "`in` rule",
"properties": {
"property": {
"type": "string"
},
"operator": {
"enum": [
"in",
"containsAny"
]
},
"value": {
"type": "array",
"items": {
"type": "string"
},
"errorMessage": "must be an array of strings when the operator is 'in' or 'containsAny'"
}
},
"additionalProperties": false,
"required": [
"property",
"operator",
"value"
]
},
{
"type": "object",
"title": "`contains` rule",
"properties": {
"property": {
"type": "string"
},
"operator": {
"enum": [
"contains"
]
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
]
}
},
"additionalProperties": false,
"required": [
"property",
"operator",
"value"
]
},
{
"allOf": [
"circular(Search identifier query)",
{
"title": "Nested query"
}
]
}
]
}
}
},
"required": [
"combinator",
"rules"
],
"additionalProperties": false
}
]
},
"title": {
"type": "string",
"description": "The title of the entity."
},
"icon": {
"type": "string",
"description": "The icon of the entity."
},
"team": {
"oneOf": [
{
"title": "Team (Single)",
"type": "string",
"description": "The Port team/s to which the entity will belong."
},
{
"title": "Teams (Multiple)",
"type": "array",
"items": {
"type": "string"
},
"description": "The Port team/s to which the entity will belong."
},
{
"title": "Search relations query",
"type": "object",
"properties": {
"combinator": {
"enum": [
"and",
"or"
]
},
"rules": {
"type": "array",
"description": "A search query to define the entity's identifier based on a property of the entity.<br/>Read more [here](https://docs.port.io/context-lake/ingestion/configure-mapping/overview#map-by-property).",
"items": {
"anyOf": [
{
"type": "object",
"title": "`=` rule",
"properties": {
"property": {
"type": "string"
},
"operator": {
"enum": [
"="
]
},
"value": {
"anyOf": [
{
"type": "string",
"title": "String"
},
{
"type": "number",
"title": "Number"
},
{
"type": "null"
}
]
}
},
"additionalProperties": false,
"required": [
"property",
"operator",
"value"
]
},
{
"type": "object",
"title": "`in` rule",
"properties": {
"property": {
"type": "string"
},
"operator": {
"enum": [
"in",
"containsAny"
]
},
"value": {
"type": "array",
"items": {
"type": "string"
},
"errorMessage": "must be an array of strings when the operator is 'in' or 'containsAny'"
}
},
"additionalProperties": false,
"required": [
"property",
"operator",
"value"
]
},
{
"type": "object",
"title": "`contains` rule",
"properties": {
"property": {
"type": "string"
},
"operator": {
"enum": [
"contains"
]
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
]
}
},
"additionalProperties": false,
"required": [
"property",
"operator",
"value"
]
},
{
"allOf": [
"circular(Search relations query)",
{
"title": "Nested query"
}
]
}
]
}
}
},
"required": [
"combinator",
"rules"
],
"additionalProperties": false
},
{
"title": "Union source slice",
"description": "Only valid when the blueprint's \"ownership.union\" is enabled: a single source key mapped to that source's slice of owning teams, as in `{ \"<sourceKey>\": [\"team-a\"] }`. The slice may also be a search query.",
"type": "object",
"minProperties": 1,
"maxProperties": 1,
"additionalProperties": {
"anyOf": [
{
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
},
{
"title": "Search relations query",
"type": "object",
"properties": {
"combinator": {
"enum": [
"and",
"or"
]
},
"rules": {
"type": "array",
"description": "A search query to define the entity's identifier based on a property of the entity.<br/>Read more [here](https://docs.port.io/context-lake/ingestion/configure-mapping/overview#map-by-property).",
"items": {
"anyOf": [
{
"type": "object",
"title": "`=` rule",
"properties": {
"property": {
"type": "string"
},
"operator": {
"enum": [
"="
]
},
"value": {
"anyOf": [
{
"type": "string",
"title": "String"
},
{
"type": "number",
"title": "Number"
},
{
"type": "null"
}
]
}
},
"additionalProperties": false,
"required": [
"property",
"operator",
"value"
]
},
{
"type": "object",
"title": "`in` rule",
"properties": {
"property": {
"type": "string"
},
"operator": {
"enum": [
"in",
"containsAny"
]
},
"value": {
"type": "array",
"items": {
"type": "string"
},
"errorMessage": "must be an array of strings when the operator is 'in' or 'containsAny'"
}
},
"additionalProperties": false,
"required": [
"property",
"operator",
"value"
]
},
{
"type": "object",
"title": "`contains` rule",
"properties": {
"property": {
"type": "string"
},
"operator": {
"enum": [
"contains"
]
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
]
}
},
"additionalProperties": false,
"required": [
"property",
"operator",
"value"
]
},
{
"allOf": [
"circular(Search relations query)",
{
"title": "Nested query"
}
]
}
]
}
}
},
"required": [
"combinator",
"rules"
],
"additionalProperties": false
}
]
}
}
]
},
"properties": {
"type": "object",
"default": {},
"description": "An object containing the properties of the entity, in `\"key\":\"value\"` pairs where the `key` is the property's identifier, and the `value` is its value."
},
"relations": {
"type": "object",
"description": "An object containing the relations of the entity, in `\"key\":\"value\"` pairs where the `key` is the relation's identifier, and the `value` is the related entity's identifier for single-relations, or an array of identifiers for many-relations.<br/>You can also use a [search query](https://docs.port.io/context-lake/ingestion/configure-mapping/configuration-methods#mapping-relations-using-search-queries) to define relations based on a property of the related entity.",
"additionalProperties": {
"anyOf": [
{
"type": "string",
"pattern": "^(?!\\.{1,2}$)[\\p{L}0-9@_.+:\\\\/='-]+$",
"maxLength": 1000,
"title": "string"
},
{
"type": "array",
"items": {
"type": "string",
"pattern": "^(?!\\.{1,2}$)[\\p{L}0-9@_.+:\\\\/='-]+$"
},
"title": "array"
},
{
"type": "null",
"title": "null"
},
{
"title": "Search relations query",
"type": "object",
"properties": {
"combinator": {
"enum": [
"and",
"or"
]
},
"rules": {
"type": "array",
"description": "A search query to define the entity's identifier based on a property of the entity.<br/>Read more [here](https://docs.port.io/context-lake/ingestion/configure-mapping/overview#map-by-property).",
"items": {
"anyOf": [
{
"type": "object",
"title": "`=` rule",
"properties": {
"property": {
"type": "string"
},
"operator": {
"enum": [
"="
]
},
"value": {
"anyOf": [
{
"type": "string",
"title": "String"
},
{
"type": "number",
"title": "Number"
},
{
"type": "null"
}
]
}
},
"additionalProperties": false,
"required": [
"property",
"operator",
"value"
]
},
{
"type": "object",
"title": "`in` rule",
"properties": {
"property": {
"type": "string"
},
"operator": {
"enum": [
"in",
"containsAny"
]
},
"value": {
"type": "array",
"items": {
"type": "string"
},
"errorMessage": "must be an array of strings when the operator is 'in' or 'containsAny'"
}
},
"additionalProperties": false,
"required": [
"property",
"operator",
"value"
]
},
{
"type": "object",
"title": "`contains` rule",
"properties": {
"property": {
"type": "string"
},
"operator": {
"enum": [
"contains"
]
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
]
}
},
"additionalProperties": false,
"required": [
"property",
"operator",
"value"
]
},
{
"allOf": [
"circular(Search relations query)",
{
"title": "Nested query"
}
]
}
]
}
}
},
"required": [
"combinator",
"rules"
],
"additionalProperties": false
},
{
"title": "Union source slice",
"description": "Only valid for relations with \"union\" enabled: a single source key mapped to that source's slice of targets, as in `{ \"<sourceKey>\": [\"target-id\"] }`. The slice may also be a search query.",
"type": "object",
"minProperties": 1,
"maxProperties": 1,
"additionalProperties": {
"anyOf": [
{
"type": [
"array",
"null"
],
"items": {
"type": "string",
"pattern": "^(?!\\.{1,2}$)[\\p{L}0-9@_.+:\\\\/='-]+$"
}
},
{
"title": "Search relations query",
"type": "object",
"properties": {
"combinator": {
"enum": [
"and",
"or"
]
},
"rules": {
"type": "array",
"description": "A search query to define the entity's identifier based on a property of the entity.<br/>Read more [here](https://docs.port.io/context-lake/ingestion/configure-mapping/overview#map-by-property).",
"items": {
"anyOf": [
{
"type": "object",
"title": "`=` rule",
"properties": {
"property": {
"type": "string"
},
"operator": {
"enum": [
"="
]
},
"value": {
"anyOf": [
{
"type": "string",
"title": "String"
},
{
"type": "number",
"title": "Number"
},
{
"type": "null"
}
]
}
},
"additionalProperties": false,
"required": [
"property",
"operator",
"value"
]
},
{
"type": "object",
"title": "`in` rule",
"properties": {
"property": {
"type": "string"
},
"operator": {
"enum": [
"in",
"containsAny"
]
},
"value": {
"type": "array",
"items": {
"type": "string"
},
"errorMessage": "must be an array of strings when the operator is 'in' or 'containsAny'"
}
},
"additionalProperties": false,
"required": [
"property",
"operator",
"value"
]
},
{
"type": "object",
"title": "`contains` rule",
"properties": {
"property": {
"type": "string"
},
"operator": {
"enum": [
"contains"
]
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
]
}
},
"additionalProperties": false,
"required": [
"property",
"operator",
"value"
]
},
{
"allOf": [
"circular(Search relations query)",
{
"title": "Nested query"
}
]
}
]
}
}
},
"required": [
"combinator",
"rules"
],
"additionalProperties": false
}
]
}
}
]
}
}
},
"additionalProperties": false
}
}
},
"required": [
"entities",
"ok"
],
"additionalProperties": false
}
}
}
},
"401": {
"description": "Default Response",
"content": {
"application/json": {
"schema": {
"properties": {
"ok": {
"const": false
},
"error": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"ok",
"error"
],
"additionalProperties": false
}
}
}
},
"404": {
"description": "A resource with the provided identifier was not found",
"content": {
"application/json": {
"schema": {
"properties": {
"ok": {
"const": false
},
"error": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"ok",
"error",
"message"
],
"additionalProperties": false,
"description": "A resource with the provided identifier was not found"
}
}
}
},
"413": {
"description": "Request body is too large (limit is 1MiB)",
"content": {
"application/json": {
"schema": {
"properties": {
"ok": {
"const": false
},
"error": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"ok",
"error"
],
"additionalProperties": false,
"description": "Request body is too large (limit is 1MiB)"
}
}
}
},
"422": {
"description": "The json provided does not match the route's schema",
"content": {
"application/json": {
"schema": {
"properties": {
"ok": {
"const": false
},
"error": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"ok",
"error",
"message"
],
"additionalProperties": false,
"description": "The json provided does not match the route's schema"
}
}
}
}
}
}