# Preferred Route

## List

> Retrieve a list of preferred routes for the specified published resource.

```json
{"openapi":"3.0.1","info":{"title":"Parallels RAS - REST API v1.0","version":"1.0"},"paths":{"/api/PubItems/{id}/PreferredRoute":{"get":{"tags":["3-Publishing//Preferred Routes"],"summary":"List","description":"Retrieve a list of preferred routes for the specified published resource.","operationId":"2b1a3c83-cd06-4e78-878c-9e1a5bfd7723","parameters":[{"name":"id","in":"path","description":"ID of the published resource to be acquired.","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"Success","content":{"application/json; api-version=1.0":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PubPreferredRoute"}}}}},"401":{"description":"Unauthorized","content":{"application/json; api-version=1.0":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not Found","content":{"application/json; api-version=1.0":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}},"components":{"schemas":{"PubPreferredRoute":{"type":"object","properties":{"id":{"type":"integer","description":"<para type=\"description\">ID of the object.</para>","format":"int32"},"priority":{"type":"integer","description":"<para type=\"description\">Priority of the object.</para>","format":"int32"},"name":{"type":"string","description":"<para type=\"description\">The Name of the Publishing Route</para>","nullable":true},"description":{"type":"string","description":"<para type=\"description\">Description of the Publishing Route</para>","nullable":true},"enabled":{"type":"boolean","description":"<para type=\"description\">Whether the Publishing Route is enabled or not</para>"},"referenceType":{"$ref":"#/components/schemas/RoutingType"},"referenceId":{"type":"integer","description":"<para type=\"description\">Reference ID of the Publishing Route</para>","format":"int32"}},"additionalProperties":false,"description":"<para type=\"synopsis\">Publishing Preferred Route</para>\r\n<para type=\"description\"></para>"},"RoutingType":{"enum":[["3 = Gateway","51 = HALB","83 = Custom"]],"type":"string","description":"<para type=\"synopsis\">RAS Publishing Routing Type</para>\r\n<para type=\"description\"></para>","format":"int32"},"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}}}
```

{% openapi src="<https://content.gitbook.com/content/jyGAUPrA6XIdGAfHCnJE/blobs/7mKwtvutT7xlWtmCVnxB/swagger%201.json>" path="/api/PubItems/{id}/PreferredRoute" method="post" %}
[swagger 1.json](https://content.gitbook.com/content/jyGAUPrA6XIdGAfHCnJE/blobs/7mKwtvutT7xlWtmCVnxB/swagger%201.json)
{% endopenapi %}

## Update

> Update the specified preferred route for the specified published resource.

```json
{"openapi":"3.0.1","info":{"title":"Parallels RAS - REST API v1.0","version":"1.0"},"paths":{"/api/PubItems/{id}/PreferredRoute/{preferredRouteId}":{"put":{"tags":["3-Publishing//Preferred Routes"],"summary":"Update","description":"Update the specified preferred route for the specified published resource.","operationId":"351d4a4a-2d59-4044-a2c0-efdd88c90ca0","parameters":[{"name":"id","in":"path","description":"ID of the published resource to be updated","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"preferredRouteId","in":"path","description":"ID of the preferred route to be updated","required":true,"schema":{"type":"integer","format":"int32"}}],"requestBody":{"description":"Published item preferred route configuration","content":{"application/json; api-version=1.0":{"schema":{"$ref":"#/components/schemas/SetPubItemPreferredRoute"}}}},"responses":{"201":{"description":"Created"},"401":{"description":"Unauthorized","content":{"application/json; api-version=1.0":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not Found","content":{"application/json; api-version=1.0":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict","content":{"application/json; api-version=1.0":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}},"components":{"schemas":{"SetPubItemPreferredRoute":{"type":"object","properties":{"name":{"maxLength":255,"minLength":1,"type":"string","description":"<para type=\"description\">The Name of the Preferred Route</para>","nullable":true},"description":{"type":"string","description":"<para type=\"description\">Description of the Preferred Route</para>","nullable":true},"enabled":{"type":"boolean","description":"<para type=\"description\">Whether the Preferred Route is enabled or not</para>","nullable":true},"referenceType":{"$ref":"#/components/schemas/RoutingType"},"referenceId":{"type":"integer","description":"<para type=\"description\">Reference ID of the Preferred Route</para>","format":"int32","nullable":true},"priority":{"$ref":"#/components/schemas/MoveDirection"}},"additionalProperties":false},"RoutingType":{"enum":[["3 = Gateway","51 = HALB","83 = Custom"]],"type":"string","description":"<para type=\"synopsis\">RAS Publishing Routing Type</para>\r\n<para type=\"description\"></para>","format":"int32"},"MoveDirection":{"enum":[["0 = Up","1 = Down"]],"type":"string","description":"<para type=\"synopsis\">Move Direction.</para>\r\n<para type=\"description\"></para>\r\n<para type=\"description\"></para>","format":"int32"},"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}}}
```

## Delete

> Delete a preferred route from the specified published resource.

```json
{"openapi":"3.0.1","info":{"title":"Parallels RAS - REST API v1.0","version":"1.0"},"paths":{"/api/PubItems/{id}/PreferredRoute/{preferredRouteId}":{"delete":{"tags":["3-Publishing//Preferred Routes"],"summary":"Delete","description":"Delete a preferred route from the specified published resource.","operationId":"bb0ea73f-f6fc-4c8d-8444-dc5d06fbcd14","parameters":[{"name":"id","in":"path","description":"ID of the published resource to be updated","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"preferredRouteId","in":"path","description":"ID of the preferred route to be deleted","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"204":{"description":"No Content"},"401":{"description":"Unauthorized","content":{"application/json; api-version=1.0":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not Found","content":{"application/json; api-version=1.0":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}},"components":{"schemas":{"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}}}
```
