{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/progress-software/json-schema/progress-software-chef-automate-api-cfgmgmt-response-node-segments-with-rollout-progress-schema.json",
  "title": "NodeSegmentsWithRolloutProgress",
  "description": "A Node Segment is the set of Chef Infra nodes with a shared policy_name,\npolicy_node_group, and policy_domain_url.\n\nNodeSegmentsWithRolloutProgress lists all of the node segments matching the\nrequest with information about the progress and status of the code rollouts for each segment.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/progress-software-configmgmt-api-openapi.yml#/components/schemas/chef.automate.api.cfgmgmt.response.NodeSegmentsWithRolloutProgress",
  "type": "object",
  "properties": {
    "node_segment_rollout_progress": {
      "description": "The NodeSegmentRolloutProgress are sorted by policy group, policy\nname, then domain URL.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/chef.automate.api.cfgmgmt.response.NodeSegmentRolloutProgress"
      }
    }
  },
  "$defs": {
    "chef.automate.api.cfgmgmt.response.CurrentRolloutProgress": {
      "type": "object",
      "properties": {
        "build_link": {
          "type": "string"
        },
        "latest_run_errored_count": {
          "type": "integer",
          "format": "int32"
        },
        "latest_run_successful_count": {
          "description": "I'm assuming it's easy to get the status when we get the counts.",
          "type": "integer",
          "format": "int32"
        },
        "node_count": {
          "type": "integer",
          "format": "int32",
          "title": "Nodes that have run the code being rolled out thus far"
        },
        "rollout": {
          "description": "Rollout is the full rollout object, but we can change this to be a subset only.",
          "$ref": "#/$defs/chef.automate.api.cfgmgmt.response.Rollout"
        },
        "source_link": {
          "type": "string"
        }
      }
    },
    "chef.automate.api.cfgmgmt.response.NodeSegmentRolloutProgress": {
      "type": "object",
      "properties": {
        "current_rollout_progress": {
          "$ref": "#/$defs/chef.automate.api.cfgmgmt.response.CurrentRolloutProgress"
        },
        "policy_domain_url": {
          "type": "string"
        },
        "policy_name": {
          "type": "string",
          "title": "policy_name, policy_node_group, policy_domain_url make up a \"compound\nid\" for the node segment"
        },
        "policy_node_group": {
          "type": "string"
        },
        "previous_rollouts": {
          "type": "array",
          "title": "This is the last, say 2 or 4 rollouts before the current one (to give a\ntotal of 3 or 5)",
          "items": {
            "$ref": "#/$defs/chef.automate.api.cfgmgmt.response.PastRolloutProgress"
          }
        },
        "total_nodes": {
          "type": "integer",
          "format": "int32",
          "title": "total nodes in elasticsearch in the node segment"
        }
      }
    },
    "chef.automate.api.cfgmgmt.response.PastRolloutProgress": {
      "type": "object",
      "properties": {
        "build_link": {
          "type": "string"
        },
        "latest_run_node_count": {
          "description": "The number of nodes in the node segment for which the last recorded CCR\nwas part of this rollout. Note that no breakdown of success/errored is\nprovided, since some nodes may have moved on to the current rollout and\nare not included in the count.",
          "type": "integer",
          "format": "int32"
        },
        "rollout": {
          "description": "Rollout is the full rollout object, but we can change this to be a subset only.",
          "$ref": "#/$defs/chef.automate.api.cfgmgmt.response.Rollout"
        },
        "source_link": {
          "type": "string"
        }
      }
    },
    "chef.automate.api.cfgmgmt.response.Rollout": {
      "description": "A Rollout represents the process of distributing Chef Infra code (with\nPolicyfiles) to a set of nodes. It's used to track which nodes have run the\nlatest version of the Chef Infra code assigned to them and also provide the\nuser insights about the code by aggregating Chef Client run results\naccording to the version of Chef Infra code applied. Metadata about the code\nis stored in order to provide the user with convenient references back to\nsystems they already use (such as SCM and Ci/CD systems) to manage their code.\n\nNodes are segmented by a triple of policy name, policy group, and policy domain URL:\npolicy name generally describes what kind of system it is, e.g., a database server\npolicy group generally describes where the system fits in the user's code\nlifecycle, e.g., \"QA\" or \"production.\" Policy groups may also represent a\nsubset of nodes within a code lifecycle stage, such as a \"production-canary\"\ngroup.\npolicy domain URL identifies the system that distributes the Chef Infra code\nand is the owner of the namespaces for policy name and group. E.g., a Chef\nServer URL with the `/organizations/:orgname` part.\n\nThere is one (or zero) revision(s) of the Chef Infra code applied to any\nsegment at a time. Rollouts track the changes to which revision of the code is\napplied to the node segments over time.",
      "type": "object",
      "properties": {
        "ci_job_id": {
          "description": "If the rollout was initiated by Ci/CD or similar system, the id of the job\nthat initiated the rollout. Should include the Ci system's nickname or\nother identifying information users would need to associate the job ID to\nthe Ci/CD system.",
          "type": "string"
        },
        "ci_job_url": {
          "description": "If the rollout was initiated via Ci/CD or similar system, the web URL\nfor the job that initiated the rollout.",
          "type": "string"
        },
        "description": {
          "description": "A free-form description of the rollout, as given by the user. Long\nmessages may be displayed in a truncated form in the UI. The content may\nbe entered manually by the user or extracted from another system, for\nexample a git commit message.",
          "type": "string"
        },
        "end_time": {
          "description": "The time that the rollout was replaced with another rollout.",
          "type": "string"
        },
        "id": {
          "description": "The system-generated ID for this rollout. The system currently provides\nautoincrementing integers for the Ids.",
          "type": "string"
        },
        "policy_domain_url": {
          "description": "In the Chef Server case, the policy domain URL is the Chef Server URL\nwith the `/organizations/:orgname` portion of the URL path included. In\ngeneral, this can be a URL for any content storage/distribution service,\nas long as the combination of policy_name and policy_node_group is unique\non that system.\n\nThe set of nodes configured to fetch policy content from the\npolicy_domain_url and configured with the same policy_name and\npolicy_node_group form the target set of nodes for a rollout and are\nexpected to apply the policy revision described by the rollout.",
          "type": "string"
        },
        "policy_domain_username": {
          "description": "The username of the entity who uploaded/promoted the policy code to the\ncode host. In a Chef Server architecture, this is the name of the Chef\nServer user who ran the `chef push` command to upload the policy.",
          "type": "string"
        },
        "policy_name": {
          "type": "string",
          "title": "The name of the policy, i.e., the `name` attribute in the Policyfile"
        },
        "policy_node_group": {
          "description": "The group of nodes which are targeted by the rollout. In the Chef Server\ncase, this is the policy_group to which the user is pushing the policy.",
          "type": "string"
        },
        "policy_revision_id": {
          "type": "string",
          "title": "The revision_id of the compiled policy being rolled out"
        },
        "policy_scm_commit": {
          "description": "The source control system's identifier for the repository version. This\nshould be the version where the policy's lockfile was committed.",
          "type": "string"
        },
        "policy_scm_url": {
          "type": "string",
          "title": "The URL used to obtain a copy of the source code repository"
        },
        "policy_scm_web_url": {
          "type": "string",
          "title": "The URL used to view the source code repository via the web"
        },
        "scm_author_email": {
          "description": "The email address of the author of the most recent commit to the source\ncode repository. In git, this is the setting `user.email`.",
          "type": "string"
        },
        "scm_author_name": {
          "description": "The username of the author of the most recent commit to the source code\nrepository. In git, this is the setting `user.name`.",
          "type": "string"
        },
        "scm_type": {
          "title": "The source control system used with the policyfile",
          "$ref": "#/$defs/chef.automate.api.cfgmgmt.response.SCMType"
        },
        "scm_web_type": {
          "title": "The software/service used to host the source code repository",
          "$ref": "#/$defs/chef.automate.api.cfgmgmt.response.SCMWebType"
        },
        "start_time": {
          "description": "The time that the rollout began. Whenever a new rollout is created, it\nbecomes the \"current\" rollout for its node segment; that is, any nodes\nthat start a Chef Infra Client run will run the policy revision described\nby this \"current\" rollout. The system will populate the previously current\nrollout's `end_time` attribute with the current time.",
          "type": "string"
        }
      }
    },
    "chef.automate.api.cfgmgmt.response.SCMType": {
      "type": "string",
      "default": "SCM_TYPE_UNSPECIFIED",
      "enum": [
        "SCM_TYPE_UNSPECIFIED",
        "SCM_TYPE_UNKNOWN_SCM",
        "SCM_TYPE_GIT"
      ]
    },
    "chef.automate.api.cfgmgmt.response.SCMWebType": {
      "type": "string",
      "default": "SCM_WEB_TYPE_UNSPECIFIED",
      "enum": [
        "SCM_WEB_TYPE_UNSPECIFIED",
        "SCM_WEB_TYPE_UNKNOWN_SCM_WEB",
        "SCM_WEB_TYPE_GITHUB"
      ]
    }
  }
}