{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/red-hat-ansible-automation-platform/json-schema/red-hat-ansible-automation-platform-activation-read-schema.json",
  "title": "ActivationRead",
  "description": "Serializer for reading the Activation with related objects info.",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/red-hat-ansible-automation-platform-activations-api-openapi.yml#/components/schemas/ActivationRead",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "readOnly": true
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "is_enabled": {
      "type": "boolean"
    },
    "decision_environment": {
      "allOf": [
        {
          "$ref": "#/$defs/DecisionEnvironmentRef"
        }
      ]
    },
    "status": {
      "$ref": "#/$defs/StatusEnum"
    },
    "git_hash": {
      "type": "string"
    },
    "restart_on_project_update": {
      "type": "boolean",
      "description": "Auto-restart when rulebook changes after project sync"
    },
    "project": {
      "allOf": [
        {
          "$ref": "#/$defs/ProjectRef"
        }
      ]
    },
    "rulebook": {
      "allOf": [
        {
          "$ref": "#/$defs/RulebookRef"
        }
      ]
    },
    "extra_var": {
      "type": [
        "string",
        "null"
      ]
    },
    "organization": {
      "$ref": "#/$defs/OrganizationRef"
    },
    "instances": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ActivationInstance"
      }
    },
    "restart_policy": {
      "$ref": "#/$defs/RestartPolicyEnum"
    },
    "restart_count": {
      "type": "integer",
      "maximum": 2147483647,
      "minimum": -2147483648
    },
    "rulebook_name": {
      "type": "string",
      "description": "Name of the referenced rulebook"
    },
    "current_job_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "ruleset_stats": {
      "type": "string",
      "description": "The stat information about the activation"
    },
    "rules_count": {
      "type": "integer"
    },
    "rules_fired_count": {
      "type": "integer"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "readOnly": true
    },
    "modified_at": {
      "type": "string",
      "format": "date-time",
      "readOnly": true
    },
    "edited_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "created_by": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "username": {
          "type": "string"
        },
        "first_name": {
          "type": "string"
        },
        "last_name": {
          "type": "string"
        }
      }
    },
    "modified_by": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "username": {
          "type": "string"
        },
        "first_name": {
          "type": "string"
        },
        "last_name": {
          "type": "string"
        }
      }
    },
    "edited_by": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "username": {
          "type": "string"
        },
        "first_name": {
          "type": "string"
        },
        "last_name": {
          "type": "string"
        }
      }
    },
    "restarted_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "status_message": {
      "type": [
        "string",
        "null"
      ]
    },
    "awx_token_id": {
      "type": [
        "integer",
        "null"
      ],
      "readOnly": true
    },
    "eda_credentials": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/EdaCredential"
      }
    },
    "log_level": {
      "$ref": "#/$defs/LogLevelEnum"
    },
    "k8s_service_name": {
      "type": [
        "string",
        "null"
      ],
      "description": "Service name of the activation"
    },
    "k8s_pod_service_account_name": {
      "type": [
        "string",
        "null"
      ],
      "description": "Kubernetes ServiceAccount for activation job pods"
    },
    "k8s_pod_labels": {},
    "k8s_pod_annotations": {},
    "k8s_pod_node_selector": {},
    "event_streams": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/EventStreamOut"
      }
    },
    "source_mappings": {
      "type": "string",
      "description": "Mapping between sources and event streams"
    },
    "skip_audit_events": {
      "type": "boolean",
      "description": "Skip audit events for activation"
    },
    "log_tracking_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "Log tracking ID of the activation"
    },
    "enable_persistence": {
      "type": "boolean",
      "description": "Enable persistence for activation"
    },
    "rule_engine_credential_id": {
      "type": [
        "integer",
        "null"
      ],
      "description": "The Rule Engine Credential to use, if empty use the default system rule engine credential.",
      "readOnly": true
    },
    "rule_engine_credential": {
      "allOf": [
        {
          "$ref": "#/$defs/EdaCredential"
        }
      ]
    },
    "k8s_pod_tolerations": {
      "description": "Kubernetes tolerations applied to activation job pods so they can be scheduled onto tainted nodes."
    }
  },
  "required": [
    "awx_token_id",
    "created_at",
    "created_by",
    "edited_by",
    "id",
    "instances",
    "modified_at",
    "modified_by",
    "name",
    "organization",
    "rule_engine_credential_id",
    "rulebook_name",
    "rules_count",
    "rules_fired_count",
    "ruleset_stats"
  ],
  "$defs": {
    "ActivationInstance": {
      "type": "object",
      "description": "Serializer for the Activation Instance model.",
      "properties": {
        "id": {
          "type": "integer",
          "readOnly": true
        },
        "name": {
          "type": "string"
        },
        "status": {
          "$ref": "#/$defs/StatusEnum"
        },
        "git_hash": {
          "type": "string"
        },
        "status_message": {
          "type": [
            "string",
            "null"
          ]
        },
        "activation_id": {
          "type": [
            "integer",
            "null"
          ],
          "readOnly": true
        },
        "organization_id": {
          "type": "integer",
          "readOnly": true
        },
        "started_at": {
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "ended_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "readOnly": true
        },
        "queue_name": {
          "type": [
            "string",
            "null"
          ],
          "readOnly": true
        }
      },
      "required": [
        "activation_id",
        "ended_at",
        "id",
        "organization_id",
        "queue_name",
        "started_at"
      ]
    },
    "CredentialTypeRef": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "readOnly": true
        },
        "name": {
          "type": "string"
        },
        "namespace": {
          "type": [
            "string",
            "null"
          ]
        },
        "kind": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "name"
      ]
    },
    "DecisionEnvironmentRef": {
      "type": "object",
      "description": "Serializer for DecisionEnvironment reference.",
      "properties": {
        "id": {
          "type": "integer",
          "readOnly": true
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "image_url": {
          "type": "string"
        },
        "pull_policy": {
          "allOf": [
            {
              "$ref": "#/$defs/PullPolicyEnum"
            }
          ],
          "description": "Pull policy for the image before running\n\n* `always` - Always pull container before running.\n* `missing` - Only pull the image if not present before running.\n* `never` - Never pull container before running."
        },
        "organization_id": {
          "type": "integer",
          "readOnly": true
        }
      },
      "required": [
        "id",
        "image_url",
        "name",
        "organization_id"
      ]
    },
    "EdaCredential": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "inputs": {
          "type": "object",
          "additionalProperties": true,
          "readOnly": true
        },
        "credential_type": {
          "allOf": [
            {
              "$ref": "#/$defs/CredentialTypeRef"
            }
          ]
        },
        "references": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/EdaCredentialReference"
          }
        },
        "created_by": {
          "type": "object",
          "properties": {
            "id": {
              "type": "integer"
            },
            "username": {
              "type": "string"
            },
            "first_name": {
              "type": "string"
            },
            "last_name": {
              "type": "string"
            }
          }
        },
        "modified_by": {
          "type": "object",
          "properties": {
            "id": {
              "type": "integer"
            },
            "username": {
              "type": "string"
            },
            "first_name": {
              "type": "string"
            },
            "last_name": {
              "type": "string"
            }
          }
        },
        "id": {
          "type": "integer",
          "readOnly": true
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "modified_at": {
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "managed": {
          "type": "boolean",
          "readOnly": true
        },
        "organization": {
          "$ref": "#/$defs/OrganizationRef"
        }
      },
      "required": [
        "created_at",
        "created_by",
        "id",
        "inputs",
        "managed",
        "modified_at",
        "modified_by",
        "name",
        "organization"
      ]
    },
    "EdaCredentialRef": {
      "type": "object",
      "description": "Serializer for EdaCredential reference.",
      "properties": {
        "id": {
          "type": "integer",
          "readOnly": true
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "inputs": {
          "type": "object",
          "additionalProperties": true,
          "readOnly": true
        },
        "managed": {
          "type": "boolean"
        },
        "credential_type_id": {
          "type": [
            "integer",
            "null"
          ],
          "readOnly": true
        },
        "organization_id": {
          "type": "integer",
          "readOnly": true
        }
      },
      "required": [
        "credential_type_id",
        "id",
        "inputs",
        "name",
        "organization_id"
      ]
    },
    "EdaCredentialReference": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "Type of the related resource"
        },
        "id": {
          "type": "integer",
          "description": "ID of the related resource"
        },
        "name": {
          "type": "string",
          "description": "Name of the related resource"
        },
        "uri": {
          "type": "string",
          "format": "uri",
          "description": "URI of the related resource"
        }
      },
      "required": [
        "id",
        "name",
        "type",
        "uri"
      ]
    },
    "EventStreamOut": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "test_mode": {
          "type": "boolean",
          "description": "Enable test mode"
        },
        "additional_data_headers": {
          "type": "string",
          "description": "The additional http headers which will be added to the event data. The headers are comma delimited"
        },
        "organization": {
          "type": "string",
          "readOnly": true
        },
        "eda_credential": {
          "$ref": "#/$defs/EdaCredentialRef"
        },
        "event_stream_type": {
          "type": "string",
          "description": "The type of the event stream based on credential type"
        },
        "uuid": {
          "type": "string",
          "format": "uuid"
        },
        "created_by": {
          "type": "object",
          "properties": {
            "id": {
              "type": "integer"
            },
            "username": {
              "type": "string"
            },
            "first_name": {
              "type": "string"
            },
            "last_name": {
              "type": "string"
            }
          }
        },
        "modified_by": {
          "type": "object",
          "properties": {
            "id": {
              "type": "integer"
            },
            "username": {
              "type": "string"
            },
            "first_name": {
              "type": "string"
            },
            "last_name": {
              "type": "string"
            }
          }
        },
        "id": {
          "type": "integer",
          "readOnly": true
        },
        "owner": {
          "type": "string",
          "readOnly": true
        },
        "url": {
          "type": "string",
          "readOnly": true
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "modified_at": {
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "test_content_type": {
          "type": "string",
          "readOnly": true,
          "description": "The content type of test data, when in test mode"
        },
        "test_content": {
          "type": "string",
          "readOnly": true,
          "description": "The content recieved, when in test mode, stored as a yaml string"
        },
        "test_error_message": {
          "type": "string",
          "readOnly": true,
          "description": "The error message,  when in test mode"
        },
        "test_headers": {
          "type": "string",
          "readOnly": true,
          "description": "The headers recieved, when in test mode, stored as a yaml string"
        },
        "events_received": {
          "type": "integer",
          "readOnly": true,
          "description": "The total number of events received by event stream"
        },
        "last_event_received_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "readOnly": true,
          "description": "The date/time when the last event was received"
        }
      },
      "required": [
        "created_at",
        "created_by",
        "eda_credential",
        "events_received",
        "id",
        "last_event_received_at",
        "modified_at",
        "modified_by",
        "name",
        "organization",
        "owner",
        "test_content",
        "test_content_type",
        "test_error_message",
        "test_headers",
        "url"
      ]
    },
    "LogLevelEnum": {
      "enum": [
        "debug",
        "info",
        "error"
      ],
      "type": "string",
      "description": "* `debug` - debug\n* `info` - info\n* `error` - error"
    },
    "OrganizationRef": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "readOnly": true
        },
        "name": {
          "type": "string",
          "description": "The name of this resource.",
          "maxLength": 512
        },
        "description": {
          "type": "string",
          "description": "The organization description."
        }
      },
      "required": [
        "id",
        "name"
      ]
    },
    "ProjectRef": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "readOnly": true
        },
        "git_hash": {
          "type": "string"
        },
        "url": {
          "type": "string"
        },
        "scm_type": {
          "$ref": "#/$defs/ScmTypeEnum"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "organization_id": {
          "type": "integer",
          "readOnly": true
        },
        "update_revision_on_launch": {
          "type": "boolean",
          "description": "Enable automatic project sync on activation launch"
        },
        "scm_update_cache_timeout": {
          "type": "integer",
          "maximum": 2147483647,
          "minimum": -2147483648,
          "description": "Cache timeout in seconds for project updates (0 = always update, max 86400)"
        }
      },
      "required": [
        "git_hash",
        "id",
        "name",
        "organization_id",
        "url"
      ]
    },
    "PullPolicyEnum": {
      "enum": [
        "always",
        "missing",
        "never"
      ],
      "type": "string",
      "description": "* `always` - Always pull container before running.\n* `missing` - Only pull the image if not present before running.\n* `never` - Never pull container before running."
    },
    "RestartPolicyEnum": {
      "enum": [
        "always",
        "on-failure",
        "never"
      ],
      "type": "string",
      "description": "* `always` - always\n* `on-failure` - on-failure\n* `never` - never"
    },
    "RulebookRef": {
      "type": "object",
      "description": "Serializer for Rulebook reference.",
      "properties": {
        "id": {
          "type": "integer",
          "readOnly": true
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "organization_id": {
          "type": "integer",
          "readOnly": true
        }
      },
      "required": [
        "id",
        "name",
        "organization_id"
      ]
    },
    "ScmTypeEnum": {
      "enum": [
        "git"
      ],
      "type": "string",
      "description": "* `git` - Git"
    },
    "StatusEnum": {
      "enum": [
        "starting",
        "running",
        "pending",
        "failed",
        "stopping",
        "stopped",
        "deleting",
        "completed",
        "unresponsive",
        "error",
        "workers offline"
      ],
      "type": "string",
      "description": "* `starting` - starting\n* `running` - running\n* `pending` - pending\n* `failed` - failed\n* `stopping` - stopping\n* `stopped` - stopped\n* `deleting` - deleting\n* `completed` - completed\n* `unresponsive` - unresponsive\n* `error` - error\n* `workers offline` - workers offline"
    }
  }
}