{
  "properties": {
    "apiVersion": {
      "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
      "type": [
        "string",
        "null"
      ]
    },
    "kind": {
      "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
      "type": [
        "string",
        "null"
      ]
    },
    "metadata": {
      "type": [
        "object",
        "null"
      ]
    },
    "spec": {
      "additionalProperties": false,
      "properties": {
        "invoker": {
          "additionalProperties": false,
          "description": "Invoker refers to the BackupConfiguration or BackupBatch being used to invoke this backup session",
          "properties": {
            "apiGroup": {
              "description": "APIGroup is the group for the resource being referenced",
              "type": [
                "string",
                "null"
              ]
            },
            "kind": {
              "description": "Kind is the type of resource being referenced",
              "type": "string"
            },
            "name": {
              "description": "Name is the name of resource being referenced",
              "type": "string"
            }
          },
          "required": [
            "kind",
            "name"
          ],
          "type": [
            "object",
            "null"
          ]
        },
        "retryLeft": {
          "description": "RetryLeft specifies number of retry attempts left for the session. If this set to non-zero, Stash will create a new BackupSession if the current one fails.",
          "format": "int32",
          "type": [
            "integer",
            "null"
          ]
        }
      },
      "type": [
        "object",
        "null"
      ]
    },
    "status": {
      "additionalProperties": false,
      "properties": {
        "conditions": {
          "description": "Conditions shows condition of different operations/steps of the backup process",
          "items": {
            "additionalProperties": false,
            "description": "Condition defines an observation of a object operational state.",
            "properties": {
              "lastTransitionTime": {
                "description": "Last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.",
                "format": "date-time",
                "type": "string"
              },
              "message": {
                "description": "A human-readable message indicating details about the transition. This field may be empty.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "observedGeneration": {
                "description": "If set, this represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.condition[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.",
                "format": "int64",
                "type": [
                  "integer",
                  "null"
                ]
              },
              "reason": {
                "description": "The reason for the condition's last transition in CamelCase. The specific API may choose whether this field is considered a guaranteed API. This field may not be empty.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "severity": {
                "description": "Severity provides an explicit classification of Reason code, so the users or machines can immediately understand the current situation and act accordingly. The Severity field MUST be set only when Status=False.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "status": {
                "description": "Status of the condition, one of True, False, Unknown.",
                "type": "string"
              },
              "type": {
                "description": "Type of condition in CamelCase or in foo.example.com/CamelCase. Many .condition.type values are consistent across resources like Available, but because arbitrary util can be useful (see .node.status.util), the ability to deconflict is important.",
                "type": "string"
              }
            },
            "required": [
              "lastTransitionTime",
              "status",
              "type"
            ],
            "type": "object"
          },
          "type": [
            "array",
            "null"
          ]
        },
        "nextRetry": {
          "description": "NextRetry specifies the time when Stash should retry the current failed backup. This field will exist only if the `retryConfig` has been set in the respective backup invoker.",
          "format": "date-time",
          "type": [
            "string",
            "null"
          ]
        },
        "phase": {
          "description": "Phase indicates the overall phase of the backup process for this BackupSession. Phase will be \"Succeeded\" only if phase of all hosts are \"Succeeded\". If any of the host fail to complete backup, Phase will be \"Failed\".",
          "enum": [
            "Pending",
            "Skipped",
            "Running",
            "Succeeded",
            "Failed",
            "Unknown"
          ],
          "type": [
            "string",
            "null"
          ]
        },
        "retried": {
          "description": "Retried specifies whether this session was retried or not. This field will exist only if the `retryConfig` has been set in the respective backup invoker.",
          "type": [
            "boolean",
            "null"
          ]
        },
        "sessionDeadline": {
          "description": "SessionDeadline specifies the deadline of backup. BackupSession will be considered Failed if backup does not complete within this deadline",
          "format": "date-time",
          "type": [
            "string",
            "null"
          ]
        },
        "sessionDuration": {
          "description": "SessionDuration specify total time taken to complete current backup session (sum of backup duration of all targets)",
          "type": [
            "string",
            "null"
          ]
        },
        "targets": {
          "description": "Targets specify the backup status of individual targets",
          "items": {
            "additionalProperties": false,
            "properties": {
              "conditions": {
                "description": "Conditions shows condition of different operations/steps of the backup process for this target",
                "items": {
                  "additionalProperties": false,
                  "description": "Condition defines an observation of a object operational state.",
                  "properties": {
                    "lastTransitionTime": {
                      "description": "Last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.",
                      "format": "date-time",
                      "type": "string"
                    },
                    "message": {
                      "description": "A human-readable message indicating details about the transition. This field may be empty.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "observedGeneration": {
                      "description": "If set, this represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.condition[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.",
                      "format": "int64",
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "reason": {
                      "description": "The reason for the condition's last transition in CamelCase. The specific API may choose whether this field is considered a guaranteed API. This field may not be empty.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "severity": {
                      "description": "Severity provides an explicit classification of Reason code, so the users or machines can immediately understand the current situation and act accordingly. The Severity field MUST be set only when Status=False.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "description": "Status of the condition, one of True, False, Unknown.",
                      "type": "string"
                    },
                    "type": {
                      "description": "Type of condition in CamelCase or in foo.example.com/CamelCase. Many .condition.type values are consistent across resources like Available, but because arbitrary util can be useful (see .node.status.util), the ability to deconflict is important.",
                      "type": "string"
                    }
                  },
                  "required": [
                    "lastTransitionTime",
                    "status",
                    "type"
                  ],
                  "type": "object"
                },
                "type": [
                  "array",
                  "null"
                ]
              },
              "phase": {
                "description": "Phase indicates backup phase of this target",
                "enum": [
                  "Pending",
                  "Succeeded",
                  "Running",
                  "Failed"
                ],
                "type": [
                  "string",
                  "null"
                ]
              },
              "postBackupActions": {
                "description": "PostBackupActions specifies a list of actions that the backup process should execute after taking backup",
                "items": {
                  "type": "string"
                },
                "type": [
                  "array",
                  "null"
                ]
              },
              "preBackupActions": {
                "description": "PreBackupActions specifies a list of actions that the backup process should execute before taking backup",
                "items": {
                  "type": "string"
                },
                "type": [
                  "array",
                  "null"
                ]
              },
              "ref": {
                "additionalProperties": false,
                "description": "Ref refers to the backup target",
                "properties": {
                  "apiVersion": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "kind": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "namespace": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "type": [
                  "object",
                  "null"
                ]
              },
              "stats": {
                "description": "Stats shows statistics of individual hosts for this backup session",
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "duration": {
                      "description": "Duration indicates total time taken to complete backup for this host",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "error": {
                      "description": "Error indicates string value of error in case of backup failure",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "hostname": {
                      "description": "Hostname indicate name of the host that has been backed up",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "phase": {
                      "description": "Phase indicates backup phase of this host",
                      "enum": [
                        "Succeeded",
                        "Failed"
                      ],
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "snapshots": {
                      "description": "Snapshots specifies the stats of individual snapshots that has been taken for this host in current backup session",
                      "items": {
                        "additionalProperties": false,
                        "properties": {
                          "fileStats": {
                            "additionalProperties": false,
                            "description": "FileStats shows statistics of files of this snapshot",
                            "properties": {
                              "modifiedFiles": {
                                "description": "ModifiedFiles shows total number of files that has been modified since last backup",
                                "format": "int64",
                                "type": [
                                  "integer",
                                  "null"
                                ]
                              },
                              "newFiles": {
                                "description": "NewFiles shows total number of new files that has been created since last backup",
                                "format": "int64",
                                "type": [
                                  "integer",
                                  "null"
                                ]
                              },
                              "totalFiles": {
                                "description": "TotalFiles shows total number of files that has been backed up",
                                "format": "int64",
                                "type": [
                                  "integer",
                                  "null"
                                ]
                              },
                              "unmodifiedFiles": {
                                "description": "UnmodifiedFiles shows total number of files that has not been changed since last backup",
                                "format": "int64",
                                "type": [
                                  "integer",
                                  "null"
                                ]
                              }
                            },
                            "type": [
                              "object",
                              "null"
                            ]
                          },
                          "name": {
                            "description": "Name indicates the name of the backup snapshot created for this host",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "path": {
                            "description": "Path indicates the directory that has been backed up in this snapshot",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "processingTime": {
                            "description": "ProcessingTime indicates time taken to process the target data",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "totalSize": {
                            "description": "TotalSize indicates the size of data to backup in target directory",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "uploaded": {
                            "description": "Uploaded indicates size of data uploaded to backend for this snapshot",
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "type": "object"
                      },
                      "type": [
                        "array",
                        "null"
                      ]
                    }
                  },
                  "type": "object"
                },
                "type": [
                  "array",
                  "null"
                ]
              },
              "totalHosts": {
                "description": "TotalHosts specifies total number of hosts for this target that will be backed up for a BackupSession",
                "format": "int32",
                "type": [
                  "integer",
                  "null"
                ]
              }
            },
            "type": "object"
          },
          "type": [
            "array",
            "null"
          ]
        }
      },
      "type": [
        "object",
        "null"
      ]
    }
  },
  "type": "object"
}