|
| 1 | +Example schema |
| 2 | +============== |
| 3 | + |
| 4 | +.. tab-set:: |
| 5 | + |
| 6 | + .. tab-item:: Rendered using sphinx-jsonschema |
| 7 | + |
| 8 | + .. jsonschema:: ../schema/server/events/kernel-actions/v1/kernel-actions.schema.json |
| 9 | + |
| 10 | + .. tab-item:: JSON |
| 11 | + |
| 12 | + .. literalinclude:: ../schema/server/events/kernel-actions/v1/kernel-actions.schema.json |
| 13 | + :language: JSON |
| 14 | + |
| 15 | + .. tab-item:: TOML |
| 16 | + |
| 17 | + .. code-block:: toml |
| 18 | +
|
| 19 | + "$schema" = "https://json-schema.org/draft/2020-12/schema" |
| 20 | + "$id" = "https://schema.jupyter.org/server/events/kernel-actions/v1/kernel-actions.schema.json" |
| 21 | + version = 1 |
| 22 | + title = "Kernel Manager activities" |
| 23 | + personal-data = true |
| 24 | + description = "Record events of a kernel manager.\n" |
| 25 | + type = "object" |
| 26 | + required = [ "action", "msg",] |
| 27 | +
|
| 28 | + [properties.action] |
| 29 | + enum = [ "start", "interrupt", "shutdown", "restart",] |
| 30 | + description = "Action performed by the Kernel Manager.\n\nThis is a required field.\n\nPossible values:\n\n1. start\n A kernel has been started with the given kernel id.\n\n2. interrupt\n A kernel has been interrupted for the given kernel id.\n\n3. shutdown\n A kernel has been shut down for the given kernel id.\n\n4. restart\n A kernel has been restarted for the given kernel id.\n" |
| 31 | +
|
| 32 | + [properties.kernel_id] |
| 33 | + type = "string" |
| 34 | + description = "Kernel id.\n\nThis is a required field for all actions and statuses except action start with status error.\n" |
| 35 | +
|
| 36 | + [properties.kernel_name] |
| 37 | + type = "string" |
| 38 | + description = "Name of the kernel.\n" |
| 39 | +
|
| 40 | + [properties.status] |
| 41 | + enum = [ "error", "success",] |
| 42 | + description = "Status received from a rest api operation to kernel server.\n\nThis is a required field.\n\nPossible values:\n\n1. error\n Error response from a rest api operation to kernel server.\n\n2. success\n Success response from a rest api operation to kernel server.\n" |
| 43 | +
|
| 44 | + [properties.status_code] |
| 45 | + type = "number" |
| 46 | + description = "Http response codes from a rest api operation to kernel server.\nExamples: 200, 400, 502, 503, 599 etc\n" |
| 47 | +
|
| 48 | + [properties.msg] |
| 49 | + type = "string" |
| 50 | + description = "Description of the event specified in action.\n" |
| 51 | +
|
| 52 | + [if.not.properties.status] |
| 53 | + const = "error" |
| 54 | +
|
| 55 | + [if.not.properties.action] |
| 56 | + const = "start" |
| 57 | +
|
| 58 | + [then] |
| 59 | + required = [ "kernel_id",] |
| 60 | +
|
| 61 | + .. tab-item:: YAML |
| 62 | + |
| 63 | + .. code-block:: yaml |
| 64 | +
|
| 65 | + $schema: https://json-schema.org/draft/2020-12/schema |
| 66 | + $id: https://schema.jupyter.org/server/events/kernel-actions/v1/kernel-actions.schema.json |
| 67 | + version: 1 |
| 68 | + title: Kernel Manager activities |
| 69 | + personal-data: true |
| 70 | + description: 'Record events of a kernel manager. |
| 71 | +
|
| 72 | + ' |
| 73 | + type: object |
| 74 | + required: |
| 75 | + - action |
| 76 | + - msg |
| 77 | + properties: |
| 78 | + action: |
| 79 | + enum: |
| 80 | + - start |
| 81 | + - interrupt |
| 82 | + - shutdown |
| 83 | + - restart |
| 84 | + description: "Action performed by the Kernel Manager.\n\nThis is a required field.\n\nPossible values:\n\ |
| 85 | + \n1. start\n A kernel has been started with the given kernel id.\n\n2. interrupt\n A kernel\ |
| 86 | + \ has been interrupted for the given kernel id.\n\n3. shutdown\n A kernel has been shut down for\ |
| 87 | + \ the given kernel id.\n\n4. restart\n A kernel has been restarted for the given kernel id.\n" |
| 88 | + kernel_id: |
| 89 | + type: string |
| 90 | + description: 'Kernel id. |
| 91 | +
|
| 92 | +
|
| 93 | + This is a required field for all actions and statuses except action start with status error. |
| 94 | +
|
| 95 | + ' |
| 96 | + kernel_name: |
| 97 | + type: string |
| 98 | + description: 'Name of the kernel. |
| 99 | +
|
| 100 | + ' |
| 101 | + status: |
| 102 | + enum: |
| 103 | + - error |
| 104 | + - success |
| 105 | + description: "Status received from a rest api operation to kernel server.\n\nThis is a required field.\n\ |
| 106 | + \nPossible values:\n\n1. error\n Error response from a rest api operation to kernel server.\n\n\ |
| 107 | + 2. success\n Success response from a rest api operation to kernel server.\n" |
| 108 | + status_code: |
| 109 | + type: number |
| 110 | + description: 'Http response codes from a rest api operation to kernel server. |
| 111 | +
|
| 112 | + Examples: 200, 400, 502, 503, 599 etc |
| 113 | +
|
| 114 | + ' |
| 115 | + msg: |
| 116 | + type: string |
| 117 | + description: 'Description of the event specified in action. |
| 118 | +
|
| 119 | + ' |
| 120 | + if: |
| 121 | + not: |
| 122 | + properties: |
| 123 | + status: |
| 124 | + const: error |
| 125 | + action: |
| 126 | + const: start |
| 127 | + then: |
| 128 | + required: |
| 129 | + - kernel_id |
0 commit comments