1 // Copyright 2020 The Kubernetes Authors. 2 // SPDX-License-Identifier: Apache-2.0 3 4 // Package json provides a printer that outputs the eventstream in json 5 // format. Each event is printed as a json object, so the output will 6 // appear as a stream of json objects, each representing a single event. 7 // 8 // Every event will contain the following properties: 9 // - timestamp: RFC3339-formatted timestamp describing when the event happened. 10 // - type: Describes the type of the operation which the event is related to. 11 // Type values include: 12 // - validation - ValidationEvent 13 // - error - ErrorEvent 14 // - group - ActionGroupEvent 15 // - apply - ApplyEvent 16 // - prune - PruneEvent 17 // - delete - DeleteEvent 18 // - wait - WaitEvent 19 // - status - StatusEvent 20 // - summary - aggregate stats collected by the printer 21 // 22 // Validation events correspond to zero or more objects. For these events, the 23 // objects field includes a list of object identifiers. These generally fire 24 // first before most other events. 25 // 26 // Validation events have the following fields: 27 // * objects (array of objects) - a list of object identifiers 28 // - group (string, optional) - The object's API group. 29 // - kind (string) - The object's kind. 30 // - name (string) - The object's name. 31 // - namespace (string, optional) - The object's namespace. 32 // 33 // * timestamp (string) - ISO-8601 format 34 // * type (string) - "validation" 35 // * error (string) - a fatal error message specific to these objects 36 // 37 // Error events corespond to a fatal error received outside of a specific task 38 // or operation. 39 // 40 // Error events have the following fields: 41 // * timestamp (string) - ISO-8601 format 42 // * type (string) - "error" 43 // * error (string) - a fatal error message 44 // 45 // Group events correspond to a group of events of the same type: apply, prune, 46 // delete, or wait. 47 // 48 // Group events have the following fields: 49 // * action (string) - One of: "Apply", "Prune", "Delete", or "Wait". 50 // * status (string) - One of: "Started" or "Finished" 51 // * timestamp (string) - ISO-8601 format 52 // * type (string) - "group" 53 // 54 // Operation events (apply, prune, delete, and wait) corespond to an operation 55 // performed on a single object. For these events, the 56 // group, kind, name, and namespace fields identify the object. 57 // 58 // Operation events have the following fields: 59 // - group (string, optional) - The object's API group. 60 // - kind (string) - The object's kind. 61 // - name (string) - The object's name. 62 // - namespace (string, optional) - The object's namespace. 63 // - status (string) - One of: "Pending", "Successful", "Skipped", "Failed", or 64 // "Timeout". 65 // - timestamp (string) - ISO-8601 format 66 // - type (string) - "apply", "prune", "delete", or "wait" 67 // - error (string, optional) - A non-fatal error message specific to this object 68 // 69 // Status types are asynchronous events that correspond to status updates for 70 // a specific object. 71 // 72 // Status events have the following fields: 73 // - group (string, optional) - The object's API group. 74 // - kind (string) - The object's kind. 75 // - name (string) - The object's name. 76 // - namespace (string, optional) - The object's namespace. 77 // - status (string) - One of: "InProgress", "Failed", "Current", "Terminating", 78 // "NotFound", or "Unknown". 79 // - message (string) - Human readable description of the status. 80 // - timestamp (string) - ISO-8601 format 81 // - type (string) - "status" 82 // 83 // Summary types are a meta-event sent by the printer to summarize some stats 84 // that have been collected from other events. For these events, the action 85 // field corresponds to the event type being summarized: Apply, Prune, Delete, 86 // and Wait. 87 // 88 // Summary events have the following fields: 89 // * action (string) - One of: "Apply", "Prune", "Delete", or "Wait". 90 // * count (number) - Total number of objects attempted for this action 91 // * successful (number) - Number of objects for which the action was successful. 92 // * skipped (number) - Number of objects for which the action was skipped. 93 // * failed (number) - Number of objects for which the action failed. 94 // * timeout (number, optional) - Number of objects for which the action timed out. 95 // * timestamp (string) - ISO-8601 format 96 // * type (string) - "summary" 97 package json 98