Skip to content

securitycenter: Some v2 code samples use the v1 API #12713

Open
@hegemonic

Description

@hegemonic

In which file did you encounter the issue?

https://github.com/GoogleCloudPlatform/python-docs-samples/blob/98d8ab50/securitycenter/snippets_v2/snippets_findings_v2.py

Did you change the file? If so, how?

no

Describe the issue

This file is supposed to contain samples for the Security Command Center v2 API. That means each sample needs to import google.cloud.securitycenter_v2:

from google.cloud import securitycenter_v2

client = securitycenter_v2.SecurityCenterClient()

However, the securitycenter_update_source_v2 and securitycenter_list_sources_v2 samples use the v1 API:

from google.cloud import securitycenter

client = securitycenter.SecurityCenterClient()

CC: @owenhuyn

Metadata

Metadata

Assignees

Labels

api: securitycenterIssues related to the Security Command Center API.priority: p2Moderately-important priority. Fix may not be included in next release.samplesIssues that are directly related to samples.triage meI really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions