1
1
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2
+ """Client and server classes corresponding to protobuf-defined services."""
2
3
import grpc
3
4
4
5
from google .iam .v1 import iam_policy_pb2 as google_dot_iam_dot_v1_dot_iam__policy__pb2
7
8
8
9
class ContainerAnalysisStub (object ):
9
10
"""Retrieves analysis results of Cloud components such as Docker container
10
- images. The Container Analysis API is an implementation of the
11
- [Grafeas](https://grafeas.io) API.
12
-
13
- Analysis results are stored as a series of occurrences. An `Occurrence`
14
- contains information about a specific analysis instance on a resource. An
15
- occurrence refers to a `Note`. A note contains details describing the
16
- analysis and is generally stored in a separate project, called a `Provider`.
17
- Multiple occurrences can refer to the same note.
18
-
19
- For example, an SSL vulnerability could affect multiple images. In this case,
20
- there would be one note for the vulnerability and an occurrence for each
21
- image with the vulnerability referring to that note.
22
- """
11
+ images. The Container Analysis API is an implementation of the
12
+ [Grafeas](https://grafeas.io) API.
13
+
14
+ Analysis results are stored as a series of occurrences. An `Occurrence`
15
+ contains information about a specific analysis instance on a resource. An
16
+ occurrence refers to a `Note`. A note contains details describing the
17
+ analysis and is generally stored in a separate project, called a `Provider`.
18
+ Multiple occurrences can refer to the same note.
19
+
20
+ For example, an SSL vulnerability could affect multiple images. In this case,
21
+ there would be one note for the vulnerability and an occurrence for each
22
+ image with the vulnerability referring to that note.
23
+ """
23
24
24
25
def __init__ (self , channel ):
25
26
"""Constructor.
26
27
27
- Args:
28
- channel: A grpc.Channel.
29
- """
28
+ Args:
29
+ channel: A grpc.Channel.
30
+ """
30
31
self .SetIamPolicy = channel .unary_unary (
31
32
"/google.devtools.containeranalysis.v1.ContainerAnalysis/SetIamPolicy" ,
32
33
request_serializer = google_dot_iam_dot_v1_dot_iam__policy__pb2 .SetIamPolicyRequest .SerializeToString ,
@@ -46,57 +47,57 @@ def __init__(self, channel):
46
47
47
48
class ContainerAnalysisServicer (object ):
48
49
"""Retrieves analysis results of Cloud components such as Docker container
49
- images. The Container Analysis API is an implementation of the
50
- [Grafeas](https://grafeas.io) API.
51
-
52
- Analysis results are stored as a series of occurrences. An `Occurrence`
53
- contains information about a specific analysis instance on a resource. An
54
- occurrence refers to a `Note`. A note contains details describing the
55
- analysis and is generally stored in a separate project, called a `Provider`.
56
- Multiple occurrences can refer to the same note.
57
-
58
- For example, an SSL vulnerability could affect multiple images. In this case,
59
- there would be one note for the vulnerability and an occurrence for each
60
- image with the vulnerability referring to that note.
61
- """
50
+ images. The Container Analysis API is an implementation of the
51
+ [Grafeas](https://grafeas.io) API.
52
+
53
+ Analysis results are stored as a series of occurrences. An `Occurrence`
54
+ contains information about a specific analysis instance on a resource. An
55
+ occurrence refers to a `Note`. A note contains details describing the
56
+ analysis and is generally stored in a separate project, called a `Provider`.
57
+ Multiple occurrences can refer to the same note.
58
+
59
+ For example, an SSL vulnerability could affect multiple images. In this case,
60
+ there would be one note for the vulnerability and an occurrence for each
61
+ image with the vulnerability referring to that note.
62
+ """
62
63
63
64
def SetIamPolicy (self , request , context ):
64
65
"""Sets the access control policy on the specified note or occurrence.
65
- Requires `containeranalysis.notes.setIamPolicy` or
66
- `containeranalysis.occurrences.setIamPolicy` permission if the resource is
67
- a note or an occurrence, respectively.
68
-
69
- The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for
70
- notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for
71
- occurrences.
72
- """
66
+ Requires `containeranalysis.notes.setIamPolicy` or
67
+ `containeranalysis.occurrences.setIamPolicy` permission if the resource is
68
+ a note or an occurrence, respectively.
69
+
70
+ The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for
71
+ notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for
72
+ occurrences.
73
+ """
73
74
context .set_code (grpc .StatusCode .UNIMPLEMENTED )
74
75
context .set_details ("Method not implemented!" )
75
76
raise NotImplementedError ("Method not implemented!" )
76
77
77
78
def GetIamPolicy (self , request , context ):
78
79
"""Gets the access control policy for a note or an occurrence resource.
79
- Requires `containeranalysis.notes.setIamPolicy` or
80
- `containeranalysis.occurrences.setIamPolicy` permission if the resource is
81
- a note or occurrence, respectively.
82
-
83
- The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for
84
- notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for
85
- occurrences.
86
- """
80
+ Requires `containeranalysis.notes.setIamPolicy` or
81
+ `containeranalysis.occurrences.setIamPolicy` permission if the resource is
82
+ a note or occurrence, respectively.
83
+
84
+ The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for
85
+ notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for
86
+ occurrences.
87
+ """
87
88
context .set_code (grpc .StatusCode .UNIMPLEMENTED )
88
89
context .set_details ("Method not implemented!" )
89
90
raise NotImplementedError ("Method not implemented!" )
90
91
91
92
def TestIamPermissions (self , request , context ):
92
93
"""Returns the permissions that a caller has on the specified note or
93
- occurrence. Requires list permission on the project (for example,
94
- `containeranalysis.notes.list`).
94
+ occurrence. Requires list permission on the project (for example,
95
+ `containeranalysis.notes.list`).
95
96
96
- The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for
97
- notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for
98
- occurrences.
99
- """
97
+ The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for
98
+ notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for
99
+ occurrences.
100
+ """
100
101
context .set_code (grpc .StatusCode .UNIMPLEMENTED )
101
102
context .set_details ("Method not implemented!" )
102
103
raise NotImplementedError ("Method not implemented!" )
@@ -124,3 +125,102 @@ def add_ContainerAnalysisServicer_to_server(servicer, server):
124
125
"google.devtools.containeranalysis.v1.ContainerAnalysis" , rpc_method_handlers
125
126
)
126
127
server .add_generic_rpc_handlers ((generic_handler ,))
128
+
129
+
130
+ # This class is part of an EXPERIMENTAL API.
131
+ class ContainerAnalysis (object ):
132
+ """Retrieves analysis results of Cloud components such as Docker container
133
+ images. The Container Analysis API is an implementation of the
134
+ [Grafeas](https://grafeas.io) API.
135
+
136
+ Analysis results are stored as a series of occurrences. An `Occurrence`
137
+ contains information about a specific analysis instance on a resource. An
138
+ occurrence refers to a `Note`. A note contains details describing the
139
+ analysis and is generally stored in a separate project, called a `Provider`.
140
+ Multiple occurrences can refer to the same note.
141
+
142
+ For example, an SSL vulnerability could affect multiple images. In this case,
143
+ there would be one note for the vulnerability and an occurrence for each
144
+ image with the vulnerability referring to that note.
145
+ """
146
+
147
+ @staticmethod
148
+ def SetIamPolicy (
149
+ request ,
150
+ target ,
151
+ options = (),
152
+ channel_credentials = None ,
153
+ call_credentials = None ,
154
+ compression = None ,
155
+ wait_for_ready = None ,
156
+ timeout = None ,
157
+ metadata = None ,
158
+ ):
159
+ return grpc .experimental .unary_unary (
160
+ request ,
161
+ target ,
162
+ "/google.devtools.containeranalysis.v1.ContainerAnalysis/SetIamPolicy" ,
163
+ google_dot_iam_dot_v1_dot_iam__policy__pb2 .SetIamPolicyRequest .SerializeToString ,
164
+ google_dot_iam_dot_v1_dot_policy__pb2 .Policy .FromString ,
165
+ options ,
166
+ channel_credentials ,
167
+ call_credentials ,
168
+ compression ,
169
+ wait_for_ready ,
170
+ timeout ,
171
+ metadata ,
172
+ )
173
+
174
+ @staticmethod
175
+ def GetIamPolicy (
176
+ request ,
177
+ target ,
178
+ options = (),
179
+ channel_credentials = None ,
180
+ call_credentials = None ,
181
+ compression = None ,
182
+ wait_for_ready = None ,
183
+ timeout = None ,
184
+ metadata = None ,
185
+ ):
186
+ return grpc .experimental .unary_unary (
187
+ request ,
188
+ target ,
189
+ "/google.devtools.containeranalysis.v1.ContainerAnalysis/GetIamPolicy" ,
190
+ google_dot_iam_dot_v1_dot_iam__policy__pb2 .GetIamPolicyRequest .SerializeToString ,
191
+ google_dot_iam_dot_v1_dot_policy__pb2 .Policy .FromString ,
192
+ options ,
193
+ channel_credentials ,
194
+ call_credentials ,
195
+ compression ,
196
+ wait_for_ready ,
197
+ timeout ,
198
+ metadata ,
199
+ )
200
+
201
+ @staticmethod
202
+ def TestIamPermissions (
203
+ request ,
204
+ target ,
205
+ options = (),
206
+ channel_credentials = None ,
207
+ call_credentials = None ,
208
+ compression = None ,
209
+ wait_for_ready = None ,
210
+ timeout = None ,
211
+ metadata = None ,
212
+ ):
213
+ return grpc .experimental .unary_unary (
214
+ request ,
215
+ target ,
216
+ "/google.devtools.containeranalysis.v1.ContainerAnalysis/TestIamPermissions" ,
217
+ google_dot_iam_dot_v1_dot_iam__policy__pb2 .TestIamPermissionsRequest .SerializeToString ,
218
+ google_dot_iam_dot_v1_dot_iam__policy__pb2 .TestIamPermissionsResponse .FromString ,
219
+ options ,
220
+ channel_credentials ,
221
+ call_credentials ,
222
+ compression ,
223
+ wait_for_ready ,
224
+ timeout ,
225
+ metadata ,
226
+ )
0 commit comments