Skip to content

Commit c02b122

Browse files
feat: [containeranalysis] add ExportSBOM API method for v1 (#6210)
* feat: add ExportSBOM API method for v1 docs: Minor formatting changes to proto headers PiperOrigin-RevId: 740056523 Source-Link: googleapis/googleapis@7a92b96 Source-Link: googleapis/googleapis-gen@7917811 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWRldnRvb2xzLWNvbnRhaW5lcmFuYWx5c2lzLy5Pd2xCb3QueWFtbCIsImgiOiI3OTE3ODExZDZmYjRjMGYwYzc1NzYyYWE2Yzk3MDhkN2UyNzE3MWEzIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent a1c34d6 commit c02b122

13 files changed

Lines changed: 1583 additions & 30 deletions

packages/google-devtools-containeranalysis/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/
6262

6363
| Sample | Source Code | Try it |
6464
| --------------------------- | --------------------------------- | ------ |
65+
| Container_analysis.export_s_b_o_m | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1/container_analysis.export_s_b_o_m.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-devtools-containeranalysis/samples/generated/v1/container_analysis.export_s_b_o_m.js,packages/google-devtools-containeranalysis/samples/README.md) |
6566
| Container_analysis.get_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1/container_analysis.get_iam_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-devtools-containeranalysis/samples/generated/v1/container_analysis.get_iam_policy.js,packages/google-devtools-containeranalysis/samples/README.md) |
6667
| Container_analysis.get_vulnerability_occurrences_summary | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1/container_analysis.get_vulnerability_occurrences_summary.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-devtools-containeranalysis/samples/generated/v1/container_analysis.get_vulnerability_occurrences_summary.js,packages/google-devtools-containeranalysis/samples/README.md) |
6768
| Container_analysis.set_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1/container_analysis.set_iam_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-devtools-containeranalysis/samples/generated/v1/container_analysis.set_iam_policy.js,packages/google-devtools-containeranalysis/samples/README.md) |

packages/google-devtools-containeranalysis/protos/google/devtools/containeranalysis/v1/containeranalysis.proto

Lines changed: 81 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ option go_package = "cloud.google.com/go/containeranalysis/apiv1/containeranalys
2929
option java_multiple_files = true;
3030
option java_package = "com.google.containeranalysis.v1";
3131
option objc_class_prefix = "GCA";
32-
option ruby_package = "Google::Cloud::ContainerAnalysis::V1";
3332
option php_namespace = "Google\\Cloud\\ContainerAnalysis\\V1";
33+
option ruby_package = "Google::Cloud::ContainerAnalysis::V1";
3434

