File tree Expand file tree Collapse file tree 1 file changed +44
-1
lines changed Expand file tree Collapse file tree 1 file changed +44
-1
lines changed Original file line number Diff line number Diff line change @@ -606,7 +606,50 @@ prevent the automatic encoding behavior.
606
606
```
607
607
608
608
## Enable Asynchronous Operations with x-ms-long-running-operation<a name="longrunning"></a>
609
- >TODO: x-ms-long-running-operation
609
+ Some requests like creating/deleting a resource cannot be carried out immediately. In such a situation, the server
610
+ sends a 201 (Created) or 202 (Accepted) and provides a link to monitor the status of the request. When such an operation
611
+ is marked with extension `"x-ms-long-running-operation": true,` in Swagger, the generated code will know how to fetch
612
+ the link to monitor the status. It will keep on polling at regular intervals till the request reaches one of the
613
+ terminal states`Succeeded|Failed|Canceled`.
614
+ ```json
615
+ "paths" : {
616
+ "/products/{name}" : {
617
+ "put" : {
618
+ "operationId" : " products_create" ,
619
+ "x-ms-long-running-operation" : true ,
620
+ "description" : " A pageable list of Products." ,
621
+ "parameters" : [
622
+ {
623
+ "name" : " name" ,
624
+ "in" : " path" ,
625
+ "required" : true ,
626
+ "type" : " string" ,
627
+ "description" : " The name of the Product."
628
+ },
629
+ {
630
+ "name" : " parameters" ,
631
+ "in" : " body" ,
632
+ "required" : true ,
633
+ "schema" : {
634
+ "$ref" : " #/definitions/ProductCreateParameters"
635
+ },
636
+ "description" : " The parameters to provide for the created product."
637
+ }
638
+ ],
639
+ "responses" : {
640
+ "200" : {
641
+ "schema" : {
642
+ "$ref" : " #/definitions/Product"
643
+ }
644
+ },
645
+ "202" : {
646
+ "description" : " "
647
+ }
648
+ }
649
+ }
650
+ }
651
+ }
652
+ ```
610
653
611
654
##Global parameters<a name="globalParam"></a>
612
655
Swagger allows for parameters to be defined separately from the operation where they are used. By convention, AutoRest
You can’t perform that action at this time.
0 commit comments