github.com/choria-io/go-choria@v0.28.1-0.20240416190746-b3bf9c7d5a45/internal/fs/schemas/choria/protocol/v1/request.json (about) 1 { 2 "$schema": "http://json-schema.org/draft-04/schema", 3 "description": "Choria Request version 1", 4 "title": "RequestV1", 5 "type":"object", 6 "required":[ 7 "protocol", 8 "message", 9 "envelope" 10 ], 11 "properties": { 12 "protocol": { 13 "type":"string", 14 "enum": [ 15 "choria:request:1" 16 ] 17 }, 18 "message": { 19 "type":"string", 20 "description": "JSON encoded data to be delivered to the Agent", 21 "minLength": 1 22 }, 23 "envelope": { 24 "type":"object", 25 "required":[ 26 "requestid", 27 "senderid", 28 "callerid", 29 "collective", 30 "agent", 31 "ttl", 32 "time", 33 "filter" 34 ], 35 "properties": { 36 "requestid": { 37 "type":"string", 38 "description": "Globally unique Request ID", 39 "minLength": 32, 40 "maxLength": 32 41 }, 42 "senderid": { 43 "type": "string", 44 "description": "The identity of the machine that sent this message" 45 }, 46 "callerid": { 47 "type":"string", 48 "description": "The caller id of the client making this request", 49 "minLength": 1 50 }, 51 "collective": { 52 "type":"string", 53 "description": "The sub collective this message is destined for", 54 "minLength": 1 55 }, 56 "agent": { 57 "type":"string", 58 "description": "The name of the agent on the server that sent this message", 59 "minLength": 1 60 }, 61 "ttl": { 62 "type":"integer", 63 "description": "The number of seconds after creation that this message should be considered valid for", 64 "default": 60, 65 "minimum": 30 66 }, 67 "time": { 68 "type":"integer", 69 "description": "Unix time stamp of UTC time when the reply was made" 70 }, 71 "filter":{ 72 "type":"object", 73 "required":[ 74 "fact", 75 "cf_class", 76 "identity", 77 "compound" 78 ], 79 "properties": { 80 "compound": { 81 "type":"array", 82 "description": "List of compound filters to be applied in an AND fashion", 83 "items": { 84 "type":"array", 85 "items": { 86 "type": "object" 87 } 88 } 89 }, 90 "identity": { 91 "type":"array", 92 "description": "List of identities the message should match, applied in an OR fashion", 93 "items": { 94 "type":"string" 95 } 96 }, 97 "agent": { 98 "type":"array", 99 "description": "List of agents the node should have, applied in an AND fashion", 100 "items": { 101 "type":"string" 102 } 103 }, 104 "cf_class": { 105 "type":"array", 106 "description": "The list of configuration management classes the node should have, applied in an AND fashion", 107 "items": { 108 "type":"string" 109 } 110 }, 111 "fact": { 112 "type":"array", 113 "description": "Fact values the node should have, applied in an AND fashion", 114 "items": { 115 "type":"object", 116 "required": [ 117 "fact", 118 "operator", 119 "value" 120 ], 121 "properties": { 122 "fact": { 123 "type":"string", 124 "description": "The fact name to match", 125 "minLength": 1 126 }, 127 "operator": { 128 "type":"string", 129 "description": "The comparison to do on it's value", 130 "enum": [ 131 ">=", 132 "<=", 133 "<", 134 ">", 135 "!=", 136 "==", 137 "=~" 138 ] 139 }, 140 "value": { 141 "type":"string", 142 "description": "Value to compare the fact value with using the operator", 143 "minLength": 1 144 } 145 } 146 } 147 } 148 } 149 } 150 } 151 } 152 } 153 }