Skip to content

Commit 4d376e4

Browse files
authored
feat(AIP-148): add well known strings section (#1239)
1 parent 6e52d72 commit 4d376e4

File tree

1 file changed

+35
-12
lines changed

1 file changed

+35
-12
lines changed

aip/general/0148.md

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ placement:
1010
# Standard fields
1111

1212
Certain concepts are common throughout any corpus of APIs. In these situations,
13-
it is useful to have a standard field name that is used consistently to
14-
communicate that concept.
13+
it is useful to have a standard field name and behavior that is used
14+
consistently to communicate that concept.
1515

1616
## Guidance
1717

@@ -34,15 +34,6 @@ The `string parent` field refers to the resource name of the parent of a
3434
collection, and **should** be used in most `List` (AIP-132) and `Create`
3535
(AIP-133) requests.
3636

37-
#### uid
38-
39-
The output only `string uid` field refers to a system-assigned, unique
40-
identifier for a resource. When provided, this field **should** be a [UUID4][].
41-
[Declarative-friendly resources][] **should** include this field.
42-
43-
<!-- prettier-ignore -->
44-
[uuid4]: https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)
45-
4637
### Other names
4738

4839
#### display_name
@@ -137,6 +128,25 @@ used by server-side policies, such as IAM conditions. Annotations exist to
137128
allow client tools to store their own state information without requiring a
138129
database.
139130

131+
### Well known string fields
132+
133+
#### IP address
134+
135+
A field that represents an IP address **must** comply with the following:
136+
137+
* use type `string`
138+
* use the name `ip_address` or end with the suffix `_ip_address` e.g.
139+
`resolved_ip_address`
140+
* specify the IP address version format via one of the supported formats `IPV4`,
141+
`IPV6`, or if it can be either, `IPV4_OR_IPV6` (see [AIP-202][aip-202])
142+
143+
#### uid
144+
145+
The output only `string uid` field refers to a system-assigned unique
146+
identifier for a resource. When provided, this field **must** be a [UUID4][]
147+
and **must** specify this format via the `UUID4` format extension (see
148+
[AIP-202][aip-202]). [Declarative-friendly resources][] **should** include this
149+
field.
140150

141151
## Further reading
142152

@@ -148,18 +158,31 @@ database.
148158
- For the `validate_only` field, see AIP-163.
149159
- For fields related to soft delete and undelete, see AIP-164.
150160

161+
## Rationale
162+
163+
### Well known string fields
164+
165+
Some fields represent very well defined concepts or artifacts that sometimes
166+
also have strict governance of their semantics. For such fields, presenting an
167+
equally standardized API surface is important. This enables development of
168+
improved API consumer tools and documentation, as well as a more unified user
169+
experience across the platform.
170+
151171
## History
152172

153173
Before 2023-07, `purge_time` for soft-deleted resources was also called
154174
`expire_time`. `purge_time` was introduced to reduce user confusion.
155175

156176
## Changelog
157177

178+
- **2023-10-05**: Introduce well known string fields with IP Address and `uid`.
158179
- **2023-08-14**: Introduce the term `annotations` from AIP-128.
159180
- **2023-07-13**: Introduce the term `purge_time`.
160181
- **2021-04-06**: Require output only field behavior for `uid` and `delete_time`
161182
fields.
162183

163184
<!-- prettier-ignore -->
185+
[aip-202]: ./0202.md
164186
[declarative-friendly resources]: ./0128.md#resources
165-
[kubernetes limits]: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/#syntax-and-character-set
187+
[kubernetes limits]: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/#syntax-and-character-set
188+
[uuid4]: https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)

0 commit comments

Comments
 (0)