diff --git a/Gopkg.lock b/Gopkg.lock index c4b940cfc..3961ecac2 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -2023,7 +2023,8 @@ revision = "8be79e1e0910c292df4e79c241bb7e8f7e725959" [[projects]] - digest = "1:887c07769ee52c81222ea1112b11a3947c703da529d1643d85c216b9537d87b8" + branch = "master" + digest = "1:70c173b8ecc111dd01dc07f0ada72c076e4ed91618ee559312ef8adf154cc539" name = "google.golang.org/api" packages = [ "dns/v1", @@ -2037,8 +2038,7 @@ "transport/http/internal/propagation", ] pruneopts = "NUT" - revision = "0cbcb99a9ea0c8023c794b2693cbe1def82ed4d7" - version = "v0.3.2" + revision = "bbbc0e98e3cc6ddcebca23f9ac35acda33bd5b38" [[projects]] digest = "1:7206d98ec77c90c72ec2c405181a1dcf86965803b6dbc4f98ceab7a5047c37a9" @@ -2100,7 +2100,7 @@ version = "v1.12.0" [[projects]] - digest = "1:b886012746f19e2a7c6c3901ea9f86e8a5e32ff2b4407086f4f3181269976957" + digest = "1:2d9005f36a1bd4f00c3fd501f87cd82909aa69b5fe15aee28636cced39c9ecfe" name = "gopkg.in/DataDog/dd-trace-go.v1" packages = [ "ddtrace", @@ -2108,10 +2108,11 @@ "ddtrace/internal", "ddtrace/opentracer", "ddtrace/tracer", + "internal/globalconfig", ] pruneopts = "NUT" - revision = "7fb2bce4b1ed6ab61f7a9e1be30dea56de19db7c" - version = "v1.8.0" + revision = "eed4d38387cb9c74f7a29cb3eb9b06155a09d259" + version = "v1.13.0" [[projects]] digest = "1:c970218a20933dd0a2eb2006de922217fa9276f57d25009b2a934eb1c50031cc" diff --git a/Gopkg.toml b/Gopkg.toml index 6a23fbf40..986c94abd 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -255,7 +255,7 @@ [[constraint]] name = "gopkg.in/DataDog/dd-trace-go.v1" - version = "1.7.0" + version = "1.13.0" [[constraint]] name = "github.com/google/uuid" diff --git a/vendor/google.golang.org/api/dns/v1/dns-gen.go b/vendor/google.golang.org/api/dns/v1/dns-gen.go index 575120926..f900962e8 100644 --- a/vendor/google.golang.org/api/dns/v1/dns-gen.go +++ b/vendor/google.golang.org/api/dns/v1/dns-gen.go @@ -215,21 +215,40 @@ type ResourceRecordSetsService struct { s *Service } +// Change: A Change represents a set of ResourceRecordSet additions and +// deletions applied atomically to a ManagedZone. ResourceRecordSets +// within a ManagedZone are modified by creating a new Change element in +// the Changes collection. In turn the Changes collection also records +// the past modifications to the ResourceRecordSets in a ManagedZone. +// The current state of the ManagedZone is the sum effect of applying +// all Change elements in the Changes collection in sequence. type Change struct { + // Additions: Which ResourceRecordSets to add? Additions []*ResourceRecordSet `json:"additions,omitempty"` + // Deletions: Which ResourceRecordSets to remove? Must match existing + // data exactly. Deletions []*ResourceRecordSet `json:"deletions,omitempty"` + // Id: Unique identifier for the resource; defined by the server (output + // only). Id string `json:"id,omitempty"` + // IsServing: If the DNS queries for the zone will be served. IsServing bool `json:"isServing,omitempty"` // Kind: Identifies what kind of resource this is. Value: the fixed // string "dns#change". Kind string `json:"kind,omitempty"` + // StartTime: The time that this operation was started by the server + // (output only). This is in RFC3339 text format. StartTime string `json:"startTime,omitempty"` + // Status: Status of the operation (output only). A status of "done" + // means that the request to update the authoritative servers has been + // sent, but the servers might not be updated yet. + // // Possible values: // "done" // "pending" @@ -262,7 +281,10 @@ func (s *Change) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// ChangesListResponse: The response to a request to enumerate Changes +// to a ResourceRecordSets collection. type ChangesListResponse struct { + // Changes: The requested changes. Changes []*Change `json:"changes,omitempty"` Header *ResponseHeader `json:"header,omitempty"` @@ -270,6 +292,17 @@ type ChangesListResponse struct { // Kind: Type of resource. Kind string `json:"kind,omitempty"` + // NextPageToken: The presence of this field indicates that there exist + // more results following your last page of results in pagination order. + // To fetch them, make another list request using this value as your + // pagination token. + // + // In this way you can retrieve the complete contents of even very large + // collections one page at a time. However, if the contents of the + // collection change between the first and last paginated list request, + // the set of all elements returned will be an inconsistent view of the + // collection. There is no way to retrieve a "snapshot" of collections + // larger than the maximum page size. NextPageToken string `json:"nextPageToken,omitempty"` // ServerResponse contains the HTTP response code and headers from the @@ -299,7 +332,11 @@ func (s *ChangesListResponse) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// DnsKey: A DNSSEC key pair. type DnsKey struct { + // Algorithm: String mnemonic specifying the DNSSEC algorithm of this + // key. Immutable after creation time. + // // Possible values: // "ecdsap256sha256" // "ecdsap384sha384" @@ -308,26 +345,56 @@ type DnsKey struct { // "rsasha512" Algorithm string `json:"algorithm,omitempty"` + // CreationTime: The time that this resource was created in the control + // plane. This is in RFC3339 text format. Output only. CreationTime string `json:"creationTime,omitempty"` + // Description: A mutable string of at most 1024 characters associated + // with this resource for the user's convenience. Has no effect on the + // resource's function. Description string `json:"description,omitempty"` + // Digests: Cryptographic hashes of the DNSKEY resource record + // associated with this DnsKey. These digests are needed to construct a + // DS record that points at this DNS key. Output only. Digests []*DnsKeyDigest `json:"digests,omitempty"` + // Id: Unique identifier for the resource; defined by the server (output + // only). Id string `json:"id,omitempty"` + // IsActive: Active keys will be used to sign subsequent changes to the + // ManagedZone. Inactive keys will still be present as DNSKEY Resource + // Records for the use of resolvers validating existing signatures. IsActive bool `json:"isActive,omitempty"` + // KeyLength: Length of the key in bits. Specified at creation time then + // immutable. KeyLength int64 `json:"keyLength,omitempty"` + // KeyTag: The key tag is a non-cryptographic hash of the a DNSKEY + // resource record associated with this DnsKey. The key tag can be used + // to identify a DNSKEY more quickly (but it is not a unique + // identifier). In particular, the key tag is used in a parent zone's DS + // record to point at the DNSKEY in this child ManagedZone. The key tag + // is a number in the range [0, 65535] and the algorithm to calculate it + // is specified in RFC4034 Appendix B. Output only. KeyTag int64 `json:"keyTag,omitempty"` // Kind: Identifies what kind of resource this is. Value: the fixed // string "dns#dnsKey". Kind string `json:"kind,omitempty"` + // PublicKey: Base64 encoded public half of this key. Output only. PublicKey string `json:"publicKey,omitempty"` + // Type: One of "KEY_SIGNING" or "ZONE_SIGNING". Keys of type + // KEY_SIGNING have the Secure Entry Point flag set and, when active, + // will be used to sign only resource record sets of type DNSKEY. + // Otherwise, the Secure Entry Point flag will be cleared and this key + // will be used to sign only resource record sets of other types. + // Immutable after creation time. + // // Possible values: // "keySigning" // "zoneSigning" @@ -361,8 +428,12 @@ func (s *DnsKey) MarshalJSON() ([]byte, error) { } type DnsKeyDigest struct { + // Digest: The base-16 encoded bytes of this digest. Suitable for use in + // a DS resource record. Digest string `json:"digest,omitempty"` + // Type: Specifies the algorithm used to calculate this digest. + // // Possible values: // "sha1" // "sha256" @@ -392,7 +463,13 @@ func (s *DnsKeyDigest) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// DnsKeySpec: Parameters for DnsKey key generation. Used for generating +// initial keys for a new ManagedZone and as default when adding a new +// DnsKey. type DnsKeySpec struct { + // Algorithm: String mnemonic specifying the DNSSEC algorithm of this + // key. + // // Possible values: // "ecdsap256sha256" // "ecdsap384sha384" @@ -401,8 +478,16 @@ type DnsKeySpec struct { // "rsasha512" Algorithm string `json:"algorithm,omitempty"` + // KeyLength: Length of the keys in bits. KeyLength int64 `json:"keyLength,omitempty"` + // KeyType: Specifies whether this is a key signing key (KSK) or a zone + // signing key (ZSK). Key signing keys have the Secure Entry Point flag + // set and, when active, will only be used to sign resource record sets + // of type DNSKEY. Zone signing keys do not have the Secure Entry Point + // flag set and will be used to sign all other types of resource record + // sets. + // // Possible values: // "keySigning" // "zoneSigning" @@ -435,7 +520,10 @@ func (s *DnsKeySpec) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// DnsKeysListResponse: The response to a request to enumerate DnsKeys +// in a ManagedZone. type DnsKeysListResponse struct { + // DnsKeys: The requested resources. DnsKeys []*DnsKey `json:"dnsKeys,omitempty"` Header *ResponseHeader `json:"header,omitempty"` @@ -443,6 +531,17 @@ type DnsKeysListResponse struct { // Kind: Type of resource. Kind string `json:"kind,omitempty"` + // NextPageToken: The presence of this field indicates that there exist + // more results following your last page of results in pagination order. + // To fetch them, make another list request using this value as your + // pagination token. + // + // In this way you can retrieve the complete contents of even very large + // collections one page at a time. However, if the contents of the + // collection change between the first and last paginated list request, + // the set of all elements returned will be an inconsistent view of the + // collection. There is no way to retrieve a "snapshot" of collections + // larger than the maximum page size. NextPageToken string `json:"nextPageToken,omitempty"` // ServerResponse contains the HTTP response code and headers from the @@ -472,31 +571,60 @@ func (s *DnsKeysListResponse) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// ManagedZone: A zone is a subtree of the DNS namespace under one +// administrative responsibility. A ManagedZone is a resource that +// represents a DNS zone hosted by the Cloud DNS service. type ManagedZone struct { + // CreationTime: The time that this resource was created on the server. + // This is in RFC3339 text format. Output only. CreationTime string `json:"creationTime,omitempty"` + // Description: A mutable string of at most 1024 characters associated + // with this resource for the user's convenience. Has no effect on the + // managed zone's function. Description string `json:"description,omitempty"` + // DnsName: The DNS name of this managed zone, for instance + // "example.com.". DnsName string `json:"dnsName,omitempty"` + // DnssecConfig: DNSSEC configuration. DnssecConfig *ManagedZoneDnsSecConfig `json:"dnssecConfig,omitempty"` + // Id: Unique identifier for the resource; defined by the server (output + // only) Id uint64 `json:"id,omitempty,string"` // Kind: Identifies what kind of resource this is. Value: the fixed // string "dns#managedZone". Kind string `json:"kind,omitempty"` + // Labels: User labels. Labels map[string]string `json:"labels,omitempty"` + // Name: User assigned name for this resource. Must be unique within the + // project. The name must be 1-63 characters long, must begin with a + // letter, end with a letter or digit, and only contain lowercase + // letters, digits or dashes. Name string `json:"name,omitempty"` + // NameServerSet: Optionally specifies the NameServerSet for this + // ManagedZone. A NameServerSet is a set of DNS name servers that all + // host the same ManagedZones. Most users will leave this field unset. NameServerSet string `json:"nameServerSet,omitempty"` + // NameServers: Delegate your managed_zone to these virtual name + // servers; defined by the server (output only) NameServers []string `json:"nameServers,omitempty"` + // PrivateVisibilityConfig: For privately visible zones, the set of + // Virtual Private Cloud resources that the zone is visible from. PrivateVisibilityConfig *ManagedZonePrivateVisibilityConfig `json:"privateVisibilityConfig,omitempty"` + // Visibility: The zone's visibility: public zones are exposed to the + // Internet, while private zones are visible only to Virtual Private + // Cloud resources. + // // Possible values: // "private" // "public" @@ -530,17 +658,25 @@ func (s *ManagedZone) MarshalJSON() ([]byte, error) { } type ManagedZoneDnsSecConfig struct { + // DefaultKeySpecs: Specifies parameters that will be used for + // generating initial DnsKeys for this ManagedZone. Output only while + // state is not OFF. DefaultKeySpecs []*DnsKeySpec `json:"defaultKeySpecs,omitempty"` // Kind: Identifies what kind of resource this is. Value: the fixed // string "dns#managedZoneDnsSecConfig". Kind string `json:"kind,omitempty"` + // NonExistence: Specifies the mechanism used to provide authenticated + // denial-of-existence responses. Output only while state is not OFF. + // // Possible values: // "nsec" // "nsec3" NonExistence string `json:"nonExistence,omitempty"` + // State: Specifies whether DNSSEC is enabled, and what mode it is in. + // // Possible values: // "off" // "on" @@ -577,8 +713,20 @@ type ManagedZoneOperationsListResponse struct { // Kind: Type of resource. Kind string `json:"kind,omitempty"` + // NextPageToken: The presence of this field indicates that there exist + // more results following your last page of results in pagination order. + // To fetch them, make another list request using this value as your + // page token. + // + // In this way you can retrieve the complete contents of even very large + // collections one page at a time. However, if the contents of the + // collection change between the first and last paginated list request, + // the set of all elements returned will be an inconsistent view of the + // collection. There is no way to retrieve a consistent snapshot of a + // collection larger than the maximum page size. NextPageToken string `json:"nextPageToken,omitempty"` + // Operations: The operation resources. Operations []*Operation `json:"operations,omitempty"` // ServerResponse contains the HTTP response code and headers from the @@ -613,6 +761,7 @@ type ManagedZonePrivateVisibilityConfig struct { // string "dns#managedZonePrivateVisibilityConfig". Kind string `json:"kind,omitempty"` + // Networks: The list of VPC networks that can see this zone. Networks []*ManagedZonePrivateVisibilityConfigNetwork `json:"networks,omitempty"` // ForceSendFields is a list of field names (e.g. "Kind") to @@ -643,6 +792,9 @@ type ManagedZonePrivateVisibilityConfigNetwork struct { // string "dns#managedZonePrivateVisibilityConfigNetwork". Kind string `json:"kind,omitempty"` + // NetworkUrl: The fully qualified URL of the VPC network to bind to. + // This should be formatted like + // https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network} NetworkUrl string `json:"networkUrl,omitempty"` // ForceSendFields is a list of field names (e.g. "Kind") to @@ -674,8 +826,20 @@ type ManagedZonesListResponse struct { // Kind: Type of resource. Kind string `json:"kind,omitempty"` + // ManagedZones: The managed zone resources. ManagedZones []*ManagedZone `json:"managedZones,omitempty"` + // NextPageToken: The presence of this field indicates that there exist + // more results following your last page of results in pagination order. + // To fetch them, make another list request using this value as your + // page token. + // + // In this way you can retrieve the complete contents of even very large + // collections one page at a time. However, if the contents of the + // collection change between the first and last paginated list request, + // the set of all elements returned will be an inconsistent view of the + // collection. There is no way to retrieve a consistent snapshot of a + // collection larger than the maximum page size. NextPageToken string `json:"nextPageToken,omitempty"` // ServerResponse contains the HTTP response code and headers from the @@ -705,26 +869,52 @@ func (s *ManagedZonesListResponse) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// Operation: An operation represents a successful mutation performed on +// a Cloud DNS resource. Operations provide: - An audit log of server +// resource mutations. - A way to recover/retry API calls in the case +// where the response is never received by the caller. Use the caller +// specified client_operation_id. type Operation struct { + // DnsKeyContext: Only populated if the operation targeted a DnsKey + // (output only). DnsKeyContext *OperationDnsKeyContext `json:"dnsKeyContext,omitempty"` + // Id: Unique identifier for the resource. This is the + // client_operation_id if the client specified it when the mutation was + // initiated, otherwise, it is generated by the server. The name must be + // 1-63 characters long and match the regular expression [-a-z0-9]? + // (output only) Id string `json:"id,omitempty"` // Kind: Identifies what kind of resource this is. Value: the fixed // string "dns#operation". Kind string `json:"kind,omitempty"` + // StartTime: The time that this operation was started by the server. + // This is in RFC3339 text format (output only). StartTime string `json:"startTime,omitempty"` + // Status: Status of the operation. Can be one of the following: + // "PENDING" or "DONE" (output only). A status of "DONE" means that the + // request to update the authoritative servers has been sent, but the + // servers might not be updated yet. + // // Possible values: // "done" // "pending" Status string `json:"status,omitempty"` + // Type: Type of the operation. Operations include insert, update, and + // delete (output only). Type string `json:"type,omitempty"` + // User: User who requested the operation, for example: + // user@example.com. cloud-dns-system for operations automatically done + // by the system. (output only) User string `json:"user,omitempty"` + // ZoneContext: Only populated if the operation targeted a ManagedZone + // (output only). ZoneContext *OperationManagedZoneContext `json:"zoneContext,omitempty"` // ServerResponse contains the HTTP response code and headers from the @@ -755,8 +945,10 @@ func (s *Operation) MarshalJSON() ([]byte, error) { } type OperationDnsKeyContext struct { + // NewValue: The post-operation DnsKey resource. NewValue *DnsKey `json:"newValue,omitempty"` + // OldValue: The pre-operation DnsKey resource. OldValue *DnsKey `json:"oldValue,omitempty"` // ForceSendFields is a list of field names (e.g. "NewValue") to @@ -783,8 +975,10 @@ func (s *OperationDnsKeyContext) MarshalJSON() ([]byte, error) { } type OperationManagedZoneContext struct { + // NewValue: The post-operation ManagedZone resource. NewValue *ManagedZone `json:"newValue,omitempty"` + // OldValue: The pre-operation ManagedZone resource. OldValue *ManagedZone `json:"oldValue,omitempty"` // ForceSendFields is a list of field names (e.g. "NewValue") to @@ -810,15 +1004,22 @@ func (s *OperationManagedZoneContext) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// Project: A project resource. The project is a top level container for +// resources including Cloud DNS ManagedZones. Projects can be created +// only in the APIs console. type Project struct { + // Id: User assigned unique identifier for the resource (output only). Id string `json:"id,omitempty"` // Kind: Identifies what kind of resource this is. Value: the fixed // string "dns#project". Kind string `json:"kind,omitempty"` + // Number: Unique numeric identifier for the resource; defined by the + // server (output only). Number uint64 `json:"number,omitempty,string"` + // Quota: Quotas assigned to this project (output only). Quota *Quota `json:"quota,omitempty"` // ServerResponse contains the HTTP response code and headers from the @@ -848,29 +1049,49 @@ func (s *Project) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// Quota: Limits associated with a Project. type Quota struct { + // DnsKeysPerManagedZone: Maximum allowed number of DnsKeys per + // ManagedZone. DnsKeysPerManagedZone int64 `json:"dnsKeysPerManagedZone,omitempty"` // Kind: Identifies what kind of resource this is. Value: the fixed // string "dns#quota". Kind string `json:"kind,omitempty"` + // ManagedZones: Maximum allowed number of managed zones in the project. ManagedZones int64 `json:"managedZones,omitempty"` + // ManagedZonesPerNetwork: Maximum allowed number of managed zones which + // can be attached to a network. ManagedZonesPerNetwork int64 `json:"managedZonesPerNetwork,omitempty"` + // NetworksPerManagedZone: Maximum allowed number of networks to which a + // privately scoped zone can be attached. NetworksPerManagedZone int64 `json:"networksPerManagedZone,omitempty"` + // ResourceRecordsPerRrset: Maximum allowed number of ResourceRecords + // per ResourceRecordSet. ResourceRecordsPerRrset int64 `json:"resourceRecordsPerRrset,omitempty"` + // RrsetAdditionsPerChange: Maximum allowed number of ResourceRecordSets + // to add per ChangesCreateRequest. RrsetAdditionsPerChange int64 `json:"rrsetAdditionsPerChange,omitempty"` + // RrsetDeletionsPerChange: Maximum allowed number of ResourceRecordSets + // to delete per ChangesCreateRequest. RrsetDeletionsPerChange int64 `json:"rrsetDeletionsPerChange,omitempty"` + // RrsetsPerManagedZone: Maximum allowed number of ResourceRecordSets + // per zone in the project. RrsetsPerManagedZone int64 `json:"rrsetsPerManagedZone,omitempty"` + // TotalRrdataSizePerChange: Maximum allowed size for total rrdata in + // one ChangesCreateRequest in bytes. TotalRrdataSizePerChange int64 `json:"totalRrdataSizePerChange,omitempty"` + // WhitelistedKeySpecs: DNSSEC algorithm and key length types that can + // be used for DnsKeys. WhitelistedKeySpecs []*DnsKeySpec `json:"whitelistedKeySpecs,omitempty"` // ForceSendFields is a list of field names (e.g. @@ -898,19 +1119,29 @@ func (s *Quota) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// ResourceRecordSet: A unit of data that will be returned by the DNS +// servers. type ResourceRecordSet struct { // Kind: Identifies what kind of resource this is. Value: the fixed // string "dns#resourceRecordSet". Kind string `json:"kind,omitempty"` + // Name: For example, www.example.com. Name string `json:"name,omitempty"` + // Rrdatas: As defined in RFC 1035 (section 5) and RFC 1034 (section + // 3.6.1) -- see examples. Rrdatas []string `json:"rrdatas,omitempty"` + // SignatureRrdatas: As defined in RFC 4034 (section 3.2). SignatureRrdatas []string `json:"signatureRrdatas,omitempty"` + // Ttl: Number of seconds that this ResourceRecordSet can be cached by + // resolvers. Ttl int64 `json:"ttl,omitempty"` + // Type: The identifier of a supported record type. See the list of + // Supported DNS record types. Type string `json:"type,omitempty"` // ForceSendFields is a list of field names (e.g. "Kind") to @@ -942,8 +1173,20 @@ type ResourceRecordSetsListResponse struct { // Kind: Type of resource. Kind string `json:"kind,omitempty"` + // NextPageToken: The presence of this field indicates that there exist + // more results following your last page of results in pagination order. + // To fetch them, make another list request using this value as your + // pagination token. + // + // In this way you can retrieve the complete contents of even very large + // collections one page at a time. However, if the contents of the + // collection change between the first and last paginated list request, + // the set of all elements returned will be an inconsistent view of the + // collection. There is no way to retrieve a consistent snapshot of a + // collection larger than the maximum page size. NextPageToken string `json:"nextPageToken,omitempty"` + // Rrsets: The resource record set resources. Rrsets []*ResourceRecordSet `json:"rrsets,omitempty"` // ServerResponse contains the HTTP response code and headers from the @@ -973,7 +1216,11 @@ func (s *ResourceRecordSetsListResponse) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// ResponseHeader: Elements common to every response. type ResponseHeader struct { + // OperationId: For mutating operation requests that completed + // successfully. This is the client_operation_id if the client specified + // it, otherwise it is generated by the server (output only). OperationId string `json:"operationId,omitempty"` // ForceSendFields is a list of field names (e.g. "OperationId") to @@ -1011,7 +1258,7 @@ type ChangesCreateCall struct { header_ http.Header } -// Create: +// Create: Atomically update the ResourceRecordSet collection. func (r *ChangesService) Create(project string, managedZone string, change *Change) *ChangesCreateCall { c := &ChangesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project @@ -1021,6 +1268,9 @@ func (r *ChangesService) Create(project string, managedZone string, change *Chan } // ClientOperationId sets the optional parameter "clientOperationId": +// For mutating operation requests only. An optional identifier +// specified by the client. Must be unique for operation resources in +// the Operations collection. func (c *ChangesCreateCall) ClientOperationId(clientOperationId string) *ChangesCreateCall { c.urlParams_.Set("clientOperationId", clientOperationId) return c @@ -1117,7 +1367,7 @@ func (c *ChangesCreateCall) Do(opts ...googleapi.CallOption) (*Change, error) { } return ret, nil // { - // "description": "", + // "description": "Atomically update the ResourceRecordSet collection.", // "httpMethod": "POST", // "id": "dns.changes.create", // "parameterOrder": [ @@ -1126,15 +1376,18 @@ func (c *ChangesCreateCall) Do(opts ...googleapi.CallOption) (*Change, error) { // ], // "parameters": { // "clientOperationId": { + // "description": "For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.", // "location": "query", // "type": "string" // }, // "managedZone": { + // "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.", // "location": "path", // "required": true, // "type": "string" // }, // "project": { + // "description": "Identifies the project addressed by this request.", // "location": "path", // "required": true, // "type": "string" @@ -1168,7 +1421,7 @@ type ChangesGetCall struct { header_ http.Header } -// Get: +// Get: Fetch the representation of an existing Change. func (r *ChangesService) Get(project string, managedZone string, changeId string) *ChangesGetCall { c := &ChangesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project @@ -1178,6 +1431,9 @@ func (r *ChangesService) Get(project string, managedZone string, changeId string } // ClientOperationId sets the optional parameter "clientOperationId": +// For mutating operation requests only. An optional identifier +// specified by the client. Must be unique for operation resources in +// the Operations collection. func (c *ChangesGetCall) ClientOperationId(clientOperationId string) *ChangesGetCall { c.urlParams_.Set("clientOperationId", clientOperationId) return c @@ -1283,7 +1539,7 @@ func (c *ChangesGetCall) Do(opts ...googleapi.CallOption) (*Change, error) { } return ret, nil // { - // "description": "", + // "description": "Fetch the representation of an existing Change.", // "httpMethod": "GET", // "id": "dns.changes.get", // "parameterOrder": [ @@ -1293,20 +1549,24 @@ func (c *ChangesGetCall) Do(opts ...googleapi.CallOption) (*Change, error) { // ], // "parameters": { // "changeId": { + // "description": "The identifier of the requested change, from a previous ResourceRecordSetsChangeResponse.", // "location": "path", // "required": true, // "type": "string" // }, // "clientOperationId": { + // "description": "For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.", // "location": "query", // "type": "string" // }, // "managedZone": { + // "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.", // "location": "path", // "required": true, // "type": "string" // }, // "project": { + // "description": "Identifies the project addressed by this request.", // "location": "path", // "required": true, // "type": "string" @@ -1338,7 +1598,7 @@ type ChangesListCall struct { header_ http.Header } -// List: +// List: Enumerate Changes to a ResourceRecordSet collection. func (r *ChangesService) List(project string, managedZone string) *ChangesListCall { c := &ChangesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project @@ -1346,19 +1606,24 @@ func (r *ChangesService) List(project string, managedZone string) *ChangesListCa return c } -// MaxResults sets the optional parameter "maxResults": +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to be returned. If unspecified, the server will decide how +// many results to return. func (c *ChangesListCall) MaxResults(maxResults int64) *ChangesListCall { c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// PageToken sets the optional parameter "pageToken": +// PageToken sets the optional parameter "pageToken": A tag returned by +// a previous list request that was truncated. Use this parameter to +// continue a previous list request. func (c *ChangesListCall) PageToken(pageToken string) *ChangesListCall { c.urlParams_.Set("pageToken", pageToken) return c } -// SortBy sets the optional parameter "sortBy": +// SortBy sets the optional parameter "sortBy": Sorting criterion. The +// only supported value is change sequence. // // Possible values: // "changeSequence" (default) @@ -1367,7 +1632,8 @@ func (c *ChangesListCall) SortBy(sortBy string) *ChangesListCall { return c } -// SortOrder sets the optional parameter "sortOrder": +// SortOrder sets the optional parameter "sortOrder": Sorting order +// direction: 'ascending' or 'descending'. func (c *ChangesListCall) SortOrder(sortOrder string) *ChangesListCall { c.urlParams_.Set("sortOrder", sortOrder) return c @@ -1472,7 +1738,7 @@ func (c *ChangesListCall) Do(opts ...googleapi.CallOption) (*ChangesListResponse } return ret, nil // { - // "description": "", + // "description": "Enumerate Changes to a ResourceRecordSet collection.", // "httpMethod": "GET", // "id": "dns.changes.list", // "parameterOrder": [ @@ -1481,26 +1747,31 @@ func (c *ChangesListCall) Do(opts ...googleapi.CallOption) (*ChangesListResponse // ], // "parameters": { // "managedZone": { + // "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.", // "location": "path", // "required": true, // "type": "string" // }, // "maxResults": { + // "description": "Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { + // "description": "Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.", // "location": "query", // "type": "string" // }, // "project": { + // "description": "Identifies the project addressed by this request.", // "location": "path", // "required": true, // "type": "string" // }, // "sortBy": { // "default": "changeSequence", + // "description": "Sorting criterion. The only supported value is change sequence.", // "enum": [ // "changeSequence" // ], @@ -1511,6 +1782,7 @@ func (c *ChangesListCall) Do(opts ...googleapi.CallOption) (*ChangesListResponse // "type": "string" // }, // "sortOrder": { + // "description": "Sorting order direction: 'ascending' or 'descending'.", // "location": "query", // "type": "string" // } @@ -1563,7 +1835,7 @@ type DnsKeysGetCall struct { header_ http.Header } -// Get: +// Get: Fetch the representation of an existing DnsKey. func (r *DnsKeysService) Get(project string, managedZone string, dnsKeyId string) *DnsKeysGetCall { c := &DnsKeysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project @@ -1573,12 +1845,18 @@ func (r *DnsKeysService) Get(project string, managedZone string, dnsKeyId string } // ClientOperationId sets the optional parameter "clientOperationId": +// For mutating operation requests only. An optional identifier +// specified by the client. Must be unique for operation resources in +// the Operations collection. func (c *DnsKeysGetCall) ClientOperationId(clientOperationId string) *DnsKeysGetCall { c.urlParams_.Set("clientOperationId", clientOperationId) return c } -// DigestType sets the optional parameter "digestType": +// DigestType sets the optional parameter "digestType": An optional +// comma-separated list of digest types to compute and display for key +// signing keys. If omitted, the recommended digest type will be +// computed and displayed. func (c *DnsKeysGetCall) DigestType(digestType string) *DnsKeysGetCall { c.urlParams_.Set("digestType", digestType) return c @@ -1684,7 +1962,7 @@ func (c *DnsKeysGetCall) Do(opts ...googleapi.CallOption) (*DnsKey, error) { } return ret, nil // { - // "description": "", + // "description": "Fetch the representation of an existing DnsKey.", // "httpMethod": "GET", // "id": "dns.dnsKeys.get", // "parameterOrder": [ @@ -1694,24 +1972,29 @@ func (c *DnsKeysGetCall) Do(opts ...googleapi.CallOption) (*DnsKey, error) { // ], // "parameters": { // "clientOperationId": { + // "description": "For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.", // "location": "query", // "type": "string" // }, // "digestType": { + // "description": "An optional comma-separated list of digest types to compute and display for key signing keys. If omitted, the recommended digest type will be computed and displayed.", // "location": "query", // "type": "string" // }, // "dnsKeyId": { + // "description": "The identifier of the requested DnsKey.", // "location": "path", // "required": true, // "type": "string" // }, // "managedZone": { + // "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.", // "location": "path", // "required": true, // "type": "string" // }, // "project": { + // "description": "Identifies the project addressed by this request.", // "location": "path", // "required": true, // "type": "string" @@ -1743,7 +2026,7 @@ type DnsKeysListCall struct { header_ http.Header } -// List: +// List: Enumerate DnsKeys to a ResourceRecordSet collection. func (r *DnsKeysService) List(project string, managedZone string) *DnsKeysListCall { c := &DnsKeysListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project @@ -1751,19 +2034,26 @@ func (r *DnsKeysService) List(project string, managedZone string) *DnsKeysListCa return c } -// DigestType sets the optional parameter "digestType": +// DigestType sets the optional parameter "digestType": An optional +// comma-separated list of digest types to compute and display for key +// signing keys. If omitted, the recommended digest type will be +// computed and displayed. func (c *DnsKeysListCall) DigestType(digestType string) *DnsKeysListCall { c.urlParams_.Set("digestType", digestType) return c } -// MaxResults sets the optional parameter "maxResults": +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to be returned. If unspecified, the server will decide how +// many results to return. func (c *DnsKeysListCall) MaxResults(maxResults int64) *DnsKeysListCall { c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// PageToken sets the optional parameter "pageToken": +// PageToken sets the optional parameter "pageToken": A tag returned by +// a previous list request that was truncated. Use this parameter to +// continue a previous list request. func (c *DnsKeysListCall) PageToken(pageToken string) *DnsKeysListCall { c.urlParams_.Set("pageToken", pageToken) return c @@ -1868,7 +2158,7 @@ func (c *DnsKeysListCall) Do(opts ...googleapi.CallOption) (*DnsKeysListResponse } return ret, nil // { - // "description": "", + // "description": "Enumerate DnsKeys to a ResourceRecordSet collection.", // "httpMethod": "GET", // "id": "dns.dnsKeys.list", // "parameterOrder": [ @@ -1877,24 +2167,29 @@ func (c *DnsKeysListCall) Do(opts ...googleapi.CallOption) (*DnsKeysListResponse // ], // "parameters": { // "digestType": { + // "description": "An optional comma-separated list of digest types to compute and display for key signing keys. If omitted, the recommended digest type will be computed and displayed.", // "location": "query", // "type": "string" // }, // "managedZone": { + // "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.", // "location": "path", // "required": true, // "type": "string" // }, // "maxResults": { + // "description": "Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { + // "description": "Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.", // "location": "query", // "type": "string" // }, // "project": { + // "description": "Identifies the project addressed by this request.", // "location": "path", // "required": true, // "type": "string" @@ -1948,7 +2243,7 @@ type ManagedZoneOperationsGetCall struct { header_ http.Header } -// Get: +// Get: Fetch the representation of an existing Operation. func (r *ManagedZoneOperationsService) Get(project string, managedZone string, operation string) *ManagedZoneOperationsGetCall { c := &ManagedZoneOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project @@ -1958,6 +2253,9 @@ func (r *ManagedZoneOperationsService) Get(project string, managedZone string, o } // ClientOperationId sets the optional parameter "clientOperationId": +// For mutating operation requests only. An optional identifier +// specified by the client. Must be unique for operation resources in +// the Operations collection. func (c *ManagedZoneOperationsGetCall) ClientOperationId(clientOperationId string) *ManagedZoneOperationsGetCall { c.urlParams_.Set("clientOperationId", clientOperationId) return c @@ -2063,7 +2361,7 @@ func (c *ManagedZoneOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operat } return ret, nil // { - // "description": "", + // "description": "Fetch the representation of an existing Operation.", // "httpMethod": "GET", // "id": "dns.managedZoneOperations.get", // "parameterOrder": [ @@ -2073,20 +2371,24 @@ func (c *ManagedZoneOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operat // ], // "parameters": { // "clientOperationId": { + // "description": "For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.", // "location": "query", // "type": "string" // }, // "managedZone": { + // "description": "Identifies the managed zone addressed by this request.", // "location": "path", // "required": true, // "type": "string" // }, // "operation": { + // "description": "Identifies the operation addressed by this request.", // "location": "path", // "required": true, // "type": "string" // }, // "project": { + // "description": "Identifies the project addressed by this request.", // "location": "path", // "required": true, // "type": "string" @@ -2118,7 +2420,7 @@ type ManagedZoneOperationsListCall struct { header_ http.Header } -// List: +// List: Enumerate Operations for the given ManagedZone. func (r *ManagedZoneOperationsService) List(project string, managedZone string) *ManagedZoneOperationsListCall { c := &ManagedZoneOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project @@ -2126,19 +2428,24 @@ func (r *ManagedZoneOperationsService) List(project string, managedZone string) return c } -// MaxResults sets the optional parameter "maxResults": +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to be returned. If unspecified, the server will decide how +// many results to return. func (c *ManagedZoneOperationsListCall) MaxResults(maxResults int64) *ManagedZoneOperationsListCall { c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// PageToken sets the optional parameter "pageToken": +// PageToken sets the optional parameter "pageToken": A tag returned by +// a previous list request that was truncated. Use this parameter to +// continue a previous list request. func (c *ManagedZoneOperationsListCall) PageToken(pageToken string) *ManagedZoneOperationsListCall { c.urlParams_.Set("pageToken", pageToken) return c } -// SortBy sets the optional parameter "sortBy": +// SortBy sets the optional parameter "sortBy": Sorting criterion. The +// only supported values are START_TIME and ID. // // Possible values: // "id" @@ -2248,7 +2555,7 @@ func (c *ManagedZoneOperationsListCall) Do(opts ...googleapi.CallOption) (*Manag } return ret, nil // { - // "description": "", + // "description": "Enumerate Operations for the given ManagedZone.", // "httpMethod": "GET", // "id": "dns.managedZoneOperations.list", // "parameterOrder": [ @@ -2257,26 +2564,31 @@ func (c *ManagedZoneOperationsListCall) Do(opts ...googleapi.CallOption) (*Manag // ], // "parameters": { // "managedZone": { + // "description": "Identifies the managed zone addressed by this request.", // "location": "path", // "required": true, // "type": "string" // }, // "maxResults": { + // "description": "Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { + // "description": "Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.", // "location": "query", // "type": "string" // }, // "project": { + // "description": "Identifies the project addressed by this request.", // "location": "path", // "required": true, // "type": "string" // }, // "sortBy": { // "default": "startTime", + // "description": "Sorting criterion. The only supported values are START_TIME and ID.", // "enum": [ // "id", // "startTime" @@ -2335,7 +2647,7 @@ type ManagedZonesCreateCall struct { header_ http.Header } -// Create: +// Create: Create a new ManagedZone. func (r *ManagedZonesService) Create(project string, managedzone *ManagedZone) *ManagedZonesCreateCall { c := &ManagedZonesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project @@ -2344,6 +2656,9 @@ func (r *ManagedZonesService) Create(project string, managedzone *ManagedZone) * } // ClientOperationId sets the optional parameter "clientOperationId": +// For mutating operation requests only. An optional identifier +// specified by the client. Must be unique for operation resources in +// the Operations collection. func (c *ManagedZonesCreateCall) ClientOperationId(clientOperationId string) *ManagedZonesCreateCall { c.urlParams_.Set("clientOperationId", clientOperationId) return c @@ -2439,7 +2754,7 @@ func (c *ManagedZonesCreateCall) Do(opts ...googleapi.CallOption) (*ManagedZone, } return ret, nil // { - // "description": "", + // "description": "Create a new ManagedZone.", // "httpMethod": "POST", // "id": "dns.managedZones.create", // "parameterOrder": [ @@ -2447,10 +2762,12 @@ func (c *ManagedZonesCreateCall) Do(opts ...googleapi.CallOption) (*ManagedZone, // ], // "parameters": { // "clientOperationId": { + // "description": "For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.", // "location": "query", // "type": "string" // }, // "project": { + // "description": "Identifies the project addressed by this request.", // "location": "path", // "required": true, // "type": "string" @@ -2482,7 +2799,7 @@ type ManagedZonesDeleteCall struct { header_ http.Header } -// Delete: +// Delete: Delete a previously created ManagedZone. func (r *ManagedZonesService) Delete(project string, managedZone string) *ManagedZonesDeleteCall { c := &ManagedZonesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project @@ -2491,6 +2808,9 @@ func (r *ManagedZonesService) Delete(project string, managedZone string) *Manage } // ClientOperationId sets the optional parameter "clientOperationId": +// For mutating operation requests only. An optional identifier +// specified by the client. Must be unique for operation resources in +// the Operations collection. func (c *ManagedZonesDeleteCall) ClientOperationId(clientOperationId string) *ManagedZonesDeleteCall { c.urlParams_.Set("clientOperationId", clientOperationId) return c @@ -2557,7 +2877,7 @@ func (c *ManagedZonesDeleteCall) Do(opts ...googleapi.CallOption) error { } return nil // { - // "description": "", + // "description": "Delete a previously created ManagedZone.", // "httpMethod": "DELETE", // "id": "dns.managedZones.delete", // "parameterOrder": [ @@ -2566,15 +2886,18 @@ func (c *ManagedZonesDeleteCall) Do(opts ...googleapi.CallOption) error { // ], // "parameters": { // "clientOperationId": { + // "description": "For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.", // "location": "query", // "type": "string" // }, // "managedZone": { + // "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.", // "location": "path", // "required": true, // "type": "string" // }, // "project": { + // "description": "Identifies the project addressed by this request.", // "location": "path", // "required": true, // "type": "string" @@ -2601,7 +2924,7 @@ type ManagedZonesGetCall struct { header_ http.Header } -// Get: +// Get: Fetch the representation of an existing ManagedZone. func (r *ManagedZonesService) Get(project string, managedZone string) *ManagedZonesGetCall { c := &ManagedZonesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project @@ -2610,6 +2933,9 @@ func (r *ManagedZonesService) Get(project string, managedZone string) *ManagedZo } // ClientOperationId sets the optional parameter "clientOperationId": +// For mutating operation requests only. An optional identifier +// specified by the client. Must be unique for operation resources in +// the Operations collection. func (c *ManagedZonesGetCall) ClientOperationId(clientOperationId string) *ManagedZonesGetCall { c.urlParams_.Set("clientOperationId", clientOperationId) return c @@ -2714,7 +3040,7 @@ func (c *ManagedZonesGetCall) Do(opts ...googleapi.CallOption) (*ManagedZone, er } return ret, nil // { - // "description": "", + // "description": "Fetch the representation of an existing ManagedZone.", // "httpMethod": "GET", // "id": "dns.managedZones.get", // "parameterOrder": [ @@ -2723,15 +3049,18 @@ func (c *ManagedZonesGetCall) Do(opts ...googleapi.CallOption) (*ManagedZone, er // ], // "parameters": { // "clientOperationId": { + // "description": "For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.", // "location": "query", // "type": "string" // }, // "managedZone": { + // "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.", // "location": "path", // "required": true, // "type": "string" // }, // "project": { + // "description": "Identifies the project addressed by this request.", // "location": "path", // "required": true, // "type": "string" @@ -2762,26 +3091,32 @@ type ManagedZonesListCall struct { header_ http.Header } -// List: +// List: Enumerate ManagedZones that have been created but not yet +// deleted. func (r *ManagedZonesService) List(project string) *ManagedZonesListCall { c := &ManagedZonesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project return c } -// DnsName sets the optional parameter "dnsName": +// DnsName sets the optional parameter "dnsName": Restricts the list to +// return only zones with this domain name. func (c *ManagedZonesListCall) DnsName(dnsName string) *ManagedZonesListCall { c.urlParams_.Set("dnsName", dnsName) return c } -// MaxResults sets the optional parameter "maxResults": +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to be returned. If unspecified, the server will decide how +// many results to return. func (c *ManagedZonesListCall) MaxResults(maxResults int64) *ManagedZonesListCall { c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// PageToken sets the optional parameter "pageToken": +// PageToken sets the optional parameter "pageToken": A tag returned by +// a previous list request that was truncated. Use this parameter to +// continue a previous list request. func (c *ManagedZonesListCall) PageToken(pageToken string) *ManagedZonesListCall { c.urlParams_.Set("pageToken", pageToken) return c @@ -2885,7 +3220,7 @@ func (c *ManagedZonesListCall) Do(opts ...googleapi.CallOption) (*ManagedZonesLi } return ret, nil // { - // "description": "", + // "description": "Enumerate ManagedZones that have been created but not yet deleted.", // "httpMethod": "GET", // "id": "dns.managedZones.list", // "parameterOrder": [ @@ -2893,19 +3228,23 @@ func (c *ManagedZonesListCall) Do(opts ...googleapi.CallOption) (*ManagedZonesLi // ], // "parameters": { // "dnsName": { + // "description": "Restricts the list to return only zones with this domain name.", // "location": "query", // "type": "string" // }, // "maxResults": { + // "description": "Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { + // "description": "Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.", // "location": "query", // "type": "string" // }, // "project": { + // "description": "Identifies the project addressed by this request.", // "location": "path", // "required": true, // "type": "string" @@ -2958,7 +3297,7 @@ type ManagedZonesPatchCall struct { header_ http.Header } -// Patch: +// Patch: Apply a partial update to an existing ManagedZone. func (r *ManagedZonesService) Patch(project string, managedZone string, managedzone *ManagedZone) *ManagedZonesPatchCall { c := &ManagedZonesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project @@ -2968,6 +3307,9 @@ func (r *ManagedZonesService) Patch(project string, managedZone string, managedz } // ClientOperationId sets the optional parameter "clientOperationId": +// For mutating operation requests only. An optional identifier +// specified by the client. Must be unique for operation resources in +// the Operations collection. func (c *ManagedZonesPatchCall) ClientOperationId(clientOperationId string) *ManagedZonesPatchCall { c.urlParams_.Set("clientOperationId", clientOperationId) return c @@ -3064,7 +3406,7 @@ func (c *ManagedZonesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, er } return ret, nil // { - // "description": "", + // "description": "Apply a partial update to an existing ManagedZone.", // "httpMethod": "PATCH", // "id": "dns.managedZones.patch", // "parameterOrder": [ @@ -3073,15 +3415,18 @@ func (c *ManagedZonesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, er // ], // "parameters": { // "clientOperationId": { + // "description": "For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.", // "location": "query", // "type": "string" // }, // "managedZone": { + // "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.", // "location": "path", // "required": true, // "type": "string" // }, // "project": { + // "description": "Identifies the project addressed by this request.", // "location": "path", // "required": true, // "type": "string" @@ -3114,7 +3459,7 @@ type ManagedZonesUpdateCall struct { header_ http.Header } -// Update: +// Update: Update an existing ManagedZone. func (r *ManagedZonesService) Update(project string, managedZone string, managedzone *ManagedZone) *ManagedZonesUpdateCall { c := &ManagedZonesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project @@ -3124,6 +3469,9 @@ func (r *ManagedZonesService) Update(project string, managedZone string, managed } // ClientOperationId sets the optional parameter "clientOperationId": +// For mutating operation requests only. An optional identifier +// specified by the client. Must be unique for operation resources in +// the Operations collection. func (c *ManagedZonesUpdateCall) ClientOperationId(clientOperationId string) *ManagedZonesUpdateCall { c.urlParams_.Set("clientOperationId", clientOperationId) return c @@ -3220,7 +3568,7 @@ func (c *ManagedZonesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, e } return ret, nil // { - // "description": "", + // "description": "Update an existing ManagedZone.", // "httpMethod": "PUT", // "id": "dns.managedZones.update", // "parameterOrder": [ @@ -3229,15 +3577,18 @@ func (c *ManagedZonesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, e // ], // "parameters": { // "clientOperationId": { + // "description": "For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.", // "location": "query", // "type": "string" // }, // "managedZone": { + // "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.", // "location": "path", // "required": true, // "type": "string" // }, // "project": { + // "description": "Identifies the project addressed by this request.", // "location": "path", // "required": true, // "type": "string" @@ -3269,7 +3620,7 @@ type ProjectsGetCall struct { header_ http.Header } -// Get: +// Get: Fetch the representation of an existing Project. func (r *ProjectsService) Get(project string) *ProjectsGetCall { c := &ProjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project @@ -3277,6 +3628,9 @@ func (r *ProjectsService) Get(project string) *ProjectsGetCall { } // ClientOperationId sets the optional parameter "clientOperationId": +// For mutating operation requests only. An optional identifier +// specified by the client. Must be unique for operation resources in +// the Operations collection. func (c *ProjectsGetCall) ClientOperationId(clientOperationId string) *ProjectsGetCall { c.urlParams_.Set("clientOperationId", clientOperationId) return c @@ -3380,7 +3734,7 @@ func (c *ProjectsGetCall) Do(opts ...googleapi.CallOption) (*Project, error) { } return ret, nil // { - // "description": "", + // "description": "Fetch the representation of an existing Project.", // "httpMethod": "GET", // "id": "dns.projects.get", // "parameterOrder": [ @@ -3388,10 +3742,12 @@ func (c *ProjectsGetCall) Do(opts ...googleapi.CallOption) (*Project, error) { // ], // "parameters": { // "clientOperationId": { + // "description": "For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.", // "location": "query", // "type": "string" // }, // "project": { + // "description": "Identifies the project addressed by this request.", // "location": "path", // "required": true, // "type": "string" @@ -3423,7 +3779,8 @@ type ResourceRecordSetsListCall struct { header_ http.Header } -// List: +// List: Enumerate ResourceRecordSets that have been created but not yet +// deleted. func (r *ResourceRecordSetsService) List(project string, managedZone string) *ResourceRecordSetsListCall { c := &ResourceRecordSetsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project @@ -3431,25 +3788,32 @@ func (r *ResourceRecordSetsService) List(project string, managedZone string) *Re return c } -// MaxResults sets the optional parameter "maxResults": +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to be returned. If unspecified, the server will decide how +// many results to return. func (c *ResourceRecordSetsListCall) MaxResults(maxResults int64) *ResourceRecordSetsListCall { c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// Name sets the optional parameter "name": +// Name sets the optional parameter "name": Restricts the list to return +// only records with this fully qualified domain name. func (c *ResourceRecordSetsListCall) Name(name string) *ResourceRecordSetsListCall { c.urlParams_.Set("name", name) return c } -// PageToken sets the optional parameter "pageToken": +// PageToken sets the optional parameter "pageToken": A tag returned by +// a previous list request that was truncated. Use this parameter to +// continue a previous list request. func (c *ResourceRecordSetsListCall) PageToken(pageToken string) *ResourceRecordSetsListCall { c.urlParams_.Set("pageToken", pageToken) return c } -// Type sets the optional parameter "type": +// Type sets the optional parameter "type": Restricts the list to return +// only records of this type. If present, the "name" parameter must also +// be present. func (c *ResourceRecordSetsListCall) Type(type_ string) *ResourceRecordSetsListCall { c.urlParams_.Set("type", type_) return c @@ -3554,7 +3918,7 @@ func (c *ResourceRecordSetsListCall) Do(opts ...googleapi.CallOption) (*Resource } return ret, nil // { - // "description": "", + // "description": "Enumerate ResourceRecordSets that have been created but not yet deleted.", // "httpMethod": "GET", // "id": "dns.resourceRecordSets.list", // "parameterOrder": [ @@ -3563,29 +3927,35 @@ func (c *ResourceRecordSetsListCall) Do(opts ...googleapi.CallOption) (*Resource // ], // "parameters": { // "managedZone": { + // "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.", // "location": "path", // "required": true, // "type": "string" // }, // "maxResults": { + // "description": "Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "name": { + // "description": "Restricts the list to return only records with this fully qualified domain name.", // "location": "query", // "type": "string" // }, // "pageToken": { + // "description": "Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.", // "location": "query", // "type": "string" // }, // "project": { + // "description": "Identifies the project addressed by this request.", // "location": "path", // "required": true, // "type": "string" // }, // "type": { + // "description": "Restricts the list to return only records of this type. If present, the \"name\" parameter must also be present.", // "location": "query", // "type": "string" // } diff --git a/vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/ddtrace.go b/vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/ddtrace.go index bfd40561e..e147ffe4b 100644 --- a/vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/ddtrace.go +++ b/vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/ddtrace.go @@ -108,4 +108,8 @@ type StartSpanConfig struct { // Tags holds a set of key/value pairs that should be set as metadata on the // new span. Tags map[string]interface{} + + // Force-set the SpanID, rather than use a random number. If no Parent SpanContext is present, + // then this will also set the TraceID to the same value. + SpanID uint64 } diff --git a/vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/ext/tags.go b/vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/ext/tags.go index 6775e2aac..c21f84825 100644 --- a/vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/ext/tags.go +++ b/vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/ext/tags.go @@ -27,10 +27,15 @@ const ( // HTTPURL sets the HTTP URL for a span. HTTPURL = "http.url" - // TODO: In the next major version, suffix these constants (SpanType, etc) - // with "*Key" (SpanTypeKey, etc) to more easily differentiate between + // TODO: In the next major version, prefix these constants (SpanType, etc) + // with "Key*" (KeySpanType, etc) to more easily differentiate between // constants representing tag values and constants representing keys. + // SpanName is a pseudo-key for setting a span's operation name by means of + // a tag. It is mostly here to facilitate vendor-agnostic frameworks like Opentracing + // and OpenCensus. + SpanName = "span.name" + // SpanType defines the Span type (web, db, cache). SpanType = "span.type" @@ -54,4 +59,20 @@ const ( // Environment specifies the environment to use with a trace. Environment = "env" + + // EventSampleRate specifies the rate at which this span will be sampled + // as an APM event. + EventSampleRate = "_dd1.sr.eausr" + + // AnalyticsEvent specifies whether the span should be recorded as a Trace + // Search & Analytics event. + AnalyticsEvent = "analytics.event" + + // ManualKeep is a tag which specifies that the trace to which this span + // belongs to should be kept when set to true. + ManualKeep = "manual.keep" + + // ManualDrop is a tag which specifies that the trace to which this span + // belongs to should be dropped when set to true. + ManualDrop = "manual.drop" ) diff --git a/vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/opentracer/option.go b/vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/opentracer/option.go index cbae45184..6ee859a4a 100644 --- a/vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/opentracer/option.go +++ b/vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/opentracer/option.go @@ -18,6 +18,11 @@ func ResourceName(name string) opentracing.StartSpanOption { return opentracing.Tag{Key: ext.ResourceName, Value: name} } +// SpanName sets the Datadog operation name for the span. +func SpanName(name string) opentracing.StartSpanOption { + return opentracing.Tag{Key: ext.SpanName, Value: name} +} + // SpanType can be used with opentracing.StartSpan to set the type of a span. func SpanType(name string) opentracing.StartSpanOption { return opentracing.Tag{Key: ext.SpanType, Value: name} diff --git a/vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer/option.go b/vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer/option.go index 789c9aa38..b9f0028fb 100644 --- a/vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer/option.go +++ b/vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer/option.go @@ -8,6 +8,7 @@ import ( "gopkg.in/DataDog/dd-trace-go.v1/ddtrace" "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/ext" + "gopkg.in/DataDog/dd-trace-go.v1/internal/globalconfig" ) // config holds the tracer configuration. @@ -117,6 +118,22 @@ func WithHTTPRoundTripper(r http.RoundTripper) StartOption { } } +// WithAnalytics allows specifying whether Trace Search & Analytics should be enabled +// for integrations. +func WithAnalytics(on bool) StartOption { + if on { + return WithAnalyticsRate(1.0) + } + return WithAnalyticsRate(0.0) +} + +// WithAnalyticsRate sets the global sampling rate for sampling APM events. +func WithAnalyticsRate(rate float64) StartOption { + return func(_ *config) { + globalconfig.SetAnalyticsRate(rate) + } +} + // StartSpanOption is a configuration option for StartSpan. It is aliased in order // to help godoc group all the functions returning it together. It is considered // more correct to refer to it as the type as the origin, ddtrace.StartSpanOption. @@ -149,6 +166,15 @@ func SpanType(name string) StartSpanOption { return Tag(ext.SpanType, name) } +// WithSpanID sets the SpanID on the started span, instead of using a random number. +// If there is no parent Span (eg from ChildOf), then the TraceID will also be set to the +// value given here. +func WithSpanID(id uint64) StartSpanOption { + return func(cfg *ddtrace.StartSpanConfig) { + cfg.SpanID = id + } +} + // ChildOf tells StartSpan to use the given span context as a parent for the // created span. func ChildOf(ctx ddtrace.SpanContext) StartSpanOption { @@ -179,7 +205,8 @@ func FinishTime(t time.Time) FinishOption { } // WithError marks the span as having had an error. It uses the information from -// err to set tags such as the error message, error type and stack trace. +// err to set tags such as the error message, error type and stack trace. It has +// no effect if the error is nil. func WithError(err error) FinishOption { return func(cfg *ddtrace.FinishConfig) { cfg.Error = err diff --git a/vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer/sampler.go b/vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer/sampler.go index 26d814cef..773354caa 100644 --- a/vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer/sampler.go +++ b/vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer/sampler.go @@ -140,5 +140,5 @@ func (ps *prioritySampler) apply(spn *span) { } else { spn.SetTag(ext.SamplingPriority, ext.PriorityAutoReject) } - spn.SetTag(samplingPriorityRateKey, rate) + spn.SetTag(keySamplingPriorityRate, rate) } diff --git a/vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer/span.go b/vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer/span.go index f8113710f..e8d9432bc 100644 --- a/vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer/span.go +++ b/vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer/span.go @@ -80,10 +80,15 @@ func (s *span) SetTag(key string, value interface{}) { if s.finished { return } - if key == ext.Error { + switch key { + case ext.Error: s.setTagError(value, true) return } + if v, ok := value.(bool); ok { + s.setTagBool(key, v) + return + } if v, ok := value.(string); ok { s.setTagString(key, v) return @@ -133,6 +138,8 @@ func (s *span) setTagError(value interface{}, debugStack bool) { // setTagString sets a string tag. This method is not safe for concurrent use. func (s *span) setTagString(key, v string) { switch key { + case ext.SpanName: + s.Name = v case ext.ServiceName: s.Service = v case ext.ResourceName: @@ -144,13 +151,39 @@ func (s *span) setTagString(key, v string) { } } +// setTagBool sets a boolean tag on the span. +func (s *span) setTagBool(key string, v bool) { + switch key { + case ext.AnalyticsEvent: + if v { + s.setTagNumeric(ext.EventSampleRate, 1.0) + } else { + s.setTagNumeric(ext.EventSampleRate, 0.0) + } + case ext.ManualDrop: + if v { + s.setTagNumeric(ext.SamplingPriority, ext.PriorityUserReject) + } + case ext.ManualKeep: + if v { + s.setTagNumeric(ext.SamplingPriority, ext.PriorityUserKeep) + } + default: + if v { + s.setTagString(key, "true") + } else { + s.setTagString(key, "false") + } + } +} + // setTagNumeric sets a numeric tag, in our case called a metric. This method // is not safe for concurrent use. func (s *span) setTagNumeric(key string, v float64) { switch key { case ext.SamplingPriority: // setting sampling priority per spec - s.Metrics[samplingPriorityKey] = v + s.Metrics[keySamplingPriority] = v s.context.setSamplingPriority(int(v)) default: s.Metrics[key] = v @@ -236,6 +269,7 @@ func (s *span) String() string { } const ( - samplingPriorityKey = "_sampling_priority_v1" - samplingPriorityRateKey = "_sampling_priority_rate_v1" + keySamplingPriority = "_sampling_priority_v1" + keySamplingPriorityRate = "_sampling_priority_rate_v1" + keyOrigin = "_dd.origin" ) diff --git a/vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer/spancontext.go b/vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer/spancontext.go index 2def04015..4302eba71 100644 --- a/vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer/spancontext.go +++ b/vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer/spancontext.go @@ -25,10 +25,9 @@ type spanContext struct { traceID uint64 spanID uint64 - mu sync.RWMutex // guards below fields - baggage map[string]string - priority int - hasPriority bool + mu sync.RWMutex // guards below fields + baggage map[string]string + origin string // e.g. "synthetics" } // newSpanContext creates a new SpanContext to serve as context for the given @@ -42,15 +41,10 @@ func newSpanContext(span *span, parent *spanContext) *spanContext { spanID: span.SpanID, span: span, } - if v, ok := span.Metrics[samplingPriorityKey]; ok { - context.hasPriority = true - context.priority = int(v) - } if parent != nil { context.trace = parent.trace context.drop = parent.drop - context.hasPriority = parent.hasSamplingPriority() - context.priority = parent.samplingPriority() + context.origin = parent.origin parent.ForeachBaggageItem(func(k, v string) bool { context.setBaggageItem(k, v) return true @@ -59,6 +53,10 @@ func newSpanContext(span *span, parent *spanContext) *spanContext { if context.trace == nil { context.trace = newTrace() } + if context.trace.root == nil { + // first span in the trace can safely be assumed to be the root + context.trace.root = span + } // put span in context's trace context.trace.push(span) return context @@ -82,22 +80,21 @@ func (c *spanContext) ForeachBaggageItem(handler func(k, v string) bool) { } func (c *spanContext) setSamplingPriority(p int) { - c.mu.Lock() - defer c.mu.Unlock() - c.priority = p - c.hasPriority = true + if c.trace == nil { + c.trace = newTrace() + } + c.trace.setSamplingPriority(float64(p)) } func (c *spanContext) samplingPriority() int { - c.mu.RLock() - defer c.mu.RUnlock() - return c.priority + if c.trace == nil { + return 0 + } + return c.trace.samplingPriority() } func (c *spanContext) hasSamplingPriority() bool { - c.mu.RLock() - defer c.mu.RUnlock() - return c.hasPriority + return c.trace != nil && c.trace.hasSamplingPriority() } func (c *spanContext) setBaggageItem(key, val string) { @@ -116,15 +113,23 @@ func (c *spanContext) baggageItem(key string) string { } // finish marks this span as finished in the trace. -func (c *spanContext) finish() { c.trace.ackFinish() } +func (c *spanContext) finish() { c.trace.finishedOne() } -// trace holds information about a specific trace. This structure is shared -// between all spans in a trace. +// trace contains shared context information about a trace, such as sampling +// priority, the root reference and a buffer of the spans which are part of the +// trace, if these exist. type trace struct { mu sync.RWMutex // guards below fields spans []*span // all the spans that are part of this trace finished int // the number of finished spans full bool // signifies that the span buffer is full + priority *float64 // sampling priority + locked bool // specifies if the sampling priority can be altered + + // root specifies the root of the trace, if known; it is nil when a span + // context is extracted from a carrier, at which point there are no spans in + // the trace yet. + root *span } var ( @@ -146,6 +151,43 @@ func newTrace() *trace { return &trace{spans: make([]*span, 0, traceStartSize)} } +func (t *trace) hasSamplingPriority() bool { + t.mu.RLock() + defer t.mu.RUnlock() + return t.priority != nil +} + +func (t *trace) samplingPriority() int { + t.mu.RLock() + defer t.mu.RUnlock() + if t.priority == nil { + return 0 + } + return int(*t.priority) +} + +func (t *trace) setSamplingPriority(p float64) { + t.mu.Lock() + defer t.mu.Unlock() + t.setSamplingPriorityLocked(p) +} + +func (t *trace) setSamplingPriorityLocked(p float64) { + if t.locked { + return + } + if t.root == nil { + // this trace is part of a context that doesn't belong to a + // trace yet, meaning that the sampling priority is locked + // by a distributed trace. + t.locked = true + } + if t.priority == nil { + t.priority = new(float64) + } + *t.priority = p +} + // push pushes a new span into the trace. If the buffer is full, it returns // a errBufferFull error. func (t *trace) push(sp *span) { @@ -164,12 +206,16 @@ func (t *trace) push(sp *span) { } return } + if v, ok := sp.Metrics[keySamplingPriority]; ok { + t.setSamplingPriorityLocked(v) + } t.spans = append(t.spans, sp) } -// ackFinish aknowledges that another span in the trace has finished, and checks -// if the trace is complete, in which case it calls the onFinish function. -func (t *trace) ackFinish() { +// finishedOne aknowledges that another span in the trace has finished, and checks +// if the trace is complete, in which case it calls the onFinish function. It uses +// the given priority, if non-nil, to mark the root span. +func (t *trace) finishedOne() { t.mu.Lock() defer t.mu.Unlock() if t.full { @@ -185,6 +231,9 @@ func (t *trace) ackFinish() { } if tr, ok := internal.GetGlobalTracer().(*tracer); ok { // we have a tracer that can receive completed traces. + if t.priority != nil { + t.root.Metrics[keySamplingPriority] = *t.priority + } tr.pushTrace(t.spans) } t.spans = nil diff --git a/vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer/textmap.go b/vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer/textmap.go index fe0ef9933..d8053ba00 100644 --- a/vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer/textmap.go +++ b/vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer/textmap.go @@ -2,10 +2,12 @@ package tracer import ( "net/http" + "os" "strconv" "strings" "gopkg.in/DataDog/dd-trace-go.v1/ddtrace" + "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/ext" ) // HTTPHeadersCarrier wraps an http.Header as a TextMapWriter and TextMapReader, allowing @@ -54,6 +56,11 @@ func (c TextMapCarrier) ForeachKey(handler func(key, val string) error) error { return nil } +const ( + headerPropagationStyleInject = "DD_PROPAGATION_STYLE_INJECT" + headerPropagationStyleExtract = "DD_PROPAGATION_STYLE_EXTRACT" +) + const ( // DefaultBaggageHeaderPrefix specifies the prefix that will be used in // HTTP headers or text maps to prefix baggage keys. @@ -72,6 +79,10 @@ const ( DefaultPriorityHeader = "x-datadog-sampling-priority" ) +// originHeader specifies the name of the header indicating the origin of the trace. +// It is used with the Synthetics product and usually has the value "synthetics". +const originHeader = "x-datadog-origin" + // PropagatorConfig defines the configuration for initializing a propagator. type PropagatorConfig struct { // BaggagePrefix specifies the prefix that will be used to store baggage @@ -110,21 +121,86 @@ func NewPropagator(cfg *PropagatorConfig) Propagator { if cfg.PriorityHeader == "" { cfg.PriorityHeader = DefaultPriorityHeader } - return &propagator{cfg} + return &chainedPropagator{ + injectors: getPropagators(cfg, headerPropagationStyleInject), + extractors: getPropagators(cfg, headerPropagationStyleExtract), + } } -// propagator implements a propagator which uses TextMap internally. -// It propagates the trace and span IDs, as well as the baggage from the -// context. -type propagator struct{ cfg *PropagatorConfig } +// chainedPropagator implements Propagator and applies a list of injectors and extractors. +// When injecting, all injectors are called to propagate the span context. +// When extracting, it tries each extractor, selecting the first successful one. +type chainedPropagator struct { + injectors []Propagator + extractors []Propagator +} + +// getPropagators returns a list of propagators based on the list found in the +// given environment variable. If the list doesn't contain a value or has invalid +// values, the default propagator will be returned. +func getPropagators(cfg *PropagatorConfig, env string) []Propagator { + dd := &propagator{cfg} + ps := os.Getenv(env) + if ps == "" { + return []Propagator{dd} + } + var list []Propagator + for _, v := range strings.Split(ps, ",") { + switch strings.ToLower(v) { + case "datadog": + list = append(list, dd) + case "b3": + list = append(list, &propagatorB3{}) + default: + // TODO(cgilmour): consider logging something for invalid/unknown styles. + } + } + if len(list) == 0 { + // return the default + return []Propagator{dd} + } + return list +} // Inject defines the Propagator to propagate SpanContext data // out of the current process. The implementation propagates the // TraceID and the current active SpanID, as well as the Span baggage. +func (p *chainedPropagator) Inject(spanCtx ddtrace.SpanContext, carrier interface{}) error { + for _, v := range p.injectors { + err := v.Inject(spanCtx, carrier) + if err != nil { + return err + } + } + return nil +} + +// Extract implements Propagator. +func (p *chainedPropagator) Extract(carrier interface{}) (ddtrace.SpanContext, error) { + for _, v := range p.extractors { + ctx, err := v.Extract(carrier) + if ctx != nil { + // first extractor returns + return ctx, nil + } + if err == ErrSpanContextNotFound { + continue + } + return nil, err + } + return nil, ErrSpanContextNotFound +} + +// propagator implements Propagator and injects/extracts span contexts +// using datadog headers. Only TextMap carriers are supported. +type propagator struct { + cfg *PropagatorConfig +} + func (p *propagator) Inject(spanCtx ddtrace.SpanContext, carrier interface{}) error { - switch v := carrier.(type) { + switch c := carrier.(type) { case TextMapWriter: - return p.injectTextMap(spanCtx, v) + return p.injectTextMap(spanCtx, c) default: return ErrInvalidCarrier } @@ -141,6 +217,9 @@ func (p *propagator) injectTextMap(spanCtx ddtrace.SpanContext, writer TextMapWr if ctx.hasSamplingPriority() { writer.Set(p.cfg.PriorityHeader, strconv.Itoa(ctx.samplingPriority())) } + if ctx.origin != "" { + writer.Set(originHeader, ctx.origin) + } // propagate OpenTracing baggage for k, v := range ctx.baggage { writer.Set(p.cfg.BaggagePrefix+k, v) @@ -148,11 +227,10 @@ func (p *propagator) injectTextMap(spanCtx ddtrace.SpanContext, writer TextMapWr return nil } -// Extract implements Propagator. func (p *propagator) Extract(carrier interface{}) (ddtrace.SpanContext, error) { - switch v := carrier.(type) { + switch c := carrier.(type) { case TextMapReader: - return p.extractTextMap(v) + return p.extractTextMap(c) default: return nil, ErrInvalidCarrier } @@ -180,6 +258,8 @@ func (p *propagator) extractTextMap(reader TextMapReader) (ddtrace.SpanContext, return ErrSpanContextCorrupted } ctx.setSamplingPriority(priority) + case originHeader: + ctx.origin = v default: if strings.HasPrefix(key, p.cfg.BaggagePrefix) { ctx.setBaggageItem(strings.TrimPrefix(key, p.cfg.BaggagePrefix), v) @@ -195,3 +275,83 @@ func (p *propagator) extractTextMap(reader TextMapReader) (ddtrace.SpanContext, } return &ctx, nil } + +const ( + b3TraceIDHeader = "x-b3-traceid" + b3SpanIDHeader = "x-b3-spanid" + b3SampledHeader = "x-b3-sampled" +) + +// propagatorB3 implements Propagator and injects/extracts span contexts +// using B3 headers. Only TextMap carriers are supported. +type propagatorB3 struct{} + +func (p *propagatorB3) Inject(spanCtx ddtrace.SpanContext, carrier interface{}) error { + switch c := carrier.(type) { + case TextMapWriter: + return p.injectTextMap(spanCtx, c) + default: + return ErrInvalidCarrier + } +} + +func (*propagatorB3) injectTextMap(spanCtx ddtrace.SpanContext, writer TextMapWriter) error { + ctx, ok := spanCtx.(*spanContext) + if !ok || ctx.traceID == 0 || ctx.spanID == 0 { + return ErrInvalidSpanContext + } + writer.Set(b3TraceIDHeader, strconv.FormatUint(ctx.traceID, 16)) + writer.Set(b3SpanIDHeader, strconv.FormatUint(ctx.spanID, 16)) + if ctx.hasSamplingPriority() { + if ctx.samplingPriority() >= ext.PriorityAutoKeep { + writer.Set(b3SampledHeader, "1") + } else { + writer.Set(b3SampledHeader, "0") + } + } + return nil +} + +func (p *propagatorB3) Extract(carrier interface{}) (ddtrace.SpanContext, error) { + switch c := carrier.(type) { + case TextMapReader: + return p.extractTextMap(c) + default: + return nil, ErrInvalidCarrier + } +} + +func (*propagatorB3) extractTextMap(reader TextMapReader) (ddtrace.SpanContext, error) { + var ctx spanContext + err := reader.ForeachKey(func(k, v string) error { + var err error + key := strings.ToLower(k) + switch key { + case b3TraceIDHeader: + ctx.traceID, err = strconv.ParseUint(v, 16, 64) + if err != nil { + return ErrSpanContextCorrupted + } + case b3SpanIDHeader: + ctx.spanID, err = strconv.ParseUint(v, 16, 64) + if err != nil { + return ErrSpanContextCorrupted + } + case b3SampledHeader: + priority, err := strconv.Atoi(v) + if err != nil { + return ErrSpanContextCorrupted + } + ctx.setSamplingPriority(priority) + default: + } + return nil + }) + if err != nil { + return nil, err + } + if ctx.traceID == 0 || ctx.spanID == 0 { + return nil, ErrSpanContextNotFound + } + return &ctx, nil +} diff --git a/vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer/tracer.go b/vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer/tracer.go index 42620786b..503577709 100644 --- a/vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer/tracer.go +++ b/vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer/tracer.go @@ -230,7 +230,10 @@ func (t *tracer) StartSpan(operationName string, options ...ddtrace.StartSpanOpt context = ctx } } - id := random.Uint64() + id := opts.SpanID + if id == 0 { + id = random.Uint64() + } // span defaults span := &span{ Name: operationName, @@ -248,13 +251,19 @@ func (t *tracer) StartSpan(operationName string, options ...ddtrace.StartSpanOpt span.TraceID = context.traceID span.ParentID = context.spanID if context.hasSamplingPriority() { - span.Metrics[samplingPriorityKey] = float64(context.samplingPriority()) + span.Metrics[keySamplingPriority] = float64(context.samplingPriority()) } if context.span != nil { - // it has a local parent, inherit the service + // local parent, inherit service context.span.RLock() span.Service = context.span.Service context.span.RUnlock() + } else { + // remote parent + if context.origin != "" { + // mark origin + span.Meta[keyOrigin] = context.origin + } } } span.context = newSpanContext(span, context) @@ -361,7 +370,7 @@ const sampleRateMetricKey = "_sample_rate" // Sample samples a span with the internal sampler. func (t *tracer) sample(span *span) { - if span.context.hasPriority { + if span.context.hasSamplingPriority() { // sampling decision was already made return } diff --git a/vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer/transport.go b/vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer/transport.go index 9a8e70cfd..b2c270cac 100644 --- a/vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer/transport.go +++ b/vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer/transport.go @@ -15,7 +15,7 @@ import ( var ( // TODO(gbbr): find a more effective way to keep this up to date, // e.g. via `go generate` - tracerVersion = "v1.7.0" + tracerVersion = "v1.10.0" // We copy the transport to avoid using the default one, as it might be // augmented with tracing and we don't want these calls to be recorded. diff --git a/vendor/gopkg.in/DataDog/dd-trace-go.v1/internal/globalconfig/globalconfig.go b/vendor/gopkg.in/DataDog/dd-trace-go.v1/internal/globalconfig/globalconfig.go new file mode 100644 index 000000000..115f472ac --- /dev/null +++ b/vendor/gopkg.in/DataDog/dd-trace-go.v1/internal/globalconfig/globalconfig.go @@ -0,0 +1,28 @@ +// Package globalconfig stores configuration which applies globally to both the tracer +// and integrations. +package globalconfig + +import "sync" + +var cfg = &config{} + +type config struct { + mu sync.RWMutex + analyticsRate float64 +} + +// AnalyticsRate returns the sampling rate at which events should be marked. It uses +// synchronizing mechanisms, meaning that for optimal performance it's best to read it +// once and store it. +func AnalyticsRate() float64 { + cfg.mu.RLock() + defer cfg.mu.RUnlock() + return cfg.analyticsRate +} + +// SetAnalyticsRate sets the given event sampling rate globally. +func SetAnalyticsRate(rate float64) { + cfg.mu.Lock() + cfg.analyticsRate = rate + cfg.mu.Unlock() +}