Skip to content

Commit 4ce58eb

Browse files
committed
Add route-options documentation
1 parent 65e2241 commit 4ce58eb

File tree

6 files changed

+66
-32
lines changed

6 files changed

+66
-32
lines changed

docs/v3/source/includes/api_resources/_routes.erb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
"protocol": "tcp"
3535
}
3636
],
37+
"options": {
38+
"lb_algo": "round-robin"
39+
},
3740
"metadata": {
3841
"labels": <%= metadata.fetch(:labels, {}).to_json(space: ' ', object_nl: ' ')%>,
3942
"annotations": <%= metadata.fetch(:annotations, {}).to_json(space: ' ', object_nl: ' ')%>
@@ -124,6 +127,9 @@
124127
"protocol": "http1"
125128
}
126129
],
130+
"options": {
131+
"lb_algo": "round-robin"
132+
},
127133
"metadata": {
128134
"labels": {},
129135
"annotations": {}
@@ -212,3 +218,9 @@
212218
"protocol": "http2"
213219
}
214220
<% end %>
221+
222+
<% content_for :route_options do %>
223+
{
224+
"lb_algo": "round-robin"
225+
}
226+
<% end %>

docs/v3/source/includes/resources/routes/_create.md.erb

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ curl "https://api.example.org/v3/routes" \
2121
"data": { "guid": "space-guid" }
2222
}
2323
},
24+
"options": {
25+
"lb_algo": "round-robin"
26+
}
2427
"metadata": {
2528
"labels": { "key": "value" },
2629
"annotations": { "note": "detailed information"}
@@ -44,20 +47,21 @@ Content-Type: application/json
4447

4548
#### Required parameters
4649

47-
| Name | Type | Description |
48-
| ----------------------------------------- | ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
49-
| **relationships.space** | [_to-one relationship_](#to-one-relationships) | A relationship to the space containing the route; routes can only be mapped to destinations in that space |
50-
| **relationships.domain** | [_to-one relationship_](#to-one-relationships) | A relationship to the domain of the route |
50+
| Name | Type | Description |
51+
|--------------------------|------------------------------------------------|-----------------------------------------------------------------------------------------------------------|
52+
| **relationships.space** | [_to-one relationship_](#to-one-relationships) | A relationship to the space containing the route; routes can only be mapped to destinations in that space |
53+
| **relationships.domain** | [_to-one relationship_](#to-one-relationships) | A relationship to the domain of the route |
5154

5255
#### Optional parameters
5356

54-
| Name | Type | Description |
55-
| ------------------------ | ----------------------------------- | --------------------------------- |
56-
| **host** | _string_ | The host component for the route; not compatible with routes specifying the `tcp` protocol |
57-
| **path** | _string_ | The path component for the route; should begin with a `/` and not compatible with routes specifying the `tcp` protocol |
58-
| **port** | _integer_ | The port the route will listen on; only compatible with routes leveraging a domain that supports the `tcp` protocol. For `tcp` domains, a port will be randomly assigned if not specified
59-
| **metadata.annotations** | [_annotation object_](#annotations) | Annotations applied to the route |
60-
| **metadata.labels** | [_label object_](#labels) | Labels applied to the route |
57+
| Name | Type | Description |
58+
|--------------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
59+
| **host** | _string_ | The host component for the route; not compatible with routes specifying the `tcp` protocol |
60+
| **path** | _string_ | The path component for the route; should begin with a `/` and not compatible with routes specifying the `tcp` protocol |
61+
| **port** | _integer_ | The port the route will listen on; only compatible with routes leveraging a domain that supports the `tcp` protocol. For `tcp` domains, a port will be randomly assigned if not specified |
62+
| **options** | [_route option object_](#the-route-options-object) | Options applied to the route |
63+
| **metadata.annotations** | [_annotation object_](#annotations) | Annotations applied to the route |
64+
| **metadata.labels** | [_label object_](#labels) | Labels applied to the route |
6165

6266
#### Permitted roles
6367

docs/v3/source/includes/resources/routes/_object.md.erb

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,20 @@ Example Route object
88
<%= yield_content :single_route %>
99
```
1010

11-
| Name | Type | Description
12-
| -------------- | ------------------------ | ------------------------------------------------------
13-
| **guid** | _uuid_ | Unique identifier for the route
14-
| **created_at** | _[timestamp](#timestamps)_ | The time with zone when the object was created
15-
| **updated_at** | _[timestamp](#timestamps)_ | The time with zone when the object was last updated
16-
| **protocol** | _string_ | The protocol supported by the route, based on the route's domain configuration. Valid protocols are `http` and `tcp`
17-
| **host** | _string_ | The hostname for the route; not compatible with routes specifying the `tcp` protocol;<br>must be either a wildcard (*) or be under 63 characters long and only contain letters, numbers, dashes (-) or underscores(_)
18-
| **path** | _string_ | The path for the route; not compatible with routes specifying the `tcp` protocol;<br>must be under 128 characters long and not contain question marks (?), begin with a slash (/) and not be exactly a slash (/). Must conform to path components from [RFC 2396](https://tools.ietf.org/html/rfc2396)
19-
| **port** | _integer or `null`_ | The port that the route listens on. Only compatible with routes specifying the `tcp` protocol
20-
| **url** | _string_ | The URL for the route; URLs of protocol `http` are a combination of host, domain name, and path; URLs of protocol `tcp` are a combination of domain name and port
21-
| **destinations** | array of [_destination objects_](#the-destination-object) | List of destinations for the route
22-
| **relationships.space** | [_to-one relationship_](#to-one-relationships) | A relationship to the space containing the route. Routes can only be mapped to destinations in that space
23-
| **relationships.domain** | [_to-one relationship_](#to-one-relationships) | A relationship to the domain of the route
24-
| **metadata.labels** | [_label object_](#labels) | Labels applied to the route
25-
| **metadata.annotations** | [_annotation object_](#annotations) | Annotations applied to the route
26-
| **links** | [_links object_](#links) | Links to related resources
11+
| Name | Type | Description |
12+
|--------------------------|-----------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
13+
| **guid** | _uuid_ | Unique identifier for the route |
14+
| **created_at** | _[timestamp](#timestamps)_ | The time with zone when the object was created |
15+
| **updated_at** | _[timestamp](#timestamps)_ | The time with zone when the object was last updated |
16+
| **protocol** | _string_ | The protocol supported by the route, based on the route's domain configuration. Valid protocols are `http` and `tcp` |
17+
| **host** | _string_ | The hostname for the route; not compatible with routes specifying the `tcp` protocol;<br>must be either a wildcard (*) or be under 63 characters long and only contain letters, numbers, dashes (-) or underscores(_) |
18+
| **path** | _string_ | The path for the route; not compatible with routes specifying the `tcp` protocol;<br>must be under 128 characters long and not contain question marks (?), begin with a slash (/) and not be exactly a slash (/). Must conform to path components from [RFC 2396](https://tools.ietf.org/html/rfc2396) |
19+
| **port** | _integer or `null`_ | The port that the route listens on. Only compatible with routes specifying the `tcp` protocol |
20+
| **url** | _string_ | The URL for the route; URLs of protocol `http` are a combination of host, domain name, and path; URLs of protocol `tcp` are a combination of domain name and port |
21+
| **destinations** | array of [_destination objects_](#the-destination-object) | List of destinations for the route |
22+
| **relationships.space** | [_to-one relationship_](#to-one-relationships) | A relationship to the space containing the route. Routes can only be mapped to destinations in that space |
23+
| **relationships.domain** | [_to-one relationship_](#to-one-relationships) | A relationship to the domain of the route |
24+
| **options** | [_route option object_](#the-route-options-object) | Options applied to the route |
25+
| **metadata.labels** | [_label object_](#labels) | Labels applied to the route |
26+
| **metadata.annotations** | [_annotation object_](#annotations) | Annotations applied to the route |
27+
| **links** | [_links object_](#links) | Links to related resources |
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
### The route options object
2+
3+
```
4+
Example Route-Options object
5+
```
6+
```json
7+
<%= yield_content :route_options %>
8+
```
9+
10+
| Name | Type | Description |
11+
|-------------|----------|----------------------------------------------------------------------------------------------------------|
12+
| **lb_algo** | _string_ | The load balancer associated with this route. Valid algorithms are 'round-robin' and 'least-connections' |

docs/v3/source/includes/resources/routes/_update.md.erb

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ curl "https://api.example.org/v3/routes/[guid]" \
1010
-H "Authorization: bearer [token]" \
1111
-H "Content-type: application/json" \
1212
-d '{
13+
"options": {
14+
"lb_algo": "round-robin"
15+
}
1316
"metadata": {
1417
"labels": {"key": "value"},
1518
"annotations": {"note": "detailed information"}
@@ -33,14 +36,15 @@ Content-Type: application/json
3336

3437
#### Optional parameters
3538

36-
| Name | Type | Description | Default |
37-
| ----------- | -------- | ------------------------------------------------------------------------ | ------- |
38-
| **metadata.labels** | [_label object_](#labels) | Labels applied to the route | |
39-
| **metadata.annotations** | [_annotation object_](#annotations) | Annotations applied to the route | |
39+
| Name | Type | Description | Default |
40+
|----------------------------|-----------------------------------------------------|----------------------------------|---------|
41+
| **options** | [_route option object_](#the-route-options-object) | Options applied to the route | |
42+
| **metadata.labels** | [_label object_](#labels) | Labels applied to the route | |
43+
| **metadata.annotations** | [_annotation object_](#annotations) | Annotations applied to the route | |
4044

4145
#### Permitted roles
4246

43-
|
47+
|
4448
----- |
4549
Admin |
4650
Space Developer |

docs/v3/source/index.html.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ includes:
243243
- resources/routes/header
244244
- resources/routes/object
245245
- resources/routes/destination_object
246+
- resources/routes/route_options_object
246247
- resources/routes/create
247248
- resources/routes/get
248249
- resources/routes/list

0 commit comments

Comments
 (0)