You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/reference/resource-schema/udt/index.md
+86-40
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
type: docs
3
3
title: "User Defined Type Resource schemas"
4
4
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"
6
6
categories: "Schema"
7
7
weight: 100
8
8
---
@@ -30,65 +30,110 @@ in this manifest. A sample manifest is shown below:
30
30
31
31
Manifest file has below keys at the top level:
32
32
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 |
37
37
38
38
### types
39
39
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 |
43
43
44
44
## resource type name
45
45
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 |
50
50
51
51
## apiVersions
52
52
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 |
56
56
57
57
## api version name
58
58
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 |
62
62
63
63
## schema
64
64
65
65
`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)
66
66
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 |
72
72
73
73
### properties
74
74
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 |
78
78
79
79
### property name
80
80
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 |
84
85
86
+
Depending on the type, there can be more keys in a property.
85
87
86
-
#### Examples
87
88
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**
89
123
90
124
```
91
125
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
92
137
size:
93
138
type: string
94
139
description: The size of database to provision
@@ -97,15 +142,11 @@ Manifest file has below keys at the top level:
97
142
- M
98
143
- L
99
144
- XL
100
-
host:
101
-
type: string
102
-
description: hostname
103
-
maxLength: 20
104
145
```
146
+
#### array type property
105
147
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`.
109
150
110
151
```
111
152
schema:
@@ -120,9 +161,11 @@ schema:
120
161
format: uint32
121
162
```
122
163
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
124
167
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.
126
169
127
170
```
128
171
schema:
@@ -139,6 +182,9 @@ schema:
139
182
type: string
140
183
```
141
184
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.
0 commit comments