3535
// Retrieves analysis results of Cloud components such as Docker container
3636
// images. The Container Analysis API is an implementation of the
@@ -47,7 +47,8 @@ option php_namespace = "Google\\Cloud\\ContainerAnalysis\\V1";
4747
// image with the vulnerability referring to that note.
4848
service ContainerAnalysis {
4949
option (google.api.default_host) = "containeranalysis.googleapis.com";
50-
option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
50+
option (google.api.oauth_scopes) =
51+
"https://www.googleapis.com/auth/cloud-platform";
5152

5253
// Sets the access control policy on the specified note or occurrence.
5354
// Requires `containeranalysis.notes.setIamPolicy` or
@@ -57,14 +58,23 @@ service ContainerAnalysis {
5758
// The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for
5859
// notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for
5960
// occurrences.
60-
rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) {
61+
rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest)
62+
returns (google.iam.v1.Policy) {
6163
option (google.api.http) = {
6264
post: "/v1/{resource=projects/*/notes/*}:setIamPolicy"
6365
body: "*"
6466
additional_bindings {
6567
post: "/v1/{resource=projects/*/occurrences/*}:setIamPolicy"
6668
body: "*"
6769
}
70+
additional_bindings {
71+
post: "/v1/{resource=projects/*/locations/*/notes/*}:setIamPolicy"
72+
body: "*"
73+
}
74+
additional_bindings {
75+
post: "/v1/{resource=projects/*/locations/*/occurrences/*}:setIamPolicy"
76+
body: "*"
77+
}
6878
};
6979
option (google.api.method_signature) = "resource,policy";
7080
}
@@ -77,14 +87,23 @@ service ContainerAnalysis {
7787
// The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for
7888
// notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for
7989
// occurrences.
80-
rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) {
90+
rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest)
91+
returns (google.iam.v1.Policy) {
8192
option (google.api.http) = {
8293
post: "/v1/{resource=projects/*/notes/*}:getIamPolicy"
8394
body: "*"
8495
additional_bindings {
8596
post: "/v1/{resource=projects/*/occurrences/*}:getIamPolicy"
8697
body: "*"
8798
}
99+
additional_bindings {
100+
post: "/v1/{resource=projects/*/locations/*/notes/*}:getIamPolicy"
101+
body: "*"
102+
}
103+
additional_bindings {
104+
post: "/v1/{resource=projects/*/locations/*/occurrences/*}:getIamPolicy"
105+
body: "*"
106+
}
88107
};
89108
option (google.api.method_signature) = "resource";
90109
}
@@ -96,31 +115,85 @@ service ContainerAnalysis {
96115
// The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for
97116
// notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for
98117
// occurrences.
99-
rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) {
118+
rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest)
119+
returns (google.iam.v1.TestIamPermissionsResponse) {
100120
option (google.api.http) = {
101121
post: "/v1/{resource=projects/*/notes/*}:testIamPermissions"
102122
body: "*"
103123
additional_bindings {
104124
post: "/v1/{resource=projects/*/occurrences/*}:testIamPermissions"
105125
body: "*"
106126
}
127+
additional_bindings {
128+
post: "/v1/{resource=projects/*/locations/*/notes/*}:testIamPermissions"
129+
body: "*"
130+
}
131+
additional_bindings {
132+
post: "/v1/{resource=projects/*/locations/*/occurrences/*}:testIamPermissions"
133+
body: "*"
134+
}
107135
};
108136
option (google.api.method_signature) = "resource,permissions";
109137
}
110138

111139
// Gets a summary of the number and severity of occurrences.
112-
rpc GetVulnerabilityOccurrencesSummary(GetVulnerabilityOccurrencesSummaryRequest) returns (VulnerabilityOccurrencesSummary) {
140+
rpc GetVulnerabilityOccurrencesSummary(
141+
GetVulnerabilityOccurrencesSummaryRequest)
142+
returns (VulnerabilityOccurrencesSummary) {
113143
option (google.api.http) = {
114144
get: "/v1/{parent=projects/*}/occurrences:vulnerabilitySummary"
145+
additional_bindings {
146+
get: "/v1/{parent=projects/*/locations/*}/occurrences:vulnerabilitySummary"
147+
}
115148
};
116149
option (google.api.method_signature) = "parent,filter";
117150
}
151+
152+
// Generates an SBOM for the given resource.
153+
rpc ExportSBOM(ExportSBOMRequest) returns (ExportSBOMResponse) {
154+
option (google.api.http) = {
155+
post: "/v1/{name=projects/*/resources/**}:exportSBOM"
156+
body: "*"
157+
additional_bindings {
158+
post: "/v1/{name=projects/*/locations/*/resources/**}:exportSBOM"
159+
body: "*"
160+
}
161+
};
162+
}
163+
}
164+
165+
// The request to generate and export SBOM. Target must be specified for the
166+
// request.
167+
message ExportSBOMRequest {
168+
// Empty placeholder to denote that this is a Google Cloud Storage
169+
// export request.
170+
message CloudStorageLocation {}
171+
172+
// Required. The name of the resource in the form of
173+
// `projects/[PROJECT_ID]/resources/[RESOURCE_URL]`.
174+
string name = 1 [(google.api.field_behavior) = REQUIRED];
175+
176+
// The location of the SBOM export.
177+
oneof target {
178+
// Optional. Empty placeholder to denote that this is a Google Cloud Storage
179+
// export request.
180+
CloudStorageLocation cloud_storage_location = 2
181+
[(google.api.field_behavior) = OPTIONAL];
182+
}
183+
}
184+
185+
// The response from a call to ExportSBOM.
186+
message ExportSBOMResponse {
187+
// The name of the discovery occurrence in the form
188+
// "projects/{project_id}/occurrences/{OCCURRENCE_ID}
189+
// It can be used to track the progress of the SBOM export.
190+
string discovery_occurrence = 1;
118191
}
119192

120193
// Request to get a vulnerability summary for some set of occurrences.
121194
message GetVulnerabilityOccurrencesSummaryRequest {
122-
// Required. The name of the project to get a vulnerability summary for in the form of
123-
// `projects/[PROJECT_ID]`.
195+
// Required. The name of the project to get a vulnerability summary for in the
196+
// form of `projects/[PROJECT_ID]`.
124197
string parent = 1 [
125198
(google.api.field_behavior) = REQUIRED,
126199
(google.api.resource_reference) = {

0 commit comments

Comments
 (0)