blob: c4751ca18338aa30c414e22ed37f0e64605074cc [file] [log] [blame]
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"relative-ref-clause": {
"type": "string",
"minLength": 1,
"maxLength": 101
},
"path-clause": {
"type": "string",
"pattern": "^(/[^/]+)+$",
"minLength": 1,
"maxLength": 1024
},
"relative-path-clause": {
"type": "string",
"pattern": "^[^/]+(/[^/]+)*$",
"minLength": 1,
"maxLength": 1024
},
"path-clause-multiple": {
"type": "array",
"items": {
"$ref": "#/definitions/path-clause"
},
"uniqueItems": true,
"minItems": 1
},
"url-clause": {
"type": "string",
"pattern": "^[a-z][0-9a-z+\\-\\.]+://.+$",
"minLength": 1,
"maxLength": 4096
},
"url-scheme-clause": {
"type": "string",
"pattern": "^[a-z][0-9a-z+\\-\\.]+$",
"minLength": 1,
"maxLength": 100
},
"startup-clause": {
"type": "string",
"pattern": "^(lazy|eager)$"
},
"durability-clause": {
"type": "string",
"pattern": "^(persistent|transient)$"
},
"name-clause": {
"type": "string",
"pattern": "^[0-9a-z_\\-\\.]+$",
"minLength": 1,
"maxLength": 100
},
"name-clause-multiple": {
"type": "array",
"items": {
"$ref": "#/definitions/name-clause"
},
"uniqueItems": true,
"minItems": 1
},
"storage-type-clause": {
"type": "string",
"enum": [
"data",
"cache",
"meta"
]
},
"rights-clause": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"type": "string",
"enum": [
"r*",
"w*",
"x*",
"rw*",
"rx*",
"connect",
"read_bytes",
"write_bytes",
"execute",
"get_attributes",
"update_attributes",
"enumerate",
"traverse",
"modify_directory",
"admin"
]
}
}
},
"properties": {
"program": {
"type": "object",
"title": "Program information",
"description": "Information required to run the program",
"required": [
"binary"
],
"properties": {
"binary": {
"type": "string",
"title": "Program binary",
"description": "The entry point for an executable",
"examples": [
"bin/app"
]
},
"args": {
"type": "array",
"title": "Program arguments",
"description": "The arguments to provide to an executable",
"items": {
"type": "string"
},
"minItems": 1,
"examples": [
"--verbose"
]
},
"env": {
"type": "object",
"title": "Environment variables",
"description": "Environment variables to provide to an executable",
"items": {
"type": "string"
},
"minItems": 1,
"examples": [
{
"VERBOSITY": "1"
}
]
},
"lifecycle": {
"type": "object",
"title": "Lifecycle events",
"description": "Lifecycle events which a program is interested in. The default is 'ignore', meaning a the component will not be notified of the event.",
"additionalProperties": false,
"properties": {
"stop_event": {
"type": "string",
"title": "Stop event",
"description": "The stop event will occur before a component is terminated",
"examples": [
"notify"
],
"enum": [
"notify",
"ignore"
]
}
}
}
}
},
"use": {
"type": "array",
"title": "Used capabilities",
"description": "Capabilities that will be installed in this component's namespace",
"uniqueItems": true,
"items": {
"type": "object",
"oneOf": [
{
"required": [
"service"
]
},
{
"required": [
"protocol"
]
},
{
"required": [
"directory"
]
},
{
"required": [
"storage"
]
},
{
"required": [
"runner"
]
},
{
"required": [
"event"
]
}
],
"properties": {
"service": {
"title": "Used service source path",
"description": "The path under which a service is offered to this component",
"allOf": [
{
"$ref": "#/definitions/path-clause"
}
],
"examples": [
"/svc/fuchsia.logger.Log"
]
},
"protocol": {
"title": "Used legacy service source path",
"description": "A path, or a list of paths, under which a legacy service is offered to this component",
"oneOf": [
{
"$ref": "#/definitions/path-clause"
},
{
"$ref": "#/definitions/path-clause-multiple"
}
],
"examples": [
"/svc/fuchsia.logger.Log"
]
},
"directory": {
"title": "Used directory source path",
"description": "The path under which a directory is offered to this component",
"allOf": [
{
"$ref": "#/definitions/path-clause"
}
],
"examples": [
"/data/assets/widgets"
]
},
"storage": {
"title": "Used storage capability",
"description": "The type of storage which has been offered to this component",
"allOf": [
{
"$ref": "#/definitions/storage-type-clause"
}
],
"examples": [
"data"
]
},
"runner": {
"title": "Used runner name",
"description": "The name of a runner offered to this component",
"allOf": [
{
"$ref": "#/definitions/name-clause"
}
],
"examples": [
"elf"
]
},
"event": {
"title": "Used event name",
"description": "The name of an event or a list of event names",
"oneOf": [
{
"$ref": "#/definitions/name-clause"
},
{
"$ref": "#/definitions/name-clause-multiple"
}
],
"examples": [
"started"
]
},
"from": {
"title": "Used capability source",
"pattern": "^(realm|framework)$",
"description": "The component which is offering the capability to use. Either \"realm\" (default) or \"framework\"\". May not be specified for runners, because the source is implicitly \"realm\" in that case.",
"examples": [
"realm",
"framework"
]
},
"as": {
"title": "Used capability target path",
"description": "The path to which the capability will be installed in the component's incoming namespace. Defaults to \"service\"/\"directory\". May not be specified for runners.",
"oneOf": [
{
"$ref": "#/definitions/path-clause"
},
{
"$ref": "#/definitions/name-clause"
}
],
"examples": [
"/svc/fuchsia.logger.Log"
]
},
"rights": {
"title": "Used directory capability rights",
"description": "The set of capability rights which are required by this component for this use statement.",
"allOf": [
{
"$ref": "#/definitions/rights-clause"
}
],
"examples": [
[
"r*"
],
[
"r*",
"write_bytes"
]
]
},
"subdir": {
"title": "Used directory subdirectory",
"description": "An optional relative subdirectory to use instead of the root",
"allOf": [
{
"$ref": "#/definitions/relative-path-clause"
}
],
"examples": [
"data/assets"
]
},
"dependency": {
"title": "The type of dependency that this offer represents",
"description": "A component which receives a weak offer must support the offered capability being unavailable at any point. Defaults to \"strong\". Can only be used on protocols and directories",
"type": "string",
"enum": [
"strong",
"weak_for_migration"
]
},
"filter": {
"title": "Used event filters",
"description": "A component defines the path of the capability it'll get through an event. Can only be used on capability_ready events.",
"type": "object",
"properties": {
"path": {
"title": "The path(s) of the capability in a component",
"description": "A path that the component requests on capability ready",
"oneOf": [
{
"$ref": "#/definitions/path-clause"
},
{
"$ref": "#/definitions/path-clause-multiple"
}
]
}
}
}
}
}
},
"expose": {
"type": "array",
"title": "Capabilities exposed",
"description": "Capabilities exposed by this component to its containing realm",
"uniqueItems": true,
"items": {
"type": "object",
"required": [
"from"
],
"oneOf": [
{
"required": [
"service"
]
},
{
"required": [
"protocol"
]
},
{
"required": [
"directory"
]
},
{
"required": [
"runner"
]
},
{
"required": [
"resolver"
]
}
],
"properties": {
"service": {
"title": "Exposed service source path",
"description": "The path to the service being exposed. This is either a path in this component's outgoing namespace (if from \"self\"), or the path by which the service was exposed by the child (if from \"#$CHILD\").",
"allOf": [
{
"$ref": "#/definitions/path-clause"
}
],
"examples": [
"/svc/fuchsia.ui.scenic.Scenic"
]
},
"protocol": {
"title": "Exposed legacy service source path",
"description": "A path, or a list of paths, to legacy service being exposed. Each path must be from this component's outgoing namespace (if from \"self\"), or must be a protocol path exposed to this component by a child (if from \"#$CHILD\").",
"oneOf": [
{
"$ref": "#/definitions/path-clause"
},
{
"$ref": "#/definitions/path-clause-multiple"
}
],
"examples": [
"/svc/fuchsia.ui.scenic.Scenic",
[
"/svc/fuchsia.ui.scenic.Scenic",
"/svc/fuchsia.net.Netstack"
]
]
},
"directory": {
"title": "Exposed directory source path",
"description": "The path to the directory being exposed. This is either a path in this component's outgoing namespace (if from \"self\"), or the path by which the directory was exposed by the child (if from \"#$CHILD\").",
"allOf": [
{
"$ref": "#/definitions/path-clause"
}
],
"examples": [
"/data/assets/widgets"
]
},
"runner": {
"title": "Exposed runner source name",
"description": "The name of the runner being exposed. This is either a runner provided by the componenet (if from \"self\"), or the name of a runner exposed by a child (if from \"#$CHILD\").",
"allOf": [
{
"$ref": "#/definitions/name-clause"
}
],
"examples": [
"elf"
]
},
"resolver": {
"title": "Exposed resolver source name",
"description": "The name of the resolver being exposed. This is either a resolver provided by the componenet (if from \"self\"), or the name of a resolver exposed by a child (if from \"#$CHILD\").",
"allOf": [
{
"$ref": "#/definitions/name-clause"
}
],
"examples": [
"pkg_resolver"
]
},
"from": {
"title": "Exposed capability source component",
"description": "The component which has the capability to expose.",
"oneOf": [
{
"pattern": "^(self|framework|#[0-9a-z_\\-\\.]+)$",
"allOf": [
{
"$ref": "#/definitions/relative-ref-clause"
}
]
},
{
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"pattern": "^(self|framework|#[0-9a-z_\\-\\.]+)$",
"allOf": [
{
"$ref": "#/definitions/relative-ref-clause"
}
]
}
}
],
"examples": [
"self",
"#scenic"
]
},
"as": {
"title": "Exposed capability target path or name",
"description": "The path or name by which the capability will be exposed. Defaults to the source path/name.",
"oneOf": [
{
"$ref": "#/definitions/path-clause"
},
{
"$ref": "#/definitions/name-clause"
}
],
"examples": [
"/svc/fuchsia.logger.Log"
]
},
"to": {
"title": "Exposed capability target type",
"description": "The sort of destination that may receive the exposed capability. Either \"realm\" or \"framework\". Defaults to: \"realm\"",
"pattern": "^(realm|framework)$",
"examples": [
"realm",
"framework"
]
},
"rights": {
"title": "Exposed directory capability rights",
"description": "The set of capability rights which exposed by this component to the destination",
"allOf": [
{
"$ref": "#/definitions/rights-clause"
}
],
"examples": [
[
"r*"
],
[
"read_bytes",
"write_bytes"
]
]
},
"subdir": {
"title": "Exposed directory subdirectory",
"description": "An optional relative subdirectory to expose instead of the root",
"allOf": [
{
"$ref": "#/definitions/relative-path-clause"
}
],
"examples": [
"data/assets"
]
}
}
}
},
"offer": {
"type": "array",
"title": "Offered capabilities",
"description": "Capabilities offered by this component to its children",
"uniqueItems": true,
"items": {
"type": "object",
"required": [
"from",
"to"
],
"oneOf": [
{
"required": [
"service"
]
},
{
"required": [
"protocol"
]
},
{
"required": [
"directory"
]
},
{
"required": [
"storage"
]
},
{
"required": [
"runner"
]
},
{
"required": [
"resolver"
]
},
{
"required": [
"event"
]
}
],
"properties": {
"service": {
"title": "Offered service source path",
"description": "The path to the service being offered. This is either a path in this component's namespace (if from \"self\"), or the path by which the service was exposed or offered from another component (if from \"realm\" or \"#$CHILD\").",
"allOf": [
{
"$ref": "#/definitions/path-clause"
}
],
"examples": [
"/svc/fuchsia.ui.scenic.Scenic"
]
},
"protocol": {
"title": "Offered legacy service source path",
"description": "A path, or a list of paths, to legacy services offered to children. Each path must either come from this component's namespace (if from \"self\"), or must be a path which was exposed or offered from another component (if from \"realm\" or \"#$CHILD\").",
"oneOf": [
{
"$ref": "#/definitions/path-clause"
},
{
"$ref": "#/definitions/path-clause-multiple"
}
],
"examples": [
"/svc/fuchsia.ui.scenic.Scenic",
[
"/svc/fuchsia.ui.scenic.Scenic",
"/svc/fuchsia.net.Netstack"
]
]
},
"directory": {
"title": "Offered directory source path",
"description": "The path to the directory being offered. This is either a path in this component's outgoing namespace (if from \"self\"), or the path by which the directory was exposed or offered from another component (if from \"realm\" or \"#$CHILD\").",
"allOf": [
{
"$ref": "#/definitions/path-clause"
}
],
"examples": [
"/svc/fuchsia.ui.scenic.Scenic"
]
},
"storage": {
"title": "Offered storage type",
"description": "The storage type being offered. Must be one of \"data\", \"cache\", or \"meta\".",
"allOf": [
{
"$ref": "#/definitions/storage-type-clause"
}
],
"examples": [
"data"
]
},
"runner": {
"title": "Offered runner name",
"description": "The runner being offered. This is either a runner declared by this component (if from \"self\"), or a runner which was exposed or offered from another component (if from \"realm\" or \"#$CHILD\").",
"allOf": [
{
"$ref": "#/definitions/name-clause"
}
],
"examples": [
"elf"
]
},
"resolver": {
"title": "Offered resolver source name",
"description": "The name of the resolver being offered. This is either a resolver provided by the componenet (if from \"self\"), or the name of a resolver offered from another component (if from \"realm\" or \"#$CHILD\").",
"allOf": [
{
"$ref": "#/definitions/name-clause"
}
],
"examples": [
"pkg_resolver"
]
},
"event": {
"title": "Offered event name",
"description": "The name of an event or a list of event names",
"oneOf": [
{
"$ref": "#/definitions/name-clause"
},
{
"$ref": "#/definitions/name-clause-multiple"
}
]
},
"from": {
"title": "Offered capability source component",
"description": "The component which has the capability to offer. For services, directories, and runners one of \"framework\", \"realm\", \"self\" or \"#$CHILD\"; for storage either \"realm\" or \"#$STORAGE_SECTION_NAME\".",
"oneOf": [
{
"pattern": "^(realm|framework|self|#[0-9a-z_\\-\\.]+)$",
"allOf": [
{
"$ref": "#/definitions/relative-ref-clause"
}
]
},
{
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"pattern": "^(realm|framework|self|#[0-9a-z_\\-\\.]+)$",
"allOf": [
{
"$ref": "#/definitions/relative-ref-clause"
}
]
}
}
],
"examples": [
"realm",
"framework",
"self",
"#scenic"
]
},
"to": {
"type": "array",
"title": "Offered capability targets",
"description": "The components the capability is being offered to",
"uniqueItems": true,
"minItems": 1,
"items": {
"type": "string",
"pattern": "^#[a-zA-Z0-9_-]+$",
"allOf": [
{
"$ref": "#/definitions/relative-ref-clause"
}
],
"examples": [
"#scenic"
]
}
},
"as": {
"title": "Offered capability target path or name",
"description": "The path or name by which the capability will be offered. Must be omitted for storage capabilities.",
"oneOf": [
{
"$ref": "#/definitions/path-clause"
},
{
"$ref": "#/definitions/name-clause"
}
],
"examples": [
"/data/assets/widgets",
"/svc/fuchsia.ui.scenic.Scenic"
]
},
"rights": {
"title": "Offered directory capability rights",
"description": "The set of capability rights which offered by this component to the destination",
"allOf": [
{
"$ref": "#/definitions/rights-clause"
}
],
"examples": [
[
"r*"
],
[
"read_bytes",
"write_bytes"
]
]
},
"subdir": {
"title": "Offered directory subdirectory",
"description": "An optional relative subdirectory to offer instead of the root",
"allOf": [
{
"$ref": "#/definitions/relative-path-clause"
}
],
"examples": [
"data/assets"
]
},
"filter": {
"title": "Offered event filters",
"description": "A component defines the path of the capability it offers through an event. Can only be used on capability_ready events.",
"type": "object",
"properties": {
"path": {
"title": "The path(s) of the capability in a component",
"description": "A path that the component requests on capability ready",
"oneOf": [
{
"$ref": "#/definitions/path-clause"
},
{
"$ref": "#/definitions/path-clause-multiple"
}
]
}
}
}
}
}
},
"storage": {
"type": "array",
"title": "Storage capabilities",
"description": "Declared storage capabilities backed by a directories from which data, cache, or meta storage can be offered.",
"uniqueItems": true,
"items": {
"type": "object",
"required": [
"name",
"from",
"path"
],
"properties": {
"from": {
"title": "Offered directory capability source component",
"description": "The component which has the directory capability to use for storage. Either \"realm\", \"self\" or \"#$CHILD\".",
"pattern": "^(realm|self|#[0-9a-z_\\-\\.]+)$",
"allOf": [
{
"$ref": "#/definitions/relative-ref-clause"
}
],
"examples": [
"realm",
"self",
"#scenic"
]
},
"name": {
"title": "Storage name",
"description": "The component's local name for this storage",
"allOf": [
{
"$ref": "#/definitions/name-clause"
}
],
"examples": [
"minfs",
"persistent_storage"
]
},
"path": {
"title": "Offered directory capability source path",
"description": "The path of the directory capability. The path is either a path into the component's outgoing directory (if from \"self\"), or the path by which the capability was exposed or offered from another component (if from \"realm\" or \"#$CHILD\").",
"allOf": [
{
"$ref": "#/definitions/relative-ref-clause"
}
],
"examples": [
"/data/storage",
"/minfs"
]
}
}
}
},
"environments": {
"type": "array",
"title": "Environments",
"description": "An Environment defines properties which affect the behavior of components within a realm, such as its resolver.",
"uniqueItems": true,
"items": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"title": "Environment name",
"description": "The environment's name. This name is used to reference the environment assigned to the component's children.",
"allOf": [
{
"$ref": "#/definitions/name-clause"
}
],
"examples": [
"clean_env",
"ephemeral_pkg_env"
]
},
"extend": {
"title": "Environment's initial state",
"description": "Whether the environment state should extend its realm, or start with empty property set. Optional (by default, empty)",
"pattern": "^(realm|none)$",
"type": "string",
"oneOf": [
{
"required": [
"realm"
]
},
{
"required": [
"none"
]
}
],
"examples": [
"realm",
"none"
]
},
"__stop_timeout_ms": {
"type": "integer",
"minimum": 0,
"title": "Stop timeout for a component",
"description": "The duration in milliseconds that component manager will wait before telling the runner to kill the component.",
"examples": [
8000
]
},
"resolvers": {
"type": "array",
"title": "The resolvers registered with this environment",
"description": "The resolvers that will handle component URL resolution for components with this environment.",
"items": {
"type": "object",
"required": [
"scheme",
"resolver",
"from"
],
"properties": {
"scheme": {
"title": "URL scheme",
"description": "The URL scheme this resolver handles",
"allOf": [
{
"$ref": "#/definitions/url-scheme-clause"
}
],
"examples": [
"fuchsia-pkg",
"https"
]
},
"resolver": {
"title": "Resolver name",
"description": "The name of the resolver to use. The resolver must be offered to this realm.",
"allOf": [
{
"$ref": "#/definitions/name-clause"
}
],
"examples": [
"pkg_resolver"
]
},
"from": {
"title": "The resolver source component",
"description": "The component which offers or exposes this resolver capability.",
"pattern": "^(realm|self|#[0-9a-z_\\-\\.]+)$",
"allOf": [
{
"$ref": "#/definitions/relative-ref-clause"
}
],
"examples": [
"realm",
"self",
"#packagefs"
]
}
}
}
}
}
}
},
"children": {
"type": "array",
"title": "Child components",
"description": "The children of this component, including name and launch information",
"uniqueItems": true,
"items": {
"type": "object",
"required": [
"name",
"url"
],
"properties": {
"name": {
"title": "Child component name",
"description": "The parent's local name for the child",
"allOf": [
{
"$ref": "#/definitions/name-clause"
}
],
"examples": [
"echo_server",
"System-logger"
]
},
"url": {
"title": "Child component URI",
"description": "The URI that identifies the child component.",
"allOf": [
{
"$ref": "#/definitions/url-clause"
}
],
"examples": [
"fuchsia-pkg://fuchsia.com/echo_server_cpp#meta/echo_server.cml"
]
},
"startup": {
"title": "Startup mode",
"description": "Conditions that trigger the component to start (defaults to \"lazy\")",
"allOf": [
{
"$ref": "#/definitions/startup-clause"
}
],
"examples": [
"eager",
"lazy"
]
},
"environment": {
"title": "Assigned environment",
"description": "The environment assigned to the child.",
"allOf": [
{
"$ref": "#/definitions/relative-ref-clause"
}
],
"examples": [
"#test_env"
]
}
}
}
},
"collections": {
"type": "array",
"title": "Collections",
"description": "The collections under this component",
"uniqueItems": true,
"items": {
"type": "object",
"required": [
"name",
"durability"
],
"properties": {
"name": {
"title": "Collection name",
"description": "The parent's local name for the collection",
"allOf": [
{
"$ref": "#/definitions/name-clause"
}
],
"examples": [
"modular",
"tests"
]
},
"durability": {
"title": "Durability",
"description": "The durability of components in the collection. Either \"persistent\" (instances in the collection exist until the parent is destroyed) or \"transient\" (instances in the collection exist until the parent is stopped)",
"allOf": [
{
"$ref": "#/definitions/durability-clause"
}
],
"examples": [
"persistent",
"transient"
]
}
}
}
},
"facets": {
"type": "object",
"title": "Facets",
"description": "Freeform object containing third-party metadata"
},
"runners": {
"type": "array",
"title": "Runners",
"description": "Runners declared by this componenet.",
"uniqueItems": true,
"items": {
"type": "object",
"required": [
"name",
"from",
"path"
],
"properties": {
"from": {
"title": "Runner source component",
"description": "The component providing the underlying runner protocol. Either \"realm\", \"self\" or \"#$CHILD\".",
"pattern": "^(realm|self|#[0-9a-z_\\-\\.]+)$",
"allOf": [
{
"$ref": "#/definitions/relative-ref-clause"
}
],
"examples": [
"realm",
"self",
"#scenic"
]
},
"name": {
"title": "Runner name",
"description": "The name of this runner.",
"allOf": [
{
"$ref": "#/definitions/name-clause"
}
],
"examples": [
"elf"
]
},
"path": {
"title": "The path of the capability",
"description": "The path of the capability providing the runner service. The path is either a path into the component's outgoing directory (if from \"self\"), or the path by which the capability was exposed or offered from another component (if from \"realm\" or \"#$CHILD\").",
"allOf": [
{
"$ref": "#/definitions/relative-ref-clause"
}
],
"examples": [
"/elf"
]
}
}
}
},
"resolvers": {
"type": "array",
"title": "Resolvers",
"description": "Resolvers declared by this component.",
"uniqueItems": true,
"items": {
"type": "object",
"required": [
"name",
"path"
],
"properties": {
"name": {
"title": "Resolver name",
"description": "The name of this resolver.",
"allOf": [
{
"$ref": "#/definitions/name-clause"
}
],
"examples": [
"pkg_resolver"
]
},
"path": {
"title": "The path of the resolver protocol",
"description": "The path in the component's outgoing directory providing the resolver protocol.",
"allOf": [
{
"$ref": "#/definitions/path-clause"
}
],
"examples": [
"/svc/fuchsia.sys2.ComponentResolver"
]
}
}
}
}
}
}