{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://oam.dev/v1/oam.application_configuration.schema.json",
"title": "Manifest",
"description": "A JSON Schema to validate wasmCloud Application Deployment Manager (WADM) manifests",
"type": "object",
"properties": {
"apiVersion": {
"type": "string",
"description": "The specific version of the Open Application Model specification in use"
},
"kind": {
"type": "string",
"description": "The entity type being described in the manifest"
},
"metadata": {
"type": "object",
"description": "Application configuration metadata.",
"properties": {
"name": {
"type": "string"
},
"annotations": {
"type": "object",
"description": "A set of string key/value pairs used as arbitrary annotations on this application configuration.",
"properties": {
"description": {
"type": "string"
}
},
"additionalProperties": {
"type": "string"
}
}
}
},
"spec": {
"type": "object",
"description": "Configuration attributes for various items in the lattice",
"$ref": "#/definitions/manifestSpec"
}
},
"required": [
"apiVersion",
"kind",
"metadata",
"spec"
],
"additionalProperties": false,
"definitions": {
"manifestSpec": {
"type": "object",
"properties": {
"components": {
"type": "array",
"description": "Component instance definitions.",
"items": {
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/wasmComponent"
},
{
"$ref": "#/definitions/providerComponent"
}
]
}
}
},
"required": [
"components"
],
"additionalProperties": false
},
"opconfigVariable": {
"type": "object",
"description": "The Variables section defines variables that may be used elsewhere in the application configuration. The variable section provides a way for an application operator to specify common values that can be substituted into multiple other locations in this configuration (using the [fromVariable(VARNAME)] syntax).",
"properties": {
"name": {
"type": "string",
"description": "The parameter's name. Must be unique per configuration.",
"$comment": "Some systems have upper bounds for name length. Do we limit here?",
"maxLength": 128
},
"value": {
"type": "string",
"description": "The scalar value."
}
},
"required": [
"name",
"value"
],
"additionalProperties": false
},
"applicationScope": {
"type": "object",
"description": "The scope section defines application scopes that will be created with this application configuration.",
"properties": {
"name": {
"type": "string",
"description": "The name of the application scope. Must be unique to the deployment environment."
},
"type": {
"type": "string",
"description": "The fully-qualified GROUP/VERSION.KIND name of the application scope."
},
"properties": {
"type": "object",
"description": "The properties attached to this scope.",
"$ref": "#/definitions/propertiesObject"
}
},
"required": [
"name",
"type"
],
"additionalProperties": false
},
"wasmComponent": {
"type": "object",
"description": "This section defines the instances of components to create with this application configuration.",
"properties": {
"name": {
"type": "string",
"description": "The name of the component to create an instance of."
},
"type": {
"description": "The type of instance : component.",
"anyOf": [
{
"const": "component"
},
{
"const": "actor",
"$comment": "Deprecated: use 'component' instead"
}
]
},
"properties": {
"type": "object",
"description": "Overrides of parameters that are exposed by the application scope type defined in 'type'.",
"$ref": "#/definitions/componentProperties"
},
"traits": {
"type": "array",
"description": "Specifies the traits to attach to this component instance.",
"items": {
"$ref": "#/definitions/trait"
}
}
},
"required": [
"name",
"type",
"properties"
],
"additionalProperties": true
},
"providerComponent": {
"type": "object",
"description": "This section defines the instances of providers to create with this application configuration.",
"properties": {
"name": {
"type": "string",
"description": "The name of the provider to create an instance of."
},
"type": {
"description": "The type of instance: capability.",
"const": "capability"
},
"properties": {
"type": "object",
"description": "Overrides of parameters that are exposed by the application scope type defined in 'type'.",
"$ref": "#/definitions/providerProperties"
},
"traits": {
"type": "array",
"description": "Specifies the traits to attach to this component instance.",
"items": {
"$ref": "#/definitions/trait"
}
}
},
"required": [
"name",
"type",
"properties"
],
"additionalProperties": true
},
"componentProperties": {
"type": "object",
"description": "Values supplied to parameters that are used to override the parameters exposed by other types.",
"properties": {
"image": {
"type": "string",
"description": "The image reference to use for the component.",
"$comment": "Some systems have upper bounds for name length. Do we limit here?",
"maxLength": 512
},
"id": {
"type": "string",
"description": "The component identifier to use for the component. Will be autogenerated if not supplied.",
"maxLength": 64
},
"config": {
"type": "array",
"items": {
"$ref": "#/definitions/configProperty"
},
"default": [],
"description": "Configuration properties for the provider"
}
},
"required": [
"image"
],
"additionalProperties": false
},
"providerProperties": {
"type": "object",
"description": "Values supplied to parameters that are used to override the parameters exposed by other types.",
"properties": {
"image": {
"type": "string",
"description": "The image reference to use for the provider.",
"$comment": "Some systems have upper bounds for name length. Do we limit here?",
"maxLength": 512
},
"id": {
"type": "string",
"description": "The component identifier to use for the provider.",
"maxLength": 64
},
"config": {
"type": "array",
"items": {
"$ref": "#/definitions/configProperty"
},
"default": [],
"description": "Configuration properties for the provider"
}
},
"required": [
"image"
],
"additionalProperties": false
},
"trait": {
"type": "object",
"description": "The trait section defines traits that will be used in a component instance.",
"properties": {
"type": {
"type": "string",
"description": "The trait type for the instance, whether spreadscaler or link"
},
"properties": {
"type": "object",
"description": "Overrides of parameters that are exposed by the trait type defined in 'type'.",
"anyOf": [
{
"$ref": "#/definitions/linkProperties"
},
{
"$ref": "#/definitions/spreadscalerProperties"
}
]
}
},
"required": [
"type",
"properties"
],
"additionalProperties": false
},
"configProperty": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"properties": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"required": [
"name"
],
"additionalProperties": false
},
"linkProperties": {
"target": {
"type": "string",
"description": "The target this link applies to. This should be the name of a component in the manifest"
},
"namespace": {
"type": "string",
"description": "WIT namespace for the link"
},
"package": {
"type": "string",
"description": "WIT package for the link"
},
"interfaces": {
"type": "array",
"items": {
"type": "string"
},
"description": "WIT interfaces for the link"
},
"source_config": {
"type": "array",
"items": {
"$ref": "#/definitions/configProperty"
},
"default": [],
"description": "Configuration properties for the source of the link"
},
"target_config": {
"type": "array",
"items": {
"$ref": "#/definitions/configProperty"
},
"default": [],
"description": "Configuration properties for the target of the link"
},
"name": {
"type": "string",
"description": "The name of this link",
"default": null
},
"required": [
"target",
"namespace",
"package",
"interfaces"
]
},
"spreadscalerProperties": {
"type": "object",
"description": "A properties object (for spreadscaler configuration) is an object whose structure is determined by the spreadscaler property schema. It may be a simple value, or it may be a complex object.",
"properties": {
"instances": {
"anyOf": [
{
"type": "integer",
"title": "instances"
},
{
"type": "integer",
"title": "replicas"
}
]
},
"spread": {
"type": "array",
"items": {
"type": "object",
"description": "A spread object for spreading replicas.",
"properties": {
"name": {
"type": "string"
},
"requirements": {
"additionalProperties": {
"type": "string"
}
},
"weight": {
"type": "integer"
}
},
"required": [
"name",
"requirements"
]
}
}
},
"oneOf": [
{
"required": [
"instances"
]
},
{
"required": [
"replicas"
]
}
]
},
"propertiesObject": {
"anyOf": [
{
"type": "object",
"description": "A properties object (for trait and scope configuration) is an object whose structure is determined by the trait or scope property schema. It may be a simple value, or it may be a complex object.",
"additionalProperties": true
},
{
"type": "string",
"description": "A properties object (for trait and scope configuration) is an object whose structure is determined by the trait or scope property schema. It may be a simple value, or it may be a complex object."
}
]
}
}
}