cf-copilot 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +17 -19
- data/bin/{build_and_install_copilot_gem → build-and-install-copilot-gem} +0 -0
- data/bin/dockerized-rebuild-proto +6 -0
- data/bin/{generate_protos → generate-protos} +3 -3
- data/bin/push-gem +6 -0
- data/lib/cf-copilot.rb +4 -3
- data/lib/copilot/protos/cloud_controller_pb.rb +1 -0
- data/lib/copilot/protos/common_pb.rb +4 -4
- data/lib/copilot/version.rb +1 -1
- metadata +19 -18
- data/bin/build_and_run_docker +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 263c111aaa50a83fbe120d5379ce7f7e400d9eb6
|
4
|
+
data.tar.gz: 4e822c834808cf2b3b97d640b896f2b84effbeab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57868ece58883157fc0286b8664ada0e51f593131af40aadd42730189de4d502143ad28f038bbb19c30c9e4a85751ddbf66660eef751644788b0ab988945bbc3
|
7
|
+
data.tar.gz: 968bdcce9ece3058c748fc48ff769b4b44b65ad4851d193c5d5523ca9e35a8849c3e9b7bfacae74ffc8229ed920de6e2a11e7053f68ae7427af0ad47c7ca0a64
|
data/README.md
CHANGED
@@ -1,29 +1,27 @@
|
|
1
|
-
|
1
|
+
# Ruby SDK
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
docker build -t protobuf-ruby-dependencies .
|
8
|
-
docker run -v $COPILOT_ROOT:/tmp/copilot -it protobuf-ruby-dependencies /bin/bash
|
9
|
-
cd /tmp/copilot
|
10
|
-
```
|
3
|
+
## Notes
|
4
|
+
|
5
|
+
- All commands below from the root of this repo
|
6
|
+
- There is no need to run `generate-protos` directly (use the script / docker image)
|
11
7
|
|
12
8
|
### How to generate services and messages from the `.proto` file
|
9
|
+
```
|
10
|
+
pushd sdk/ruby
|
11
|
+
bin/dockerized-rebuild-proto
|
12
|
+
popd
|
13
|
+
```
|
13
14
|
|
14
|
-
|
15
|
+
### Run all of the associated ruby specs
|
15
16
|
```
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
--plugin="protoc-gen-grpc=$(which grpc_tools_ruby_protoc_plugin)" \
|
20
|
-
./cloud_controller.proto
|
17
|
+
pushd sdk/ruby
|
18
|
+
bin/test
|
19
|
+
popd
|
21
20
|
```
|
22
21
|
|
23
22
|
### How to build and install the `cf-copilot` ruby gem
|
24
|
-
|
25
|
-
Starting from the repo root:
|
26
23
|
```
|
27
|
-
|
28
|
-
|
24
|
+
pushd sdk/ruby
|
25
|
+
bin/build-and-install-copilot-gem
|
26
|
+
popd
|
29
27
|
```
|
File without changes
|
@@ -4,9 +4,9 @@ set -euo pipefail
|
|
4
4
|
|
5
5
|
echo "Generating services and messages for cf-copilot..."
|
6
6
|
|
7
|
-
pushd "${
|
8
|
-
protoc --ruby_out="${
|
9
|
-
--grpc_out="${
|
7
|
+
pushd "${BUILD_ROOT}/api/protos"
|
8
|
+
protoc --ruby_out="${BUILD_ROOT}/sdk/ruby/lib/copilot/protos" \
|
9
|
+
--grpc_out="${BUILD_ROOT}/sdk/ruby/lib/copilot/protos" \
|
10
10
|
--plugin="protoc-gen-grpc=$(which grpc_tools_ruby_protoc_plugin)" \
|
11
11
|
./cloud_controller.proto
|
12
12
|
popd
|
data/bin/push-gem
ADDED
data/lib/cf-copilot.rb
CHANGED
@@ -25,8 +25,8 @@ module Cloudfoundry
|
|
25
25
|
service.health(request)
|
26
26
|
end
|
27
27
|
|
28
|
-
def upsert_route(guid:, host:)
|
29
|
-
route = Api::Route.new(guid: guid, host: host)
|
28
|
+
def upsert_route(guid:, host:, path: '')
|
29
|
+
route = Api::Route.new(guid: guid, host: host, path: path)
|
30
30
|
request = Api::UpsertRouteRequest.new(route: route)
|
31
31
|
service.upsert_route(request)
|
32
32
|
rescue GRPC::BadStatus => e
|
@@ -61,7 +61,8 @@ module Cloudfoundry
|
|
61
61
|
capi_diego_process_association: {
|
62
62
|
capi_process_guid: capi_process_guid,
|
63
63
|
diego_process_guids: diego_process_guids
|
64
|
-
}
|
64
|
+
}
|
65
|
+
)
|
65
66
|
|
66
67
|
service.upsert_capi_diego_process_association(request)
|
67
68
|
rescue GRPC::BadStatus => e
|
@@ -26,6 +26,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
26
26
|
add_message "api.Route" do
|
27
27
|
optional :guid, :string, 1
|
28
28
|
optional :host, :string, 2
|
29
|
+
optional :path, :string, 3
|
29
30
|
end
|
30
31
|
add_message "api.UpsertRouteRequest" do
|
31
32
|
optional :route, :message, 1, "api.Route"
|
@@ -4,14 +4,14 @@
|
|
4
4
|
require 'google/protobuf'
|
5
5
|
|
6
6
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
7
|
-
add_message
|
7
|
+
add_message 'api.HealthResponse' do
|
8
8
|
optional :healthy, :bool, 1
|
9
9
|
end
|
10
|
-
add_message
|
10
|
+
add_message 'api.HealthRequest' do
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
14
|
module Api
|
15
|
-
HealthResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup(
|
16
|
-
HealthRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup(
|
15
|
+
HealthResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup('api.HealthResponse').msgclass
|
16
|
+
HealthRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup('api.HealthRequest').msgclass
|
17
17
|
end
|
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.5
|
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-05-
|
11
|
+
date: 2018-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: grpc
|
@@ -39,47 +39,47 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.16'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: pry
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '10.0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '10.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
75
|
+
version: '3.0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
82
|
+
version: '3.0'
|
83
83
|
description:
|
84
84
|
email:
|
85
85
|
- cf-routing@pivotal.io
|
@@ -90,9 +90,10 @@ files:
|
|
90
90
|
- LICENSE
|
91
91
|
- NOTICE
|
92
92
|
- README.md
|
93
|
-
- bin/
|
94
|
-
- bin/
|
95
|
-
- bin/
|
93
|
+
- bin/build-and-install-copilot-gem
|
94
|
+
- bin/dockerized-rebuild-proto
|
95
|
+
- bin/generate-protos
|
96
|
+
- bin/push-gem
|
96
97
|
- bin/test
|
97
98
|
- lib/cf-copilot.rb
|
98
99
|
- lib/copilot/protos/cloud_controller_pb.rb
|