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: azure/ConsiderationsForServiceDesign.md
+16Lines changed: 16 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -119,6 +119,22 @@ As you build out your service and API, there are a number of decisions that can
119
119
120
120
:ballot_box_with_check:**YOU SHOULD** implement [conditional requests](https://tools.ietf.org/html/rfc7232) early. This allows you to support concurrency, which tends to be a concern later on.
121
121
122
+
## Action Operations
123
+
124
+
Most operations conform to one of the standard REST Create, Read, Update, Delete, or List (CRUDL) style of operations. We refer to all other operations as "action" operations. Some examples of action operations are to reboot a VM, or send an email.
125
+
126
+
It is good practice to define the path for action operations that is easily distinguished from any resource path of the service. When services allow user-specified resource ids (also a good practice), the recommended approach for this is:
127
+
1) constrain user-specified resource ids to allow only certain characters, such as alphanumeric and '-' or '_', and
128
+
2) use a special character not in the set of valid characters for resource names to distinguish the "action" in the path.
129
+
130
+
In Azure we recommend distinguishing action operations by appending a ':' followed by an action verb to the final path segment. E.g.
Copy file name to clipboardExpand all lines: azure/Guidelines.md
+9-10Lines changed: 9 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -203,7 +203,7 @@ Note: RFC 1123 defines the date format as a modification of the date format in [
203
203
204
204
:no_entry:**DO NOT** use "x-" prefix for custom headers, unless the header already exists in production [[RFC 6648](https://datatracker.ietf.org/doc/html/rfc6648)].
205
205
206
-
#### Additional References
206
+
**Additional References**
207
207
-[StackOverflow - Difference between http parameters and http headers](https://stackoverflow.com/questions/40492782)
-[Why isn't HTTP PUT allowed to do partial updates in a REST API?](https://stackoverflow.com/questions/19732423/why-isnt-http-put-allowed-to-do-partial-updates-in-a-rest-api)
@@ -425,23 +425,20 @@ Both Rectangle and Circle have common fields: `kind`, `fillColor`, `lineColor`,
425
425
## Common API Patterns
426
426
427
427
### Performing an Action
428
-
The REST specification is used to model the state of a resource, and is primarily intended to handle CRUD (Create, Read, Update, Delete) operations. However, many services require the ability to perform an action on a resource, e.g. getting the thumbnail of an image, sending an SMS message. It is also sometimes useful to perform an action on a collection.
428
+
The REST specification is used to model the state of a resource, and is primarily intended to handle CRUD (Create, Read, Update, Delete) operations. However, many services require the ability to perform an action on a resource, e.g. getting the thumbnail of an image or rebooting a VM. It is also sometimes useful to perform an action on a collection.
429
429
430
-
:white_check_mark:**DO** pattern your URL like this to perform an action on a resource
430
+
:ballot_box_with_check:**YOU SHOULD** pattern your URL like this to perform an action on a resource
@@ -460,8 +457,9 @@ Note: To avoid potential collision of actions and resource ids, you should disal
460
457
461
458
:white_check_mark:**DO** return a `200-OK` when the action completes synchronously and successfully.
462
459
463
-
:ballot_box_with_check:**YOU SHOULD** use a verb to name your action.
460
+
:ballot_box_with_check:**YOU SHOULD** use a verb as the `<action>` component of the path.
464
461
462
+
:no_entry:**DO NOT** use an action operation when the operation behavior could reasonably be defined as one of the standard REST Create, Read, Update, Delete, or List operations.
465
463
466
464
### Collections
467
465
:white_check_mark:**DO** structure the response to a list operation as an object with a top-level array field containing the set (or subset) of resources.
@@ -984,7 +982,8 @@ Client libraries are required to send telemetry and distributed tracing informat
984
982
:white_check_mark:**DO** follow the Azure SDK client guidelines for supporting telemetry headers and Open Telemetry.
985
983
986
984
:no_entry:**DO NOT** reject a call if you have custom headers you don't understand, and specifically, distributed tracing headers.
0 commit comments