Skip to content

docs(compute-samples): added region tags #7070

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

Merged
merged 2 commits into from
Apr 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package compute;

// [START compute_template_create]
import com.google.cloud.compute.v1.AccessConfig;
import com.google.cloud.compute.v1.AccessConfig.NetworkTier;
import com.google.cloud.compute.v1.AttachedDisk;
Expand Down Expand Up @@ -132,4 +133,5 @@ public static void createInstanceTemplateWithDiskType(String projectId, String t
.printf("Instance Template Operation Status %s: %s", templateName, response.getStatus());
}
}
}
}
// [END compute_template_create]
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package compute;

// [START compute_template_delete]

import com.google.cloud.compute.v1.DeleteInstanceTemplateRequest;
import com.google.cloud.compute.v1.InstanceTemplatesClient;
import com.google.cloud.compute.v1.Operation;
Expand Down Expand Up @@ -54,4 +56,5 @@ public static void deleteInstanceTemplate(String projectId, String templateName)
response.getStatus());
}
}
}
}
// [END compute_template_delete]
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package compute;

// [START compute_template_get]

import com.google.cloud.compute.v1.GetInstanceTemplateRequest;
import com.google.cloud.compute.v1.InstanceTemplate;
import com.google.cloud.compute.v1.InstanceTemplatesClient;
Expand All @@ -26,7 +28,7 @@ public class GetInstanceTemplate {
public static void main(String[] args) throws IOException {
// TODO(developer): Replace these variables before running the sample.
// projectId: project ID or project number of the Cloud project you use.
// templateName: name of the new template to retrieve.
// templateName: name of the template to retrieve.
String projectId = "your-project-id";
String templateName = "template-name";
getInstanceTemplate(projectId, templateName);
Expand All @@ -46,4 +48,5 @@ public static void getInstanceTemplate(String projectId, String templateName) th
System.out.println("Instance Template retrieved: " + instanceTemplate.getName());
}
}
}
}
// [END compute_template_get]
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package compute;

// [START compute_template_list]

import com.google.cloud.compute.v1.InstanceTemplate;
import com.google.cloud.compute.v1.InstanceTemplatesClient;
import com.google.cloud.compute.v1.InstanceTemplatesClient.ListPagedResponse;
Expand All @@ -42,4 +44,5 @@ public static ListPagedResponse listInstanceTemplates(String projectId) throws I
return templates;
}
}
}
}
// [END compute_template_list]