Unverified Commit 65c84529 authored by Kubernetes Prow Robot's avatar Kubernetes Prow Robot Committed by GitHub

Merge pull request #72248 from freehan/revendor

Revendor GCE API Go Client
parents b006342c 0e4ba4b7
...@@ -122,23 +122,23 @@ ...@@ -122,23 +122,23 @@
}, },
{ {
"ImportPath": "github.com/GoogleCloudPlatform/k8s-cloud-provider/pkg/cloud", "ImportPath": "github.com/GoogleCloudPlatform/k8s-cloud-provider/pkg/cloud",
"Comment": "1.2.0", "Comment": "1.3.0",
"Rev": "773c7a284e1399960745d0e2c501f577a20d4947" "Rev": "f8e99590510076aa1e3ff07df946f05220c50fb4"
}, },
{ {
"ImportPath": "github.com/GoogleCloudPlatform/k8s-cloud-provider/pkg/cloud/filter", "ImportPath": "github.com/GoogleCloudPlatform/k8s-cloud-provider/pkg/cloud/filter",
"Comment": "1.2.0", "Comment": "1.3.0",
"Rev": "773c7a284e1399960745d0e2c501f577a20d4947" "Rev": "f8e99590510076aa1e3ff07df946f05220c50fb4"
}, },
{ {
"ImportPath": "github.com/GoogleCloudPlatform/k8s-cloud-provider/pkg/cloud/meta", "ImportPath": "github.com/GoogleCloudPlatform/k8s-cloud-provider/pkg/cloud/meta",
"Comment": "1.2.0", "Comment": "1.3.0",
"Rev": "773c7a284e1399960745d0e2c501f577a20d4947" "Rev": "f8e99590510076aa1e3ff07df946f05220c50fb4"
}, },
{ {
"ImportPath": "github.com/GoogleCloudPlatform/k8s-cloud-provider/pkg/cloud/mock", "ImportPath": "github.com/GoogleCloudPlatform/k8s-cloud-provider/pkg/cloud/mock",
"Comment": "1.2.0", "Comment": "1.3.0",
"Rev": "773c7a284e1399960745d0e2c501f577a20d4947" "Rev": "f8e99590510076aa1e3ff07df946f05220c50fb4"
}, },
{ {
"ImportPath": "github.com/JeffAshton/win_pdh", "ImportPath": "github.com/JeffAshton/win_pdh",
...@@ -3751,47 +3751,47 @@ ...@@ -3751,47 +3751,47 @@
}, },
{ {
"ImportPath": "google.golang.org/api/compute/v0.alpha", "ImportPath": "google.golang.org/api/compute/v0.alpha",
"Rev": "3639d6d93f377f39a1de765fa4ef37b3c7ca8bd9" "Rev": "583d854617af4d2080b5d2a24d72f7fc5a128ab2"
}, },
{ {
"ImportPath": "google.golang.org/api/compute/v0.beta", "ImportPath": "google.golang.org/api/compute/v0.beta",
"Rev": "3639d6d93f377f39a1de765fa4ef37b3c7ca8bd9" "Rev": "583d854617af4d2080b5d2a24d72f7fc5a128ab2"
}, },
{ {
"ImportPath": "google.golang.org/api/compute/v1", "ImportPath": "google.golang.org/api/compute/v1",
"Rev": "3639d6d93f377f39a1de765fa4ef37b3c7ca8bd9" "Rev": "583d854617af4d2080b5d2a24d72f7fc5a128ab2"
}, },
{ {
"ImportPath": "google.golang.org/api/container/v1", "ImportPath": "google.golang.org/api/container/v1",
"Rev": "3639d6d93f377f39a1de765fa4ef37b3c7ca8bd9" "Rev": "583d854617af4d2080b5d2a24d72f7fc5a128ab2"
}, },
{ {
"ImportPath": "google.golang.org/api/gensupport", "ImportPath": "google.golang.org/api/gensupport",
"Rev": "3639d6d93f377f39a1de765fa4ef37b3c7ca8bd9" "Rev": "583d854617af4d2080b5d2a24d72f7fc5a128ab2"
}, },
{ {
"ImportPath": "google.golang.org/api/googleapi", "ImportPath": "google.golang.org/api/googleapi",
"Rev": "3639d6d93f377f39a1de765fa4ef37b3c7ca8bd9" "Rev": "583d854617af4d2080b5d2a24d72f7fc5a128ab2"
}, },
{ {
"ImportPath": "google.golang.org/api/googleapi/internal/uritemplates", "ImportPath": "google.golang.org/api/googleapi/internal/uritemplates",
"Rev": "3639d6d93f377f39a1de765fa4ef37b3c7ca8bd9" "Rev": "583d854617af4d2080b5d2a24d72f7fc5a128ab2"
}, },
{ {
"ImportPath": "google.golang.org/api/logging/v2beta1", "ImportPath": "google.golang.org/api/logging/v2beta1",
"Rev": "3639d6d93f377f39a1de765fa4ef37b3c7ca8bd9" "Rev": "583d854617af4d2080b5d2a24d72f7fc5a128ab2"
}, },
{ {
"ImportPath": "google.golang.org/api/monitoring/v3", "ImportPath": "google.golang.org/api/monitoring/v3",
"Rev": "3639d6d93f377f39a1de765fa4ef37b3c7ca8bd9" "Rev": "583d854617af4d2080b5d2a24d72f7fc5a128ab2"
}, },
{ {
"ImportPath": "google.golang.org/api/pubsub/v1", "ImportPath": "google.golang.org/api/pubsub/v1",
"Rev": "3639d6d93f377f39a1de765fa4ef37b3c7ca8bd9" "Rev": "583d854617af4d2080b5d2a24d72f7fc5a128ab2"
}, },
{ {
"ImportPath": "google.golang.org/api/tpu/v1", "ImportPath": "google.golang.org/api/tpu/v1",
"Rev": "3639d6d93f377f39a1de765fa4ef37b3c7ca8bd9" "Rev": "583d854617af4d2080b5d2a24d72f7fc5a128ab2"
}, },
{ {
"ImportPath": "google.golang.org/genproto/googleapis/rpc/status", "ImportPath": "google.golang.org/genproto/googleapis/rpc/status",
......
...@@ -7,8 +7,6 @@ go_library( ...@@ -7,8 +7,6 @@ go_library(
importpath = "google.golang.org/api/compute/v0.alpha", importpath = "google.golang.org/api/compute/v0.alpha",
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [ deps = [
"//vendor/golang.org/x/net/context:go_default_library",
"//vendor/golang.org/x/net/context/ctxhttp:go_default_library",
"//vendor/google.golang.org/api/gensupport:go_default_library", "//vendor/google.golang.org/api/gensupport:go_default_library",
"//vendor/google.golang.org/api/googleapi:go_default_library", "//vendor/google.golang.org/api/googleapi:go_default_library",
], ],
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -7,8 +7,6 @@ go_library( ...@@ -7,8 +7,6 @@ go_library(
importpath = "google.golang.org/api/compute/v0.beta", importpath = "google.golang.org/api/compute/v0.beta",
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [ deps = [
"//vendor/golang.org/x/net/context:go_default_library",
"//vendor/golang.org/x/net/context/ctxhttp:go_default_library",
"//vendor/google.golang.org/api/gensupport:go_default_library", "//vendor/google.golang.org/api/gensupport:go_default_library",
"//vendor/google.golang.org/api/googleapi:go_default_library", "//vendor/google.golang.org/api/googleapi:go_default_library",
], ],
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -7,8 +7,6 @@ go_library( ...@@ -7,8 +7,6 @@ go_library(
importpath = "google.golang.org/api/compute/v1", importpath = "google.golang.org/api/compute/v1",
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [ deps = [
"//vendor/golang.org/x/net/context:go_default_library",
"//vendor/golang.org/x/net/context/ctxhttp:go_default_library",
"//vendor/google.golang.org/api/gensupport:go_default_library", "//vendor/google.golang.org/api/gensupport:go_default_library",
"//vendor/google.golang.org/api/googleapi:go_default_library", "//vendor/google.golang.org/api/googleapi:go_default_library",
], ],
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -7,8 +7,6 @@ go_library( ...@@ -7,8 +7,6 @@ go_library(
importpath = "google.golang.org/api/container/v1", importpath = "google.golang.org/api/container/v1",
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [ deps = [
"//vendor/golang.org/x/net/context:go_default_library",
"//vendor/golang.org/x/net/context/ctxhttp:go_default_library",
"//vendor/google.golang.org/api/gensupport:go_default_library", "//vendor/google.golang.org/api/gensupport:go_default_library",
"//vendor/google.golang.org/api/googleapi:go_default_library", "//vendor/google.golang.org/api/googleapi:go_default_library",
], ],
......
...@@ -6,12 +6,10 @@ go_library( ...@@ -6,12 +6,10 @@ go_library(
"backoff.go", "backoff.go",
"buffer.go", "buffer.go",
"doc.go", "doc.go",
"go18.go",
"header.go", "header.go",
"json.go", "json.go",
"jsonfloat.go", "jsonfloat.go",
"media.go", "media.go",
"not_go18.go",
"params.go", "params.go",
"resumable.go", "resumable.go",
"retry.go", "retry.go",
...@@ -20,11 +18,7 @@ go_library( ...@@ -20,11 +18,7 @@ go_library(
importmap = "k8s.io/kubernetes/vendor/google.golang.org/api/gensupport", importmap = "k8s.io/kubernetes/vendor/google.golang.org/api/gensupport",
importpath = "google.golang.org/api/gensupport", importpath = "google.golang.org/api/gensupport",
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [ deps = ["//vendor/google.golang.org/api/googleapi:go_default_library"],
"//vendor/golang.org/x/net/context:go_default_library",
"//vendor/golang.org/x/net/context/ctxhttp:go_default_library",
"//vendor/google.golang.org/api/googleapi:go_default_library",
],
) )
filegroup( filegroup(
......
...@@ -9,6 +9,8 @@ import ( ...@@ -9,6 +9,8 @@ import (
"time" "time"
) )
// BackoffStrategy defines the set of functions that a backoff-er must
// implement.
type BackoffStrategy interface { type BackoffStrategy interface {
// Pause returns the duration of the next pause and true if the operation should be // Pause returns the duration of the next pause and true if the operation should be
// retried, or false if no further retries should be attempted. // retried, or false if no further retries should be attempted.
...@@ -28,6 +30,7 @@ type ExponentialBackoff struct { ...@@ -28,6 +30,7 @@ type ExponentialBackoff struct {
n uint n uint
} }
// Pause returns the amount of time the caller should wait.
func (eb *ExponentialBackoff) Pause() (time.Duration, bool) { func (eb *ExponentialBackoff) Pause() (time.Duration, bool) {
if eb.total > eb.Max { if eb.total > eb.Max {
return 0, false return 0, false
...@@ -40,6 +43,8 @@ func (eb *ExponentialBackoff) Pause() (time.Duration, bool) { ...@@ -40,6 +43,8 @@ func (eb *ExponentialBackoff) Pause() (time.Duration, bool) {
return d, true return d, true
} }
// Reset resets the backoff strategy such that the next Pause call will begin
// counting from the start. It is not safe to call concurrently with Pause.
func (eb *ExponentialBackoff) Reset() { func (eb *ExponentialBackoff) Reset() {
eb.n = 0 eb.n = 0
eb.total = 0 eb.total = 0
......
...@@ -11,7 +11,8 @@ import ( ...@@ -11,7 +11,8 @@ import (
"google.golang.org/api/googleapi" "google.golang.org/api/googleapi"
) )
// MediaBuffer buffers data from an io.Reader to support uploading media in retryable chunks. // MediaBuffer buffers data from an io.Reader to support uploading media in
// retryable chunks. It should be created with NewMediaBuffer.
type MediaBuffer struct { type MediaBuffer struct {
media io.Reader media io.Reader
...@@ -22,6 +23,7 @@ type MediaBuffer struct { ...@@ -22,6 +23,7 @@ type MediaBuffer struct {
off int64 off int64
} }
// NewMediaBuffer initializes a MediaBuffer.
func NewMediaBuffer(media io.Reader, chunkSize int) *MediaBuffer { func NewMediaBuffer(media io.Reader, chunkSize int) *MediaBuffer {
return &MediaBuffer{media: media, chunk: make([]byte, 0, chunkSize)} return &MediaBuffer{media: media, chunk: make([]byte, 0, chunkSize)}
} }
......
// Copyright 2018 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build go1.8
package gensupport
import (
"io"
"net/http"
)
// SetGetBody sets the GetBody field of req to f.
func SetGetBody(req *http.Request, f func() (io.ReadCloser, error)) {
req.GetBody = f
}
// Copyright 2016 Google Inc. All Rights Reserved. // Copyright 2016 Google LLC
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
......
...@@ -242,6 +242,7 @@ func NewInfoFromResumableMedia(r io.ReaderAt, size int64, mediaType string) *Med ...@@ -242,6 +242,7 @@ func NewInfoFromResumableMedia(r io.ReaderAt, size int64, mediaType string) *Med
} }
} }
// SetProgressUpdater sets the progress updater for the media info.
func (mi *MediaInfo) SetProgressUpdater(pu googleapi.ProgressUpdater) { func (mi *MediaInfo) SetProgressUpdater(pu googleapi.ProgressUpdater) {
if mi != nil { if mi != nil {
mi.progressUpdater = pu mi.progressUpdater = pu
...@@ -334,3 +335,8 @@ func (mi *MediaInfo) ResumableUpload(locURI string) *ResumableUpload { ...@@ -334,3 +335,8 @@ func (mi *MediaInfo) ResumableUpload(locURI string) *ResumableUpload {
}, },
} }
} }
// SetGetBody sets the GetBody field of req to f.
func SetGetBody(req *http.Request, f func() (io.ReadCloser, error)) {
req.GetBody = f
}
// Copyright 2018 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build !go1.8
package gensupport
import (
"io"
"net/http"
)
func SetGetBody(req *http.Request, f func() (io.ReadCloser, error)) {}
...@@ -43,6 +43,7 @@ func (u URLParams) Encode() string { ...@@ -43,6 +43,7 @@ func (u URLParams) Encode() string {
return url.Values(u).Encode() return url.Values(u).Encode()
} }
// SetOptions sets the URL params and any additional call options.
func SetOptions(u URLParams, opts ...googleapi.CallOption) { func SetOptions(u URLParams, opts ...googleapi.CallOption) {
for _, o := range opts { for _, o := range opts {
u.Set(o.Get()) u.Set(o.Get())
......
...@@ -5,14 +5,13 @@ ...@@ -5,14 +5,13 @@
package gensupport package gensupport
import ( import (
"context"
"errors" "errors"
"fmt" "fmt"
"io" "io"
"net/http" "net/http"
"sync" "sync"
"time" "time"
"golang.org/x/net/context"
) )
const ( const (
......
// Copyright 2017 Google Inc. All Rights Reserved. // Copyright 2017 Google LLC
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
...@@ -15,12 +15,11 @@ ...@@ -15,12 +15,11 @@
package gensupport package gensupport
import ( import (
"context"
"io" "io"
"net" "net"
"net/http" "net/http"
"time" "time"
"golang.org/x/net/context"
) )
// Retry invokes the given function, retrying it multiple times if the connection failed or // Retry invokes the given function, retrying it multiple times if the connection failed or
......
...@@ -5,12 +5,10 @@ ...@@ -5,12 +5,10 @@
package gensupport package gensupport
import ( import (
"context"
"encoding/json" "encoding/json"
"errors" "errors"
"net/http" "net/http"
"golang.org/x/net/context"
"golang.org/x/net/context/ctxhttp"
) )
// Hook is the type of a function that is called once before each HTTP request // Hook is the type of a function that is called once before each HTTP request
...@@ -32,7 +30,8 @@ func RegisterHook(h Hook) { ...@@ -32,7 +30,8 @@ func RegisterHook(h Hook) {
// SendRequest sends a single HTTP request using the given client. // SendRequest sends a single HTTP request using the given client.
// If ctx is non-nil, it calls all hooks, then sends the request with // If ctx is non-nil, it calls all hooks, then sends the request with
// ctxhttp.Do, then calls any functions returned by the hooks in reverse order. // req.WithContext, then calls any functions returned by the hooks in
// reverse order.
func SendRequest(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error) { func SendRequest(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error) {
// Disallow Accept-Encoding because it interferes with the automatic gzip handling // Disallow Accept-Encoding because it interferes with the automatic gzip handling
// done by the default http.Transport. See https://github.com/google/google-api-go-client/issues/219. // done by the default http.Transport. See https://github.com/google/google-api-go-client/issues/219.
...@@ -50,7 +49,7 @@ func SendRequest(ctx context.Context, client *http.Client, req *http.Request) (* ...@@ -50,7 +49,7 @@ func SendRequest(ctx context.Context, client *http.Client, req *http.Request) (*
} }
// Send request. // Send request.
resp, err := ctxhttp.Do(ctx, client, req) resp, err := send(ctx, client, req)
// Call returned funcs in reverse order. // Call returned funcs in reverse order.
for i := len(post) - 1; i >= 0; i-- { for i := len(post) - 1; i >= 0; i-- {
...@@ -61,6 +60,23 @@ func SendRequest(ctx context.Context, client *http.Client, req *http.Request) (* ...@@ -61,6 +60,23 @@ func SendRequest(ctx context.Context, client *http.Client, req *http.Request) (*
return resp, err return resp, err
} }
func send(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error) {
if client == nil {
client = http.DefaultClient
}
resp, err := client.Do(req.WithContext(ctx))
// If we got an error, and the context has been canceled,
// the context's error is probably more useful.
if err != nil {
select {
case <-ctx.Done():
err = ctx.Err()
default:
}
}
return resp, err
}
// DecodeResponse decodes the body of res into target. If there is no body, // DecodeResponse decodes the body of res into target. If there is no body,
// target is unchanged. // target is unchanged.
func DecodeResponse(target interface{}, res *http.Response) error { func DecodeResponse(target interface{}, res *http.Response) error {
......
...@@ -37,24 +37,28 @@ type SizeReaderAt interface { ...@@ -37,24 +37,28 @@ type SizeReaderAt interface {
// ServerResponse is embedded in each Do response and // ServerResponse is embedded in each Do response and
// provides the HTTP status code and header sent by the server. // provides the HTTP status code and header sent by the server.
type ServerResponse struct { type ServerResponse struct {
// HTTPStatusCode is the server's response status code. // HTTPStatusCode is the server's response status code. When using a
// When using a resource method's Do call, this will always be in the 2xx range. // resource method's Do call, this will always be in the 2xx range.
HTTPStatusCode int HTTPStatusCode int
// Header contains the response header fields from the server. // Header contains the response header fields from the server.
Header http.Header Header http.Header
} }
const ( const (
// Version defines the gax version being used. This is typically sent
// in an HTTP header to services.
Version = "0.5" Version = "0.5"
// UserAgent is the header string used to identify this package. // UserAgent is the header string used to identify this package.
UserAgent = "google-api-go-client/" + Version UserAgent = "google-api-go-client/" + Version
// The default chunk size to use for resumable uploads if not specified by the user. // DefaultUploadChunkSize is the default chunk size to use for resumable
// uploads if not specified by the user.
DefaultUploadChunkSize = 8 * 1024 * 1024 DefaultUploadChunkSize = 8 * 1024 * 1024
// The minimum chunk size that can be used for resumable uploads. All // MinUploadChunkSize is the minimum chunk size that can be used for
// user-specified chunk sizes must be multiple of this value. // resumable uploads. All user-specified chunk sizes must be multiple of
// this value.
MinUploadChunkSize = 256 * 1024 MinUploadChunkSize = 256 * 1024
) )
...@@ -161,9 +165,13 @@ func CheckMediaResponse(res *http.Response) error { ...@@ -161,9 +165,13 @@ func CheckMediaResponse(res *http.Response) error {
} }
} }
// MarshalStyle defines whether to marshal JSON with a {"data": ...} wrapper.
type MarshalStyle bool type MarshalStyle bool
// WithDataWrapper marshals JSON with a {"data": ...} wrapper.
var WithDataWrapper = MarshalStyle(true) var WithDataWrapper = MarshalStyle(true)
// WithoutDataWrapper marshals JSON without a {"data": ...} wrapper.
var WithoutDataWrapper = MarshalStyle(false) var WithoutDataWrapper = MarshalStyle(false)
func (wrap MarshalStyle) JSONReader(v interface{}) (io.Reader, error) { func (wrap MarshalStyle) JSONReader(v interface{}) (io.Reader, error) {
...@@ -212,6 +220,7 @@ func (w countingWriter) Write(p []byte) (int, error) { ...@@ -212,6 +220,7 @@ func (w countingWriter) Write(p []byte) (int, error) {
// The remaining usable pieces of resumable uploads is exposed in each auto-generated API. // The remaining usable pieces of resumable uploads is exposed in each auto-generated API.
type ProgressUpdater func(current, total int64) type ProgressUpdater func(current, total int64)
// MediaOption defines the interface for setting media options.
type MediaOption interface { type MediaOption interface {
setOptions(o *MediaOptions) setOptions(o *MediaOptions)
} }
...@@ -268,6 +277,11 @@ func ProcessMediaOptions(opts []MediaOption) *MediaOptions { ...@@ -268,6 +277,11 @@ func ProcessMediaOptions(opts []MediaOption) *MediaOptions {
return mo return mo
} }
// ResolveRelative resolves relatives such as "http://www.golang.org/" and
// "topics/myproject/mytopic" into a single string, such as
// "http://www.golang.org/topics/myproject/mytopic". It strips all parent
// references (e.g. ../..) as well as anything after the host
// (e.g. /bar/gaz gets stripped out of foo.com/bar/gaz).
func ResolveRelative(basestr, relstr string) string { func ResolveRelative(basestr, relstr string) string {
u, _ := url.Parse(basestr) u, _ := url.Parse(basestr)
afterColonPath := "" afterColonPath := ""
......
...@@ -120,33 +120,33 @@ func quotedList(n int, fn func(dst []byte, i int) []byte) ([]byte, error) { ...@@ -120,33 +120,33 @@ func quotedList(n int, fn func(dst []byte, i int) []byte) ([]byte, error) {
return dst, nil return dst, nil
} }
func (s Int64s) MarshalJSON() ([]byte, error) { func (q Int64s) MarshalJSON() ([]byte, error) {
return quotedList(len(s), func(dst []byte, i int) []byte { return quotedList(len(q), func(dst []byte, i int) []byte {
return strconv.AppendInt(dst, s[i], 10) return strconv.AppendInt(dst, q[i], 10)
}) })
} }
func (s Int32s) MarshalJSON() ([]byte, error) { func (q Int32s) MarshalJSON() ([]byte, error) {
return quotedList(len(s), func(dst []byte, i int) []byte { return quotedList(len(q), func(dst []byte, i int) []byte {
return strconv.AppendInt(dst, int64(s[i]), 10) return strconv.AppendInt(dst, int64(q[i]), 10)
}) })
} }
func (s Uint64s) MarshalJSON() ([]byte, error) { func (q Uint64s) MarshalJSON() ([]byte, error) {
return quotedList(len(s), func(dst []byte, i int) []byte { return quotedList(len(q), func(dst []byte, i int) []byte {
return strconv.AppendUint(dst, s[i], 10) return strconv.AppendUint(dst, q[i], 10)
}) })
} }
func (s Uint32s) MarshalJSON() ([]byte, error) { func (q Uint32s) MarshalJSON() ([]byte, error) {
return quotedList(len(s), func(dst []byte, i int) []byte { return quotedList(len(q), func(dst []byte, i int) []byte {
return strconv.AppendUint(dst, uint64(s[i]), 10) return strconv.AppendUint(dst, uint64(q[i]), 10)
}) })
} }
func (s Float64s) MarshalJSON() ([]byte, error) { func (q Float64s) MarshalJSON() ([]byte, error) {
return quotedList(len(s), func(dst []byte, i int) []byte { return quotedList(len(q), func(dst []byte, i int) []byte {
return strconv.AppendFloat(dst, s[i], 'g', -1, 64) return strconv.AppendFloat(dst, q[i], 'g', -1, 64)
}) })
} }
......
...@@ -7,8 +7,6 @@ go_library( ...@@ -7,8 +7,6 @@ go_library(
importpath = "google.golang.org/api/logging/v2beta1", importpath = "google.golang.org/api/logging/v2beta1",
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [ deps = [
"//vendor/golang.org/x/net/context:go_default_library",
"//vendor/golang.org/x/net/context/ctxhttp:go_default_library",
"//vendor/google.golang.org/api/gensupport:go_default_library", "//vendor/google.golang.org/api/gensupport:go_default_library",
"//vendor/google.golang.org/api/googleapi:go_default_library", "//vendor/google.golang.org/api/googleapi:go_default_library",
], ],
......
...@@ -7,8 +7,6 @@ go_library( ...@@ -7,8 +7,6 @@ go_library(
importpath = "google.golang.org/api/monitoring/v3", importpath = "google.golang.org/api/monitoring/v3",
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [ deps = [
"//vendor/golang.org/x/net/context:go_default_library",
"//vendor/golang.org/x/net/context/ctxhttp:go_default_library",
"//vendor/google.golang.org/api/gensupport:go_default_library", "//vendor/google.golang.org/api/gensupport:go_default_library",
"//vendor/google.golang.org/api/googleapi:go_default_library", "//vendor/google.golang.org/api/googleapi:go_default_library",
], ],
......
...@@ -7,8 +7,6 @@ go_library( ...@@ -7,8 +7,6 @@ go_library(
importpath = "google.golang.org/api/pubsub/v1", importpath = "google.golang.org/api/pubsub/v1",
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [ deps = [
"//vendor/golang.org/x/net/context:go_default_library",
"//vendor/golang.org/x/net/context/ctxhttp:go_default_library",
"//vendor/google.golang.org/api/gensupport:go_default_library", "//vendor/google.golang.org/api/gensupport:go_default_library",
"//vendor/google.golang.org/api/googleapi:go_default_library", "//vendor/google.golang.org/api/googleapi:go_default_library",
], ],
......
...@@ -7,8 +7,6 @@ go_library( ...@@ -7,8 +7,6 @@ go_library(
importpath = "google.golang.org/api/tpu/v1", importpath = "google.golang.org/api/tpu/v1",
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [ deps = [
"//vendor/golang.org/x/net/context:go_default_library",
"//vendor/golang.org/x/net/context/ctxhttp:go_default_library",
"//vendor/google.golang.org/api/gensupport:go_default_library", "//vendor/google.golang.org/api/gensupport:go_default_library",
"//vendor/google.golang.org/api/googleapi:go_default_library", "//vendor/google.golang.org/api/googleapi:go_default_library",
], ],
......
...@@ -400,34 +400,6 @@ ...@@ -400,34 +400,6 @@
"https://www.googleapis.com/auth/cloud-platform" "https://www.googleapis.com/auth/cloud-platform"
] ]
}, },
"reset": {
"description": "Resets a node, which stops and starts the VM.",
"flatPath": "v1/projects/{projectsId}/locations/{locationsId}/nodes/{nodesId}:reset",
"httpMethod": "POST",
"id": "tpu.projects.locations.nodes.reset",
"parameterOrder": [
"name"
],
"parameters": {
"name": {
"description": "The resource name.",
"location": "path",
"pattern": "^projects/[^/]+/locations/[^/]+/nodes/[^/]+$",
"required": true,
"type": "string"
}
},
"path": "v1/{+name}:reset",
"request": {
"$ref": "ResetNodeRequest"
},
"response": {
"$ref": "Operation"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
},
"start": { "start": {
"description": "Starts a node.", "description": "Starts a node.",
"flatPath": "v1/projects/{projectsId}/locations/{locationsId}/nodes/{nodesId}:start", "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/nodes/{nodesId}:start",
...@@ -686,7 +658,7 @@ ...@@ -686,7 +658,7 @@
} }
} }
}, },
"revision": "20180601", "revision": "20181010",
"rootUrl": "https://tpu.googleapis.com/", "rootUrl": "https://tpu.googleapis.com/",
"schemas": { "schemas": {
"AcceleratorType": { "AcceleratorType": {
...@@ -760,6 +732,13 @@ ...@@ -760,6 +732,13 @@
"$ref": "Node" "$ref": "Node"
}, },
"type": "array" "type": "array"
},
"unreachable": {
"description": "Locations that could not be reached.",
"items": {
"type": "string"
},
"type": "array"
} }
}, },
"type": "object" "type": "object"
...@@ -940,7 +919,9 @@ ...@@ -940,7 +919,9 @@
"REPAIRING", "REPAIRING",
"STOPPED", "STOPPED",
"STOPPING", "STOPPING",
"STARTING" "STARTING",
"PREEMPTED",
"TERMINATED"
], ],
"enumDescriptions": [ "enumDescriptions": [
"TPU node state is not known/set.", "TPU node state is not known/set.",
...@@ -952,7 +933,9 @@ ...@@ -952,7 +933,9 @@
"TPU node is being repaired and may be unusable. Details can be\nfound in the `help_description` field.", "TPU node is being repaired and may be unusable. Details can be\nfound in the `help_description` field.",
"7 - Reserved. Was SUSPENDED.\nTPU node is stopped.", "7 - Reserved. Was SUSPENDED.\nTPU node is stopped.",
"TPU node is currently stopping.", "TPU node is currently stopping.",
"TPU node is currently starting." "TPU node is currently starting.",
"TPU node has been preempted. Only applies to Preemptible TPU Nodes.",
"TPU node has been terminated due to maintenance or has reached the end of\nits life cycle (for preemptible nodes)."
], ],
"type": "string" "type": "string"
}, },
...@@ -1046,12 +1029,6 @@ ...@@ -1046,12 +1029,6 @@
}, },
"type": "object" "type": "object"
}, },
"ResetNodeRequest": {
"description": "Request for ResetNode.",
"id": "ResetNodeRequest",
"properties": {},
"type": "object"
},
"SchedulingConfig": { "SchedulingConfig": {
"id": "SchedulingConfig", "id": "SchedulingConfig",
"properties": { "properties": {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment