# ServiceID

A [commissioning file](/1-7-3/documentation/services/structure-of-commissioning-files.md) acts as a template for creating a concrete service. It is the template only, much like in a programming language the *class* serves as a template for concrete *object* instantiations. When [installing](/1-7-3/documentation/services/working-with-service-commissioning-files.md#installing-services) a service, the concrete service can be configured by choosing different values for the parameters of the commissioning file. In this configuration step, the *serviceId* is chosen as a unique identifier for this concrete service.

The *serviceId* may consist of ascii characters (lower and upper case), numbers, underscore, and period (decimal point), identical to how Docker container names may be chosen [\[1\]](/1-7-3/documentation/services/serviceid.md) (regular expression pattern: `[a-zA-Z0-9][a-zA-Z0-9_.]*`). If no serviceId is specified explicitly, an auto-generated one is used, and also proposed as default when installing a service. The auto-generated serviceId is taken from the [metadata name](/1-7-3/documentation/services/structure-of-commissioning-files/metadata.md#name) property with all non-allowed characters removed. For backward-compatibility reasons, the auto-generated serviceId in 1.0.x changes all characters to lowercase and also removes all punctuation, including underscore and period.

Due to different parameter choices, the concrete services may be very different once enabled, even when the same commissioning file was used. Hence, the *serviceId* is used as the unique identifier for each enabled service.

The *serviceId* is also important when referencing resources in other services for [inter-service referencing](/1-7-3/documentation/services/inter-service-referencing.md).

The length of the *serviceId* is generally not restricted, except if there are any [Cybus::Container](/1-7-3/documentation/services/structure-of-commissioning-files/resources/cybus-container.md) or [Cybus::Volume](/1-7-3/documentation/services/structure-of-commissioning-files/resources/cybus-volume.md) resources in the given service commissioning file. For any of these resources, the resulting resource name from *serviceId* and *resourceId* together must be not longer than 63 characters, which is a limitation from the Docker container hostname property. If any of these resources exist in the file, the *serviceId* will be checked to be not longer than what is possible while still fulfilling the resource name restriction on the container resources. For example, if there is a *Cybus::Container* resource with a 10 character long resourceId, the serviceId must be at most 52 characters long (63, minus 10, minus 1 hyphen character). This check will be performed upon installation of the service.

## Footnotes

\[[1](/1-7-3/documentation/services/serviceid.md)]

There is one exception from the Docker analogy: The hyphen character `-` (also called minus) is intentionally not allowed for identifiers within the Connectware, because it is used internally as the separator character between service ID and resource ID e.g. for Docker container resources.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cybus.io/1-7-3/documentation/services/serviceid.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
