text
stringlengths
0
662
name: it-service
description: IT operations
spec:
owner:
kind: Team
name: contractor-group/it-ops
```
In this example, theΒ `spec.owner`Β has been broken apart since the name was complex. The kind happened to be written with an uppercase letter T, which also works. The namespace was left out just like in the string version above, which is handled identically.
## **Figuring out an entity reference based on its catalog URL**
In OpenContext the catalog URL of an entity contains the parts used for an entity reference. For instance, if a catalog entity's URL ends with `catalog/contractor-group/team/it-ops` then:
- Kind = `Team`
- Namespace = `contractor-group`
- Name = `it-ops`
- String reference = `team:contractor-group/it-ops`
- Compound reference = See above in the [Compound References section](#compound-references)
---
sidebar_position: 12
---
# Kind: Location
This is a special kind of entity that is a marker that references other places to look for OpenContext data. For the most part this is created automatically by the system. One would only create this kind of YAML definition if one wants to add supplementary data to OpenContext or entities that cannot be auto-discovered.
## Definition
```yaml
apiVersion: opencontext.com/v1alpha1
kind: Location
spec:
targets: string[]
```
- **apiVersion**: opencontext.com/v1alpha1 [required]
- **kind**: Location [required]
- **metadata**: ([ObjectMeta](common#metadata)) [optional]
Standard object’s metadata. For more information see the [Common to All Kinds](common) doc
- **spec**: ([Spec](#spec)) [required]
Specification to describe a Location to look for OpenContext data.
## Spec
- targets (string array) [required]
A list of targets as strings. They can all be either absolute paths/URLs, or relative paths such asΒ `./details/oc-catalog.yaml` which are resolved relative to the location of this Location entity itself.
## Examples
These example YAML configurations are all shown as if they were in their own file. They can be concatenated into a single file by separating the contents with a triple dash `---` like in Kubernetes.
If you had the following directory structure in your GitHub repository
```bash
.
β”œβ”€β”€ services
β”‚Β Β  β”œβ”€β”€ it-service.yaml
β”‚Β Β  β”œβ”€β”€ service-crates.yaml
β”‚Β Β  β”œβ”€β”€ service-dumpster-prod.yaml
β”‚Β Β  β”œβ”€β”€ service-greenhouse.yaml
β”‚Β Β  β”œβ”€β”€ service-retail.yaml
β”‚Β Β  └── service-wholesale.yaml
```
then to create a location file for all services you would create a location YAML (all-services.yaml) in the root of your GitHub repository and populate it like so.
```yaml
apiVersion: opencontext.com/v1alpha1
kind: Location
metadata:
name: scatterly-services
description: A collection of all Scatter.ly services
spec:
targets:
- ./services/service-greenhouse.yaml
- ./services/service-crates.yaml
- ./services/service-wholesale.yaml
- ./services/service-retail.yaml
- ./services/service-dumpster-prod.yaml
- ./services/it-service.yaml
```
Now your directory structure should look something like the following.
```bash
.
β”œβ”€β”€ all-services.yaml
β”œβ”€β”€ services
β”‚Β Β  β”œβ”€β”€ it-service.yaml
β”‚Β Β  β”œβ”€β”€ service-crates.yaml
β”‚Β Β  β”œβ”€β”€ service-dumpster-prod.yaml
β”‚Β Β  β”œβ”€β”€ service-greenhouse.yaml
β”‚Β Β  β”œβ”€β”€ service-retail.yaml
β”‚Β Β  └── service-wholesale.yaml
```
---
sidebar_position: 11
---