Skip to content

Commit 7d63a1e

Browse files
committed
wip
1 parent 44f1c60 commit 7d63a1e

File tree

1 file changed

+86
-40
lines changed
  • docs/content/reference/resource-schema/udt

1 file changed

+86
-40
lines changed

Diff for: docs/content/reference/resource-schema/udt/index.md

+86-40
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
type: docs
33
title: "User Defined Type Resource schemas"
44
linkTitle: "User Defined Types"
5-
description: "Schema docs for the resources of user defined type that can comprise a Radius Application"
5+
description: "Schema docs for the resources of an user defined type that can comprise a Radius Application"
66
categories: "Schema"
77
weight: 100
88
---
@@ -30,65 +30,110 @@ in this manifest. A sample manifest is shown below:
3030

3131
Manifest file has below keys at the top level:
3232

33-
| Key | Description | Example |
34-
|-----|-------------|---------|
35-
| **name** | The namespace in which the resource type is registered | `MyCompany.Resources` |
36-
| [**types**](#types) | type names in the specified namespace. The resource type manifest usually has one type that should be registered. | `postgresDatabases` |
33+
| Key | Description | Example | Required |
34+
|-----|-------------|---------|---------|
35+
| **name** | The namespace in which the resource type is registered | `MyCompany.Resources` | yes |
36+
| [**types**](#types) | type names in the specified namespace. The resource type manifest usually has one type that should be registered. | `postgresDatabases` | yes |
3737

3838
### types
3939

40-
| Key | Description | Example |
41-
|-----|-------------|---------|
42-
| [**resource type name**](#resource-type-name) | The namespace in which the resource type is registered | `MyCompany.Resources` |
40+
| Key | Description | Example | Required |
41+
|-----|-------------|---------|----------|
42+
| [**resource type name**](#resource-type-name) | The namespace in which the resource type is registered | `MyCompany.Resources` | yes |
4343

4444
## resource type name
4545

46-
| Key | Description | Example |
47-
|-----|-------------|---------|
48-
| **description** | Description of the resource type | `A postgreSQL database` |
49-
| [**apiVersions**](#apiVersions) | api versions which support this resource type | `2025-01-01-preview` |
46+
| Key | Description | Example | Required |
47+
|-----|-------------|---------|----------|
48+
| **description** | Description of the resource type | `A postgreSQL database` | yes |
49+
| [**apiVersions**](#apiVersions) | api versions which support this resource type | `2025-01-01-preview` | yes |
5050

5151
## apiVersions
5252

53-
| Key | Description | Example |
54-
|-----|-------------|---------|
55-
| [**api version name**](#api-version-name) | a specific api version which supports this resource type | `2025-01-01-preview` |
53+
| Key | Description | Example | Required |
54+
|-----|-------------|---------|----------|
55+
| [**api version name**](#api-version-name) | a specific api version which supports this resource type | `2025-01-01-preview` | yes |
5656

5757
## api version name
5858

59-
| Key | Description |
60-
|-----|-------------|
61-
| [**schema**](#schema) | openAPI v3 structural schema of the resource type in a specific api version. Radius supports a subset of open API capabilities. This is covered in subsequent sections |
59+
| Key | Description | Required |
60+
|-----|-------------|----------|
61+
| [**schema**](#schema) | openAPI v3 structural schema of the resource type in a specific api version. Radius supports a subset of open API capabilities. This is covered in subsequent sections | yes |
6262

6363
## schema
6464

6565
`schema` holds the description of the structural schema for new resource type use using [Open API v3](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schema-object)
6666

67-
| Key | Description |
68-
|-----|-------------|
69-
| **type**| type of `schema`. This is always object, representing a open API v3 object |
70-
| [**properties**](#properties)| properties which are valid for a resource of the specified resource type|
71-
| **required** | list of properties that are required for a resource |
67+
| Key | Description | Required|
68+
|-----|-------------|-----------
69+
| **type**| type of `schema`. This is always `object`, representing a open API v3 object | yes |
70+
| [**properties**](#properties)| properties which are valid for a resource of the specified resource type| yes |
71+
| **required** | list of properties that are required for a resource | no |
7272

7373
### properties
7474

75-
| Key | Description | Example |
76-
|-----|-------------|---------|
77-
| [**property name**](#property-name)| A property name. Property names MUST be strings and SHOULD conform to the regular expression: ^[a-zA-Z0-9\.\-_]+$.| logging-verbosity |
75+
| Key | Description | Example | Required |
76+
|-----|-------------|---------|----------|
77+
| [**property name**](#property-name)| A property name. Property names MUST be strings and SHOULD conform to the regular expression: ^[a-zA-Z0-9\.\-_]+$.| logging-verbosity | yes |
7878

7979
### property name
8080

81-
| Key | Description | Example |
82-
|-----|-------------|---------|
83-
| **type**| type of the value of property. This can be any primitive type defined in [Open API v3 data types](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#data-types) OR an array OR a map | [examples](#examples) |
81+
| Key | Description | Example | Required |
82+
|-----|-------------|---------|----------|
83+
| **type** | type of the value of property. This can be any [primitive type](#primitive-type-property), an [array](#array-type-property) or a[map](#map-type-property) | - | yes |
84+
| **description** | description of the property | "The size of database to provision" | no |
8485

86+
Depending on the type, there can be more keys in a property.
8587

86-
#### Examples
8788

88-
##### primitive type property
89+
#### primitive type property
90+
91+
A property can be any primitive data type defined in [Open API v3 data types](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#data-types).
92+
93+
** Numeric values **
94+
95+
| Type | Format | Description |
96+
|------|---------|-------------|
97+
| integer | int32 | signed 32 bits |
98+
| integer | int64 | signed 64 bits (a.k.a long) |
99+
| integer | uint32 | unsigned 32 bits |
100+
| number | float | a float value |
101+
| number | double | a double precision value |
102+
103+
** Strings **
104+
105+
| Type | Format | Description |
106+
|------|---------|-------------|
107+
| string | _ | any string |
108+
| string | byte | base64 encoded characters |
109+
| string | binary | any sequence of octets |
110+
| string | date | As defined by full-date - RFC3339 |
111+
| string | date-time | As defined by date-time - RFC3339 |
112+
| string | password | A hint to UIs to obscure input |
113+
114+
** Boolean **
115+
116+
| Type | Format | Description |
117+
|------|---------|-------------|
118+
| boolean | - | `true` or `false` |
119+
120+
121+
122+
**Example**
89123

90124
```
91125
properties:
126+
host:
127+
type: string
128+
description: hostname
129+
maxLength: 20
130+
port:
131+
type: uint32
132+
description: server listening port
133+
created:
134+
type: string
135+
description: date on which the resource was created
136+
format: date
92137
size:
93138
type: string
94139
description: The size of database to provision
@@ -97,15 +142,11 @@ Manifest file has below keys at the top level:
97142
- M
98143
- L
99144
- XL
100-
host:
101-
type: string
102-
description: hostname
103-
maxLength: 20
104145
```
146+
#### array type property
105147

106-
##### array
107-
108-
`array` must specify a `type` for item
148+
Arrays can be used to store a collection of items of same type.
149+
A property of type `array` must specify a `type` for each `item`.
109150

110151
```
111152
schema:
@@ -120,9 +161,11 @@ schema:
120161
format: uint32
121162
```
122163

123-
##### map
164+
The above example specifies "ports" is an array property and each item in this array is of type integer.
165+
166+
#### map type property
124167

125-
We support map through `addionalProperties`. This is useful when the resource type allows for dynamic (user defined) keys. We still must specify a type for the value of the property.
168+
We support map through `addionalProperties`. This is useful when the resource type allows for dynamic (user defined) keys. The keys are always `string` type. We must specify a type for the value of the property.
126169

127170
```
128171
schema:
@@ -139,6 +182,9 @@ schema:
139182
type: string
140183
```
141184

185+
In the above example, we allow the resource to have labels such as "namespace:app, env: prod". Note that we did not have to define "namespace" and "env" explicitly by using this approach, which would not work for allowing labels.
186+
187+
142188

143189

144190

0 commit comments

Comments
 (0)