java-docs-samples
java-docs-samples copied to clipboard
feat(security-command-center): add sample for creating client with regional endpoint
Description
This sample shows how to create a Security Command Center client that uses a regional endpoint, along with a client that uses the default endpoint. That's because Security Command Center's regional endpoints support only a limited subset of Security Command Center resources that are subject to data residency controls: https://cloud.google.com/security-command-center/docs/data-residency-support#scc-regional-urls-rest
As a result, it's likely that customers will need to create two clients: one for their regional endpoint, to call the methods it supports, and another for the default endpoint, to call all other methods.
This sample will be used here: https://cloud.google.com/security-command-center/docs/data-residency-support#regional-urls
Checklist
- [x] I have followed Sample Format Guide
- [x]
pom.xmlparent set to latestshared-configuration - [x] Appropriate changes to README are included in PR
- [ ] These samples need a new API enabled in testing projects to pass (let us know which ones)
- [ ] These samples need a new/updated env vars in testing projects set to pass (let us know which ones)
- [x] Tests pass:
mvn clean verifyrequired - [x] Lint passes:
mvn -P lint checkstyle:checkrequired - [ ] Static Analysis:
mvn -P lint clean compile pmd:cpd-check spotbugs:checkadvisory only - [ ] This sample adds a new sample directory, and I updated the CODEOWNERS file with the codeowners for this sample
- [ ] This sample adds a new Product API, and I updated the Blunderbuss issue/PR auto-assigner with the codeowners for this sample
- [x] Please merge this PR for me once it is approved
Here is the summary of changes.
You are about to add 1 region tag.
- security-command-center/snippets/src/main/java/vtwo/client/CreateClientWithEndpoint.java:19, tag
securitycenter_set_client_endpoint_v2
This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:
- [ ] Refresh this comment
The Kokoro CI failures don't appear to be related to this PR. Let me know if you disagree.
Hello @hegemonic, I have converted this PR to draft because it fails on multiple integration tests. Please address failing tests before submitting this PR for review.
@minherz As I mentioned above, the Kokoro CI failures don't appear to be related to this PR. They involve a different set of tests that this PR doesn't update. Also, note that flaky-bot has already reported that these tests are failing at HEAD: #9542
If you don't agree, please let me know why this PR would cause these tests to fail.
@minherz As I mentioned above, the Kokoro CI failures don't appear to be related to this PR. They involve a different set of tests that this PR doesn't update. Also, note that flaky-bot has already reported that these tests are failing at
HEAD: #9542If you don't agree, please let me know why this PR would cause these tests to fail.
I agree with your assessment that the failing tests do not directly related to the code changes you made. However, these tests do belong to the security-command-center set of snippets. So all the set's tests run each time any change to the set is made. And all the tests have to pass because any change can introduce indirect changes. For example, new tests may introduce a friction in the test environment(s) and influenced the results of the tests' execution.
All tests of the security-command-center have to pass before this PR can be reviewed and then merged. As someone submitting new samples it seems logical to expect that you have background in the domain. If you find yourself unable to resolve the failing tests, please reach out to maintainers of the security-command-center snippets and ask them to help with this problem. According to CODEOWNERS gcp-security-command-center team maintains this set of snippets.
Yes, I'm familiar with Security Command Center, but I don't own any of these code samples—I'm just writing this one as a favor.
I'll ask one of the owners to fix the existing samples. For now, I'll move this back to a draft.
#9580 was merged, so this PR is ready to review.