File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
compute/cloud-client/src/main/java/compute/snapshot Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -31,22 +31,23 @@ public static void main(String[] args) throws IOException {
3131 // Name of the region in which your snapshot schedule is located.
3232 String region = "us-central1" ;
3333 // Name of your snapshot schedule.
34- String scheduleName = "YOUR_SCHEDULE_NAME" ;
34+ String snapshotScheduleName = "YOUR_SCHEDULE_NAME" ;
3535
36- getSnapshotSchedule (projectId , region , scheduleName );
36+ getSnapshotSchedule (projectId , region , snapshotScheduleName );
3737 }
3838
3939 // Retrieves the details of a snapshot schedule.
4040 public static ResourcePolicy getSnapshotSchedule (
41- String projectId , String region , String scheduleName ) throws IOException {
41+ String projectId , String region , String snapshotScheduleName ) throws IOException {
4242 // Initialize client that will be used to send requests. This client only needs to be created
4343 // once, and can be reused for multiple requests.
4444 try (ResourcePoliciesClient resourcePoliciesClient = ResourcePoliciesClient .create ()) {
4545 GetResourcePolicyRequest request = GetResourcePolicyRequest .newBuilder ()
4646 .setProject (projectId )
4747 .setRegion (region )
48- .setResourcePolicy (scheduleName )
48+ .setResourcePolicy (snapshotScheduleName )
4949 .build ();
50+
5051 return resourcePoliciesClient .get (request );
5152 }
5253 }
You can’t perform that action at this time.
0 commit comments