Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/presenters/v3/route_destination_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ def destination_hash
},
weight: destination.weight,
port: destination.presented_port,
protocol: destination.protocol
protocol: destination.protocol,
created_at: destination.created_at,
updated_at: destination.updated_at
}
end

Expand Down
28 changes: 21 additions & 7 deletions docs/v3/source/includes/api_resources/_routes.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
},
"weight": null,
"port": 8080,
"protocol": "tcp"
"protocol": "tcp",
"created_at": "2019-05-10T17:17:48Z",
"updated_at": "2019-05-10T17:17:48Z"
},
{
"guid": "27e96a3b-5bcf-49ed-8048-351e0be23e6f",
Expand All @@ -31,7 +33,9 @@
},
"weight": null,
"port": 8080,
"protocol": "tcp"
"protocol": "tcp",
"created_at": "2019-05-10T17:17:48Z",
"updated_at": "2019-05-10T17:17:48Z"
}
],
"options": {
Expand Down Expand Up @@ -112,7 +116,9 @@
},
"weight": null,
"port": 8080,
"protocol": "http1"
"protocol": "http1",
"created_at": "2019-05-10T17:17:48Z",
"updated_at": "2019-05-10T17:17:48Z"
},
{
"guid": "27e96a3b-5bcf-49ed-8048-351e0be23e6f",
Expand All @@ -124,7 +130,9 @@
},
"weight": null,
"port": 8080,
"protocol": "http1"
"protocol": "http1",
"created_at": "2019-05-10T17:17:48Z",
"updated_at": "2019-05-10T17:17:48Z"
}
],
"options": {
Expand Down Expand Up @@ -178,7 +186,9 @@
},
"weight": null,
"port": 8080,
"protocol": "http2"
"protocol": "http2",
"created_at": "2019-05-10T17:17:48Z",
"updated_at": "2019-05-10T17:17:48Z"
},
{
"guid": "fbef10a2-8ee7-11e9-aa2d-abeeaf7b83c5",
Expand All @@ -190,7 +200,9 @@
},
"weight": null,
"port": 9000,
"protocol": "http1"
"protocol": "http1",
"created_at": "2019-05-10T17:17:48Z",
"updated_at": "2019-05-10T17:17:48Z"
}
],
"links": {
Expand All @@ -215,7 +227,9 @@
},
"weight": null,
"port": 8080,
"protocol": "http2"
"protocol": "http2",
"created_at": "2019-05-10T17:17:48Z",
"updated_at": "2019-05-10T17:17:48Z"
}
<% end %>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ If a destination does not specify a port, the default port depends on the app li
| **port** | _integer_ | Port on the destination process to route traffic to
| **weight** (*deprecated*) | _integer_ or `null` | Percentage of traffic which will be routed to this destination. _**DEPRECATED:** this feature was only available via the experimental Service Mesh routing plane. It is no longer supported._ |
| **protocol** | _string_ or `null` | Protocol to use for this destination. Valid protocols are `http1` or `http2` if route protocol is `http`, `tcp` if route protocol is `tcp`. A `null` value will set it either `http1` or `tcp` based on the route protocol; _this feature is only available if you turn it on in routing release_ |
| **created_at** | _[timestamp](#timestamps)_| The time with zone when the object was created |
| **updated_at** | _[timestamp](#timestamps)_| The time with zone when the object was last updated |
16 changes: 12 additions & 4 deletions spec/request/route_destinations_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@
},
weight: nil,
port: 8080,
protocol: 'http1'
protocol: 'http1',
created_at: destination.created_at.iso8601,
updated_at: destination.updated_at.iso8601
}
],
links: {
Expand Down Expand Up @@ -268,7 +270,9 @@
},
weight: nil,
port: 8080,
protocol: 'http1'
protocol: 'http1',
created_at: existing_destination.created_at.iso8601,
updated_at: existing_destination.updated_at.iso8601
},
{
guid: UUID_REGEX,
Expand All @@ -280,7 +284,9 @@
},
weight: nil,
port: 8080,
protocol: 'http2'
protocol: 'http2',
created_at: iso8601,
updated_at: iso8601
}
],
links: {
Expand Down Expand Up @@ -791,7 +797,9 @@
},
weight: nil,
port: 8080,
protocol: 'http2'
protocol: 'http2',
created_at: iso8601,
updated_at: iso8601
}
],
links: {
Expand Down
16 changes: 12 additions & 4 deletions spec/request/routes_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@
},
weight: route_in_org_dest_web.weight,
port: route_in_org_dest_web.presented_port,
protocol: 'http1'
protocol: 'http1',
created_at: iso8601,
updated_at: iso8601
}, {
guid: route_in_org_dest_worker.guid,
app: {
Expand All @@ -75,7 +77,9 @@
},
weight: route_in_org_dest_worker.weight,
port: route_in_org_dest_worker.presented_port,
protocol: 'http1'
protocol: 'http1',
created_at: iso8601,
updated_at: iso8601
}),
relationships: {
space: {
Expand Down Expand Up @@ -3607,7 +3611,9 @@
},
weight: route_mapping1.weight,
port: route_mapping1.presented_port,
protocol: 'http1'
protocol: 'http1',
created_at: iso8601,
updated_at: iso8601
}),
relationships: {
space: {
Expand Down Expand Up @@ -3651,7 +3657,9 @@
},
weight: route_mapping2.weight,
port: route_mapping2.presented_port,
protocol: 'http1'
protocol: 'http1',
created_at: iso8601,
updated_at: iso8601
}),
relationships: {
space: {
Expand Down
11 changes: 8 additions & 3 deletions spec/unit/presenters/v3/route_destination_presenter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ module VCAP::CloudController::Presenters::V3
app_port: 1234,
route: route,
process_type: 'web',
weight: 55
weight: 55,
created_at: Time.at(1)
)
end

Expand All @@ -37,7 +38,9 @@ module VCAP::CloudController::Presenters::V3
route: {
href: "http://api2.vcap.me/v3/routes/#{route.guid}"
}
}
},
created_at: Time.at(1),
updated_at: route_mapping.updated_at
)
end
end
Expand All @@ -54,7 +57,9 @@ module VCAP::CloudController::Presenters::V3
},
weight: route_mapping.weight,
port: route_mapping.presented_port,
protocol: route_mapping.protocol
protocol: route_mapping.protocol,
created_at: Time.at(1),
updated_at: route_mapping.updated_at
)
end
end
Expand Down
8 changes: 6 additions & 2 deletions spec/unit/presenters/v3/route_presenter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ module VCAP::CloudController::Presenters::V3
},
weight: destination.weight,
port: destination.presented_port,
protocol: destination.protocol
protocol: destination.protocol,
created_at: destination.created_at,
updated_at: destination.updated_at
},
{
guid: destination2.guid,
Expand All @@ -98,7 +100,9 @@ module VCAP::CloudController::Presenters::V3
},
weight: destination2.weight,
port: destination2.presented_port,
protocol: destination2.protocol
protocol: destination2.protocol,
created_at: destination.created_at,
updated_at: destination.updated_at
}
]
expect(subject[:destinations]).to match_array(expected_destinations)
Expand Down