godep revendor google api go clients

This commit is contained in:
Minhan Xia 2017-09-14 16:00:59 -07:00
parent 4714cddc22
commit 43d2da04f9
18 changed files with 51587 additions and 5546 deletions

26
Godeps/Godeps.json generated
View File

@ -2861,55 +2861,55 @@
},
{
"ImportPath": "google.golang.org/api/cloudkms/v1",
"Rev": "98825bb0065da4054e5da6db34f5fc598e50bc24"
"Rev": "654f863362977d69086620b5f72f13e911da2410"
},
{
"ImportPath": "google.golang.org/api/cloudmonitoring/v2beta2",
"Rev": "98825bb0065da4054e5da6db34f5fc598e50bc24"
"Rev": "654f863362977d69086620b5f72f13e911da2410"
},
{
"ImportPath": "google.golang.org/api/compute/v0.alpha",
"Rev": "98825bb0065da4054e5da6db34f5fc598e50bc24"
"Rev": "654f863362977d69086620b5f72f13e911da2410"
},
{
"ImportPath": "google.golang.org/api/compute/v0.beta",
"Rev": "98825bb0065da4054e5da6db34f5fc598e50bc24"
"Rev": "654f863362977d69086620b5f72f13e911da2410"
},
{
"ImportPath": "google.golang.org/api/compute/v1",
"Rev": "98825bb0065da4054e5da6db34f5fc598e50bc24"
"Rev": "654f863362977d69086620b5f72f13e911da2410"
},
{
"ImportPath": "google.golang.org/api/container/v1",
"Rev": "98825bb0065da4054e5da6db34f5fc598e50bc24"
"Rev": "654f863362977d69086620b5f72f13e911da2410"
},
{
"ImportPath": "google.golang.org/api/dns/v1",
"Rev": "98825bb0065da4054e5da6db34f5fc598e50bc24"
"Rev": "654f863362977d69086620b5f72f13e911da2410"
},
{
"ImportPath": "google.golang.org/api/gensupport",
"Rev": "98825bb0065da4054e5da6db34f5fc598e50bc24"
"Rev": "654f863362977d69086620b5f72f13e911da2410"
},
{
"ImportPath": "google.golang.org/api/googleapi",
"Rev": "98825bb0065da4054e5da6db34f5fc598e50bc24"
"Rev": "654f863362977d69086620b5f72f13e911da2410"
},
{
"ImportPath": "google.golang.org/api/googleapi/internal/uritemplates",
"Rev": "98825bb0065da4054e5da6db34f5fc598e50bc24"
"Rev": "654f863362977d69086620b5f72f13e911da2410"
},
{
"ImportPath": "google.golang.org/api/logging/v2beta1",
"Rev": "98825bb0065da4054e5da6db34f5fc598e50bc24"
"Rev": "654f863362977d69086620b5f72f13e911da2410"
},
{
"ImportPath": "google.golang.org/api/monitoring/v3",
"Rev": "98825bb0065da4054e5da6db34f5fc598e50bc24"
"Rev": "654f863362977d69086620b5f72f13e911da2410"
},
{
"ImportPath": "google.golang.org/api/pubsub/v1",
"Rev": "98825bb0065da4054e5da6db34f5fc598e50bc24"
"Rev": "654f863362977d69086620b5f72f13e911da2410"
},
{
"ImportPath": "google.golang.org/genproto/googleapis/rpc/status",

View File

@ -1,9 +1,4 @@
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
@ -16,6 +11,7 @@ go_library(
],
"//conditions:default": [],
}),
visibility = ["//visibility:public"],
)
filegroup(

File diff suppressed because it is too large Load Diff

View File

@ -364,169 +364,6 @@ func (s *Binding) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CloudAuditOptions: Write a Cloud Audit log
type CloudAuditOptions struct {
// LogName: The log_name to populate in the Cloud Audit Record.
//
// Possible values:
// "UNSPECIFIED_LOG_NAME" - Default. Should not be used.
// "ADMIN_ACTIVITY" - Corresponds to
// "cloudaudit.googleapis.com/activity"
// "DATA_ACCESS" - Corresponds to
// "cloudaudit.googleapis.com/data_access"
LogName string `json:"logName,omitempty"`
// ForceSendFields is a list of field names (e.g. "LogName") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "LogName") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *CloudAuditOptions) MarshalJSON() ([]byte, error) {
type noMethod CloudAuditOptions
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Condition: A condition to be met.
type Condition struct {
// Iam: Trusted attributes supplied by the IAM system.
//
// Possible values:
// "NO_ATTR" - Default non-attribute.
// "AUTHORITY" - Either principal or (if present) authority selector.
// "ATTRIBUTION" - The principal (even if an authority selector is
// present), which
// must only be used for attribution, not authorization.
// "APPROVER" - An approver (distinct from the requester) that has
// authorized this
// request.
// When used with IN, the condition indicates that one of the
// approvers
// associated with the request matches the specified principal, or is
// a
// member of the specified group. Approvers can only grant
// additional
// access, and are thus only used in a strictly positive context
// (e.g. ALLOW/IN or DENY/NOT_IN).
// "JUSTIFICATION_TYPE" - What types of justifications have been
// supplied with this request.
// String values should match enum names from
// tech.iam.JustificationType,
// e.g. "MANUAL_STRING". It is not permitted to grant access based
// on
// the *absence* of a justification, so justification conditions can
// only
// be used in a "positive" context (e.g., ALLOW/IN or
// DENY/NOT_IN).
//
// Multiple justifications, e.g., a Buganizer ID and a
// manually-entered
// reason, are normal and supported.
Iam string `json:"iam,omitempty"`
// Op: An operator to apply the subject with.
//
// Possible values:
// "NO_OP" - Default no-op.
// "EQUALS" - DEPRECATED. Use IN instead.
// "NOT_EQUALS" - DEPRECATED. Use NOT_IN instead.
// "IN" - The condition is true if the subject (or any element of it
// if it is
// a set) matches any of the supplied values.
// "NOT_IN" - The condition is true if the subject (or every element
// of it if it is
// a set) matches none of the supplied values.
// "DISCHARGED" - Subject is discharged
Op string `json:"op,omitempty"`
// Svc: Trusted attributes discharged by the service.
Svc string `json:"svc,omitempty"`
// Sys: Trusted attributes supplied by any service that owns resources
// and uses
// the IAM system for access control.
//
// Possible values:
// "NO_ATTR" - Default non-attribute type
// "REGION" - Region of the resource
// "SERVICE" - Service name
// "NAME" - Resource name
// "IP" - IP address of the caller
Sys string `json:"sys,omitempty"`
// Value: DEPRECATED. Use 'values' instead.
Value string `json:"value,omitempty"`
// Values: The objects of the condition. This is mutually exclusive with
// 'value'.
Values []string `json:"values,omitempty"`
// ForceSendFields is a list of field names (e.g. "Iam") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Iam") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Condition) MarshalJSON() ([]byte, error) {
type noMethod Condition
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CounterOptions: Options for counters
type CounterOptions struct {
// Field: The field value to attribute.
Field string `json:"field,omitempty"`
// Metric: The metric to update.
Metric string `json:"metric,omitempty"`
// ForceSendFields is a list of field names (e.g. "Field") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Field") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *CounterOptions) MarshalJSON() ([]byte, error) {
type noMethod CounterOptions
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CryptoKey: A CryptoKey represents a logical key that can be used for
// cryptographic
// operations.
@ -538,6 +375,9 @@ type CryptoKey struct {
// created.
CreateTime string `json:"createTime,omitempty"`
// Labels: Labels with user defined metadata.
Labels map[string]string `json:"labels,omitempty"`
// Name: Output only. The resource name for this CryptoKey in the
// format
// `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
@ -620,6 +460,14 @@ func (s *CryptoKey) MarshalJSON() ([]byte, error) {
// parent CryptoKey, in which case the server will choose the
// appropriate
// version for the operation.
//
// For security reasons, the raw cryptographic key material represented
// by a
// CryptoKeyVersion can never be viewed or exported. It can only be used
// to
// encrypt or decrypt data when an authorized user or application
// invokes Cloud
// KMS.
type CryptoKeyVersion struct {
// CreateTime: Output only. The time at which this CryptoKeyVersion was
// created.
@ -689,10 +537,6 @@ func (s *CryptoKeyVersion) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// DataAccessOptions: Write a Data Access (Gin) log
type DataAccessOptions struct {
}
// DecryptRequest: Request message for KeyManagementService.Decrypt.
type DecryptRequest struct {
// AdditionalAuthenticatedData: Optional data that must match the data
@ -1146,69 +990,6 @@ func (s *Location) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// LogConfig: Specifies what kind of log the caller must write
// Increment a streamz counter with the specified metric and field
// names.
//
// Metric names should start with a '/', generally be
// lowercase-only,
// and end in "_count". Field names should not contain an initial
// slash.
// The actual exported metric names will have "/iam/policy"
// prepended.
//
// Field names correspond to IAM request parameters and field values
// are
// their respective values.
//
// At present the only supported field names are
// - "iam_principal", corresponding to IAMContext.principal;
// - "" (empty string), resulting in one aggretated counter with no
// field.
//
// Examples:
// counter { metric: "/debug_access_count" field: "iam_principal" }
// ==> increment counter /iam/policy/backend_debug_access_count
// {iam_principal=[value of
// IAMContext.principal]}
//
// At this time we do not support:
// * multiple field names (though this may be supported in the future)
// * decrementing the counter
// * incrementing it by anything other than 1
type LogConfig struct {
// CloudAudit: Cloud audit options.
CloudAudit *CloudAuditOptions `json:"cloudAudit,omitempty"`
// Counter: Counter options.
Counter *CounterOptions `json:"counter,omitempty"`
// DataAccess: Data access options.
DataAccess *DataAccessOptions `json:"dataAccess,omitempty"`
// ForceSendFields is a list of field names (e.g. "CloudAudit") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "CloudAudit") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *LogConfig) MarshalJSON() ([]byte, error) {
type noMethod LogConfig
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Policy: Defines an Identity and Access Management (IAM) policy. It is
// used to
// specify access control policies for Cloud Platform resources.
@ -1276,20 +1057,6 @@ type Policy struct {
IamOwned bool `json:"iamOwned,omitempty"`
// Rules: If more than one rule is specified, the rules are applied in
// the following
// manner:
// - All matching LOG rules are always applied.
// - If any DENY/DENY_WITH_LOG rule matches, permission is denied.
// Logging will be applied if one or more matching rule requires
// logging.
// - Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is
// granted.
// Logging will be applied if one or more matching rule requires
// logging.
// - Otherwise, if no rule applies, permission is denied.
Rules []*Rule `json:"rules,omitempty"`
// Version: Version of the `Policy`. The default version is 0.
Version int64 `json:"version,omitempty"`
@ -1325,77 +1092,6 @@ func (s *Policy) MarshalJSON() ([]byte, error) {
type RestoreCryptoKeyVersionRequest struct {
}
// Rule: A rule to be applied in a Policy.
type Rule struct {
// Action: Required
//
// Possible values:
// "NO_ACTION" - Default no action.
// "ALLOW" - Matching 'Entries' grant access.
// "ALLOW_WITH_LOG" - Matching 'Entries' grant access and the caller
// promises to log
// the request per the returned log_configs.
// "DENY" - Matching 'Entries' deny access.
// "DENY_WITH_LOG" - Matching 'Entries' deny access and the caller
// promises to log
// the request per the returned log_configs.
// "LOG" - Matching 'Entries' tell IAM.Check callers to generate logs.
Action string `json:"action,omitempty"`
// Conditions: Additional restrictions that must be met
Conditions []*Condition `json:"conditions,omitempty"`
// Description: Human-readable description of the rule.
Description string `json:"description,omitempty"`
// In: If one or more 'in' clauses are specified, the rule matches
// if
// the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.
In []string `json:"in,omitempty"`
// LogConfig: The config returned to callers of tech.iam.IAM.CheckPolicy
// for any entries
// that match the LOG action.
LogConfig []*LogConfig `json:"logConfig,omitempty"`
// NotIn: If one or more 'not_in' clauses are specified, the rule
// matches
// if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries.
// The format for in and not_in entries is the same as for members in
// a
// Binding (see google/iam/v1/policy.proto).
NotIn []string `json:"notIn,omitempty"`
// Permissions: A permission is a string of form '<service>.<resource
// type>.<verb>'
// (e.g., 'storage.buckets.list'). A value of '*' matches all
// permissions,
// and a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs.
Permissions []string `json:"permissions,omitempty"`
// ForceSendFields is a list of field names (e.g. "Action") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Action") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Rule) MarshalJSON() ([]byte, error) {
type noMethod Rule
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SetIamPolicyRequest: Request message for `SetIamPolicy` method.
type SetIamPolicyRequest struct {
// Policy: REQUIRED: The complete policy to be applied to the

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -850,28 +850,43 @@ func (s *HttpLoadBalancing) MarshalJSON() ([]byte, error) {
// IPAllocationPolicy: Configuration for controlling how IPs are
// allocated in the cluster.
type IPAllocationPolicy struct {
// ClusterIpv4Cidr: The IP address range for the cluster pod IPs. If
// this field is set, then
// ClusterIpv4Cidr: This field is deprecated, use
// cluster_ipv4_cidr_block.
ClusterIpv4Cidr string `json:"clusterIpv4Cidr,omitempty"`
// ClusterIpv4CidrBlock: The IP address range for the cluster pod IPs.
// If this field is set, then
// `cluster.cluster_ipv4_cidr` must be left blank.
//
// This field is only applicable when `use_ip_aliases` is true.
//
// Set to blank to have a range will be chosen with the default
// size.
// Set to blank to have a range chosen with the default size.
//
// Set to /netmask (e.g. `/14`) to have a range be chosen with a
// Set to /netmask (e.g. `/14`) to have a range chosen with a
// specific
// netmask.
//
// Set to a
// Set to
// a
// [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
// no
// tation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks
//
// notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks
// (e.g.
// `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific
// range
// to use.
ClusterIpv4Cidr string `json:"clusterIpv4Cidr,omitempty"`
ClusterIpv4CidrBlock string `json:"clusterIpv4CidrBlock,omitempty"`
// ClusterSecondaryRangeName: The name of the secondary range to be used
// for the cluster CIDR
// block. The secondary range will be used for pod IP
// addresses. This must be an existing secondary range associated
// with the cluster subnetwork.
//
// This field is only applicable with use_ip_aliases is true
// and
// create_subnetwork is false.
ClusterSecondaryRangeName string `json:"clusterSecondaryRangeName,omitempty"`
// CreateSubnetwork: Whether a new subnetwork will be created
// automatically for the cluster.
@ -879,50 +894,68 @@ type IPAllocationPolicy struct {
// This field is only applicable when `use_ip_aliases` is true.
CreateSubnetwork bool `json:"createSubnetwork,omitempty"`
// NodeIpv4Cidr: The IP address range of the instance IPs in this
// NodeIpv4Cidr: This field is deprecated, use node_ipv4_cidr_block.
NodeIpv4Cidr string `json:"nodeIpv4Cidr,omitempty"`
// NodeIpv4CidrBlock: The IP address range of the instance IPs in this
// cluster.
//
// This is applicable only if `create_subnetwork` is true.
//
// Set to blank to have a range will be chosen with the default
// size.
// Set to blank to have a range chosen with the default size.
//
// Set to /netmask (e.g. `/14`) to have a range be chosen with a
// Set to /netmask (e.g. `/14`) to have a range chosen with a
// specific
// netmask.
//
// Set to a
// Set to
// a
// [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
// no
// tation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks
//
// notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks
// (e.g.
// `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific
// range
// to use.
NodeIpv4Cidr string `json:"nodeIpv4Cidr,omitempty"`
NodeIpv4CidrBlock string `json:"nodeIpv4CidrBlock,omitempty"`
// ServicesIpv4Cidr: The IP address range of the services IPs in this
// cluster. If blank, a range
// ServicesIpv4Cidr: This field is deprecated, use
// services_ipv4_cidr_block.
ServicesIpv4Cidr string `json:"servicesIpv4Cidr,omitempty"`
// ServicesIpv4CidrBlock: The IP address range of the services IPs in
// this cluster. If blank, a range
// will be automatically chosen with the default size.
//
// This field is only applicable when `use_ip_aliases` is true.
//
// Set to blank to have a range will be chosen with the default
// size.
// Set to blank to have a range chosen with the default size.
//
// Set to /netmask (e.g. `/14`) to have a range be chosen with a
// Set to /netmask (e.g. `/14`) to have a range chosen with a
// specific
// netmask.
//
// Set to a
// Set to
// a
// [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
// no
// tation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks
//
// notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks
// (e.g.
// `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific
// range
// to use.
ServicesIpv4Cidr string `json:"servicesIpv4Cidr,omitempty"`
ServicesIpv4CidrBlock string `json:"servicesIpv4CidrBlock,omitempty"`
// ServicesSecondaryRangeName: The name of the secondary range to be
// used as for the services
// CIDR block. The secondary range will be used for service
// ClusterIPs. This must be an existing secondary range associated
// with the cluster subnetwork.
//
// This field is only applicable with use_ip_aliases is true
// and
// create_subnetwork is false.
ServicesSecondaryRangeName string `json:"servicesSecondaryRangeName,omitempty"`
// SubnetworkName: A custom subnetwork name to be used if
// `create_subnetwork` is true. If
@ -1313,7 +1346,8 @@ type NodeConfig struct {
// and conflicts should be avoided.
// For more information, including usage and the valid values,
// see:
// http://kubernetes.io/v1.1/docs/user-guide/labels.html
// https://kubernetes.io/docs/concepts/overview/working-with-objects
// /labels/
Labels map[string]string `json:"labels,omitempty"`
// LocalSsdCount: The number of local SSD disks to be attached to the
@ -1627,6 +1661,11 @@ type Operation struct {
// Detail: Detailed operation progress, if available.
Detail string `json:"detail,omitempty"`
// EndTime: [Output only] The time the operation completed,
// in
// [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
EndTime string `json:"endTime,omitempty"`
// Name: The server-assigned ID for the operation.
Name string `json:"name,omitempty"`
@ -1654,6 +1693,11 @@ type Operation struct {
// SelfLink: Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
// StartTime: [Output only] The time the operation started,
// in
// [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
StartTime string `json:"startTime,omitempty"`
// Status: The current status of the operation.
//
// Possible values:

View File

@ -174,26 +174,126 @@ func typeHeader(contentType string) textproto.MIMEHeader {
// PrepareUpload determines whether the data in the supplied reader should be
// uploaded in a single request, or in sequential chunks.
// chunkSize is the size of the chunk that media should be split into.
// If chunkSize is non-zero and the contents of media do not fit in a single
// chunk (or there is an error reading media), then media will be returned as a
// MediaBuffer. Otherwise, media will be returned as a Reader.
//
// If chunkSize is zero, media is returned as the first value, and the other
// two return values are nil, true.
//
// Otherwise, a MediaBuffer is returned, along with a bool indicating whether the
// contents of media fit in a single chunk.
//
// After PrepareUpload has been called, media should no longer be used: the
// media content should be accessed via one of the return values.
func PrepareUpload(media io.Reader, chunkSize int) (io.Reader, *MediaBuffer) {
func PrepareUpload(media io.Reader, chunkSize int) (r io.Reader, mb *MediaBuffer, singleChunk bool) {
if chunkSize == 0 { // do not chunk
return media, nil
return media, nil, true
}
mb = NewMediaBuffer(media, chunkSize)
_, _, _, err := mb.Chunk()
// If err is io.EOF, we can upload this in a single request. Otherwise, err is
// either nil or a non-EOF error. If it is the latter, then the next call to
// mb.Chunk will return the same error. Returning a MediaBuffer ensures that this
// error will be handled at some point.
return nil, mb, err == io.EOF
}
// MediaInfo holds information for media uploads. It is intended for use by generated
// code only.
type MediaInfo struct {
// At most one of Media and MediaBuffer will be set.
media io.Reader
buffer *MediaBuffer
singleChunk bool
mType string
size int64 // mediaSize, if known. Used only for calls to progressUpdater_.
progressUpdater googleapi.ProgressUpdater
}
// NewInfoFromMedia should be invoked from the Media method of a call. It returns a
// MediaInfo populated with chunk size and content type, and a reader or MediaBuffer
// if needed.
func NewInfoFromMedia(r io.Reader, options []googleapi.MediaOption) *MediaInfo {
mi := &MediaInfo{}
opts := googleapi.ProcessMediaOptions(options)
if !opts.ForceEmptyContentType {
r, mi.mType = DetermineContentType(r, opts.ContentType)
}
mi.media, mi.buffer, mi.singleChunk = PrepareUpload(r, opts.ChunkSize)
return mi
}
// NewInfoFromResumableMedia should be invoked from the ResumableMedia method of a
// call. It returns a MediaInfo using the given reader, size and media type.
func NewInfoFromResumableMedia(r io.ReaderAt, size int64, mediaType string) *MediaInfo {
rdr := ReaderAtToReader(r, size)
rdr, mType := DetermineContentType(rdr, mediaType)
return &MediaInfo{
size: size,
mType: mType,
buffer: NewMediaBuffer(rdr, googleapi.DefaultUploadChunkSize),
media: nil,
singleChunk: false,
}
}
func (mi *MediaInfo) SetProgressUpdater(pu googleapi.ProgressUpdater) {
if mi != nil {
mi.progressUpdater = pu
}
}
// UploadType determines the type of upload: a single request, or a resumable
// series of requests.
func (mi *MediaInfo) UploadType() string {
if mi.singleChunk {
return "multipart"
}
return "resumable"
}
// UploadRequest sets up an HTTP request for media upload. It adds headers
// as necessary, and returns a replacement for the body.
func (mi *MediaInfo) UploadRequest(reqHeaders http.Header, body io.Reader) (newBody io.Reader, cleanup func()) {
cleanup = func() {}
if mi == nil {
return body, cleanup
}
var media io.Reader
if mi.media != nil {
// This only happens when the caller has turned off chunking. In that
// case, we write all of media in a single non-retryable request.
media = mi.media
} else if mi.singleChunk {
// The data fits in a single chunk, which has now been read into the MediaBuffer.
// We obtain that chunk so we can write it in a single request. The request can
// be retried because the data is stored in the MediaBuffer.
media, _, _, _ = mi.buffer.Chunk()
}
if media != nil {
combined, ctype := CombineBodyMedia(body, "application/json", media, mi.mType)
cleanup = func() { combined.Close() }
reqHeaders.Set("Content-Type", ctype)
body = combined
}
if mi.buffer != nil && mi.mType != "" && !mi.singleChunk {
reqHeaders.Set("X-Upload-Content-Type", mi.mType)
}
return body, cleanup
}
// ResumableUpload returns an appropriately configured ResumableUpload value if the
// upload is resumable, or nil otherwise.
func (mi *MediaInfo) ResumableUpload(locURI string) *ResumableUpload {
if mi == nil || mi.singleChunk {
return nil
}
return &ResumableUpload{
URI: locURI,
Media: mi.buffer,
MediaType: mi.mType,
Callback: func(curr int64) {
if mi.progressUpdater != nil {
mi.progressUpdater(curr, mi.size)
}
},
}
mb := NewMediaBuffer(media, chunkSize)
rdr, _, _, err := mb.Chunk()
if err == io.EOF { // we can upload this in a single request
return rdr, nil
}
// err might be a non-EOF error. If it is, the next call to mb.Chunk will
// return the same error. Returning a MediaBuffer ensures that this error
// will be handled at some point.
return nil, mb
}

File diff suppressed because it is too large Load Diff

View File

@ -204,6 +204,55 @@ type ProjectsSinksService struct {
s *Service
}
// BucketOptions: BucketOptions describes the bucket boundaries used to
// create a histogram for the distribution. The buckets can be in a
// linear sequence, an exponential sequence, or each bucket can be
// specified explicitly. BucketOptions does not include the number of
// values in each bucket.A bucket has an inclusive lower bound and
// exclusive upper bound for the values that are counted for that
// bucket. The upper bound of a bucket must be strictly greater than the
// lower bound. The sequence of N buckets for a distribution consists of
// an underflow bucket (number 0), zero or more finite buckets (number 1
// through N - 2) and an overflow bucket (number N - 1). The buckets are
// contiguous: the lower bound of bucket i (i > 0) is the same as the
// upper bound of bucket i - 1. The buckets span the whole range of
// finite values: lower bound of the underflow bucket is -infinity and
// the upper bound of the overflow bucket is +infinity. The finite
// buckets are so-called because both bounds are finite.
type BucketOptions struct {
// ExplicitBuckets: The explicit buckets.
ExplicitBuckets *Explicit `json:"explicitBuckets,omitempty"`
// ExponentialBuckets: The exponential buckets.
ExponentialBuckets *Exponential `json:"exponentialBuckets,omitempty"`
// LinearBuckets: The linear bucket.
LinearBuckets *Linear `json:"linearBuckets,omitempty"`
// ForceSendFields is a list of field names (e.g. "ExplicitBuckets") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ExplicitBuckets") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *BucketOptions) MarshalJSON() ([]byte, error) {
type noMethod BucketOptions
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Empty: A generic empty message that you can re-use to avoid defining
// duplicated empty messages in your APIs. A typical example is to use
// it as the request or the response type of an API method. For
@ -219,6 +268,96 @@ type Empty struct {
googleapi.ServerResponse `json:"-"`
}
// Explicit: Specifies a set of buckets with arbitrary widths.There are
// size(bounds) + 1 (= N) buckets. Bucket i has the following
// boundaries:Upper bound (0 <= i < N-1): boundsi Lower bound (1 <= i <
// N); boundsi - 1The bounds field must contain at least one element. If
// bounds has only one element, then there are no finite buckets, and
// that single element is the common boundary of the overflow and
// underflow buckets.
type Explicit struct {
// Bounds: The values must be monotonically increasing.
Bounds []float64 `json:"bounds,omitempty"`
// ForceSendFields is a list of field names (e.g. "Bounds") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Bounds") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Explicit) MarshalJSON() ([]byte, error) {
type noMethod Explicit
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Exponential: Specifies an exponential sequence of buckets that have a
// width that is proportional to the value of the lower bound. Each
// bucket represents a constant relative uncertainty on a specific value
// in the bucket.There are num_finite_buckets + 2 (= N) buckets. Bucket
// i has the following boundaries:Upper bound (0 <= i < N-1): scale *
// (growth_factor ^ i). Lower bound (1 <= i < N): scale *
// (growth_factor ^ (i - 1)).
type Exponential struct {
// GrowthFactor: Must be greater than 1.
GrowthFactor float64 `json:"growthFactor,omitempty"`
// NumFiniteBuckets: Must be greater than 0.
NumFiniteBuckets int64 `json:"numFiniteBuckets,omitempty"`
// Scale: Must be greater than 0.
Scale float64 `json:"scale,omitempty"`
// ForceSendFields is a list of field names (e.g. "GrowthFactor") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "GrowthFactor") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Exponential) MarshalJSON() ([]byte, error) {
type noMethod Exponential
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
func (s *Exponential) UnmarshalJSON(data []byte) error {
type noMethod Exponential
var s1 struct {
GrowthFactor gensupport.JSONFloat64 `json:"growthFactor"`
Scale gensupport.JSONFloat64 `json:"scale"`
*noMethod
}
s1.noMethod = (*noMethod)(s)
if err := json.Unmarshal(data, &s1); err != nil {
return err
}
s.GrowthFactor = float64(s1.GrowthFactor)
s.Scale = float64(s1.Scale)
return nil
}
// HttpRequest: A common proto for logging HTTP requests. Only contains
// semantics defined by the HTTP specification. Product-specific logging
// information MUST be defined in a separate message.
@ -243,6 +382,10 @@ type HttpRequest struct {
// the request was received until the response was sent.
Latency string `json:"latency,omitempty"`
// Protocol: Protocol used for the request. Examples: "HTTP/1.1",
// "HTTP/2", "websocket"
Protocol string `json:"protocol,omitempty"`
// Referer: The referer URL of the request, as defined in HTTP/1.1
// Header Field Definitions
// (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html).
@ -345,6 +488,62 @@ func (s *LabelDescriptor) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Linear: Specifies a linear sequence of buckets that all have the same
// width (except overflow and underflow). Each bucket represents a
// constant absolute uncertainty on the specific value in the
// bucket.There are num_finite_buckets + 2 (= N) buckets. Bucket i has
// the following boundaries:Upper bound (0 <= i < N-1): offset + (width
// * i). Lower bound (1 <= i < N): offset + (width * (i - 1)).
type Linear struct {
// NumFiniteBuckets: Must be greater than 0.
NumFiniteBuckets int64 `json:"numFiniteBuckets,omitempty"`
// Offset: Lower bound of the first bucket.
Offset float64 `json:"offset,omitempty"`
// Width: Must be greater than 0.
Width float64 `json:"width,omitempty"`
// ForceSendFields is a list of field names (e.g. "NumFiniteBuckets") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "NumFiniteBuckets") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *Linear) MarshalJSON() ([]byte, error) {
type noMethod Linear
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
func (s *Linear) UnmarshalJSON(data []byte) error {
type noMethod Linear
var s1 struct {
Offset gensupport.JSONFloat64 `json:"offset"`
Width gensupport.JSONFloat64 `json:"width"`
*noMethod
}
s1.noMethod = (*noMethod)(s)
if err := json.Unmarshal(data, &s1); err != nil {
return err
}
s.Offset = float64(s1.Offset)
s.Width = float64(s1.Width)
return nil
}
// ListLogEntriesRequest: The parameters to ListLogEntries.
type ListLogEntriesRequest struct {
// Filter: Optional. A filter that chooses which log entries to return.
@ -420,7 +619,9 @@ func (s *ListLogEntriesRequest) MarshalJSON() ([]byte, error) {
// ListLogEntriesResponse: Result returned from ListLogEntries.
type ListLogEntriesResponse struct {
// Entries: A list of log entries.
// Entries: A list of log entries. If entries is empty, nextPageToken
// may still be returned, indicating that more entries may exist. See
// nextPageToken for more information.
Entries []*LogEntry `json:"entries,omitempty"`
// NextPageToken: If there might be more results than those appearing in
@ -627,9 +828,9 @@ type LogEntry struct {
// provide a value, then Stackdriver Logging considers other log entries
// in the same project, with the same timestamp, and with the same
// insert_id to be duplicates which can be removed. If omitted in new
// log entries, then Stackdriver Logging will insert its own unique
// identifier. The insert_id is used to order log entries that have the
// same timestamp value.
// log entries, then Stackdriver Logging assigns its own unique
// identifier. The insert_id is also used to order log entries that have
// the same timestamp value.
InsertId string `json:"insertId,omitempty"`
// JsonPayload: The log entry payload, represented as a structure that
@ -707,10 +908,12 @@ type LogEntry struct {
TextPayload string `json:"textPayload,omitempty"`
// Timestamp: Optional. The time the event described by the log entry
// occurred. If omitted in a new log entry, Stackdriver Logging will
// insert the time the log entry is received. Stackdriver Logging might
// reject log entries whose time stamps are more than a couple of hours
// in the future. Log entries with time stamps in the past are accepted.
// occurred. This time is used to compute the log entry's age and to
// enforce the logs retention period. If this field is omitted in a new
// log entry, then Stackdriver Logging assigns it the current
// time.Incoming log entries should have timestamps that are no more
// than the logs retention period in the past, and no more than 24 hours
// in the future. See the entries.write API method for more information.
Timestamp string `json:"timestamp,omitempty"`
// Trace: Optional. Resource name of the trace associated with the log
@ -881,8 +1084,17 @@ func (s *LogLine) MarshalJSON() ([]byte, error) {
// LogMetric: Describes a logs-based metric. The value of the metric is
// the number of log entries that match a logs filter in a given time
// interval.
// interval.Logs-based metric can also be used to extract values from
// logs and create a a distribution of the values. The distribution
// records the statistics of the extracted values along with an optional
// histogram of the values as specified by the bucket options.
type LogMetric struct {
// BucketOptions: Optional. The bucket_options are required when the
// logs-based metric is using a DISTRIBUTION value type and it describes
// the bucket boundaries used to create a histogram of the extracted
// values.
BucketOptions *BucketOptions `json:"bucketOptions,omitempty"`
// Description: Optional. A description of this metric, which is used in
// documentation.
Description string `json:"description,omitempty"`
@ -893,6 +1105,38 @@ type LogMetric struct {
// The maximum length of the filter is 20000 characters.
Filter string `json:"filter,omitempty"`
// LabelExtractors: Optional. A map from a label key string to an
// extractor expression which is used to extract data from a log entry
// field and assign as the label value. Each label key specified in the
// LabelDescriptor must have an associated extractor expression in this
// map. The syntax of the extractor expression is the same as for the
// value_extractor field.The extracted value is converted to the type
// defined in the label descriptor. If the either the extraction or the
// type conversion fails, the label will have a default value. The
// default value for a string label is an empty string, for an integer
// label its 0, and for a boolean label its false.Note that there are
// upper bounds on the maximum number of labels and the number of active
// time series that are allowed in a project.
LabelExtractors map[string]string `json:"labelExtractors,omitempty"`
// MetricDescriptor: Optional. The metric descriptor associated with the
// logs-based metric. If unspecified, it uses a default metric
// descriptor with a DELTA metric kind, INT64 value type, with no labels
// and a unit of "1". Such a metric counts the number of log entries
// matching the filter expression.The name, type, and description fields
// in the metric_descriptor are output only, and is constructed using
// the name and description field in the LogMetric.To create a
// logs-based metric that records a distribution of log values, a DELTA
// metric kind with a DISTRIBUTION value type must be used along with a
// value_extractor expression in the LogMetric.Each label in the metric
// descriptor must have a matching label name as the key and an
// extractor expression as the value in the label_extractors map.The
// metric_kind and value_type fields in the metric_descriptor cannot be
// updated once initially configured. New labels can be added in the
// metric_descriptor, but existing labels cannot be modified except for
// their description.
MetricDescriptor *MetricDescriptor `json:"metricDescriptor,omitempty"`
// Name: Required. The client-assigned metric identifier. Examples:
// "error_count", "nginx/requests".Metric identifiers are limited to 100
// characters and can include only the following characters: A-Z, a-z,
@ -906,10 +1150,26 @@ type LogMetric struct {
// Example: "projects/my-project/metrics/nginx%2Frequests".
Name string `json:"name,omitempty"`
// Version: Output only. The API version that created or updated this
// metric. The version also dictates the syntax of the filter
// expression. When a value for this field is missing, the default value
// of V2 should be assumed.
// ValueExtractor: Optional. A value_extractor is required when using a
// distribution logs-based metric to extract the values to record from a
// log entry. Two functions are supported for value extraction:
// EXTRACT(field) or REGEXP_EXTRACT(field, regex). The argument are: 1.
// field: The name of the log entry field from which the value is to be
// extracted. 2. regex: A regular expression using the Google RE2
// syntax (https://github.com/google/re2/wiki/Syntax) with a single
// capture group to extract data from the specified log entry field.
// The value of the field is converted to a string before applying the
// regex. It is an error to specify a regex that does not include
// exactly one capture group.The result of the extraction must be
// convertible to a double type, as the distribution always records
// double values. If either the extraction or the conversion to double
// fails, then those values are not recorded in the
// distribution.Example: REGEXP_EXTRACT(jsonPayload.request,
// ".*quantity=(\d+).*")
ValueExtractor string `json:"valueExtractor,omitempty"`
// Version: Deprecated. The API version that created or updated this
// metric. The v2 format is used by default and cannot be changed.
//
// Possible values:
// "V2" - Stackdriver Logging API v2.
@ -920,7 +1180,7 @@ type LogMetric struct {
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Description") to
// ForceSendFields is a list of field names (e.g. "BucketOptions") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
@ -928,7 +1188,7 @@ type LogMetric struct {
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Description") to include
// NullFields is a list of field names (e.g. "BucketOptions") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
@ -961,18 +1221,14 @@ type LogSink struct {
// not exported. For more information, see Exporting Logs With Sinks.
Destination string `json:"destination,omitempty"`
// EndTime: Optional. The time at which this sink will stop exporting
// log entries. Log entries are exported only if their timestamp is
// earlier than the end time. If this field is not supplied, there is no
// end time. If both a start time and an end time are provided, then the
// end time must be later than the start time.
// EndTime: Deprecated. This field is ignored when creating or updating
// sinks.
EndTime string `json:"endTime,omitempty"`
// Filter: Optional. An advanced logs filter. The only exported log
// entries are those that are in the resource owning the sink and that
// match the filter. The filter must use the log entry format specified
// by the output_version_format parameter. For example, in the v2
// format:
// match the filter. For
// example:
// logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR
//
Filter string `json:"filter,omitempty"`
@ -1013,10 +1269,8 @@ type LogSink struct {
// "V1" - LogEntry version 1 format.
OutputVersionFormat string `json:"outputVersionFormat,omitempty"`
// StartTime: Optional. The time at which this sink will begin exporting
// log entries. Log entries are exported only if their timestamp is not
// earlier than the start time. The default value of this field is the
// time the sink is created or updated.
// StartTime: Deprecated. This field is ignored when creating or
// updating sinks.
StartTime string `json:"startTime,omitempty"`
// WriterIdentity: Output only. An IAM identity&mdash;a service account
@ -1057,6 +1311,154 @@ func (s *LogSink) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// MetricDescriptor: Defines a metric type and its schema. Once a metric
// descriptor is created, deleting or altering it stops data collection
// and makes the metric type's existing data unusable.
type MetricDescriptor struct {
// Description: A detailed description of the metric, which can be used
// in documentation.
Description string `json:"description,omitempty"`
// DisplayName: A concise name for the metric, which can be displayed in
// user interfaces. Use sentence case without an ending period, for
// example "Request count".
DisplayName string `json:"displayName,omitempty"`
// Labels: The set of labels that can be used to describe a specific
// instance of this metric type. For example, the
// appengine.googleapis.com/http/server/response_latencies metric type
// has a label for the HTTP response code, response_code, so you can
// look at latencies for successful responses or just for responses that
// failed.
Labels []*LabelDescriptor `json:"labels,omitempty"`
// MetricKind: Whether the metric records instantaneous values, changes
// to a value, etc. Some combinations of metric_kind and value_type
// might not be supported.
//
// Possible values:
// "METRIC_KIND_UNSPECIFIED" - Do not use this default value.
// "GAUGE" - An instantaneous measurement of a value.
// "DELTA" - The change in a value during a time interval.
// "CUMULATIVE" - A value accumulated over a time interval. Cumulative
// measurements in a time series should have the same start time and
// increasing end times, until an event resets the cumulative value to
// zero and sets a new start time for the following points.
MetricKind string `json:"metricKind,omitempty"`
// Name: The resource name of the metric descriptor. Depending on the
// implementation, the name typically includes: (1) the parent resource
// name that defines the scope of the metric type or of its data; and
// (2) the metric's URL-encoded type, which also appears in the type
// field of this descriptor. For example, following is the resource name
// of a custom metric within the GCP project
// my-project-id:
// "projects/my-project-id/metricDescriptors/custom.google
// apis.com%2Finvoice%2Fpaid%2Famount"
//
Name string `json:"name,omitempty"`
// Type: The metric type, including its DNS name prefix. The type is not
// URL-encoded. All user-defined custom metric types have the DNS name
// custom.googleapis.com. Metric types should use a natural hierarchical
// grouping. For
// example:
// "custom.googleapis.com/invoice/paid/amount"
// "appengine.google
// apis.com/http/server/response_latencies"
//
Type string `json:"type,omitempty"`
// Unit: The unit in which the metric value is reported. It is only
// applicable if the value_type is INT64, DOUBLE, or DISTRIBUTION. The
// supported units are a subset of The Unified Code for Units of Measure
// (http://unitsofmeasure.org/ucum.html) standard:Basic units (UNIT)
// bit bit
// By byte
// s second
// min minute
// h hour
// d dayPrefixes (PREFIX)
// k kilo (10**3)
// M mega (10**6)
// G giga (10**9)
// T tera (10**12)
// P peta (10**15)
// E exa (10**18)
// Z zetta (10**21)
// Y yotta (10**24)
// m milli (10**-3)
// u micro (10**-6)
// n nano (10**-9)
// p pico (10**-12)
// f femto (10**-15)
// a atto (10**-18)
// z zepto (10**-21)
// y yocto (10**-24)
// Ki kibi (2**10)
// Mi mebi (2**20)
// Gi gibi (2**30)
// Ti tebi (2**40)GrammarThe grammar includes the dimensionless unit 1,
// such as 1/s.The grammar also includes these connectors:
// / division (as an infix operator, e.g. 1/s).
// . multiplication (as an infix operator, e.g. GBy.d)The grammar for a
// unit is as follows:
// Expression = Component { "." Component } { "/" Component }
// ;
//
// Component = [ PREFIX ] UNIT [ Annotation ]
// | Annotation
// | "1"
// ;
//
// Annotation = "{" NAME "}" ;
// Notes:
// Annotation is just a comment if it follows a UNIT and is equivalent
// to 1 if it is used alone. For examples, {requests}/s == 1/s,
// By{transmitted}/s == By/s.
// NAME is a sequence of non-blank printable ASCII characters not
// containing '{' or '}'.
Unit string `json:"unit,omitempty"`
// ValueType: Whether the measurement is an integer, a floating-point
// number, etc. Some combinations of metric_kind and value_type might
// not be supported.
//
// Possible values:
// "VALUE_TYPE_UNSPECIFIED" - Do not use this default value.
// "BOOL" - The value is a boolean. This value type can be used only
// if the metric kind is GAUGE.
// "INT64" - The value is a signed 64-bit integer.
// "DOUBLE" - The value is a double precision floating point number.
// "STRING" - The value is a text string. This value type can be used
// only if the metric kind is GAUGE.
// "DISTRIBUTION" - The value is a Distribution.
// "MONEY" - The value is money.
ValueType string `json:"valueType,omitempty"`
// ForceSendFields is a list of field names (e.g. "Description") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Description") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *MetricDescriptor) MarshalJSON() ([]byte, error) {
type noMethod MetricDescriptor
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// MonitoredResource: An object representing a resource that can be used
// for monitoring, logging, billing, or other purposes. Examples include
// virtual machine instances, databases, and storage devices such as
@ -1404,17 +1806,23 @@ func (s *SourceReference) MarshalJSON() ([]byte, error) {
// WriteLogEntriesRequest: The parameters to WriteLogEntries.
type WriteLogEntriesRequest struct {
// Entries: Required. The log entries to write. Values supplied for the
// fields log_name, resource, and labels in this entries.write request
// are inserted into those log entries in this list that do not provide
// their own values.Stackdriver Logging also creates and inserts values
// for timestamp and insert_id if the entries do not provide them. The
// created insert_id for the N'th entry in this list will be greater
// than earlier entries and less than later entries. Otherwise, the
// order of log entries in this list does not matter.To improve
// throughput and to avoid exceeding the quota limit for calls to
// entries.write, you should write multiple log entries at once rather
// than calling this method for each individual log entry.
// Entries: Required. The log entries to send to Stackdriver Logging.
// The order of log entries in this list does not matter. Values
// supplied in this method's log_name, resource, and labels fields are
// copied into those log entries in this list that do not include values
// for their corresponding fields. For more information, see the
// LogEntry type.If the timestamp or insert_id fields are missing in log
// entries, then this method supplies the current time or a unique
// identifier, respectively. The supplied values are chosen so that,
// among the log entries that did not supply their own values, the
// entries earlier in the list will sort before the entries later in the
// list. See the entries.list method.Log entries with timestamps that
// are more than the logs retention period in the past or more than 24
// hours in the future might be discarded. Discarding does not return an
// error.To improve throughput and to avoid exceeding the quota limit
// for calls to entries.write, you should try to include several log
// entries in this list, rather than calling this method for each
// individual log entry.
Entries []*LogEntry `json:"entries,omitempty"`
// Labels: Optional. Default labels that are added to the labels field
@ -1964,7 +2372,11 @@ type EntriesWriteCall struct {
header_ http.Header
}
// Write: Writes log entries to Stackdriver Logging.
// Write: Log entry resourcesWrites log entries to Stackdriver Logging.
// This API method is the only way to send log entries to Stackdriver
// Logging. This method is used, directly or indirectly, by the
// Stackdriver Logging agent (fluentd) and all logging libraries
// configured to use Stackdriver Logging.
func (r *EntriesService) Write(writelogentriesrequest *WriteLogEntriesRequest) *EntriesWriteCall {
c := &EntriesWriteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.writelogentriesrequest = writelogentriesrequest
@ -2054,7 +2466,7 @@ func (c *EntriesWriteCall) Do(opts ...googleapi.CallOption) (*WriteLogEntriesRes
}
return ret, nil
// {
// "description": "Writes log entries to Stackdriver Logging.",
// "description": "Log entry resourcesWrites log entries to Stackdriver Logging. This API method is the only way to send log entries to Stackdriver Logging. This method is used, directly or indirectly, by the Stackdriver Logging agent (fluentd) and all logging libraries configured to use Stackdriver Logging.",
// "flatPath": "v2beta1/entries:write",
// "httpMethod": "POST",
// "id": "logging.entries.write",
@ -3651,10 +4063,9 @@ type ProjectsSinksCreateCall struct {
// Create: Creates a sink that exports specified log entries to a
// destination. The export of newly-ingested log entries begins
// immediately, unless the current time is outside the sink's start and
// end times or the sink's writer_identity is not permitted to write to
// the destination. A sink can export log entries only from the resource
// owning the sink.
// immediately, unless the sink's writer_identity is not permitted to
// write to the destination. A sink can export log entries only from the
// resource owning the sink.
func (r *ProjectsSinksService) Create(parent string, logsink *LogSink) *ProjectsSinksCreateCall {
c := &ProjectsSinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.parent = parent
@ -3765,7 +4176,7 @@ func (c *ProjectsSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSink, er
}
return ret, nil
// {
// "description": "Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the current time is outside the sink's start and end times or the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink.",
// "description": "Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink.",
// "flatPath": "v2beta1/projects/{projectsId}/sinks",
// "httpMethod": "POST",
// "id": "logging.projects.sinks.create",
@ -4274,13 +4685,10 @@ type ProjectsSinksUpdateCall struct {
header_ http.Header
}
// Update: Updates a sink. If the named sink doesn't exist, then this
// method is identical to sinks.create. If the named sink does exist,
// then this method replaces the following fields in the existing sink
// with values from the new sink: destination, filter,
// output_version_format, start_time, and end_time. The updated filter
// might also have a new writer_identity; see the unique_writer_identity
// field.
// Update: Updates a sink. This method replaces the following fields in
// the existing sink with values from the new sink: destination, and
// filter. The updated sink might also have a new writer_identity; see
// the unique_writer_identity field.
func (r *ProjectsSinksService) Update(sinkNameid string, logsink *LogSink) *ProjectsSinksUpdateCall {
c := &ProjectsSinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.sinkNameid = sinkNameid
@ -4304,6 +4712,21 @@ func (c *ProjectsSinksUpdateCall) UniqueWriterIdentity(uniqueWriterIdentity bool
return c
}
// UpdateMask sets the optional parameter "updateMask": Field mask that
// specifies the fields in sink that need an update. A sink field will
// be overwritten if, and only if, it is in the update mask. name and
// output only fields cannot be updated.An empty updateMask is
// temporarily treated as using the following mask for backwards
// compatibility purposes: destination,filter,includeChildren At some
// point in the future, behavior will be removed and specifying an empty
// updateMask will be an error.For a detailed FieldMask definition, see
// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmaskExample:
// updateMask=filter.
func (c *ProjectsSinksUpdateCall) UpdateMask(updateMask string) *ProjectsSinksUpdateCall {
c.urlParams_.Set("updateMask", updateMask)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
@ -4390,7 +4813,7 @@ func (c *ProjectsSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSink, er
}
return ret, nil
// {
// "description": "Updates a sink. If the named sink doesn't exist, then this method is identical to sinks.create. If the named sink does exist, then this method replaces the following fields in the existing sink with values from the new sink: destination, filter, output_version_format, start_time, and end_time. The updated filter might also have a new writer_identity; see the unique_writer_identity field.",
// "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter. The updated sink might also have a new writer_identity; see the unique_writer_identity field.",
// "flatPath": "v2beta1/projects/{projectsId}/sinks/{sinksId}",
// "httpMethod": "PUT",
// "id": "logging.projects.sinks.update",
@ -4409,6 +4832,12 @@ func (c *ProjectsSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSink, er
// "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field:\nIf the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity.\nIf the old value is false and the new value is true, then writer_identity is changed to a unique service account.\nIt is an error if the old value is true and the new value is set to false or defaulted to false.",
// "location": "query",
// "type": "boolean"
// },
// "updateMask": {
// "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmaskExample: updateMask=filter.",
// "format": "google-fieldmask",
// "location": "query",
// "type": "string"
// }
// },
// "path": "v2beta1/{+sinkName}",

File diff suppressed because it is too large Load Diff

View File

@ -268,6 +268,45 @@ func (s *CollectdPayload) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CollectdPayloadError: Describes the error status for payloads that
// were not written.
type CollectdPayloadError struct {
// Error: Records the error status for the payload. If this field is
// present, the partial errors for nested values won't be populated.
Error *Status `json:"error,omitempty"`
// Index: The zero-based index in
// CreateCollectdTimeSeriesRequest.collectd_payloads.
Index int64 `json:"index,omitempty"`
// ValueErrors: Records the error status for values that were not
// written due to an error.Failed payloads for which nothing is written
// will not include partial value errors.
ValueErrors []*CollectdValueError `json:"valueErrors,omitempty"`
// ForceSendFields is a list of field names (e.g. "Error") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Error") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *CollectdPayloadError) MarshalJSON() ([]byte, error) {
type noMethod CollectdPayloadError
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CollectdValue: A single data point from a collectd-based plugin.
type CollectdValue struct {
// DataSourceName: The data source for the collectd value. For example
@ -317,6 +356,39 @@ func (s *CollectdValue) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CollectdValueError: Describes the error status for values that were
// not written.
type CollectdValueError struct {
// Error: Records the error status for the value.
Error *Status `json:"error,omitempty"`
// Index: The zero-based index in CollectdPayload.values within the
// parent CreateCollectdTimeSeriesRequest.collectd_payloads.
Index int64 `json:"index,omitempty"`
// ForceSendFields is a list of field names (e.g. "Error") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Error") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *CollectdValueError) MarshalJSON() ([]byte, error) {
type noMethod CollectdValueError
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CreateCollectdTimeSeriesRequest: The CreateCollectdTimeSeries
// request.
type CreateCollectdTimeSeriesRequest struct {
@ -357,6 +429,41 @@ func (s *CreateCollectdTimeSeriesRequest) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CreateCollectdTimeSeriesResponse: The CreateCollectdTimeSeries
// response.
type CreateCollectdTimeSeriesResponse struct {
// PayloadErrors: Records the error status for points that were not
// written due to an error.Failed requests for which nothing is written
// will return an error response instead.
PayloadErrors []*CollectdPayloadError `json:"payloadErrors,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "PayloadErrors") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "PayloadErrors") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *CreateCollectdTimeSeriesResponse) MarshalJSON() ([]byte, error) {
type noMethod CreateCollectdTimeSeriesResponse
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CreateTimeSeriesRequest: The CreateTimeSeries request.
type CreateTimeSeriesRequest struct {
// TimeSeries: The new data to be added to a list of time series. Adds
@ -1492,6 +1599,82 @@ func (s *SourceContext) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Status: The Status type defines a logical error model that is
// suitable for different programming environments, including REST APIs
// and RPC APIs. It is used by gRPC (https://github.com/grpc). The error
// model is designed to be:
// Simple to use and understand for most users
// Flexible enough to meet unexpected needsOverviewThe Status message
// contains three pieces of data: error code, error message, and error
// details. The error code should be an enum value of google.rpc.Code,
// but it may accept additional error codes if needed. The error message
// should be a developer-facing English message that helps developers
// understand and resolve the error. If a localized user-facing error
// message is needed, put the localized message in the error details or
// localize it in the client. The optional error details may contain
// arbitrary information about the error. There is a predefined set of
// error detail types in the package google.rpc that can be used for
// common error conditions.Language mappingThe Status message is the
// logical representation of the error model, but it is not necessarily
// the actual wire format. When the Status message is exposed in
// different client libraries and different wire protocols, it can be
// mapped differently. For example, it will likely be mapped to some
// exceptions in Java, but more likely mapped to some error codes in
// C.Other usesThe error model and the Status message can be used in a
// variety of environments, either with or without APIs, to provide a
// consistent developer experience across different environments.Example
// uses of this error model include:
// Partial errors. If a service needs to return partial errors to the
// client, it may embed the Status in the normal response to indicate
// the partial errors.
// Workflow errors. A typical workflow has multiple steps. Each step may
// have a Status message for error reporting.
// Batch operations. If a client uses batch request and batch response,
// the Status message should be used directly inside batch response, one
// for each error sub-response.
// Asynchronous operations. If an API call embeds asynchronous operation
// results in its response, the status of those operations should be
// represented directly using the Status message.
// Logging. If some API errors are stored in logs, the message Status
// could be used directly after any stripping needed for
// security/privacy reasons.
type Status struct {
// Code: The status code, which should be an enum value of
// google.rpc.Code.
Code int64 `json:"code,omitempty"`
// Details: A list of messages that carry the error details. There is a
// common set of message types for APIs to use.
Details []googleapi.RawMessage `json:"details,omitempty"`
// Message: A developer-facing error message, which should be in
// English. Any user-facing error message should be localized and sent
// in the google.rpc.Status.details field, or localized by the client.
Message string `json:"message,omitempty"`
// ForceSendFields is a list of field names (e.g. "Code") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Code") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Status) MarshalJSON() ([]byte, error) {
type noMethod Status
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// TimeInterval: A time interval extending just after a start time
// through an end time. If the start time is the same as the end time,
// then the interval represents a single point in time.
@ -1789,13 +1972,13 @@ func (c *ProjectsCollectdTimeSeriesCreateCall) doRequest(alt string) (*http.Resp
}
// Do executes the "monitoring.projects.collectdTimeSeries.create" call.
// Exactly one of *Empty or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *Empty.ServerResponse.Header or (if a response was returned at all)
// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
// check whether the returned error was because http.StatusNotModified
// was returned.
func (c *ProjectsCollectdTimeSeriesCreateCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
// Exactly one of *CreateCollectdTimeSeriesResponse or error will be
// non-nil. Any non-2xx status code is an error. Response headers are in
// either *CreateCollectdTimeSeriesResponse.ServerResponse.Header or (if
// a response was returned at all) in error.(*googleapi.Error).Header.
// Use googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *ProjectsCollectdTimeSeriesCreateCall) Do(opts ...googleapi.CallOption) (*CreateCollectdTimeSeriesResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
@ -1814,7 +1997,7 @@ func (c *ProjectsCollectdTimeSeriesCreateCall) Do(opts ...googleapi.CallOption)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Empty{
ret := &CreateCollectdTimeSeriesResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
@ -1847,7 +2030,7 @@ func (c *ProjectsCollectdTimeSeriesCreateCall) Do(opts ...googleapi.CallOption)
// "$ref": "CreateCollectdTimeSeriesRequest"
// },
// "response": {
// "$ref": "Empty"
// "$ref": "CreateCollectdTimeSeriesResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",

File diff suppressed because it is too large Load Diff