Skip to content
Open
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
27 changes: 27 additions & 0 deletions cbt.go
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,13 @@ var commands = []struct {
Usage: "cbt listinstances",
Required: ProjectRequired,
},
{
Name: "directaccess_connectivity",
Desc: "Returns if Direct Access is supported",
do: doDirectAccessConnectivity,
Usage: "cbt directaccess_connectivity <app-profile-id>",
Required: ProjectAndInstanceRequired,
},
// {
// Name: "listsnapshots",
// Desc: "List backups in a cluster (deprecated)",
Expand Down Expand Up @@ -1329,6 +1336,26 @@ func doListInstances(ctx context.Context, args ...string) {
tw.Flush()
}

func doDirectAccessConnectivity(ctx context.Context, args ...string) {
if len(args) != 1 {
log.Fatalf("usage: cbt directaccess_connectivity <app-profile-id>")
}
appProfileId := args[0]

supported, err := bigtable.CheckDirectAccessSupported(ctx, config.Project, config.Instance, appProfileId)
if err != nil {
fmt.Fprintf(os.Stderr, "Error during connectivity check: %v\n", err)
os.Exit(1)
}

if supported {
fmt.Println("✅ Success: Direct access (DirectPath) is supported.")
} else {
fmt.Println("❌ Failure: Direct access (DirectPath) is NOT supported.")
fmt.Println(" Please check your network configuration, VPC settings, and DNS resolution.")
}
}

func doListClusters(ctx context.Context, args ...string) {
if len(args) != 0 {
log.Fatalf("usage: cbt listclusters")
Expand Down
10 changes: 10 additions & 0 deletions cbtdoc.go
Original file line number Diff line number Diff line change
Expand Up @@ -454,5 +454,15 @@ Usage:
Usage:

cbt waitforreplication <table-id>

# Tests whether the environment is correctly configured to support DirectPath connectivity
to a specific Bigtable instance with a given app profile.
This check validates network reachability and configuration required for the client
to connect directly to Cloud Bigtable.

Usage:

cbt directaccess_connectivity <app-profile-id>
*/

package main
46 changes: 26 additions & 20 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,51 +1,56 @@
module cloud.google.com/go/cbt

go 1.23.0
go 1.24.0

toolchain go1.24.4

require (
cloud.google.com/go/bigtable v1.38.0
cloud.google.com/go/bigtable v1.40.1
github.com/google/go-cmp v0.7.0
github.com/jhump/protoreflect v1.17.0
github.com/olekukonko/tablewriter v0.0.5
golang.org/x/oauth2 v0.30.0
golang.org/x/sys v0.33.0
google.golang.org/api v0.237.0
google.golang.org/grpc v1.73.0
google.golang.org/protobuf v1.36.6
golang.org/x/sys v0.35.0
google.golang.org/api v0.247.0
google.golang.org/grpc v1.74.2
google.golang.org/protobuf v1.36.7
gopkg.in/yaml.v2 v2.4.0
)

// IMPORTANT: If this ever changes, ensure that THIRD_PARTY_NOTICES.txt is
// updated accordingly.
require (
cloud.google.com/go v0.121.2
cloud.google.com/go/compute/metadata v0.7.0 // indirect
cloud.google.com/go v0.121.6
cloud.google.com/go/compute/metadata v0.8.0 // indirect
cloud.google.com/go/iam v1.5.2 // indirect
cloud.google.com/go/longrunning v0.6.7 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cncf/xds/go v0.0.0-20250326154945-ae57f3c0d45f // indirect
github.com/cncf/xds/go v0.0.0-20250501225837-2ac532fd4443 // indirect
github.com/envoyproxy/protoc-gen-validate v1.2.1 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/btree v1.1.3 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.6 // indirect
github.com/googleapis/gax-go/v2 v2.14.2 // indirect
golang.org/x/net v0.41.0 // indirect
golang.org/x/text v0.26.0 // indirect
google.golang.org/genproto v0.0.0-20250505200425-f936aa4a68b2 // indirect
github.com/googleapis/gax-go/v2 v2.15.0 // indirect
golang.org/x/net v0.43.0 // indirect
golang.org/x/text v0.28.0 // indirect
google.golang.org/genproto v0.0.0-20250603155806-513f23925822 // indirect
rsc.io/binaryregexp v0.2.0 // indirect
)

require (
cel.dev/expr v0.23.0 // indirect
cloud.google.com/go/auth v0.16.2 // indirect
cel.dev/expr v0.24.0 // indirect
cloud.google.com/go/auth v0.16.4 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect
cloud.google.com/go/monitoring v1.24.2 // indirect
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.27.0 // indirect
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.53.0 // indirect
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.53.0 // indirect
github.com/bufbuild/protocompile v0.14.1 // indirect
github.com/envoyproxy/go-control-plane/envoy v1.32.4 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-jose/go-jose/v4 v4.0.5 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/google/s2a-go v0.1.9 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
Expand All @@ -54,16 +59,17 @@ require (
github.com/spiffe/go-spiffe/v2 v2.5.0 // indirect
github.com/zeebo/errs v1.4.0 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/contrib/detectors/gcp v1.36.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 // indirect
go.opentelemetry.io/otel v1.36.0 // indirect
go.opentelemetry.io/otel/metric v1.36.0 // indirect
go.opentelemetry.io/otel/sdk v1.36.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.36.0 // indirect
go.opentelemetry.io/otel/trace v1.36.0 // indirect
golang.org/x/crypto v0.39.0 // indirect
golang.org/x/sync v0.15.0 // indirect
golang.org/x/crypto v0.41.0 // indirect
golang.org/x/sync v0.16.0 // indirect
golang.org/x/time v0.12.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250603155806-513f23925822 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250603155806-513f23925822 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250818200422-3122310a409c // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250818200422-3122310a409c // indirect
)
Loading
Loading