github.com/choria-io/go-choria@v0.28.1-0.20240416190746-b3bf9c7d5a45/internal/fs/schemas/choria/protocol/v2/request.json (about) 1 { 2 "$schema": "http://json-schema.org/draft-07/schema", 3 "$id": "https://choria.io/schemas/choria/protocol/v2/request.json", 4 "description": "Choria Request version 2", 5 "title": "RequestV2", 6 "type":"object", 7 "required":[ 8 "protocol", 9 "message", 10 "id", 11 "sender", 12 "caller", 13 "collective", 14 "agent", 15 "ttl", 16 "time" 17 ], 18 "properties": { 19 "protocol": { 20 "type": "string", 21 "const":"io.choria.protocol.v2.request" 22 }, 23 "message": { 24 "type":"string", 25 "description": "Base64 encoded data to be delivered to the Agent", 26 "minLength": 1 27 }, 28 "id": { 29 "type": "string", 30 "description": "The unique ID for the request, logged in AAA etc", 31 "minLength": 1 32 }, 33 "sender": { 34 "type": "string", 35 "description": "Typically the host that the request was initiated from", 36 "minLength": 1 37 }, 38 "caller": { 39 "type": "string", 40 "description": "Who made the request in the form of `kind=name`", 41 "minLength": 1 42 }, 43 "collective": { 44 "type": "string", 45 "description": "Collective this request is targeted at", 46 "minLength": 1 47 }, 48 "agent": { 49 "type": "string", 50 "description": "The agent this request is targeted at", 51 "minLength": 1 52 }, 53 "ttl": { 54 "type": "integer", 55 "description": "How long this request is valid for", 56 "minimum": 1 57 }, 58 "time": { 59 "type": "integer", 60 "description": "he unix nano time the request was created", 61 "minimum": 1, 62 "maximum": 18446744073709551615 63 }, 64 "filter":{ 65 "type":"object", 66 "required":[ 67 "fact", 68 "cf_class", 69 "identity", 70 "compound" 71 ], 72 "properties": { 73 "compound": { 74 "type":"array", 75 "description": "List of compound filters to be applied in an AND fashion", 76 "items": { 77 "type":"array", 78 "items": { 79 "type": "object" 80 } 81 } 82 }, 83 "identity": { 84 "type":"array", 85 "description": "List of identities the message should match, applied in an OR fashion", 86 "items": { 87 "type":"string" 88 } 89 }, 90 "agent": { 91 "type":"array", 92 "description": "List of agents the node should have, applied in an AND fashion", 93 "items": { 94 "type":"string" 95 } 96 }, 97 "cf_class": { 98 "type":"array", 99 "description": "The list of configuration management classes the node should have, applied in an AND fashion", 100 "items": { 101 "type":"string" 102 } 103 }, 104 "fact": { 105 "type":"array", 106 "description": "Fact values the node should have, applied in an AND fashion", 107 "items": { 108 "type":"object", 109 "required": [ 110 "fact", 111 "operator", 112 "value" 113 ], 114 "properties": { 115 "fact": { 116 "type":"string", 117 "description": "The fact name to match", 118 "minLength": 1 119 }, 120 "operator": { 121 "type":"string", 122 "description": "The comparison to do on it's value", 123 "enum": [ 124 ">=", 125 "<=", 126 "<", 127 ">", 128 "!=", 129 "==", 130 "=~" 131 ] 132 }, 133 "value": { 134 "type":"string", 135 "description": "Value to compare the fact value with using the operator", 136 "minLength": 1 137 } 138 } 139 } 140 } 141 } 142 } 143 } 144 }