New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Adding API v2 Source samples #9299
Conversation
Here is the summary of changes. You are about to add 4 region tags.
This comment is generated by snippet-bot.
|
5c3d15a
to
49ab460
Compare
security-command-center/snippets/src/main/java/vtwo/source/UpdateFindingSource.java
Outdated
Show resolved
Hide resolved
49ab460
to
671b448
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the snippets. PTAL at the comments and the failing tests.
security-command-center/snippets/src/main/java/vtwo/source/GetSource.java
Outdated
Show resolved
Hide resolved
security-command-center/snippets/src/main/java/vtwo/source/GetSource.java
Outdated
Show resolved
Hide resolved
security-command-center/snippets/src/main/java/vtwo/source/GetSource.java
Outdated
Show resolved
Hide resolved
security-command-center/snippets/src/main/java/vtwo/source/GetSource.java
Outdated
Show resolved
Hide resolved
try (SecurityCenterClient client = SecurityCenterClient.create()) { | ||
|
||
// Start setting up a request to get a source. | ||
SourceName sourceName = SourceName.ofOrganizationSourceName(organizationId, sourceId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't the v2 API require a location to be passed as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I create a source, this is the response:
Created source : name: "organizations/xx/sources/xx"
To use V2, this syntax must be used:
"organizations/[organization_id]/source/[source_id]"
but I tried other approaches like
"organizations/%s/locations/%s/sources/%s"
"organizations/%s/sources/%s/locations/%s"
SourceName sourceName = SourceName.ofOrganizationSourceName(organizationId, sourceId);
Parent String = String.format("%s/locals/%s", sourceName.toString(), "global");
all resulting in an INVALID_ARGUMENT.
Kindly show me the best approach.
security-command-center/snippets/src/main/java/vtwo/source/UpdateFindingSource.java
Show resolved
Hide resolved
} | ||
|
||
@BeforeClass | ||
public static void setUp() throws IOException, InterruptedException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create a corresponding method with AfterClass
annotation cleaning up the resources created in setUp()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rafaelMurata I'm unable to see the changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for V2 I can't clear the SOURCE and FINDING.
security-command-center/snippets/src/test/java/vtwo/SourceIT.java
Outdated
Show resolved
Hide resolved
security-command-center/snippets/src/main/java/vtwo/source/UpdateFindingSource.java
Show resolved
Hide resolved
6fb37af
to
0249c82
Compare
security-command-center/snippets/src/main/java/vtwo/source/GetSource.java
Outdated
Show resolved
Hide resolved
} | ||
|
||
@BeforeClass | ||
public static void setUp() throws IOException, InterruptedException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rafaelMurata I'm unable to see the changes.
0249c82
to
79c7341
Compare
@rafaelMurata Kindly add the AfterClass method to clean up the resources created during setup |
79c7341
to
8050f13
Compare
done. |
security-command-center/snippets/src/test/java/vtwo/SourceIT.java
Outdated
Show resolved
Hide resolved
8050f13
to
86e394d
Compare
86e394d
to
bb5fc67
Compare
@Sita04 |
bb5fc67
to
4f50bf0
Compare
@Sita04 |
Description
b/337023783
Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.
Checklist
pom.xml
parent set to latestshared-configuration
mvn clean verify
requiredmvn -P lint checkstyle:check
requiredmvn -P lint clean compile pmd:cpd-check spotbugs:check
advisory only