cf-copilot 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cf-copilot.rb +23 -6
- data/lib/copilot/protos/cloud_controller_pb.rb +46 -8
- data/lib/copilot/protos/cloud_controller_services_pb.rb +5 -0
- data/lib/copilot/version.rb +1 -1
- metadata +3 -5
- data/lib/copilot/protos/cloud_controller_future_pb.rb +0 -83
- data/lib/copilot/protos/cloud_controller_future_services_pb.rb +0 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e3212c64c7f0e49e907a2ca20cf80460c2cfd42
|
4
|
+
data.tar.gz: 160b2fb27ce5bd82499cd940798a19f770204187
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b449d9a7aa23506717c1af15909ab4b176394ff28be6404e3b0493b33531bcdfbc8fd67f8953801b848946029864c3651450453db80c8ba6d4784afff19ed2b8
|
7
|
+
data.tar.gz: 6b32c2525aade91c22c6677b0cd5093f0aeb8304350ebf1769b6b85db391d9517ba112dab95f64e644ef63dbf0e556875f3a04a783bf752e6a37bca58e46ab4f
|
data/lib/cf-copilot.rb
CHANGED
@@ -35,22 +35,39 @@ module Cloudfoundry
|
|
35
35
|
service.delete_route(request)
|
36
36
|
end
|
37
37
|
|
38
|
-
def map_route(capi_process_guid:,
|
39
|
-
|
40
|
-
route_mapping = Api::RouteMapping.new(capi_process: capi_process, route_guid: route_guid)
|
38
|
+
def map_route(capi_process_guid:, route_guid:)
|
39
|
+
route_mapping = Api::RouteMapping.new(capi_process_guid: capi_process_guid, route_guid: route_guid)
|
41
40
|
request = Api::MapRouteRequest.new(route_mapping: route_mapping)
|
42
41
|
service.map_route(request)
|
43
42
|
end
|
44
43
|
|
45
44
|
def unmap_route(capi_process_guid:, route_guid:)
|
46
|
-
|
45
|
+
route_mapping = Api::RouteMapping.new(capi_process_guid: capi_process_guid, route_guid: route_guid)
|
46
|
+
request = Api::UnmapRouteRequest.new(route_mapping: route_mapping)
|
47
47
|
service.unmap_route(request)
|
48
48
|
end
|
49
49
|
|
50
|
+
def upsert_capi_diego_process_association(capi_process_guid:, diego_process_guids:)
|
51
|
+
request = Api::UpsertCapiDiegoProcessAssociationRequest.new(
|
52
|
+
capi_diego_process_association: {
|
53
|
+
capi_process_guid: capi_process_guid,
|
54
|
+
diego_process_guids: diego_process_guids
|
55
|
+
})
|
56
|
+
|
57
|
+
service.upsert_capi_diego_process_association(request)
|
58
|
+
end
|
59
|
+
|
60
|
+
def delete_capi_diego_process_association(capi_process_guid:)
|
61
|
+
request = Api::DeleteCapiDiegoProcessAssociationRequest.new(
|
62
|
+
capi_process_guid: capi_process_guid
|
63
|
+
)
|
64
|
+
service.delete_capi_diego_process_association(request)
|
65
|
+
end
|
66
|
+
|
50
67
|
# untested - this will change a lot and no one is using it yet
|
51
68
|
def bulk_sync(routes:, route_mappings:)
|
52
|
-
routes.map! {
|
53
|
-
route_mappings.map! {
|
69
|
+
routes.map! {|route| Api::UpsertRouteRequest.new(route: route)}
|
70
|
+
route_mappings.map! {|mapping| Api::MapRouteRequest.new(route_mapping: mapping)}
|
54
71
|
|
55
72
|
request = Api::BulkSyncRequest.new(routes: routes, route_mappings: route_mappings)
|
56
73
|
service.bulk_sync(request)
|
@@ -5,6 +5,24 @@ require 'google/protobuf'
|
|
5
5
|
|
6
6
|
require 'common_pb'
|
7
7
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
8
|
+
add_message "api.ListCfRoutesRequest" do
|
9
|
+
end
|
10
|
+
add_message "api.ListCfRoutesResponse" do
|
11
|
+
map :routes, :string, :string, 1
|
12
|
+
end
|
13
|
+
add_message "api.ListCfRouteMappingsRequest" do
|
14
|
+
end
|
15
|
+
add_message "api.ListCfRouteMappingsResponse" do
|
16
|
+
map :route_mappings, :string, :message, 1, "api.RouteMapping"
|
17
|
+
end
|
18
|
+
add_message "api.ListCapiDiegoProcessAssociationsRequest" do
|
19
|
+
end
|
20
|
+
add_message "api.DiegoProcessGuids" do
|
21
|
+
repeated :diego_process_guids, :string, 1
|
22
|
+
end
|
23
|
+
add_message "api.ListCapiDiegoProcessAssociationsResponse" do
|
24
|
+
map :capi_diego_process_associations, :string, :message, 1, "api.DiegoProcessGuids"
|
25
|
+
end
|
8
26
|
add_message "api.Route" do
|
9
27
|
optional :guid, :string, 1
|
10
28
|
optional :host, :string, 2
|
@@ -19,12 +37,8 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
19
37
|
end
|
20
38
|
add_message "api.DeleteRouteResponse" do
|
21
39
|
end
|
22
|
-
add_message "api.CapiProcess" do
|
23
|
-
optional :guid, :string, 1
|
24
|
-
optional :diego_process_guid, :string, 2
|
25
|
-
end
|
26
40
|
add_message "api.RouteMapping" do
|
27
|
-
optional :
|
41
|
+
optional :capi_process_guid, :string, 1
|
28
42
|
optional :route_guid, :string, 2
|
29
43
|
end
|
30
44
|
add_message "api.MapRouteRequest" do
|
@@ -33,23 +47,47 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
33
47
|
add_message "api.MapRouteResponse" do
|
34
48
|
end
|
35
49
|
add_message "api.UnmapRouteRequest" do
|
36
|
-
optional :
|
37
|
-
optional :route_guid, :string, 2
|
50
|
+
optional :route_mapping, :message, 1, "api.RouteMapping"
|
38
51
|
end
|
39
52
|
add_message "api.UnmapRouteResponse" do
|
40
53
|
end
|
54
|
+
add_message "api.CapiDiegoProcessAssociation" do
|
55
|
+
optional :capi_process_guid, :string, 1
|
56
|
+
repeated :diego_process_guids, :string, 2
|
57
|
+
end
|
58
|
+
add_message "api.UpsertCapiDiegoProcessAssociationRequest" do
|
59
|
+
optional :capi_diego_process_association, :message, 1, "api.CapiDiegoProcessAssociation"
|
60
|
+
end
|
61
|
+
add_message "api.UpsertCapiDiegoProcessAssociationResponse" do
|
62
|
+
end
|
63
|
+
add_message "api.DeleteCapiDiegoProcessAssociationRequest" do
|
64
|
+
optional :capi_process_guid, :string, 1
|
65
|
+
end
|
66
|
+
add_message "api.DeleteCapiDiegoProcessAssociationResponse" do
|
67
|
+
end
|
41
68
|
end
|
42
69
|
|
43
70
|
module Api
|
71
|
+
ListCfRoutesRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("api.ListCfRoutesRequest").msgclass
|
72
|
+
ListCfRoutesResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("api.ListCfRoutesResponse").msgclass
|
73
|
+
ListCfRouteMappingsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("api.ListCfRouteMappingsRequest").msgclass
|
74
|
+
ListCfRouteMappingsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("api.ListCfRouteMappingsResponse").msgclass
|
75
|
+
ListCapiDiegoProcessAssociationsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("api.ListCapiDiegoProcessAssociationsRequest").msgclass
|
76
|
+
DiegoProcessGuids = Google::Protobuf::DescriptorPool.generated_pool.lookup("api.DiegoProcessGuids").msgclass
|
77
|
+
ListCapiDiegoProcessAssociationsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("api.ListCapiDiegoProcessAssociationsResponse").msgclass
|
44
78
|
Route = Google::Protobuf::DescriptorPool.generated_pool.lookup("api.Route").msgclass
|
45
79
|
UpsertRouteRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("api.UpsertRouteRequest").msgclass
|
46
80
|
UpsertRouteResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("api.UpsertRouteResponse").msgclass
|
47
81
|
DeleteRouteRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("api.DeleteRouteRequest").msgclass
|
48
82
|
DeleteRouteResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("api.DeleteRouteResponse").msgclass
|
49
|
-
CapiProcess = Google::Protobuf::DescriptorPool.generated_pool.lookup("api.CapiProcess").msgclass
|
50
83
|
RouteMapping = Google::Protobuf::DescriptorPool.generated_pool.lookup("api.RouteMapping").msgclass
|
51
84
|
MapRouteRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("api.MapRouteRequest").msgclass
|
52
85
|
MapRouteResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("api.MapRouteResponse").msgclass
|
53
86
|
UnmapRouteRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("api.UnmapRouteRequest").msgclass
|
54
87
|
UnmapRouteResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("api.UnmapRouteResponse").msgclass
|
88
|
+
CapiDiegoProcessAssociation = Google::Protobuf::DescriptorPool.generated_pool.lookup("api.CapiDiegoProcessAssociation").msgclass
|
89
|
+
UpsertCapiDiegoProcessAssociationRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("api.UpsertCapiDiegoProcessAssociationRequest").msgclass
|
90
|
+
UpsertCapiDiegoProcessAssociationResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("api.UpsertCapiDiegoProcessAssociationResponse").msgclass
|
91
|
+
DeleteCapiDiegoProcessAssociationRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("api.DeleteCapiDiegoProcessAssociationRequest").msgclass
|
92
|
+
DeleteCapiDiegoProcessAssociationResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("api.DeleteCapiDiegoProcessAssociationResponse").msgclass
|
55
93
|
end
|
@@ -14,10 +14,15 @@ module Api
|
|
14
14
|
self.unmarshal_class_method = :decode
|
15
15
|
self.service_name = 'api.CloudControllerCopilot'
|
16
16
|
|
17
|
+
rpc :ListCfRoutes, ListCfRoutesRequest, ListCfRoutesResponse
|
18
|
+
rpc :ListCfRouteMappings, ListCfRouteMappingsRequest, ListCfRouteMappingsResponse
|
19
|
+
rpc :ListCapiDiegoProcessAssociations, ListCapiDiegoProcessAssociationsRequest, ListCapiDiegoProcessAssociationsResponse
|
17
20
|
rpc :UpsertRoute, UpsertRouteRequest, UpsertRouteResponse
|
18
21
|
rpc :DeleteRoute, DeleteRouteRequest, DeleteRouteResponse
|
19
22
|
rpc :MapRoute, MapRouteRequest, MapRouteResponse
|
20
23
|
rpc :UnmapRoute, UnmapRouteRequest, UnmapRouteResponse
|
24
|
+
rpc :UpsertCapiDiegoProcessAssociation, UpsertCapiDiegoProcessAssociationRequest, UpsertCapiDiegoProcessAssociationResponse
|
25
|
+
rpc :DeleteCapiDiegoProcessAssociation, DeleteCapiDiegoProcessAssociationRequest, DeleteCapiDiegoProcessAssociationResponse
|
21
26
|
rpc :Health, HealthRequest, HealthResponse
|
22
27
|
end
|
23
28
|
|
data/lib/copilot/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cf-copilot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cloud Foundry Routing Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: grpc
|
@@ -77,8 +77,6 @@ files:
|
|
77
77
|
- NOTICE
|
78
78
|
- README.md
|
79
79
|
- lib/cf-copilot.rb
|
80
|
-
- lib/copilot/protos/cloud_controller_future_pb.rb
|
81
|
-
- lib/copilot/protos/cloud_controller_future_services_pb.rb
|
82
80
|
- lib/copilot/protos/cloud_controller_pb.rb
|
83
81
|
- lib/copilot/protos/cloud_controller_services_pb.rb
|
84
82
|
- lib/copilot/protos/common_pb.rb
|
@@ -104,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
104
102
|
version: '0'
|
105
103
|
requirements: []
|
106
104
|
rubyforge_project:
|
107
|
-
rubygems_version: 2.
|
105
|
+
rubygems_version: 2.6.13
|
108
106
|
signing_key:
|
109
107
|
specification_version: 4
|
110
108
|
summary: Ruby client for copilot (a CF istio data transformer).
|
@@ -1,83 +0,0 @@
|
|
1
|
-
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
-
# source: cloud_controller_future.proto
|
3
|
-
|
4
|
-
require 'google/protobuf'
|
5
|
-
|
6
|
-
Google::Protobuf::DescriptorPool.generated_pool.build do
|
7
|
-
add_message "cloudfoundry.copilot.protos.Route" do
|
8
|
-
optional :guid, :string, 1
|
9
|
-
optional :host, :string, 2
|
10
|
-
optional :path, :string, 3
|
11
|
-
end
|
12
|
-
add_message "cloudfoundry.copilot.protos.UpsertRouteRequest" do
|
13
|
-
optional :route, :message, 1, "cloudfoundry.copilot.protos.Route"
|
14
|
-
end
|
15
|
-
add_message "cloudfoundry.copilot.protos.UpsertRouteResponse" do
|
16
|
-
end
|
17
|
-
add_message "cloudfoundry.copilot.protos.DeleteRouteRequest" do
|
18
|
-
optional :guid, :string, 1
|
19
|
-
end
|
20
|
-
add_message "cloudfoundry.copilot.protos.DeleteRouteResponse" do
|
21
|
-
end
|
22
|
-
add_message "cloudfoundry.copilot.protos.CapiProcess" do
|
23
|
-
optional :guid, :string, 1
|
24
|
-
optional :diego_process_guid, :string, 2
|
25
|
-
optional :app_guid, :string, 3
|
26
|
-
end
|
27
|
-
add_message "cloudfoundry.copilot.protos.UpsertCapiProcessRequest" do
|
28
|
-
optional :capi_process, :message, 1, "cloudfoundry.copilot.protos.CapiProcess"
|
29
|
-
end
|
30
|
-
add_message "cloudfoundry.copilot.protos.UpsertCapiProcessResponse" do
|
31
|
-
end
|
32
|
-
add_message "cloudfoundry.copilot.protos.DeleteCapiProcessRequest" do
|
33
|
-
optional :guid, :string, 1
|
34
|
-
end
|
35
|
-
add_message "cloudfoundry.copilot.protos.DeleteCapiProcessResponse" do
|
36
|
-
end
|
37
|
-
add_message "cloudfoundry.copilot.protos.RouteMapping" do
|
38
|
-
optional :capi_process_guid, :string, 1
|
39
|
-
optional :route_guid, :string, 2
|
40
|
-
end
|
41
|
-
add_message "cloudfoundry.copilot.protos.MapRouteRequest" do
|
42
|
-
optional :route_mapping, :message, 1, "cloudfoundry.copilot.protos.RouteMapping"
|
43
|
-
end
|
44
|
-
add_message "cloudfoundry.copilot.protos.MapRouteResponse" do
|
45
|
-
end
|
46
|
-
add_message "cloudfoundry.copilot.protos.UnmapRouteRequest" do
|
47
|
-
optional :capi_process_guid, :string, 1
|
48
|
-
optional :route_guid, :string, 2
|
49
|
-
end
|
50
|
-
add_message "cloudfoundry.copilot.protos.UnmapRouteResponse" do
|
51
|
-
end
|
52
|
-
add_message "cloudfoundry.copilot.protos.BulkSyncRequest" do
|
53
|
-
repeated :routes, :message, 1, "cloudfoundry.copilot.protos.Route"
|
54
|
-
repeated :processes, :message, 2, "cloudfoundry.copilot.protos.CapiProcess"
|
55
|
-
repeated :route_mappings, :message, 3, "cloudfoundry.copilot.protos.RouteMapping"
|
56
|
-
end
|
57
|
-
add_message "cloudfoundry.copilot.protos.BulkSyncResponse" do
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
module Cloudfoundry
|
62
|
-
module Copilot
|
63
|
-
module Protos
|
64
|
-
Route = Google::Protobuf::DescriptorPool.generated_pool.lookup("cloudfoundry.copilot.protos.Route").msgclass
|
65
|
-
UpsertRouteRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("cloudfoundry.copilot.protos.UpsertRouteRequest").msgclass
|
66
|
-
UpsertRouteResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("cloudfoundry.copilot.protos.UpsertRouteResponse").msgclass
|
67
|
-
DeleteRouteRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("cloudfoundry.copilot.protos.DeleteRouteRequest").msgclass
|
68
|
-
DeleteRouteResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("cloudfoundry.copilot.protos.DeleteRouteResponse").msgclass
|
69
|
-
CapiProcess = Google::Protobuf::DescriptorPool.generated_pool.lookup("cloudfoundry.copilot.protos.CapiProcess").msgclass
|
70
|
-
UpsertCapiProcessRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("cloudfoundry.copilot.protos.UpsertCapiProcessRequest").msgclass
|
71
|
-
UpsertCapiProcessResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("cloudfoundry.copilot.protos.UpsertCapiProcessResponse").msgclass
|
72
|
-
DeleteCapiProcessRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("cloudfoundry.copilot.protos.DeleteCapiProcessRequest").msgclass
|
73
|
-
DeleteCapiProcessResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("cloudfoundry.copilot.protos.DeleteCapiProcessResponse").msgclass
|
74
|
-
RouteMapping = Google::Protobuf::DescriptorPool.generated_pool.lookup("cloudfoundry.copilot.protos.RouteMapping").msgclass
|
75
|
-
MapRouteRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("cloudfoundry.copilot.protos.MapRouteRequest").msgclass
|
76
|
-
MapRouteResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("cloudfoundry.copilot.protos.MapRouteResponse").msgclass
|
77
|
-
UnmapRouteRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("cloudfoundry.copilot.protos.UnmapRouteRequest").msgclass
|
78
|
-
UnmapRouteResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("cloudfoundry.copilot.protos.UnmapRouteResponse").msgclass
|
79
|
-
BulkSyncRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("cloudfoundry.copilot.protos.BulkSyncRequest").msgclass
|
80
|
-
BulkSyncResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("cloudfoundry.copilot.protos.BulkSyncResponse").msgclass
|
81
|
-
end
|
82
|
-
end
|
83
|
-
end
|
@@ -1,32 +0,0 @@
|
|
1
|
-
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
-
# Source: cloud_controller_future.proto for package 'cloudfoundry.copilot.protos'
|
3
|
-
|
4
|
-
require 'grpc'
|
5
|
-
require 'cloud_controller_future_pb'
|
6
|
-
|
7
|
-
module Cloudfoundry
|
8
|
-
module Copilot
|
9
|
-
module Protos
|
10
|
-
module CloudControllerCopilotFuture
|
11
|
-
class Service
|
12
|
-
|
13
|
-
include GRPC::GenericService
|
14
|
-
|
15
|
-
self.marshal_class_method = :encode
|
16
|
-
self.unmarshal_class_method = :decode
|
17
|
-
self.service_name = 'cloudfoundry.copilot.protos.CloudControllerCopilotFuture'
|
18
|
-
|
19
|
-
rpc :UpsertRoute, UpsertRouteRequest, UpsertRouteResponse
|
20
|
-
rpc :DeleteRoute, DeleteRouteRequest, DeleteRouteResponse
|
21
|
-
rpc :UpsertCapiProcess, UpsertCapiProcessRequest, UpsertCapiProcessResponse
|
22
|
-
rpc :DeleteCapiProcess, DeleteCapiProcessRequest, DeleteCapiProcessResponse
|
23
|
-
rpc :MapRoute, MapRouteRequest, MapRouteResponse
|
24
|
-
rpc :UnmapRoute, UnmapRouteRequest, UnmapRouteResponse
|
25
|
-
rpc :BulkSync, BulkSyncRequest, BulkSyncResponse
|
26
|
-
end
|
27
|
-
|
28
|
-
Stub = Service.rpc_stub_class
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|