# Upload resource change page

Upload a single sharded resource-change page file for an execution stage.

Resource-change data is split into categories (planned_changes, drift_changes,
resources, etc.) and each category is sharded into zero-based pages. The request
body is the raw page file (application/octet-stream) and is currently discarded.

The planned_changes and drift_changes categories are uploaded twice: once as pages
of the whole category, and once as pages of a single change type, identified by the
change parameter. Rows in both categories are expected pre-sorted by change-type
priority (deleted, replaced, added, changed, unchanged, removed, imported).

The body is a JSON array whose element shape depends on {category}:

  planned_changes | unchanged | drift_changes  ->  ChangedResource[]
  resources | data_sources                     ->  Resource[]
  outputs                                       ->  Output[]

Example body (category=planned_changes):
json
[
  {
    "provider": "AWS",
    "type": "aws_s3_bucket",
    "name": "app_bucket",
    "module": "root",
    "change": "added",
    "change_count": 1,
    "drift": false,
    "changes": {
      "bucket": { "change": "added", "old": "", "new": "my-bucket" }
    }
  }
]


Example body (category=resources):
json
[
  {
    "provider": "AWS",
    "type": "aws_instance",
    "name": "app_server",
    "module": "root",
    "mode": "resource",
    "path_id": "namespace",
    "resource_id": "i-0abc123",
    "attributes": { "instance_type": "t2.micro" },
    "drift_status": "unchanged",
    "drift_attributes": {},
    "sensitive_attributes": []
  }
]

Endpoint: POST /iacm/api/orgs/{org}/projects/{project}/executions/{pipeline_execution_id}/{pipeline_stage_id}/resource-changes/{category}/{page}
Version: 1.0
Security: x-api-key

## Query parameters:

  - `change` (string)
    Change type this page is filtered to, for the per-change-type shards of planned_changes and drift_changes. Omit it for a page of the whole category.
    Enum: "added", "changed", "deleted", "replaced", "unchanged", "removed", "imported"

  - `generation_id` (string)
    Optional upload generation ID. Omit for legacy unversioned uploads.
    Example: "Natus ratione nobis eos cum nihil mollitia."

## Path parameters:

  - `org` (string, required)
    Org is the organisation identifier.
    Example: "i7"

  - `project` (string, required)
    Project is the project identifier.
    Example: "uri"

  - `pipeline_execution_id` (string, required)
    Pipeline execution ID
    Example: "d"

  - `pipeline_stage_id` (string, required)
    Pipeline execution stage ID
    Example: "4"

  - `category` (string, required)
    Resource-change category the page belongs to
    Enum: "planned_changes", "unchanged", "drift_changes", "resources", "data_sources", "outputs"

  - `page` (integer, required)
    1-indexed page number within the category
    Example: 1

## Header parameters:

  - `Harness-Account` (string, required)
    Account is the internal customer account ID.
    Example: "p38"

  - `Content-Length` (integer)
    Size in bytes of the uploaded page file.
    Example: 4096

## Response 400 fields (application/vnd.goa.error):

  - `fault` (boolean, required)
    Is the error a server-side fault?
    Example: true

  - `id` (string, required)
    ID is a unique identifier for this particular occurrence of the problem.
    Example: "123abc"

  - `message` (string, required)
    Message is a human-readable explanation specific to this occurrence of the problem.
    Example: "parameter 'p' must be an integer"

  - `name` (string, required)
    Name is the name of this class of errors.
    Example: "bad_request"

  - `temporary` (boolean, required)
    Is the error temporary?
    Example: true

  - `timeout` (boolean, required)
    Is the error a timeout?


## Response 200 fields
