Point unmodified GCP tools at this simulator at http://192.168.252.7:9000 — no real credentials needed.
Snippets are copy-paste ready (your live host is filled in) and mirror the conformance harness in tests/conformance/.
gcloud config set auth/disable_credentials true
gcloud config set core/project gcp-dev
# REST services — set the override for the one you use:
export CLOUDSDK_API_ENDPOINT_OVERRIDES_STORAGE="http://192.168.252.7:9000/storage/v1/"
export CLOUDSDK_API_ENDPOINT_OVERRIDES_COMPUTE="http://192.168.252.7:9000/compute/v1/"
export CLOUDSDK_API_ENDPOINT_OVERRIDES_SQLADMIN="http://192.168.252.7:9000/sql/v1beta4/"
export CLOUDSDK_API_ENDPOINT_OVERRIDES_CLOUDFUNCTIONS="http://192.168.252.7:9000/v1/"
export CLOUDSDK_API_ENDPOINT_OVERRIDES_IAM="http://192.168.252.7:9000/v1/"
# gRPC services use the bundled emulators (separate ports):
export STORAGE_EMULATOR_HOST="192.168.252.7:9000"
export PUBSUB_EMULATOR_HOST="192.168.252.7:8085"
export FIRESTORE_EMULATOR_HOST="192.168.252.7:8080" // libraries-bom 26.43.0. gapic clients (Storage/PubSub/Firestore): NoCredentials + setHost
// or *_EMULATOR_HOST. Apiary REST clients (Compute/SQL/Functions/IAM): setRootUrl("http://192.168.252.7:9000/").
HttpTransport transport = GoogleNetHttpTransport.newTrustedTransport();
JsonFactory json = GsonFactory.getDefaultInstance();import "google.golang.org/api/option"
var noAuth = option.WithoutAuthentication() // for REST clients (Compute/SQL/Functions/IAM)
// Storage/PubSub/Firestore: set *_EMULATOR_HOST instead of an endpoint.export STORAGE_EMULATOR_HOST="192.168.252.7:9000"
gcloud storage buckets create gs://demo
gcloud storage cp ./f.txt gs://demo/f.txt
gcloud storage ls gs://demoStorage st = StorageOptions.newBuilder().setHost("http://192.168.252.7:9000")
.setProjectId("gcp-dev").setCredentials(NoCredentials.getInstance()).build().getService();
st.create(BucketInfo.of("demo"));
st.create(BlobInfo.newBuilder("demo", "f.txt").build(), "hello".getBytes());// STORAGE_EMULATOR_HOST=192.168.252.7:9000
c, _ := storage.NewClient(ctx)
c.Bucket("demo").Create(ctx, "gcp-dev", nil)
w := c.Bucket("demo").Object("f.txt").NewWriter(ctx); w.Write([]byte("hello")); w.Close()gcloud compute instances create vm1 --zone=us-central1-a --machine-type=e2-micro
gcloud compute instances list --zones=us-central1-aCompute compute = new Compute.Builder(transport, json, null)
.setRootUrl("http://192.168.252.7:9000/").setApplicationName("cl").build();
compute.instances().list("gcp-dev", "us-central1-a").execute();csvc, _ := compute.NewService(ctx, noAuth, option.WithEndpoint("http://192.168.252.7:9000/compute/v1/"))
list, _ := csvc.Instances.List("gcp-dev", "us-central1-a").Do()gcloud sql instances create db1 --database-version=POSTGRES_16 --tier=db-f1-micro --region=us-central1
gcloud sql instances listSQLAdmin sql = new SQLAdmin.Builder(transport, json, null)
.setRootUrl("http://192.168.252.7:9000/").setApplicationName("cl").build();
sql.instances().list("gcp-dev").execute();ssvc, _ := sqladmin.NewService(ctx, noAuth, option.WithEndpoint("http://192.168.252.7:9000/"))
ssvc.Instances.List("gcp-dev").Do()export PUBSUB_EMULATOR_HOST="192.168.252.7:8085"
gcloud pubsub topics create demo-topic
gcloud pubsub subscriptions create demo-sub --topic=demo-topic// PUBSUB_EMULATOR_HOST=192.168.252.7:8085
TopicAdminClient admin = TopicAdminClient.create();
admin.createTopic(TopicName.of("gcp-dev", "demo-topic"));
Publisher pub = Publisher.newBuilder(TopicName.of("gcp-dev", "demo-topic")).build();
pub.publish(PubsubMessage.newBuilder().setData(ByteString.copyFromUtf8("hi")).build());// PUBSUB_EMULATOR_HOST=192.168.252.7:8085
c, _ := pubsub.NewClient(ctx, "gcp-dev")
t, _ := c.CreateTopic(ctx, "demo-topic")
t.Publish(ctx, &pubsub.Message{Data: []byte("hi")}).Get(ctx)export FIRESTORE_EMULATOR_HOST="192.168.252.7:8080"
# Document CRUD is via the client libraries (gcloud has no doc-level CRUD).// FIRESTORE_EMULATOR_HOST=192.168.252.7:8080
Firestore db = FirestoreOptions.getDefaultInstance().getService();
db.collection("users").document("alice").set(Map.of("name", "Alice"));// FIRESTORE_EMULATOR_HOST=192.168.252.7:8080
c, _ := firestore.NewClient(ctx, "gcp-dev")
c.Collection("users").Doc("alice").Set(ctx, map[string]any{"name": "Alice"})gcloud functions list --region=us-central1CloudFunctions fn = new CloudFunctions.Builder(transport, json, null)
.setRootUrl("http://192.168.252.7:9000/").setApplicationName("cl").build();
fn.projects().locations().functions().list("projects/gcp-dev/locations/us-central1").execute();fsvc, _ := cloudfunctions.NewService(ctx, noAuth, option.WithEndpoint("http://192.168.252.7:9000/"))
fsvc.Projects.Locations.Functions.List("projects/gcp-dev/locations/us-central1").Do()gcloud iam service-accounts create demo-sa
gcloud iam service-accounts listIam iam = new Iam.Builder(transport, json, null)
.setRootUrl("http://192.168.252.7:9000/").setApplicationName("cl").build();
iam.projects().serviceAccounts().list("projects/gcp-dev").execute();isvc, _ := iam.NewService(ctx, noAuth, option.WithEndpoint("http://192.168.252.7:9000/"))
isvc.Projects.ServiceAccounts.List("projects/gcp-dev").Do()gcloud compute networks create demo-vpc --subnet-mode=custom
gcloud compute networks list
gcloud compute firewall-rules list// same Apiary Compute client as Compute Engine
compute.networks().list("gcp-dev").execute();
compute.firewalls().list("gcp-dev").execute();csvc.Networks.List("gcp-dev").Do()
csvc.Firewalls.List("gcp-dev").Do()