google-cloud-container_analysis 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -0
- data/lib/google/cloud/container_analysis.rb +5 -0
- data/lib/google/cloud/container_analysis/v1.rb +9 -0
- data/lib/google/cloud/container_analysis/v1/container_analysis_client.rb +25 -3
- data/lib/google/cloud/container_analysis/v1/credentials.rb +1 -0
- data/lib/google/cloud/container_analysis/v1/doc/google/iam/v1/iam_policy.rb +5 -0
- data/lib/google/cloud/container_analysis/v1/doc/google/iam/v1/options.rb +29 -0
- data/lib/google/cloud/container_analysis/v1/doc/google/iam/v1/policy.rb +1 -0
- data/lib/google/cloud/container_analysis/v1/doc/google/type/expr.rb +1 -0
- data/lib/google/cloud/container_analysis/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee80f0f70a16fb7eaf2ceb9260995df9f03bc002445d565286a2d2c6f5bc80c6
|
4
|
+
data.tar.gz: 0c3fecd8ff483fdb910b5c816b033097fd2c928ae235ad24ed7f45676f7144d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2cc50275b44ac92a5348b262381682f8fc7783e6ae9b36e6d04882cb9cd99b26c524bf914d437a985f97ec8196af7e7bdce82efb153a3808aecb144ed48aeb3
|
7
|
+
data.tar.gz: c69a5182a0c158a180e099a59f55246e647e37d47d6fcb2c5104c5f45f8e715ac62c1404b8ac92d501bdab4a9df50b1bc2034889df05eaf4f87b601529985542
|
data/README.md
CHANGED
@@ -20,6 +20,18 @@ steps:
|
|
20
20
|
$ gem install google-cloud-container_analysis
|
21
21
|
```
|
22
22
|
|
23
|
+
### Preview
|
24
|
+
```ruby
|
25
|
+
require "google/cloud/container_analysis"
|
26
|
+
|
27
|
+
container_analysis_client = Google::Cloud::ContainerAnalysis.new
|
28
|
+
grafeas_client = container_analysis_client.grafeas_client
|
29
|
+
parent = Grafeas::V1::GrafeasClient.project_path "my-project"
|
30
|
+
results = grafeas_client.list_occurrences(parent).each do |occurrence|
|
31
|
+
# do something with occurrence
|
32
|
+
end
|
33
|
+
```
|
34
|
+
|
23
35
|
### Next Steps
|
24
36
|
- Read the [Client Library Documentation][] for Container Analysis API
|
25
37
|
to see other available methods on the client.
|
@@ -12,6 +12,7 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
|
+
|
15
16
|
require "grafeas"
|
16
17
|
require "google/gax"
|
17
18
|
require "pathname"
|
@@ -132,6 +133,10 @@ module Google
|
|
132
133
|
# The default timeout, in seconds, for calls made through this client.
|
133
134
|
# @param metadata [Hash]
|
134
135
|
# Default metadata to be sent with each request. This can be overridden on a per call basis.
|
136
|
+
# @param service_address [String]
|
137
|
+
# Override for the service hostname, or `nil` to leave as the default.
|
138
|
+
# @param service_port [Integer]
|
139
|
+
# Override for the service port, or `nil` to leave as the default.
|
135
140
|
# @param exception_transformer [Proc]
|
136
141
|
# An optional proc that intercepts any exceptions raised during an API call to inject
|
137
142
|
# custom error handling.
|
@@ -12,6 +12,7 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
|
+
|
15
16
|
require "google/cloud/container_analysis/v1/container_analysis_client"
|
16
17
|
|
17
18
|
module Google
|
@@ -119,6 +120,10 @@ module Google
|
|
119
120
|
# The default timeout, in seconds, for calls made through this client.
|
120
121
|
# @param metadata [Hash]
|
121
122
|
# Default metadata to be sent with each request. This can be overridden on a per call basis.
|
123
|
+
# @param service_address [String]
|
124
|
+
# Override for the service hostname, or `nil` to leave as the default.
|
125
|
+
# @param service_port [Integer]
|
126
|
+
# Override for the service port, or `nil` to leave as the default.
|
122
127
|
# @param exception_transformer [Proc]
|
123
128
|
# An optional proc that intercepts any exceptions raised during an API call to inject
|
124
129
|
# custom error handling.
|
@@ -128,6 +133,8 @@ module Google
|
|
128
133
|
client_config: nil,
|
129
134
|
timeout: nil,
|
130
135
|
metadata: nil,
|
136
|
+
service_address: nil,
|
137
|
+
service_port: nil,
|
131
138
|
exception_transformer: nil,
|
132
139
|
lib_name: nil,
|
133
140
|
lib_version: nil
|
@@ -139,6 +146,8 @@ module Google
|
|
139
146
|
metadata: metadata,
|
140
147
|
exception_transformer: exception_transformer,
|
141
148
|
lib_name: lib_name,
|
149
|
+
service_address: service_address,
|
150
|
+
service_port: service_port,
|
142
151
|
lib_version: lib_version
|
143
152
|
}.select { |_, v| v != nil }
|
144
153
|
Google::Cloud::ContainerAnalysis::V1::ContainerAnalysisClient.new(**kwargs)
|
@@ -19,6 +19,7 @@
|
|
19
19
|
# For the short term, the refresh process will only be runnable by Google
|
20
20
|
# engineers.
|
21
21
|
|
22
|
+
|
22
23
|
require "json"
|
23
24
|
require "pathname"
|
24
25
|
|
@@ -52,6 +53,9 @@ module Google
|
|
52
53
|
# @private
|
53
54
|
attr_reader :container_analysis_stub
|
54
55
|
|
56
|
+
# @return [Grafeas::V1::GrafeasClient] a client for the Grafeas service
|
57
|
+
attr_reader :grafeas_client
|
58
|
+
|
55
59
|
# The default address of the service.
|
56
60
|
SERVICE_ADDRESS = "containeranalysis.googleapis.com".freeze
|
57
61
|
|
@@ -113,6 +117,10 @@ module Google
|
|
113
117
|
# The default timeout, in seconds, for calls made through this client.
|
114
118
|
# @param metadata [Hash]
|
115
119
|
# Default metadata to be sent with each request. This can be overridden on a per call basis.
|
120
|
+
# @param service_address [String]
|
121
|
+
# Override for the service hostname, or `nil` to leave as the default.
|
122
|
+
# @param service_port [Integer]
|
123
|
+
# Override for the service port, or `nil` to leave as the default.
|
116
124
|
# @param exception_transformer [Proc]
|
117
125
|
# An optional proc that intercepts any exceptions raised during an API call to inject
|
118
126
|
# custom error handling.
|
@@ -122,6 +130,8 @@ module Google
|
|
122
130
|
client_config: {},
|
123
131
|
timeout: DEFAULT_TIMEOUT,
|
124
132
|
metadata: nil,
|
133
|
+
service_address: nil,
|
134
|
+
service_port: nil,
|
125
135
|
exception_transformer: nil,
|
126
136
|
lib_name: nil,
|
127
137
|
lib_version: ""
|
@@ -133,6 +143,11 @@ module Google
|
|
133
143
|
|
134
144
|
credentials ||= Google::Cloud::ContainerAnalysis::V1::Credentials.default
|
135
145
|
|
146
|
+
@grafeas_client = ::Grafeas.new(
|
147
|
+
credentials: credentials, scopes: scopes, client_config: client_config,
|
148
|
+
timeout: timeout, lib_name: lib_name, lib_version: lib_version,
|
149
|
+
service_address: service_address, service_port: service_port, metadata: metadata)
|
150
|
+
|
136
151
|
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
137
152
|
updater_proc = Google::Cloud::ContainerAnalysis::V1::Credentials.new(credentials).updater_proc
|
138
153
|
end
|
@@ -175,8 +190,8 @@ module Google
|
|
175
190
|
end
|
176
191
|
|
177
192
|
# Allow overriding the service path/port in subclasses.
|
178
|
-
service_path = self.class::SERVICE_ADDRESS
|
179
|
-
port = self.class::DEFAULT_SERVICE_PORT
|
193
|
+
service_path = service_address || self.class::SERVICE_ADDRESS
|
194
|
+
port = service_port || self.class::DEFAULT_SERVICE_PORT
|
180
195
|
interceptors = self.class::GRPC_INTERCEPTORS
|
181
196
|
@container_analysis_stub = Google::Gax::Grpc.create_stub(
|
182
197
|
service_path,
|
@@ -279,6 +294,11 @@ module Google
|
|
279
294
|
# @param resource [String]
|
280
295
|
# REQUIRED: The resource for which the policy is being requested.
|
281
296
|
# See the operation documentation for the appropriate value for this field.
|
297
|
+
# @param options_ [Google::Iam::V1::GetPolicyOptions | Hash]
|
298
|
+
# OPTIONAL: A `GetPolicyOptions` object for specifying options to
|
299
|
+
# `GetIamPolicy`. This field is only used by Cloud IAM.
|
300
|
+
# A hash of the same form as `Google::Iam::V1::GetPolicyOptions`
|
301
|
+
# can also be provided.
|
282
302
|
# @param options [Google::Gax::CallOptions]
|
283
303
|
# Overrides the default settings for this call, e.g, timeout,
|
284
304
|
# retries, etc.
|
@@ -296,10 +316,12 @@ module Google
|
|
296
316
|
|
297
317
|
def get_iam_policy \
|
298
318
|
resource,
|
319
|
+
options_: nil,
|
299
320
|
options: nil,
|
300
321
|
&block
|
301
322
|
req = {
|
302
|
-
resource: resource
|
323
|
+
resource: resource,
|
324
|
+
options: options_
|
303
325
|
}.delete_if { |_, v| v.nil? }
|
304
326
|
req = Google::Gax::to_proto(req, Google::Iam::V1::GetIamPolicyRequest)
|
305
327
|
@get_iam_policy.call(req, options, &block)
|
@@ -12,6 +12,7 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
|
+
|
15
16
|
module Google
|
16
17
|
module Iam
|
17
18
|
module V1
|
@@ -33,6 +34,10 @@ module Google
|
|
33
34
|
# @return [String]
|
34
35
|
# REQUIRED: The resource for which the policy is being requested.
|
35
36
|
# See the operation documentation for the appropriate value for this field.
|
37
|
+
# @!attribute [rw] options
|
38
|
+
# @return [Google::Iam::V1::GetPolicyOptions]
|
39
|
+
# OPTIONAL: A `GetPolicyOptions` object for specifying options to
|
40
|
+
# `GetIamPolicy`. This field is only used by Cloud IAM.
|
36
41
|
class GetIamPolicyRequest; end
|
37
42
|
|
38
43
|
# Request message for `TestIamPermissions` method.
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# Copyright 2019 Google LLC
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
|
16
|
+
module Google
|
17
|
+
module Iam
|
18
|
+
module V1
|
19
|
+
# Encapsulates settings provided to GetIamPolicy.
|
20
|
+
# @!attribute [rw] requested_policy_version
|
21
|
+
# @return [Integer]
|
22
|
+
# Optional. The policy format version to be returned.
|
23
|
+
# Acceptable values are 0 and 1.
|
24
|
+
# If the value is 0, or the field is omitted, policy format version 1 will be
|
25
|
+
# returned.
|
26
|
+
class GetPolicyOptions; end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-container_analysis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: grafeas-client
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '1.
|
33
|
+
version: '1.7'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '1.
|
40
|
+
version: '1.7'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: grpc-google-iam-v1
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -140,6 +140,7 @@ files:
|
|
140
140
|
- lib/google/cloud/container_analysis/v1/container_analysis_client_config.json
|
141
141
|
- lib/google/cloud/container_analysis/v1/credentials.rb
|
142
142
|
- lib/google/cloud/container_analysis/v1/doc/google/iam/v1/iam_policy.rb
|
143
|
+
- lib/google/cloud/container_analysis/v1/doc/google/iam/v1/options.rb
|
143
144
|
- lib/google/cloud/container_analysis/v1/doc/google/iam/v1/policy.rb
|
144
145
|
- lib/google/cloud/container_analysis/v1/doc/google/type/expr.rb
|
145
146
|
- lib/google/cloud/container_analysis/version.rb
|