Skip to content

compute: call compute package error #4377

@wanglong001

Description

@wanglong001

Client
cloud.google.com/go v0.86.0
compute
Environment
image

Go Environment
$ go version
go version go1.16.5 darwin/amd64
$ go env
GO111MODULE="auto"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/wangzelong/Library/Caches/go-build"
GOENV="/Users/wangzelong/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/wangzelong/go/pkg/mod"
GOOS="darwin"
GOPATH="/Users/wangzelong/go"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.16.5"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/p5/x22xctmd4fx7wc31mcgkw96h0000gn/T/go-build883774571=/tmp/go-build -gno-record-gcc-switches -fno-common"
Code

e.g.

reqs := &computepb.ListRegionsRequest{Project: "psyched-subset-161702"}
cli, _ := compute.NewRegionsRESTClient(context.Background(), option.WithCredentialsJSON([]byte(CRED_JSON)))
a, err := cli.List(context.TODO(), reqs)
fmt.Println(a, err)

return

<nil> Get "compute.googleapis.com/compute/v1/projects/psyched-subset-161702/regions": unsupported protocol scheme 
reqs := &computepb.ListRegionsRequest{Project: "psyched-subset-161702"}
cli, _ := compute.NewRegionsRESTClient(context.Background(), option.WithCredentialsJSON([]byte(CRED_JSON)), option.WithEndpoint("https://compute.googleapis.com/"))
a, err := cli.List(context.TODO(), reqs)
fmt.Println(a, err)

return

<nil> Get "https://compute.googleapis.com//compute/v1/projects/psyched-subset-161702/regions": stream error: stream ID 1; INTERNAL_ERROR

Metadata

Metadata

Assignees

Labels

api: computeIssues related to the Compute Engine API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions