@@ -7,7 +7,7 @@ slug: /127
77
88::: warning [ State]
99
10- Experimental
10+ Adopt
1111
1212:::
1313
@@ -17,51 +17,33 @@ such as **Infrastructure as Code (IaC) tools**, which many customers heavily
1717depend on for their DevOps workflows.\
1818An interface is considered "declarative-friendly" when resources can be managed
1919by specifying their ** desired final state** , rather than outlining a series of
20- steps or actions. In this approach, you define ** what** the resource should look
21- like, while the API takes care of the ** how** .
20+ steps or actions. In this approach, a user defines ** what** the resource should
21+ look like via an IaC tool, while the tool and underlying API take care of the
22+ ** how** .
2223
2324With the wide range of popular IaC tools and the constant demand to integrate
2425diverse resource types across multiple platforms, ** uniformity** is critical to
2526fully automating these integrations.\
26- The following guidance is to enable interfaces to be ** declarative-friendly**
27- and support ** automation** .
27+
28+ ::: warning [ Important]
29+
30+ In addition to the existing guidelines, ** declarative-friendly** interfaces
31+ require extra, stricter guidance to support IaC tooling automation.
32+
33+ :::
2834
2935## Guidance
3036
3137- A resource ** must** be strongly consistent with the ** Resource-Oriented
3238 Design** ([ IPA-101] ( 0101.md ) )
33- - An interface ** must** expose the full resource lifecycle using standard HTTP
34- verbs. The ` GET ` operation is critical for IaC tools to read the current
35- state and compare it against the desired state.
36- - A resource ** must** have ` CREATE ` , ` DELETE ` , ` GET ` , ` LIST ` and ` UPDATE `
37- methods, except for [ read-only resources] ( #read-only-resources ) which ** must**
38- have only ` GET ` and ` LIST ` methods.
39- - Response schemas of ` CREATE ` , ` GET ` and ` UPDATE ` ** must** be the same
40- - Fields defined in ` CREATE ` and ` UPDATE ` request schemas ** should be** the
41- same and ** should** be present in response schema
42- - For full guidance, see [ IPA-103] ( 0103.md ) , [ IPA-104] ( 0104.md ) ,
43- [ IPA-105] ( 0105.md ) , [ IPA-106] ( 0106.md ) , [ IPA-107] ( 0107.md ) ,
44- [ IPA-108] ( 0108.md )
45- - A resource ** must not** have custom methods ([ IPA-109] ( 0109.md ) ) as they make
46- some automations impossible. Any deviation from this guidance requires a
39+ - A resource ** must** have ` CREATE ` , ` DELETE ` , ` GET ` , ` LIST ` methods, except for
40+ [ singleton resources] ( 0113.md ) and
41+ [ read-only resources] ( 0101.md#read-only-resources ) which ** must** have ` GET `
42+ and ` LIST ` methods.
43+ - A resource ** should not** have custom methods ([ IPA-109] ( 0109.md ) ). Any
44+ complementary functionality of a resource exposed through custom methods will
45+ not be supported through automation. Deviation from this guidance requires a
4746 strong justification and review by the governing API body.
48- - A resource field ** must** have a single owner ([ IPA-111] ( 0111.md ) )
49- - Effective fields ** must** be used when a client-owned field can also be
50- controlled by the server
51- - A resource field name ** must** be consistent in between the request, response
52- body and path parameters ([ IPA-112] ( 0112.md ) )
53- - A resource ** must** have a standardized error format so that consumers can
54- fully rely on understandable API responses ([ IPA-114] ( 0114.md ) )
55- - A resource field ** should** have a single type ([ IPA-125] ( 0125.md ) )
56-
57- ### Read-Only Resources
58-
59- [ Read-only resources] ( 0101.md#read-only-resources ) are declarative-friendly when
60- they provide observable state that IaC tools need to reference or depend upon.
61-
62- For full guidance on read-only resources, see
63- [ IPA-101] ( 0101.md#read-only-resources ) . For read-only singleton resources, see
64- [ IPA-113] ( 0113.md#read-only-singleton-resources ) .
6547
6648### Motivation and Strategic Goals
6749
@@ -76,3 +58,15 @@ are predictably declarative, we can build automations that create and maintain
7658tools such as our Terraform and CloudFormation providers. This will dramatically
7759accelerate the availability of IaC support for our products and reduce manual,
7860error-prone development.
61+
62+ ### Further Reading
63+
64+ - [ IPA-101: Resource-Oriented Design] ( 0101.md )
65+ - [ IPA-104: Get] ( 0104.md )
66+ - [ IPA-105: List] ( 0105.md )
67+ - [ IPA-106: Create] ( 0106.md )
68+ - [ IPA-108: Delete] ( 0108.md )
69+ - [ IPA-109: Custom Methods] ( 0109.md )
70+ - [ IPA-111: Server-Modified Values and Defaults] ( 0111.md )
71+ - [ IPA-114: Errors] ( 0114.md )
72+ - [ IPA-125: Single Type in Request and Response] ( 0125.md )
0 commit comments