Skip to content

Instantly share code, notes, and snippets.

@Toasterson
Created April 15, 2020 13:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Toasterson/5dd1db9c7862450c981ffd10f04d849b to your computer and use it in GitHub Desktop.
Save Toasterson/5dd1db9c7862450c981ffd10f04d849b to your computer and use it in GitHub Desktop.
illumos smf converted to xsd
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
CDDL HEADER START
The contents of this file are subject to the terms of the
Common Development and Distribution License (the "License").
You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
or http://www.opensolaris.org/os/licensing.
See the License for the specific language governing permissions
and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each
file and include the License file at usr/src/OPENSOLARIS.LICENSE.
If applicable, add the following below this CDDL HEADER, with the
fields enclosed by brackets "[]" replaced with your own identifying
information: Portions Copyright [yyyy] [name of copyright owner]
CDDL HEADER END
-->
<!--
Service description DTD
Most attributes are string values (or an individual string from a
restricted set), but attributes with a specific type requirement are
noted in the comment describing the element.
-->
<!--
XInclude support
A series of service bundles may be composed via the xi:include tag.
smf(5) tools enforce that all bundles be of the same type.
-->
<!--
These entities are used for the property, propval and property_group
elements, that require type attributes for manifest, while for profiles
the type attributes are only implied.
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xmlns:xi="http://www.w3.org/2001/XInclude">
<xs:import namespace="http://www.w3.org/2001/XInclude" schemaLocation="xi.xsd"/>
<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
<xs:complexType name="fallback">
<xs:sequence>
<xs:element ref="xi:fallback"/>
</xs:sequence>
</xs:complexType>
<!--
stability
This element associates an SMI stability level with the parent
element. See attributes(5) for an explanation of interface
stability levels.
Its attribute is
value The stability level of the parent element.
-->
<xs:element name="stability">
<xs:complexType>
<xs:attribute name="value" use="required">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="Standard"/>
<xs:enumeration value="Stable"/>
<xs:enumeration value="Evolving"/>
<xs:enumeration value="Unstable"/>
<xs:enumeration value="External"/>
<xs:enumeration value="Obsolete"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<!-- Property value lists -->
<!--
value_node
This element represents a single value within any of the typed
property value lists.
Its attribute is
value The value for this node in the list.
-->
<xs:element name="value_node">
<xs:complexType>
<xs:attribute name="value" use="required"/>
</xs:complexType>
</xs:element>
<!--
count_list
integer_list
opaque_list
host_list
hostname_list
net_address_list
net_address_v4_list
net_address_v6_list
time_list
astring_list
ustring_list
boolean_list
fmri_list
uri_list
These elements represent the typed lists of values for a property.
Each contains one or more value_node elements representing each
value on the list.
None of these elements has attributes.
-->
<xs:element name="count_list">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="value_node"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="integer_list">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="value_node"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="opaque_list">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="value_node"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="host_list">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="value_node"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="hostname_list">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="value_node"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="net_address_list">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="value_node"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="net_address_v4_list">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="value_node"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="net_address_v6_list">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="value_node"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="time_list">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="value_node"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="astring_list">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="value_node"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ustring_list">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="value_node"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="boolean_list">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="value_node"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="fmri_list">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="value_node"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="uri_list">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="value_node"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- Properties and property groups -->
<!--
property
This element is for a singly or multiply valued property within a
property group. It contains an appropriate value list element,
which is expected to be consistent with the type attribute.
Its attributes are
name The name of this property.
type The data type for this property.
override These values should replace values already in the
repository.
-->
<xs:element name="property">
<xs:complexType>
<xs:choice minOccurs="0">
<xs:element ref="count_list"/>
<xs:element ref="integer_list"/>
<xs:element ref="opaque_list"/>
<xs:element ref="host_list"/>
<xs:element ref="hostname_list"/>
<xs:element ref="net_address_list"/>
<xs:element ref="net_address_v4_list"/>
<xs:element ref="net_address_v6_list"/>
<xs:element ref="time_list"/>
<xs:element ref="astring_list"/>
<xs:element ref="ustring_list"/>
<xs:element ref="boolean_list"/>
<xs:element ref="fmri_list"/>
<xs:element ref="uri_list"/>
</xs:choice>
<xs:attribute name="name" use="required"/>
<xs:attribute name="type" use="required">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="count"/>
<xs:enumeration value="integer"/>
<xs:enumeration value="opaque"/>
<xs:enumeration value="host"/>
<xs:enumeration value="hostname"/>
<xs:enumeration value="net_address"/>
<xs:enumeration value="net_address_v4"/>
<xs:enumeration value="net_address_v6"/>
<xs:enumeration value="time"/>
<xs:enumeration value="astring"/>
<xs:enumeration value="ustring"/>
<xs:enumeration value="boolean"/>
<xs:enumeration value="fmri"/>
<xs:enumeration value="uri"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="override" default="false">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="true"/>
<xs:enumeration value="false"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<!--
propval
This element is for a singly valued property within a property
group. List-valued properties must use the property element above.
Its attributes are
name The name of this property.
type The data type for this property.
value The value for this property. Must match type
restriction of type attribute.
override This value should replace any values already in the
repository.
-->
<xs:element name="propval">
<xs:complexType>
<xs:attribute name="name" use="required"/>
<xs:attribute name="type" use="required">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="count"/>
<xs:enumeration value="integer"/>
<xs:enumeration value="opaque"/>
<xs:enumeration value="host"/>
<xs:enumeration value="hostname"/>
<xs:enumeration value="net_address"/>
<xs:enumeration value="net_address_v4"/>
<xs:enumeration value="net_address_v6"/>
<xs:enumeration value="time"/>
<xs:enumeration value="astring"/>
<xs:enumeration value="ustring"/>
<xs:enumeration value="boolean"/>
<xs:enumeration value="fmri"/>
<xs:enumeration value="uri"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="value" use="required"/>
<xs:attribute name="override" default="false">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="true"/>
<xs:enumeration value="false"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<!--
property_group
This element is for a set of related properties on a service or
instance. It contains an optional stability element, as well as
zero or more property-containing elements.
Its attributes are
name The name of this property group.
type A category for this property group. Groups of type
"framework", "implementation" or "template" are primarily
of interest to the service management facility, while
groups of type "application" are expected to be only of
interest to the service to which this group is attached.
Other types may be introduced using the service symbol
namespace conventions.
delete If in the repository, this property group should be removed.
-->
<xs:element name="property_group">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" ref="stability"/>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="propval"/>
<xs:element ref="property"/>
</xs:choice>
</xs:sequence>
<xs:attribute name="name" use="required"/>
<xs:attribute name="type" use="required"/>
<xs:attribute name="delete" default="false">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="true"/>
<xs:enumeration value="false"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<!--
service_fmri
This element defines a reference to a service FMRI (for either a
service or an instance).
Its attribute is
value The FMRI.
-->
<xs:element name="service_fmri">
<xs:complexType>
<xs:attribute name="value" use="required"/>
</xs:complexType>
</xs:element>
<!-- Dependencies -->
<!--
dependency
This element identifies a group of FMRIs upon which the service is
in some sense dependent. Its interpretation is left to the
restarter to which a particular service instance is delegated. It
contains a group of service FMRIs, as well as a block of properties.
Its attributes are
name The name of this dependency.
grouping The relationship between the various FMRIs grouped
here; "require_all" of the FMRIs to be online, "require_any"
of the FMRIs to be online, or "exclude_all" of the FMRIs
from being online or in maintenance for the dependency to
be satisfied. "optional_all" dependencies are satisfied
when all of the FMRIs are either online or unable to come
online (because they are disabled, misconfigured, or one
of their dependencies is unable to come online).
restart_on The type of events from the FMRIs that the service should
be restarted for. "error" restarts the service if the
dependency is restarted due to hardware fault. "restart"
restarts the service if the dependency is restarted for
any reason, including hardware fault. "refresh" restarts
the service if the dependency is refreshed or restarted for
any reason. "none" will never restart the service due to
dependency state changes.
type The type of dependency: on another service ('service'), on
a filesystem path ('path'), or another dependency type.
delete This dependency should be deleted.
-->
<xs:element name="dependency">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="service_fmri"/>
<xs:element minOccurs="0" ref="stability"/>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="propval"/>
<xs:element ref="property"/>
</xs:choice>
</xs:sequence>
<xs:attribute name="name" use="required"/>
<xs:attribute name="grouping" use="required">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="require_all"/>
<xs:enumeration value="require_any"/>
<xs:enumeration value="exclude_all"/>
<xs:enumeration value="optional_all"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="restart_on" use="required">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="error"/>
<xs:enumeration value="restart"/>
<xs:enumeration value="refresh"/>
<xs:enumeration value="none"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="type" use="required"/>
<xs:attribute name="delete" default="false">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="true"/>
<xs:enumeration value="false"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<!-- Dependents -->
<!--
dependent
This element identifies a service which should depend on this service. It
corresponds to a dependency in the named service. The grouping and type
attributes of that dependency are implied to be "require_all" and
"service", respectively.
Its attributes are
name The name of the dependency property group to create in the
dependent entity.
grouping The grouping relationship of the dependency property
group to create in the dependent entity. See "grouping"
attribute on the dependency element.
restart_on The type of events from this service that the named service
should be restarted for.
delete True if this dependent should be deleted.
override Whether to replace an existing dependent of the same name.
-->
<xs:element name="dependent">
<xs:complexType>
<xs:sequence>
<xs:element ref="service_fmri"/>
<xs:element minOccurs="0" ref="stability"/>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="propval"/>
<xs:element ref="property"/>
</xs:choice>
</xs:sequence>
<xs:attribute name="name" use="required"/>
<xs:attribute name="grouping" use="required">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="require_all"/>
<xs:enumeration value="require_any"/>
<xs:enumeration value="exclude_all"/>
<xs:enumeration value="optional_all"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="restart_on" use="required">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="error"/>
<xs:enumeration value="restart"/>
<xs:enumeration value="refresh"/>
<xs:enumeration value="none"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="delete" default="false">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="true"/>
<xs:enumeration value="false"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="override" default="false">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="true"/>
<xs:enumeration value="false"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<!-- Method execution context, security profile, and credential definitions -->
<!--
envvar
An environment variable. It has two attributes:
name The name of the environment variable.
value The value of the environment variable.
-->
<xs:element name="envvar">
<xs:complexType>
<xs:attribute name="name" use="required"/>
<xs:attribute name="value" use="required"/>
</xs:complexType>
</xs:element>
<!--
method_environment
This element defines the environment for a method. It has no
attributes, and one or more envvar child elements.
-->
<xs:element name="method_environment">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="envvar"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!--
method_profile
This element indicates which exec_attr(5) profile applies to the
method context being defined.
Its attribute is
name The name of the profile.
-->
<xs:element name="method_profile">
<xs:complexType>
<xs:attribute name="name" use="required"/>
</xs:complexType>
</xs:element>
<!--
method_credential
This element specifies credential attributes for the execution
method to use.
Its attributes are
user The user ID, in numeric or text form.
group The group ID, in numeric or text form. If absent or
":default", the group associated with the user in the
passwd database.
supp_groups Supplementary group IDs to be associated with the
method, separated by commas or spaces. If absent or
":default", initgroups(3C) will be used.
privileges An optional string specifying the privilege set.
limit_privileges An optional string specifying the limit
privilege set.
-->
<xs:element name="method_credential">
<xs:complexType>
<xs:attribute name="user" use="required"/>
<xs:attribute name="group"/>
<xs:attribute name="supp_groups"/>
<xs:attribute name="privileges"/>
<xs:attribute name="limit_privileges"/>
</xs:complexType>
</xs:element>
<!--
method_context
This element combines credential and resource management attributes
for execution methods. It may contain a method_environment, or
a method_profile or method_credential element.
Its attributes are
working_directory The home directory to launch the method from.
":default" can be used as a token to indicate use of the
user specified by the credential or profile specified.
project The project ID, in numeric or text form. ":default" can
be used as a token to indicate use of the project
identified by getdefaultproj(3PROJECT) for the non-root
user specified by the credential or profile specified.
If the user is root, ":default" designates the project
the restarter is running in.
resource_pool The resource pool name to launch the method on.
":default" can be used as a token to indicate use of the
pool specified in the project(4) entry given in the
"project" attribute above.
-->
<xs:element name="method_context">
<xs:complexType>
<xs:sequence>
<xs:choice minOccurs="0">
<xs:element ref="method_profile"/>
<xs:element ref="method_credential"/>
</xs:choice>
<xs:element minOccurs="0" ref="method_environment"/>
</xs:sequence>
<xs:attribute name="security_flags"/>
<xs:attribute name="working_directory"/>
<xs:attribute name="project"/>
<xs:attribute name="resource_pool"/>
</xs:complexType>
</xs:element>
<!-- Restarter delegation, methods, and monitors -->
<!--
exec_method
This element describes one of the methods used by the designated
restarter to act on the service instance. Its interpretation is
left to the restarter to which a particular service instance is
delegated. It contains a set of attributes, an optional method
context, and an optional stability element for the optional
properties that can be included.
Its attributes are
type The type of method, either "method" or "monitor".
name Name of this execution method. The method names are
usually a defined interface of the restarter to which an
instance of this service is delegated.
exec The string identifying the action to take. For
svc.startd(1M), this is a string suitable to pass to
exec(2).
timeout_seconds [integer] Duration, in seconds, to wait for this
method to complete. A '0' or '-1' denotes an infinite
timeout.
delete If in the repository, the property group for this method
should be removed.
-->
<xs:element name="exec_method">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" ref="method_context"/>
<xs:element minOccurs="0" ref="stability"/>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="propval"/>
<xs:element ref="property"/>
</xs:choice>
</xs:sequence>
<xs:attribute name="type" use="required">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="method"/>
<xs:enumeration value="monitor"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="name" use="required"/>
<xs:attribute name="exec" use="required"/>
<xs:attribute name="timeout_seconds" use="required"/>
<xs:attribute name="delete" default="false">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="true"/>
<xs:enumeration value="false"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<!--
restarter
A flag element identifying the restarter to which this service or
service instance is delegated. Contains the FMRI naming the
delegated restarter.
This element has no attributes.
-->
<xs:element name="restarter">
<xs:complexType>
<xs:sequence>
<xs:element ref="service_fmri"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- Templates -->
<!--
doc_link
The doc_link relates a resource described by the given URI to the
service described by the containing template. The resource is
expected to be a documentation or elucidatory reference of some
kind.
Its attributes are
name A label for this resource.
uri A URI to the resource.
-->
<xs:element name="doc_link">
<xs:complexType>
<xs:attribute name="name" use="required"/>
<xs:attribute name="uri" use="required"/>
</xs:complexType>
</xs:element>
<!--
manpage
The manpage element connects the reference manual page to the
template's service.
Its attributes are
title The manual page title.
section The manual page's section.
manpath The MANPATH environment variable, as described in man(1)
that is required to reach the named manual page
-->
<xs:element name="manpage">
<xs:complexType>
<xs:attribute name="title" use="required"/>
<xs:attribute name="section" use="required"/>
<xs:attribute name="manpath" default=":default"/>
</xs:complexType>
</xs:element>
<!--
documentation
The documentation element groups an arbitrary number of doc_link
and manpage references.
It has no attributes.
-->
<xs:element name="documentation">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="doc_link"/>
<xs:element ref="manpage"/>
</xs:choice>
</xs:complexType>
</xs:element>
<!--
loctext
The loctext element is a container for localized text.
Its sole attribute is
xml:lang The name of the locale, in the form accepted by LC_ALL,
etc. See locale(5).
-->
<xs:element name="loctext">
<xs:complexType mixed="true">
<xs:attribute ref="xml:lang" use="required"/>
</xs:complexType>
</xs:element>
<!--
description
The description holds a set of potentially longer, localized strings that
consist of a short description of the service.
The description has no attributes.
-->
<xs:element name="description">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="loctext"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!--
common_name
The common_name holds a set of short, localized strings that
represent a well-known name for the service in the given locale.
The common_name has no attributes.
-->
<xs:element name="common_name">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="loctext"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!--
units
The units a numerical property is expressed in.
-->
<xs:element name="units">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="loctext"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!--
visibility
Expresses how a property is typically accessed. This isn't
intended as access control, but as an indicator as to how a
property is used.
Its attributes are:
value 'hidden', 'readonly', or 'readwrite' indicating that
the property should be hidden from the user, shown but
read-only, or modifiable.
-->
<xs:element name="visibility">
<xs:complexType>
<xs:attribute name="value" use="required">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="hidden"/>
<xs:enumeration value="readonly"/>
<xs:enumeration value="readwrite"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<!--
value
Describes a legal value for a property value, and optionally contains a
human-readable name and description for the specified property
value.
Its attributes are:
name A string representation of the value.
-->
<xs:element name="value">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" ref="common_name"/>
<xs:element minOccurs="0" ref="description"/>
</xs:sequence>
<xs:attribute name="name" use="required"/>
</xs:complexType>
</xs:element>
<!--
values
Human-readable names and descriptions for valid values of a property.
-->
<xs:element name="values">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="value"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!--
cardinality
Places a constraint on the number of values the property can take
on.
Its attributes are:
min minimum number of values
max maximum number of values
Both attributes are optional. If min is not specified, it defaults to
0. If max is not specified it indicates an unlimited number of values.
If neither is specified this indicates 0 or more values.
-->
<xs:element name="cardinality">
<xs:complexType>
<xs:attribute name="min" default="0"/>
<xs:attribute name="max" default="18446744073709551615"/>
</xs:complexType>
</xs:element>
<!--
internal_separators
Indicates the separators used within a property's value used to
separate the actual values. Used in situations where multiple
values are packed into a single property value instead of using a
multi-valued property.
-->
<xs:element name="internal_separators" type="xs:string"/>
<!--
range
Indicates a range of possible integer values.
Its attributes are:
min The minimum value of the range (inclusive).
max The maximum value of the range (inclusive).
-->
<xs:element name="range">
<xs:complexType>
<xs:attribute name="min" use="required"/>
<xs:attribute name="max" use="required"/>
</xs:complexType>
</xs:element>
<!--
constraints
Provides a set of constraints on the values a property can take on.
-->
<xs:element name="constraints">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="value"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="range"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!--
include_values
Includes an entire set of values in the choices block.
Its attributes are:
type Either "constraints" or "values", indicating an
inclusion of all values allowed by the property's
constraints or all values for which there are
human-readable names and descriptions, respectively.
-->
<xs:element name="include_values">
<xs:complexType>
<xs:attribute name="type" use="required">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="constraints"/>
<xs:enumeration value="values"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<!--
choices
Provides a set of common choices for the values a property can take
on. Useful in those cases where the possibilities are unenumerable
or merely inconveniently legion, and a manageable subset is desired
for presentation in a user interface.
-->
<xs:element name="choices">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="value"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="range"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="include_values"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!--
prop_pattern
The prop_pattern describes one property of the enclosing property group
pattern.
Its attributes are:
name The property's name.
type The property's type.
required
If the property group is present, this property is required.
type can be omitted if required is false.
-->
<xs:element name="prop_pattern">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" ref="common_name"/>
<xs:element minOccurs="0" ref="description"/>
<xs:element minOccurs="0" ref="units"/>
<xs:element minOccurs="0" ref="visibility"/>
<xs:element minOccurs="0" ref="cardinality"/>
<xs:element minOccurs="0" ref="internal_separators"/>
<xs:element minOccurs="0" ref="values"/>
<xs:element minOccurs="0" ref="constraints"/>
<xs:element minOccurs="0" ref="choices"/>
</xs:sequence>
<xs:attribute name="name" use="required"/>
<xs:attribute name="type">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="count"/>
<xs:enumeration value="integer"/>
<xs:enumeration value="opaque"/>
<xs:enumeration value="host"/>
<xs:enumeration value="hostname"/>
<xs:enumeration value="net_address"/>
<xs:enumeration value="net_address_v4"/>
<xs:enumeration value="net_address_v6"/>
<xs:enumeration value="time"/>
<xs:enumeration value="astring"/>
<xs:enumeration value="ustring"/>
<xs:enumeration value="boolean"/>
<xs:enumeration value="fmri"/>
<xs:enumeration value="uri"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="required" default="false">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="true"/>
<xs:enumeration value="false"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<!--
pg_pattern
The pg_pattern describes one property group.
Depending on the element's attributes, these descriptions may apply
to just the enclosing service/instance, instances of the enclosing
service, delegates of the service (assuming it is a restarter), or
all services.
Its attributes are:
name The property group's name. If not specified, it
matches all property groups with the specified type.
type The property group's type. If not specified, it
matches all property groups with the specified name.
required
If the property group is required.
target The scope of the pattern, which may be all, delegate,
instance, or this. 'all' is reserved for framework use
and applies the template to all services on the system.
'delegate' is reserved for restarters, and means the
template applies to all services which use the restarter.
'this' would refer to the defining service or instance.
'instance' can only be used in a service's template block,
and means the definition applies to all instances of this
service.
-->
<xs:element name="pg_pattern">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" ref="common_name"/>
<xs:element minOccurs="0" ref="description"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="prop_pattern"/>
</xs:sequence>
<xs:attribute name="name" default=""/>
<xs:attribute name="type" default=""/>
<xs:attribute name="required" default="false">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="true"/>
<xs:enumeration value="false"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="target" default="this">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="this"/>
<xs:enumeration value="instance"/>
<xs:enumeration value="delegate"/>
<xs:enumeration value="all"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<!--
template
The template contains a collection of metadata about the service.
It contains a localizable string that serves as a common,
human-readable name for the service. (This name should be less than
60 characters in a single byte locale.) The template may optionally
contain a longer localizable description of the service, a
collection of links to documentation, either in the form of manual
pages or in the form of URI specifications to external documentation
sources (such as docs.sun.com).
The template has no attributes.
-->
<xs:element name="template">
<xs:complexType>
<xs:sequence>
<xs:element ref="common_name"/>
<xs:element minOccurs="0" ref="description"/>
<xs:element minOccurs="0" ref="documentation"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="pg_pattern"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- Notification Parameters -->
<xs:element name="paramval">
<xs:complexType>
<xs:attribute name="name" use="required"/>
<xs:attribute name="value" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="parameter">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="value_node"/>
</xs:sequence>
<xs:attribute name="name" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="event">
<xs:complexType>
<xs:attribute name="value" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="type">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="parameter"/>
<xs:element ref="paramval"/>
</xs:choice>
<xs:attribute name="name" use="required"/>
<xs:attribute name="active" default="true">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="true"/>
<xs:enumeration value="false"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<!--
notification parameters
This element sets the notification parameters for Software Events and
Fault Management problem lifecycle events.
-->
<xs:element name="notification_parameters">
<xs:complexType>
<xs:sequence>
<xs:element ref="event"/>
<xs:element maxOccurs="unbounded" ref="type"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- Services and instances -->
<!--
create_default_instance
A flag element indicating that an otherwise empty default instance
of this service (named "default") should be created at install, with
its enabled property set as given.
Its attribute is
enabled [boolean] The initial value for the enabled state of
this instance.
-->
<xs:element name="create_default_instance">
<xs:complexType>
<xs:attribute name="enabled" use="required">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="true"/>
<xs:enumeration value="false"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<!--
single_instance
A flag element stating that this service can only have a single
instance on a particular system.
-->
<xs:element name="single_instance">
<xs:complexType/>
</xs:element>
<!--
instance
The service instance is the object representing a software component
that will run on the system if enabled. It contains an enabled
element, a set of dependencies on other services, potentially
customized methods or configuration data, an optional method
context, and a pointer to its restarter. (If no restarter is
specified, the master restarter, svc.startd(1M), is assumed to be
responsible for the service.)
Its attributes are
name The canonical name for this instance of the service.
enabled [boolean] The initial value for the enabled state of
this instance.
-->
<xs:element name="instance">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" ref="restarter"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="dependency"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="dependent"/>
<xs:element minOccurs="0" ref="method_context"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="exec_method"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="notification_parameters"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="property_group"/>
<xs:element minOccurs="0" ref="template"/>
</xs:sequence>
<xs:attribute name="name" use="required"/>
<xs:attribute name="enabled" use="required">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="true"/>
<xs:enumeration value="false"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<!--
service
The service contains the set of instances defined by default for
this service, an optional method execution context, any default
methods, the template, and various restrictions or advice applicable
at installation. The method execution context and template elements
are required for service_bundle documents with type "manifest", but
are optional for "profile" or "archive" documents.
Its attributes are
name The canonical name for the service.
version [integer] The integer version for this service.
type Whether this service is a simple service, a delegated
restarter, or a milestone (a synthetic service that
collects a group of dependencies).
-->
<xs:element name="service">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" ref="create_default_instance"/>
<xs:element minOccurs="0" ref="single_instance"/>
<xs:element minOccurs="0" ref="restarter"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="dependency"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="dependent"/>
<xs:element minOccurs="0" ref="method_context"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="exec_method"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="notification_parameters"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="property_group"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="instance"/>
<xs:element minOccurs="0" ref="stability"/>
<xs:element minOccurs="0" ref="template"/>
</xs:sequence>
<xs:attribute name="name" use="required"/>
<xs:attribute name="version" use="required"/>
<xs:attribute name="type" use="required">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="service"/>
<xs:enumeration value="restarter"/>
<xs:enumeration value="milestone"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<!--
service_bundle
The bundle possesses two attributes:
type How this file is to be understood by the framework (or
used in a non-framework compliant way). Standard types
are 'archive', 'manifest', and 'profile'.
name A name for the bundle. Manifests should be named after
the package which delivered them; profiles should be
named after the "feature set nickname" they intend to
enable.
-->
<xs:element name="service_bundle">
<xs:complexType>
<xs:choice>
<!--<xs:element minOccurs="0" maxOccurs="unbounded" ref="service_bundle"/>-->
<xs:element minOccurs="0" maxOccurs="unbounded" ref="service"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="xi:include"/>
</xs:choice>
<xs:attribute name="type" use="required"/>
<xs:attribute name="name" use="required"/>
</xs:complexType>
</xs:element>
<xs:complexType name="any" mixed="true">
<xs:sequence>
<xs:any minOccurs="0" maxOccurs="unbounded" processContents="strict"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.w3.org/2001/XInclude" xmlns:xi="http://www.w3.org/2001/XInclude">
<xs:import schemaLocation="service_bundle.xsd"/>
<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
<xs:element name="include">
<xs:complexType>
<xs:complexContent>
<xs:extension base="fallback">
<xs:attribute name="href" use="required"/>
<xs:attribute name="parse" default="xml">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="xml"/>
<xs:enumeration value="text"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="encoding"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:element name="fallback" type="any"/>
</xs:schema>
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.w3.org/XML/1998/namespace" xmlns:xi="http://www.w3.org/2001/XInclude">
<xs:import schemaLocation="service_bundle.xsd"/>
<xs:import namespace="http://www.w3.org/2001/XInclude" schemaLocation="xi.xsd"/>
<xs:attribute name="lang"/>
</xs:schema>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment