'\" te .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved. .\" 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] .TH SMF_TEMPLATE 7 "Nov 10, 2008" .SH NAME smf_template \- service management framework support for service metadata .SH DESCRIPTION .sp .LP Templates are defined by service developers to describe metadata about a service in general or individual configuration properties on a service, including human-consumable descriptions as well as definitions of valid configuration. .sp .LP Administrators are provided access to templates through SMF commands that describe configuration values and validate configuration against templates. .sp .LP Tool developers can use templates to provide more helpful user interfaces for service configuration. .SS "Template Data" .sp .LP Service metadata is defined in the template as part of the service manifest. .SS "Consuming Template Data" .sp .LP The \fBsvcs -lv\fR and \fBsvccfg describe\fR commands can be used to access metadata about properties in a human-readable format. .sp .LP \fBsvccfg\fR(8)'s \fBvalidate\fR subcommand can be used to validate a service instance or manifest against template data. A set of \fBlibscf\fR(3LIB) interfaces is available to access template data. .SS "Template Definition" .sp .LP The sole interface to define templates is the service manifest. .sp .LP Service authors should provide template metadata including \fBcommon_names\fR, \fBdescriptions\fR, \fBchoices\fR and \fBconstraints\fR for service-specific property groups and properties which they introduce. At a minimum, service authors must provide descriptions for property groups and properties in the C locale. Service authors should not provide template metadata for framework-delivered property groups such as methods and dependencies. .sp .LP See the \fBEXAMPLES\fR section for an example of authoring a template definition for a service. .SS "Template Composition" .sp .LP All template interfaces search for template data about a property group first on the instance, then on the service, then on the service's restarter, and finally globally. .sp .LP A property group template is defined by its author to apply to a specific instance, to a service and all of its instances, to a restarter's delegates, or globally. A typical service author defines the template on an instance or on a service. A template defined on an instance is applied to that instance only, and can override a template for that property group defined on the service. A template defined on the service is applied to all instances of that service. .sp .LP Restarter authors can define templates in their manifest that apply to any service which uses their restarter, which is also known as a \fBdelegate\fR. SMF framework authors have defined templates for property groups with well-known meanings to the entire SMF framework in the manifest for \fBsvc:/system/svc/global\fR. .sp .LP Templates defined globally or by the restarter and re-defined by the service or instance are flagged as a validation error. Service authors can avoid these errors by creating templates only for property groups specific to their service and not consumed by the SMF framework. .sp .LP Property group templates can also be wildcarded by name or type. Only the most specific template definition applicable to a property group is honored. .SS "Template Details" .SS "Service and Instance Templates" .sp .LP The \fBtemplate\fR element defines the start of a template block. All further definitions below can be included in a template block. A \fBtemplate\fR element can be contained in either a \fBservice\fR or \fBinstance\fR element. If it is contained in the \fBservice\fR element, it applies to the service and all instances of that service. If it is contained in the \fBinstance\fR element, it applies to only that instance of the service. .sp .LP Whenever possible, we recommend defining the template data for the entire service. .sp .in +2 .nf .fi .in -2 .SS "Service and Instance Common Names" .sp .LP The entire service or instance can define a common name to describe the purpose of the service/instance. .sp .in +2 .nf