Skip to content

Commit

Permalink
edit doc entries for sharing routes with spaces
Browse files Browse the repository at this point in the history
Co-authored-by: Merric de Launey <[email protected]>
Co-authored-by: David Alvarado <[email protected]>
  • Loading branch information
MerricdeLauney and dalvarado committed May 31, 2022
1 parent f631935 commit 0ee2a98
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 121 deletions.
121 changes: 0 additions & 121 deletions docs/v3/source/includes/experimental_resources/_share_routes.md.erb

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
### Lists shared spaces relationship (experimental)

Lists the spaces that the route has been shared to.

```
Example Request
```

```shell
curl "https://api.example.org/v3/routes/[guid]/relationships/shared_spaces" \
-H "Authorization: bearer [token]" \
-H "Content-type: application/json"
```

```http
HTTP/1.1 200 OK
Content-Type: application/json

{
"data": [
{ "guid": "space-one-guid" },
{ "guid": "space-two-guid" }
],
"links": {
"self": {
"href":"http://api.example.com/v3/routes/[guid]/relationships/shared_spaces"
}
}
}
```

#### Definition
`GET /v3/routes/:guid/relationships/shared_spaces`

#### Permitted roles

|
--- |
Admin |
Admin Read-Only |
Global Auditor |
Org Auditor |
Org Manager |
Space Auditor |
Space Developer |
Space Manager |
Space Supporter |
55 changes: 55 additions & 0 deletions docs/v3/source/includes/resources/routes/_share_routes.md.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
### Share a route with other spaces (experimental)

This endpoint shares the route with the specified spaces. In order to share into a space the requesting user must have write permission in the target space.

```
Example Request
```

```shell
curl "https://api.example.org/v3/routes/[guid]/relationships/shared_spaces" \
-X POST \
-H "Authorization: bearer [token]" \
-H "Content-type: application/json" \
-d '{
"data": [
{ "guid": "space-one-guid" },
{ "guid": "space-two-guid" }
]
}'
```

```http
HTTP/1.1 200 OK
Content-Type: application/json

{
"data": [
{ "guid": "space-one-guid" },
{ "guid": "space-two-guid" }
],
"links": {
"self": {
"href":"http://api.example.com/v3/routes/[guid]/relationships/shared_spaces"
}
}
}
```

#### Definition
`POST /v3/routes/:guid/relationships/shared_spaces`

#### Required parameters

Name | Type | Description
---- | ---- | -----------
**data** | [_to-many relationship_](#to-many-relationships) | Shared space relationships; each space will have this route shared to it

#### Permitted roles

|
--- |
Admin |
Space Developer |
Space Supporter |

31 changes: 31 additions & 0 deletions docs/v3/source/includes/resources/routes/_unshare_routes.md.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
### Unshare a route that was shared with another space (experimental)

Unshares a route that was shared with another space.

```
Example Request
```

```shell
curl "https://api.example.org/v3/routes/:guid/relationships/shared_spaces/[space_guid]" \
-X DELETE \
-H "Authorization: bearer [token]" \
-H "Content-type: application/json"
```

```http
HTTP/1.1 204 No Content
```

#### Definition
`DELETE /v3/routes/:guid/relationships/shared_spaces/:space_guid`

#### Permitted roles

|
--- |
Admin |
Space Developer |
Space Supporter |


3 changes: 3 additions & 0 deletions docs/v3/source/index.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,9 @@ includes:
- resources/routes/update
- resources/routes/delete
- resources/routes/check_route_reservations
- resources/routes/list_shared_routes
- resources/routes/share_routes
- resources/routes/unshare_routes
- resources/routes/list_destinations
- resources/routes/insert_destinations
- resources/routes/replace_destinations
Expand Down

0 comments on commit 0ee2a98

Please sign in to comment.