1 <?php 2 /* 3 * Copyright 2014 Google Inc. 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); you may not 6 * use this file except in compliance with the License. You may obtain a copy of 7 * the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 * License for the specific language governing permissions and limitations under 15 * the License. 16 */ 17 18 namespace Google\Service\OSConfig\Resource; 19 20 use Google\Service\OSConfig\ListVulnerabilityReportsResponse; 21 use Google\Service\OSConfig\VulnerabilityReport; 22 23 /** 24 * The "vulnerabilityReports" collection of methods. 25 * Typical usage is: 26 * <code> 27 * $osconfigService = new Google\Service\OSConfig(...); 28 * $vulnerabilityReports = $osconfigService->vulnerabilityReports; 29 * </code> 30 */ 31 class ProjectsLocationsInstancesVulnerabilityReports extends \Google\Service\Resource 32 { 33 /** 34 * Gets the vulnerability report for the specified VM instance. Only VMs with 35 * inventory data have vulnerability reports associated with them. 36 * (vulnerabilityReports.get) 37 * 38 * @param string $name Required. API resource name for vulnerability resource. 39 * Format: `projects/{project}/locations/{location}/instances/{instance}/vulnera 40 * bilityReport` For `{project}`, either `project-number` or `project-id` can be 41 * provided. For `{instance}`, either Compute Engine `instance-id` or `instance- 42 * name` can be provided. 43 * @param array $optParams Optional parameters. 44 * @return VulnerabilityReport 45 */ 46 public function get($name, $optParams = []) 47 { 48 $params = ['name' => $name]; 49 $params = array_merge($params, $optParams); 50 return $this->call('get', [$params], VulnerabilityReport::class); 51 } 52 /** 53 * List vulnerability reports for all VM instances in the specified zone. 54 * (vulnerabilityReports.listProjectsLocationsInstancesVulnerabilityReports) 55 * 56 * @param string $parent Required. The parent resource name. Format: 57 * `projects/{project}/locations/{location}/instances/-` For `{project}`, either 58 * `project-number` or `project-id` can be provided. 59 * @param array $optParams Optional parameters. 60 * 61 * @opt_param string filter This field supports filtering by the severity level 62 * for the vulnerability. For a list of severity levels, see [Severity levels 63 * for vulnerabilities](https://cloud.google.com/container-analysis/docs 64 * /container-scanning-overview#severity_levels_for_vulnerabilities). The filter 65 * field follows the rules described in the 66 * [AIP-160](https://google.aip.dev/160) guidelines as follows: + **Filter for a 67 * specific severity type**: you can list reports that contain vulnerabilities 68 * that are classified as medium by specifying 69 * `vulnerabilities.details.severity:MEDIUM`. + **Filter for a range of 70 * severities** : you can list reports that have vulnerabilities that are 71 * classified as critical or high by specifying 72 * `vulnerabilities.details.severity:HIGH OR 73 * vulnerabilities.details.severity:CRITICAL` 74 * @opt_param int pageSize The maximum number of results to return. 75 * @opt_param string pageToken A pagination token returned from a previous call 76 * to `ListVulnerabilityReports` that indicates where this listing should 77 * continue from. 78 * @return ListVulnerabilityReportsResponse 79 */ 80 public function listProjectsLocationsInstancesVulnerabilityReports($parent, $optParams = []) 81 { 82 $params = ['parent' => $parent]; 83 $params = array_merge($params, $optParams); 84 return $this->call('list', [$params], ListVulnerabilityReportsResponse::class); 85 } 86 } 87 88 // Adding a class alias for backwards compatibility with the previous class name. 89 class_alias(ProjectsLocationsInstancesVulnerabilityReports::class, 'Google_Service_OSConfig_Resource_ProjectsLocationsInstancesVulnerabilityReports'); 90