Vendor new Go GCP API clients (#3529)

This commit is contained in:
Riley Karson 2019-05-01 13:20:21 -07:00 committed by GitHub
parent 478b72fc10
commit 5ea4adf6f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
178 changed files with 32950 additions and 6930 deletions

4
go.mod
View File

@ -19,6 +19,6 @@ require (
github.com/pierrec/lz4 v2.0.5+incompatible // indirect
github.com/stoewer/go-strcase v1.0.2
github.com/terraform-providers/terraform-provider-random v2.0.0+incompatible
golang.org/x/oauth2 v0.0.0-20190220154721-9b3c75971fc9
google.golang.org/api v0.1.0
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421
google.golang.org/api v0.4.0
)

19
go.sum
View File

@ -173,6 +173,7 @@ github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1
github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-version v1.1.0 h1:bPIoEKD27tNdebFGGxxYwcL4nepeY4j1QP23PFRGzg0=
github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w=
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
@ -366,6 +367,8 @@ github.com/zclconf/go-cty v0.0.0-20190320224746-fd76348b9329 h1:ne520NlvoncW5zfB
github.com/zclconf/go-cty v0.0.0-20190320224746-fd76348b9329/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s=
go.opencensus.io v0.18.0 h1:Mk5rgZcggtbvtAun5aJzAtjKKN/t0R3jJPlWILlv938=
go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA=
go.opencensus.io v0.21.0 h1:mU6zScU4U1YAFPHEHYk+3JC4SY7JxgkqS10ZOSyksNg=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
@ -382,6 +385,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@ -399,11 +404,15 @@ golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAG
golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190220154721-9b3c75971fc9 h1:pfyU+l9dEu0vZzDDMsdAKa1gZbJYEn6urYXj/+Xkz7s=
golang.org/x/oauth2 v0.0.0-20190220154721-9b3c75971fc9/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421 h1:Wo7BWFiOk0QRFMLYMqJGFMd9CgUAcGx7V+qEg/h5IBI=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6 h1:bjcUS9ztw9kFmmIxJInhon/0Is3p+EHBKNgquIzo1OI=
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@ -424,10 +433,15 @@ golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZe
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181030000716-a0a13e073c7b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
google.golang.org/api v0.1.0 h1:K6z2u68e86TPdSdefXdzvXgR1zEMa+459vBSfWYAZkI=
google.golang.org/api v0.1.0/go.mod h1:UGEZY7KEX120AnNLIHFMKIo4obdJhkp2tPbaPlQx13Y=
google.golang.org/api v0.4.0 h1:KKgc1aqhV8wDPbDzlDtpvyjZFY3vjz85FP7p4wcQUyI=
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
@ -439,11 +453,15 @@ google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2/go.mod h1:JiN7NxoA
google.golang.org/genproto v0.0.0-20181202183823-bd91e49a0898/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg=
google.golang.org/genproto v0.0.0-20190201180003-4b09977fb922 h1:mBVYJnbrXLA/ZCBTCe7PtEgAUP+1bg92qTaFoPHdz+8=
google.golang.org/genproto v0.0.0-20190201180003-4b09977fb922/go.mod h1:L3J43x8/uS+qIUoksaLKe6OS3nUKxOKuIFz1sl2/jx4=
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19 h1:Lj2SnHtxkRGJDqnGaSjo+CCdIieEnwVazbOXILwQemk=
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio=
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
google.golang.org/grpc v1.18.0 h1:IZl7mfBGfbhYx2p2rKRtYgDFw6SBz+kclmxYrCksPPA=
google.golang.org/grpc v1.18.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
google.golang.org/grpc v1.19.0 h1:cfg4PD8YEdSFnm7qLV4++93WcmhH2nIUhMjhdCvl3j8=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
@ -457,6 +475,7 @@ gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o=
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
howett.net/plist v0.0.0-20181124034731-591f970eefbb/go.mod h1:vMygbs4qMhSZSc4lCUl2OEE+rDiIIJAIdR4m7MiMcm0=
labix.org/v2/mgo v0.0.0-20140701140051-000000000287/go.mod h1:Lg7AYkt1uXJoR9oeSZ3W/8IXLdvOfIITgZnommstyz4=

362
vendor/github.com/hashicorp/golang-lru/LICENSE generated vendored Normal file
View File

@ -0,0 +1,362 @@
Mozilla Public License, version 2.0
1. Definitions
1.1. "Contributor"
means each individual or legal entity that creates, contributes to the
creation of, or owns Covered Software.
1.2. "Contributor Version"
means the combination of the Contributions of others (if any) used by a
Contributor and that particular Contributor's Contribution.
1.3. "Contribution"
means Covered Software of a particular Contributor.
1.4. "Covered Software"
means Source Code Form to which the initial Contributor has attached the
notice in Exhibit A, the Executable Form of such Source Code Form, and
Modifications of such Source Code Form, in each case including portions
thereof.
1.5. "Incompatible With Secondary Licenses"
means
a. that the initial Contributor has attached the notice described in
Exhibit B to the Covered Software; or
b. that the Covered Software was made available under the terms of
version 1.1 or earlier of the License, but not also under the terms of
a Secondary License.
1.6. "Executable Form"
means any form of the work other than Source Code Form.
1.7. "Larger Work"
means a work that combines Covered Software with other material, in a
separate file or files, that is not Covered Software.
1.8. "License"
means this document.
1.9. "Licensable"
means having the right to grant, to the maximum extent possible, whether
at the time of the initial grant or subsequently, any and all of the
rights conveyed by this License.
1.10. "Modifications"
means any of the following:
a. any file in Source Code Form that results from an addition to,
deletion from, or modification of the contents of Covered Software; or
b. any new file in Source Code Form that contains any Covered Software.
1.11. "Patent Claims" of a Contributor
means any patent claim(s), including without limitation, method,
process, and apparatus claims, in any patent Licensable by such
Contributor that would be infringed, but for the grant of the License,
by the making, using, selling, offering for sale, having made, import,
or transfer of either its Contributions or its Contributor Version.
1.12. "Secondary License"
means either the GNU General Public License, Version 2.0, the GNU Lesser
General Public License, Version 2.1, the GNU Affero General Public
License, Version 3.0, or any later versions of those licenses.
1.13. "Source Code Form"
means the form of the work preferred for making modifications.
1.14. "You" (or "Your")
means an individual or a legal entity exercising rights under this
License. For legal entities, "You" includes any entity that controls, is
controlled by, or is under common control with You. For purposes of this
definition, "control" means (a) the power, direct or indirect, to cause
the direction or management of such entity, whether by contract or
otherwise, or (b) ownership of more than fifty percent (50%) of the
outstanding shares or beneficial ownership of such entity.
2. License Grants and Conditions
2.1. Grants
Each Contributor hereby grants You a world-wide, royalty-free,
non-exclusive license:
a. under intellectual property rights (other than patent or trademark)
Licensable by such Contributor to use, reproduce, make available,
modify, display, perform, distribute, and otherwise exploit its
Contributions, either on an unmodified basis, with Modifications, or
as part of a Larger Work; and
b. under Patent Claims of such Contributor to make, use, sell, offer for
sale, have made, import, and otherwise transfer either its
Contributions or its Contributor Version.
2.2. Effective Date
The licenses granted in Section 2.1 with respect to any Contribution
become effective for each Contribution on the date the Contributor first
distributes such Contribution.
2.3. Limitations on Grant Scope
The licenses granted in this Section 2 are the only rights granted under
this License. No additional rights or licenses will be implied from the
distribution or licensing of Covered Software under this License.
Notwithstanding Section 2.1(b) above, no patent license is granted by a
Contributor:
a. for any code that a Contributor has removed from Covered Software; or
b. for infringements caused by: (i) Your and any other third party's
modifications of Covered Software, or (ii) the combination of its
Contributions with other software (except as part of its Contributor
Version); or
c. under Patent Claims infringed by Covered Software in the absence of
its Contributions.
This License does not grant any rights in the trademarks, service marks,
or logos of any Contributor (except as may be necessary to comply with
the notice requirements in Section 3.4).
2.4. Subsequent Licenses
No Contributor makes additional grants as a result of Your choice to
distribute the Covered Software under a subsequent version of this
License (see Section 10.2) or under the terms of a Secondary License (if
permitted under the terms of Section 3.3).
2.5. Representation
Each Contributor represents that the Contributor believes its
Contributions are its original creation(s) or it has sufficient rights to
grant the rights to its Contributions conveyed by this License.
2.6. Fair Use
This License is not intended to limit any rights You have under
applicable copyright doctrines of fair use, fair dealing, or other
equivalents.
2.7. Conditions
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in
Section 2.1.
3. Responsibilities
3.1. Distribution of Source Form
All distribution of Covered Software in Source Code Form, including any
Modifications that You create or to which You contribute, must be under
the terms of this License. You must inform recipients that the Source
Code Form of the Covered Software is governed by the terms of this
License, and how they can obtain a copy of this License. You may not
attempt to alter or restrict the recipients' rights in the Source Code
Form.
3.2. Distribution of Executable Form
If You distribute Covered Software in Executable Form then:
a. such Covered Software must also be made available in Source Code Form,
as described in Section 3.1, and You must inform recipients of the
Executable Form how they can obtain a copy of such Source Code Form by
reasonable means in a timely manner, at a charge no more than the cost
of distribution to the recipient; and
b. You may distribute such Executable Form under the terms of this
License, or sublicense it under different terms, provided that the
license for the Executable Form does not attempt to limit or alter the
recipients' rights in the Source Code Form under this License.
3.3. Distribution of a Larger Work
You may create and distribute a Larger Work under terms of Your choice,
provided that You also comply with the requirements of this License for
the Covered Software. If the Larger Work is a combination of Covered
Software with a work governed by one or more Secondary Licenses, and the
Covered Software is not Incompatible With Secondary Licenses, this
License permits You to additionally distribute such Covered Software
under the terms of such Secondary License(s), so that the recipient of
the Larger Work may, at their option, further distribute the Covered
Software under the terms of either this License or such Secondary
License(s).
3.4. Notices
You may not remove or alter the substance of any license notices
(including copyright notices, patent notices, disclaimers of warranty, or
limitations of liability) contained within the Source Code Form of the
Covered Software, except that You may alter any license notices to the
extent required to remedy known factual inaccuracies.
3.5. Application of Additional Terms
You may choose to offer, and to charge a fee for, warranty, support,
indemnity or liability obligations to one or more recipients of Covered
Software. However, You may do so only on Your own behalf, and not on
behalf of any Contributor. You must make it absolutely clear that any
such warranty, support, indemnity, or liability obligation is offered by
You alone, and You hereby agree to indemnify every Contributor for any
liability incurred by such Contributor as a result of warranty, support,
indemnity or liability terms You offer. You may include additional
disclaimers of warranty and limitations of liability specific to any
jurisdiction.
4. Inability to Comply Due to Statute or Regulation
If it is impossible for You to comply with any of the terms of this License
with respect to some or all of the Covered Software due to statute,
judicial order, or regulation then You must: (a) comply with the terms of
this License to the maximum extent possible; and (b) describe the
limitations and the code they affect. Such description must be placed in a
text file included with all distributions of the Covered Software under
this License. Except to the extent prohibited by statute or regulation,
such description must be sufficiently detailed for a recipient of ordinary
skill to be able to understand it.
5. Termination
5.1. The rights granted under this License will terminate automatically if You
fail to comply with any of its terms. However, if You become compliant,
then the rights granted under this License from a particular Contributor
are reinstated (a) provisionally, unless and until such Contributor
explicitly and finally terminates Your grants, and (b) on an ongoing
basis, if such Contributor fails to notify You of the non-compliance by
some reasonable means prior to 60 days after You have come back into
compliance. Moreover, Your grants from a particular Contributor are
reinstated on an ongoing basis if such Contributor notifies You of the
non-compliance by some reasonable means, this is the first time You have
received notice of non-compliance with this License from such
Contributor, and You become compliant prior to 30 days after Your receipt
of the notice.
5.2. If You initiate litigation against any entity by asserting a patent
infringement claim (excluding declaratory judgment actions,
counter-claims, and cross-claims) alleging that a Contributor Version
directly or indirectly infringes any patent, then the rights granted to
You by any and all Contributors for the Covered Software under Section
2.1 of this License shall terminate.
5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user
license agreements (excluding distributors and resellers) which have been
validly granted by You or Your distributors under this License prior to
termination shall survive termination.
6. Disclaimer of Warranty
Covered Software is provided under this License on an "as is" basis,
without warranty of any kind, either expressed, implied, or statutory,
including, without limitation, warranties that the Covered Software is free
of defects, merchantable, fit for a particular purpose or non-infringing.
The entire risk as to the quality and performance of the Covered Software
is with You. Should any Covered Software prove defective in any respect,
You (not any Contributor) assume the cost of any necessary servicing,
repair, or correction. This disclaimer of warranty constitutes an essential
part of this License. No use of any Covered Software is authorized under
this License except under this disclaimer.
7. Limitation of Liability
Under no circumstances and under no legal theory, whether tort (including
negligence), contract, or otherwise, shall any Contributor, or anyone who
distributes Covered Software as permitted above, be liable to You for any
direct, indirect, special, incidental, or consequential damages of any
character including, without limitation, damages for lost profits, loss of
goodwill, work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses, even if such party shall have been
informed of the possibility of such damages. This limitation of liability
shall not apply to liability for death or personal injury resulting from
such party's negligence to the extent applicable law prohibits such
limitation. Some jurisdictions do not allow the exclusion or limitation of
incidental or consequential damages, so this exclusion and limitation may
not apply to You.
8. Litigation
Any litigation relating to this License may be brought only in the courts
of a jurisdiction where the defendant maintains its principal place of
business and such litigation shall be governed by laws of that
jurisdiction, without reference to its conflict-of-law provisions. Nothing
in this Section shall prevent a party's ability to bring cross-claims or
counter-claims.
9. Miscellaneous
This License represents the complete agreement concerning the subject
matter hereof. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent
necessary to make it enforceable. Any law or regulation which provides that
the language of a contract shall be construed against the drafter shall not
be used to construe this License against a Contributor.
10. Versions of the License
10.1. New Versions
Mozilla Foundation is the license steward. Except as provided in Section
10.3, no one other than the license steward has the right to modify or
publish new versions of this License. Each version will be given a
distinguishing version number.
10.2. Effect of New Versions
You may distribute the Covered Software under the terms of the version
of the License under which You originally received the Covered Software,
or under the terms of any subsequent version published by the license
steward.
10.3. Modified Versions
If you create software not governed by this License, and you want to
create a new license for such software, you may create and use a
modified version of this License if you rename the license and remove
any references to the name of the license steward (except to note that
such modified license differs from this License).
10.4. Distributing Source Code Form that is Incompatible With Secondary
Licenses If You choose to distribute Source Code Form that is
Incompatible With Secondary Licenses under the terms of this version of
the License, the notice described in Exhibit B of this License must be
attached.
Exhibit A - Source Code Form License Notice
This Source Code Form is subject to the
terms of the Mozilla Public License, v.
2.0. If a copy of the MPL was not
distributed with this file, You can
obtain one at
http://mozilla.org/MPL/2.0/.
If it is not possible or desirable to put the notice in a particular file,
then You may include the notice in a location (such as a LICENSE file in a
relevant directory) where a recipient would be likely to look for such a
notice.
You may add additional accurate notices of copyright ownership.
Exhibit B - "Incompatible With Secondary Licenses" Notice
This Source Code Form is "Incompatible
With Secondary Licenses", as defined by
the Mozilla Public License, v. 2.0.

161
vendor/github.com/hashicorp/golang-lru/simplelru/lru.go generated vendored Normal file
View File

@ -0,0 +1,161 @@
package simplelru
import (
"container/list"
"errors"
)
// EvictCallback is used to get a callback when a cache entry is evicted
type EvictCallback func(key interface{}, value interface{})
// LRU implements a non-thread safe fixed size LRU cache
type LRU struct {
size int
evictList *list.List
items map[interface{}]*list.Element
onEvict EvictCallback
}
// entry is used to hold a value in the evictList
type entry struct {
key interface{}
value interface{}
}
// NewLRU constructs an LRU of the given size
func NewLRU(size int, onEvict EvictCallback) (*LRU, error) {
if size <= 0 {
return nil, errors.New("Must provide a positive size")
}
c := &LRU{
size: size,
evictList: list.New(),
items: make(map[interface{}]*list.Element),
onEvict: onEvict,
}
return c, nil
}
// Purge is used to completely clear the cache.
func (c *LRU) Purge() {
for k, v := range c.items {
if c.onEvict != nil {
c.onEvict(k, v.Value.(*entry).value)
}
delete(c.items, k)
}
c.evictList.Init()
}
// Add adds a value to the cache. Returns true if an eviction occurred.
func (c *LRU) Add(key, value interface{}) (evicted bool) {
// Check for existing item
if ent, ok := c.items[key]; ok {
c.evictList.MoveToFront(ent)
ent.Value.(*entry).value = value
return false
}
// Add new item
ent := &entry{key, value}
entry := c.evictList.PushFront(ent)
c.items[key] = entry
evict := c.evictList.Len() > c.size
// Verify size not exceeded
if evict {
c.removeOldest()
}
return evict
}
// Get looks up a key's value from the cache.
func (c *LRU) Get(key interface{}) (value interface{}, ok bool) {
if ent, ok := c.items[key]; ok {
c.evictList.MoveToFront(ent)
return ent.Value.(*entry).value, true
}
return
}
// Contains checks if a key is in the cache, without updating the recent-ness
// or deleting it for being stale.
func (c *LRU) Contains(key interface{}) (ok bool) {
_, ok = c.items[key]
return ok
}
// Peek returns the key value (or undefined if not found) without updating
// the "recently used"-ness of the key.
func (c *LRU) Peek(key interface{}) (value interface{}, ok bool) {
var ent *list.Element
if ent, ok = c.items[key]; ok {
return ent.Value.(*entry).value, true
}
return nil, ok
}
// Remove removes the provided key from the cache, returning if the
// key was contained.
func (c *LRU) Remove(key interface{}) (present bool) {
if ent, ok := c.items[key]; ok {
c.removeElement(ent)
return true
}
return false
}
// RemoveOldest removes the oldest item from the cache.
func (c *LRU) RemoveOldest() (key interface{}, value interface{}, ok bool) {
ent := c.evictList.Back()
if ent != nil {
c.removeElement(ent)
kv := ent.Value.(*entry)
return kv.key, kv.value, true
}
return nil, nil, false
}
// GetOldest returns the oldest entry
func (c *LRU) GetOldest() (key interface{}, value interface{}, ok bool) {
ent := c.evictList.Back()
if ent != nil {
kv := ent.Value.(*entry)
return kv.key, kv.value, true
}
return nil, nil, false
}
// Keys returns a slice of the keys in the cache, from oldest to newest.
func (c *LRU) Keys() []interface{} {
keys := make([]interface{}, len(c.items))
i := 0
for ent := c.evictList.Back(); ent != nil; ent = ent.Prev() {
keys[i] = ent.Value.(*entry).key
i++
}
return keys
}
// Len returns the number of items in the cache.
func (c *LRU) Len() int {
return c.evictList.Len()
}
// removeOldest removes the oldest item from the cache.
func (c *LRU) removeOldest() {
ent := c.evictList.Back()
if ent != nil {
c.removeElement(ent)
}
}
// removeElement is used to remove a given list element from the cache
func (c *LRU) removeElement(e *list.Element) {
c.evictList.Remove(e)
kv := e.Value.(*entry)
delete(c.items, kv.key)
if c.onEvict != nil {
c.onEvict(kv.key, kv.value)
}
}

View File

@ -0,0 +1,36 @@
package simplelru
// LRUCache is the interface for simple LRU cache.
type LRUCache interface {
// Adds a value to the cache, returns true if an eviction occurred and
// updates the "recently used"-ness of the key.
Add(key, value interface{}) bool
// Returns key's value from the cache and
// updates the "recently used"-ness of the key. #value, isFound
Get(key interface{}) (value interface{}, ok bool)
// Check if a key exsists in cache without updating the recent-ness.
Contains(key interface{}) (ok bool)
// Returns key's value without updating the "recently used"-ness of the key.
Peek(key interface{}) (value interface{}, ok bool)
// Removes a key from the cache.
Remove(key interface{}) bool
// Removes the oldest entry from cache.
RemoveOldest() (interface{}, interface{}, bool)
// Returns the oldest entry from the cache. #key, value, isFound
GetOldest() (interface{}, interface{}, bool)
// Returns a slice of the keys in the cache, from oldest to newest.
Keys() []interface{}
// Returns the number of items in the cache.
Len() int
// Clear all cache entries
Purge()
}

28
vendor/go.opencensus.io/.travis.yml generated vendored
View File

@ -1,27 +1,17 @@
language: go
go:
# 1.8 is tested by AppVeyor
- 1.11.x
go_import_path: go.opencensus.io
# Don't email me the results of the test runs.
notifications:
email: false
go:
- 1.11.x
env:
global:
GO111MODULE=on
before_script:
- GO_FILES=$(find . -iname '*.go' | grep -v /vendor/) # All the .go files, excluding vendor/ if any
- PKGS=$(go list ./... | grep -v /vendor/) # All the import paths, excluding vendor/ if any
- curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh # Install latest dep release
- go get github.com/rakyll/embedmd
- make install-tools
script:
- embedmd -d README.md # Ensure embedded code is up-to-date
- go build ./... # Ensure dependency updates don't break build
- if [ -n "$(gofmt -s -l $GO_FILES)" ]; then echo "gofmt the following files:"; gofmt -s -l $GO_FILES; exit 1; fi
- go vet ./...
- go test -v -race $PKGS # Run all the tests with the race detector enabled
- GOARCH=386 go test -v $PKGS # Run all tests against a 386 architecture
- 'if [[ $TRAVIS_GO_VERSION = 1.8* ]]; then ! golint ./... | grep -vE "(_mock|_string|\.pb)\.go:"; fi'
- go run internal/check/version.go
- make travis-ci
- go run internal/check/version.go # TODO move this to makefile

View File

@ -41,7 +41,8 @@ git remote add fork git@github.com:YOUR_GITHUB_USERNAME/opencensus-go.git
Run tests:
```
$ go test ./...
$ make install-tools # Only first time.
$ make
```
Checkout a new branch, make modifications and push the branch to your fork:
@ -54,3 +55,9 @@ $ git push fork feature
```
Open a pull request against the main opencensus-go repo.
## General Notes
This project uses Appveyor and Travis for CI.
The dependencies are managed with `go mod` if you work with the sources under your
`$GOPATH` you need to set the environment variable `GO111MODULE=on`.

96
vendor/go.opencensus.io/Makefile generated vendored Normal file
View File

@ -0,0 +1,96 @@
# TODO: Fix this on windows.
ALL_SRC := $(shell find . -name '*.go' \
-not -path './vendor/*' \
-not -path '*/gen-go/*' \
-type f | sort)
ALL_PKGS := $(shell go list $(sort $(dir $(ALL_SRC))))
GOTEST_OPT?=-v -race -timeout 30s
GOTEST_OPT_WITH_COVERAGE = $(GOTEST_OPT) -coverprofile=coverage.txt -covermode=atomic
GOTEST=go test
GOFMT=gofmt
GOLINT=golint
GOVET=go vet
EMBEDMD=embedmd
# TODO decide if we need to change these names.
TRACE_ID_LINT_EXCEPTION="type name will be used as trace.TraceID by other packages"
TRACE_OPTION_LINT_EXCEPTION="type name will be used as trace.TraceOptions by other packages"
README_FILES := $(shell find . -name '*README.md' | sort | tr '\n' ' ')
.DEFAULT_GOAL := fmt-lint-vet-embedmd-test
.PHONY: fmt-lint-vet-embedmd-test
fmt-lint-vet-embedmd-test: fmt lint vet embedmd test
# TODO enable test-with-coverage in tavis
.PHONY: travis-ci
travis-ci: fmt lint vet embedmd test test-386
all-pkgs:
@echo $(ALL_PKGS) | tr ' ' '\n' | sort
all-srcs:
@echo $(ALL_SRC) | tr ' ' '\n' | sort
.PHONY: test
test:
$(GOTEST) $(GOTEST_OPT) $(ALL_PKGS)
.PHONY: test-386
test-386:
GOARCH=386 $(GOTEST) -v -timeout 30s $(ALL_PKGS)
.PHONY: test-with-coverage
test-with-coverage:
$(GOTEST) $(GOTEST_OPT_WITH_COVERAGE) $(ALL_PKGS)
.PHONY: fmt
fmt:
@FMTOUT=`$(GOFMT) -s -l $(ALL_SRC) 2>&1`; \
if [ "$$FMTOUT" ]; then \
echo "$(GOFMT) FAILED => gofmt the following files:\n"; \
echo "$$FMTOUT\n"; \
exit 1; \
else \
echo "Fmt finished successfully"; \
fi
.PHONY: lint
lint:
@LINTOUT=`$(GOLINT) $(ALL_PKGS) | grep -v $(TRACE_ID_LINT_EXCEPTION) | grep -v $(TRACE_OPTION_LINT_EXCEPTION) 2>&1`; \
if [ "$$LINTOUT" ]; then \
echo "$(GOLINT) FAILED => clean the following lint errors:\n"; \
echo "$$LINTOUT\n"; \
exit 1; \
else \
echo "Lint finished successfully"; \
fi
.PHONY: vet
vet:
# TODO: Understand why go vet downloads "github.com/google/go-cmp v0.2.0"
@VETOUT=`$(GOVET) ./... | grep -v "go: downloading" 2>&1`; \
if [ "$$VETOUT" ]; then \
echo "$(GOVET) FAILED => go vet the following files:\n"; \
echo "$$VETOUT\n"; \
exit 1; \
else \
echo "Vet finished successfully"; \
fi
.PHONY: embedmd
embedmd:
@EMBEDMDOUT=`$(EMBEDMD) -d $(README_FILES) 2>&1`; \
if [ "$$EMBEDMDOUT" ]; then \
echo "$(EMBEDMD) FAILED => embedmd the following files:\n"; \
echo "$$EMBEDMDOUT\n"; \
exit 1; \
else \
echo "Embedmd finished successfully"; \
fi
.PHONY: install-tools
install-tools:
go get -u golang.org/x/tools/cmd/cover
go get -u golang.org/x/lint/golint
go get -u github.com/rakyll/embedmd

6
vendor/go.opencensus.io/README.md generated vendored
View File

@ -29,7 +29,7 @@ integration with your RPC framework:
* [net/http](https://godoc.org/go.opencensus.io/plugin/ochttp)
* [gRPC](https://godoc.org/go.opencensus.io/plugin/ocgrpc)
* [database/sql](https://godoc.org/github.com/basvanbeek/ocsql)
* [database/sql](https://godoc.org/github.com/opencensus-integrations/ocsql)
* [Go kit](https://godoc.org/github.com/go-kit/kit/tracing/opencensus)
* [Groupcache](https://godoc.org/github.com/orijtech/groupcache)
* [Caddy webserver](https://godoc.org/github.com/orijtech/caddy)
@ -123,7 +123,7 @@ Currently three types of aggregations are supported:
[embedmd]:# (internal/readme/stats.go aggs)
```go
distAgg := view.Distribution(0, 1<<32, 2<<32, 3<<32)
distAgg := view.Distribution(1<<32, 2<<32, 3<<32)
countAgg := view.Count()
sumAgg := view.Sum()
```
@ -136,7 +136,7 @@ if err := view.Register(&view.View{
Name: "example.com/video_size_distribution",
Description: "distribution of processed video size over time",
Measure: videoSize,
Aggregation: view.Distribution(0, 1<<32, 2<<32, 3<<32),
Aggregation: view.Distribution(1<<32, 2<<32, 3<<32),
}); err != nil {
log.Fatalf("Failed to register view: %v", err)
}

View File

@ -12,6 +12,7 @@ environment:
install:
- set PATH=%GOPATH%\bin;c:\go\bin;%PATH%
- choco upgrade golang --version 1.11.5 # Temporary fix because of a go.sum bug in 1.11
- go version
- go env

View File

@ -1,78 +0,0 @@
// Copyright 2018, OpenCensus Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Package exemplar implements support for exemplars. Exemplars are additional
// data associated with each measurement.
//
// Their purpose it to provide an example of the kind of thing
// (request, RPC, trace span, etc.) that resulted in that measurement.
package exemplar
import (
"context"
"time"
)
const (
KeyTraceID = "trace_id"
KeySpanID = "span_id"
KeyPrefixTag = "tag:"
)
// Exemplar is an example data point associated with each bucket of a
// distribution type aggregation.
type Exemplar struct {
Value float64 // the value that was recorded
Timestamp time.Time // the time the value was recorded
Attachments Attachments // attachments (if any)
}
// Attachments is a map of extra values associated with a recorded data point.
// The map should only be mutated from AttachmentExtractor functions.
type Attachments map[string]string
// AttachmentExtractor is a function capable of extracting exemplar attachments
// from the context used to record measurements.
// The map passed to the function should be mutated and returned. It will
// initially be nil: the first AttachmentExtractor that would like to add keys to the
// map is responsible for initializing it.
type AttachmentExtractor func(ctx context.Context, a Attachments) Attachments
var extractors []AttachmentExtractor
// RegisterAttachmentExtractor registers the given extractor associated with the exemplar
// type name.
//
// Extractors will be used to attempt to extract exemplars from the context
// associated with each recorded measurement.
//
// Packages that support exemplars should register their extractor functions on
// initialization.
//
// RegisterAttachmentExtractor should not be called after any measurements have
// been recorded.
func RegisterAttachmentExtractor(e AttachmentExtractor) {
extractors = append(extractors, e)
}
// NewFromContext extracts exemplars from the given context.
// Each registered AttachmentExtractor (see RegisterAttachmentExtractor) is called in an
// unspecified order to add attachments to the exemplar.
func AttachmentsFromContext(ctx context.Context) Attachments {
var a Attachments
for _, extractor := range extractors {
a = extractor(ctx, a)
}
return a
}

23
vendor/go.opencensus.io/go.mod generated vendored
View File

@ -1,25 +1,10 @@
module go.opencensus.io
require (
git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973
github.com/ghodss/yaml v1.0.0 // indirect
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect
github.com/golang/protobuf v1.2.0
github.com/google/go-cmp v0.2.0
github.com/grpc-ecosystem/grpc-gateway v1.5.0 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1
github.com/openzipkin/zipkin-go v0.1.1
github.com/prometheus/client_golang v0.8.0
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910
github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e
github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e
golang.org/x/text v0.3.0
google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf
google.golang.org/genproto v0.0.0-20180831171423-11092d34479b
google.golang.org/grpc v1.14.0
gopkg.in/yaml.v2 v2.2.1 // indirect
github.com/hashicorp/golang-lru v0.5.0
golang.org/x/net v0.0.0-20190311183353-d8887717615a
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19 // indirect
google.golang.org/grpc v1.19.0
)

76
vendor/go.opencensus.io/go.sum generated vendored
View File

@ -1,48 +1,50 @@
git.apache.org/thrift.git v0.0.0-20180807212849-6e67faa92827/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg=
git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999 h1:sihTnRgTOUSCQz0iS0pjZuFQy/z7GXCJgSBg3+rZKHw=
git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLMYoU8P317H5OQ+Via4RmuPwCS0=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/grpc-ecosystem/grpc-gateway v1.5.0 h1:WcmKMm43DR7RdtlkEXQJyo5ws8iTp98CyhCCbOHMvNI=
github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw=
github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/openzipkin/zipkin-go v0.1.1 h1:A/ADD6HaPnAKj3yS7HjGHRK77qi41Hi0DirOOIQAeIw=
github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8=
github.com/prometheus/client_golang v0.8.0 h1:1921Yw9Gc3iSc4VQh3PIoOqgPCZS7G/4xQNVUp8Mda8=
github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910 h1:idejC8f05m9MGOsuEi1ATq9shN03HrxNkD/luQvxCv8=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e h1:n/3MEhJQjQxrOUCzh1Y3Re6aJUUWRp2M9+Oc3eVn/54=
github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273 h1:agujYaXJSxSo18YNX3jzl+4G6Bstwt+kqv47GS12uL0=
github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
golang.org/x/net v0.0.0-20180821023952-922f4815f713/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd h1:nTDtHvHSdCn1m6ITfMRqtOd/9+7a3s8RBNOZ3eYZzJA=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo=
github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180821140842-3b58ed4ad339/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e h1:o3PsSEY8E4eXWkXrIP9YJALUkVZqzHJT5DOasTyn8Vs=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f h1:Bl/8QSvNqXvPGPGXa2z5xUTmV7VDcZyvRZ+QQXkXTZQ=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6 h1:bjcUS9ztw9kFmmIxJInhon/0Is3p+EHBKNgquIzo1OI=
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
google.golang.org/api v0.0.0-20180818000503-e21acd801f91/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf h1:rjxqQmxjyqerRKEj+tZW+MCm4LgpFXu18bsEoCMgDsk=
google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20180831171423-11092d34479b h1:lohp5blsw53GBXtLyLNaTXPXS9pJ1tiTw61ZHUoE9Qw=
google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/grpc v1.14.0 h1:ArxJuB1NWfPY6r9Gp9gqwplT0Ge7nqv9msgu03lHLmo=
google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19 h1:Lj2SnHtxkRGJDqnGaSjo+CCdIieEnwVazbOXILwQemk=
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/grpc v1.19.0 h1:cfg4PD8YEdSFnm7qLV4++93WcmhH2nIUhMjhdCvl3j8=
google.golang.org/grpc v1.19.0 h1:cfg4PD8YEdSFnm7qLV4++93WcmhH2nIUhMjhdCvl3j8=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=

View File

@ -18,12 +18,12 @@ import (
"fmt"
"time"
"go.opencensus.io"
opencensus "go.opencensus.io"
)
// UserAgent is the user agent to be added to the outgoing
// requests from the exporters.
var UserAgent = fmt.Sprintf("opencensus-go [%s]", opencensus.Version())
var UserAgent = fmt.Sprintf("opencensus-go/%s", opencensus.Version())
// MonotonicEndTime returns the end time at present
// but offset from start, monotonically.

View File

@ -17,6 +17,7 @@
// used interally by the stats collector.
package tagencoding // import "go.opencensus.io/internal/tagencoding"
// Values represent the encoded buffer for the values.
type Values struct {
Buffer []byte
WriteIndex int
@ -31,6 +32,7 @@ func (vb *Values) growIfRequired(expected int) {
}
}
// WriteValue is the helper method to encode Values from map[Key][]byte.
func (vb *Values) WriteValue(v []byte) {
length := len(v) & 0xff
vb.growIfRequired(1 + length)
@ -49,7 +51,7 @@ func (vb *Values) WriteValue(v []byte) {
vb.WriteIndex += length
}
// ReadValue is the helper method to read the values when decoding valuesBytes to a map[Key][]byte.
// ReadValue is the helper method to decode Values to a map[Key][]byte.
func (vb *Values) ReadValue() []byte {
// read length of v
length := int(vb.Buffer[vb.ReadIndex])
@ -67,6 +69,7 @@ func (vb *Values) ReadValue() []byte {
return v
}
// Bytes returns a reference to already written bytes in the Buffer.
func (vb *Values) Bytes() []byte {
return vb.Buffer[:vb.WriteIndex]
}

View File

@ -22,6 +22,7 @@ import (
// TODO(#412): remove this
var Trace interface{}
// LocalSpanStoreEnabled true if the local span store is enabled.
var LocalSpanStoreEnabled bool
// BucketConfiguration stores the number of samples to store for span buckets

View File

@ -12,17 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package internal // import "go.opencensus.io/stats/internal"
const (
MaxNameLength = 255
)
func IsPrintable(str string) bool {
for _, r := range str {
if !(r >= ' ' && r <= '~') {
return false
}
}
return true
}
// Package metricdata contains the metrics data model.
//
// This is an EXPERIMENTAL package, and may change in arbitrary ways without
// notice.
package metricdata // import "go.opencensus.io/metric/metricdata"

38
vendor/go.opencensus.io/metric/metricdata/exemplar.go generated vendored Normal file
View File

@ -0,0 +1,38 @@
// Copyright 2018, OpenCensus Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package metricdata
import (
"time"
)
// Exemplars keys.
const (
AttachmentKeySpanContext = "SpanContext"
)
// Exemplar is an example data point associated with each bucket of a
// distribution type aggregation.
//
// Their purpose is to provide an example of the kind of thing
// (request, RPC, trace span, etc.) that resulted in that measurement.
type Exemplar struct {
Value float64 // the value that was recorded
Timestamp time.Time // the time the value was recorded
Attachments Attachments // attachments (if any)
}
// Attachments is a map of extra values associated with a recorded data point.
type Attachments map[string]interface{}

35
vendor/go.opencensus.io/metric/metricdata/label.go generated vendored Normal file
View File

@ -0,0 +1,35 @@
// Copyright 2018, OpenCensus Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package metricdata
// LabelKey represents key of a label. It has optional
// description attribute.
type LabelKey struct {
Key string
Description string
}
// LabelValue represents the value of a label.
// The zero value represents a missing label value, which may be treated
// differently to an empty string value by some back ends.
type LabelValue struct {
Value string // string value of the label
Present bool // flag that indicated whether a value is present or not
}
// NewLabelValue creates a new non-nil LabelValue that represents the given string.
func NewLabelValue(val string) LabelValue {
return LabelValue{Value: val, Present: true}
}

46
vendor/go.opencensus.io/metric/metricdata/metric.go generated vendored Normal file
View File

@ -0,0 +1,46 @@
// Copyright 2018, OpenCensus Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package metricdata
import (
"time"
"go.opencensus.io/resource"
)
// Descriptor holds metadata about a metric.
type Descriptor struct {
Name string // full name of the metric
Description string // human-readable description
Unit Unit // units for the measure
Type Type // type of measure
LabelKeys []LabelKey // label keys
}
// Metric represents a quantity measured against a resource with different
// label value combinations.
type Metric struct {
Descriptor Descriptor // metric descriptor
Resource *resource.Resource // resource against which this was measured
TimeSeries []*TimeSeries // one time series for each combination of label values
}
// TimeSeries is a sequence of points associated with a combination of label
// values.
type TimeSeries struct {
LabelValues []LabelValue // label values, same order as keys in the metric descriptor
Points []Point // points sequence
StartTime time.Time // time we started recording this time series
}

193
vendor/go.opencensus.io/metric/metricdata/point.go generated vendored Normal file
View File

@ -0,0 +1,193 @@
// Copyright 2018, OpenCensus Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package metricdata
import (
"time"
)
// Point is a single data point of a time series.
type Point struct {
// Time is the point in time that this point represents in a time series.
Time time.Time
// Value is the value of this point. Prefer using ReadValue to switching on
// the value type, since new value types might be added.
Value interface{}
}
//go:generate stringer -type ValueType
// NewFloat64Point creates a new Point holding a float64 value.
func NewFloat64Point(t time.Time, val float64) Point {
return Point{
Value: val,
Time: t,
}
}
// NewInt64Point creates a new Point holding an int64 value.
func NewInt64Point(t time.Time, val int64) Point {
return Point{
Value: val,
Time: t,
}
}
// NewDistributionPoint creates a new Point holding a Distribution value.
func NewDistributionPoint(t time.Time, val *Distribution) Point {
return Point{
Value: val,
Time: t,
}
}
// NewSummaryPoint creates a new Point holding a Summary value.
func NewSummaryPoint(t time.Time, val *Summary) Point {
return Point{
Value: val,
Time: t,
}
}
// ValueVisitor allows reading the value of a point.
type ValueVisitor interface {
VisitFloat64Value(float64)
VisitInt64Value(int64)
VisitDistributionValue(*Distribution)
VisitSummaryValue(*Summary)
}
// ReadValue accepts a ValueVisitor and calls the appropriate method with the
// value of this point.
// Consumers of Point should use this in preference to switching on the type
// of the value directly, since new value types may be added.
func (p Point) ReadValue(vv ValueVisitor) {
switch v := p.Value.(type) {
case int64:
vv.VisitInt64Value(v)
case float64:
vv.VisitFloat64Value(v)
case *Distribution:
vv.VisitDistributionValue(v)
case *Summary:
vv.VisitSummaryValue(v)
default:
panic("unexpected value type")
}
}
// Distribution contains summary statistics for a population of values. It
// optionally contains a histogram representing the distribution of those
// values across a set of buckets.
type Distribution struct {
// Count is the number of values in the population. Must be non-negative. This value
// must equal the sum of the values in bucket_counts if a histogram is
// provided.
Count int64
// Sum is the sum of the values in the population. If count is zero then this field
// must be zero.
Sum float64
// SumOfSquaredDeviation is the sum of squared deviations from the mean of the values in the
// population. For values x_i this is:
//
// Sum[i=1..n]((x_i - mean)^2)
//
// Knuth, "The Art of Computer Programming", Vol. 2, page 323, 3rd edition
// describes Welford's method for accumulating this sum in one pass.
//
// If count is zero then this field must be zero.
SumOfSquaredDeviation float64
// BucketOptions describes the bounds of the histogram buckets in this
// distribution.
//
// A Distribution may optionally contain a histogram of the values in the
// population.
//
// If nil, there is no associated histogram.
BucketOptions *BucketOptions
// Bucket If the distribution does not have a histogram, then omit this field.
// If there is a histogram, then the sum of the values in the Bucket counts
// must equal the value in the count field of the distribution.
Buckets []Bucket
}
// BucketOptions describes the bounds of the histogram buckets in this
// distribution.
type BucketOptions struct {
// Bounds specifies a set of bucket upper bounds.
// This defines len(bounds) + 1 (= N) buckets. The boundaries for bucket
// index i are:
//
// [0, Bounds[i]) for i == 0
// [Bounds[i-1], Bounds[i]) for 0 < i < N-1
// [Bounds[i-1], +infinity) for i == N-1
Bounds []float64
}
// Bucket represents a single bucket (value range) in a distribution.
type Bucket struct {
// Count is the number of values in each bucket of the histogram, as described in
// bucket_bounds.
Count int64
// Exemplar associated with this bucket (if any).
Exemplar *Exemplar
}
// Summary is a representation of percentiles.
type Summary struct {
// Count is the cumulative count (if available).
Count int64
// Sum is the cumulative sum of values (if available).
Sum float64
// HasCountAndSum is true if Count and Sum are available.
HasCountAndSum bool
// Snapshot represents percentiles calculated over an arbitrary time window.
// The values in this struct can be reset at arbitrary unknown times, with
// the requirement that all of them are reset at the same time.
Snapshot Snapshot
}
// Snapshot represents percentiles over an arbitrary time.
// The values in this struct can be reset at arbitrary unknown times, with
// the requirement that all of them are reset at the same time.
type Snapshot struct {
// Count is the number of values in the snapshot. Optional since some systems don't
// expose this. Set to 0 if not available.
Count int64
// Sum is the sum of values in the snapshot. Optional since some systems don't
// expose this. If count is 0 then this field must be zero.
Sum float64
// Percentiles is a map from percentile (range (0-100.0]) to the value of
// the percentile.
Percentiles map[float64]float64
}
//go:generate stringer -type Type
// Type is the overall type of metric, including its value type and whether it
// represents a cumulative total (since the start time) or if it represents a
// gauge value.
type Type int
// Metric types.
const (
TypeGaugeInt64 Type = iota
TypeGaugeFloat64
TypeGaugeDistribution
TypeCumulativeInt64
TypeCumulativeFloat64
TypeCumulativeDistribution
TypeSummary
)

View File

@ -0,0 +1,16 @@
// Code generated by "stringer -type Type"; DO NOT EDIT.
package metricdata
import "strconv"
const _Type_name = "TypeGaugeInt64TypeGaugeFloat64TypeGaugeDistributionTypeCumulativeInt64TypeCumulativeFloat64TypeCumulativeDistributionTypeSummary"
var _Type_index = [...]uint8{0, 14, 30, 51, 70, 91, 117, 128}
func (i Type) String() string {
if i < 0 || i >= Type(len(_Type_index)-1) {
return "Type(" + strconv.FormatInt(int64(i), 10) + ")"
}
return _Type_name[_Type_index[i]:_Type_index[i+1]]
}

View File

@ -12,32 +12,16 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package trace
package metricdata
import (
"context"
"encoding/hex"
// Unit is a string encoded according to the case-sensitive abbreviations from the
// Unified Code for Units of Measure: http://unitsofmeasure.org/ucum.html
type Unit string
"go.opencensus.io/exemplar"
// Predefined units. To record against a unit not represented here, create your
// own Unit type constant from a string.
const (
UnitDimensionless Unit = "1"
UnitBytes Unit = "By"
UnitMilliseconds Unit = "ms"
)
func init() {
exemplar.RegisterAttachmentExtractor(attachSpanContext)
}
func attachSpanContext(ctx context.Context, a exemplar.Attachments) exemplar.Attachments {
span := FromContext(ctx)
if span == nil {
return a
}
sc := span.SpanContext()
if !sc.IsSampled() {
return a
}
if a == nil {
a = make(exemplar.Attachments)
}
a[exemplar.KeyTraceID] = hex.EncodeToString(sc.TraceID[:])
a[exemplar.KeySpanID] = hex.EncodeToString(sc.SpanID[:])
return a
}

View File

@ -0,0 +1,78 @@
// Copyright 2019, OpenCensus Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package metricproducer
import (
"sync"
)
// Manager maintains a list of active producers. Producers can register
// with the manager to allow readers to read all metrics provided by them.
// Readers can retrieve all producers registered with the manager,
// read metrics from the producers and export them.
type Manager struct {
mu sync.RWMutex
producers map[Producer]struct{}
}
var prodMgr *Manager
var once sync.Once
// GlobalManager is a single instance of producer manager
// that is used by all producers and all readers.
func GlobalManager() *Manager {
once.Do(func() {
prodMgr = &Manager{}
prodMgr.producers = make(map[Producer]struct{})
})
return prodMgr
}
// AddProducer adds the producer to the Manager if it is not already present.
func (pm *Manager) AddProducer(producer Producer) {
if producer == nil {
return
}
pm.mu.Lock()
defer pm.mu.Unlock()
pm.producers[producer] = struct{}{}
}
// DeleteProducer deletes the producer from the Manager if it is present.
func (pm *Manager) DeleteProducer(producer Producer) {
if producer == nil {
return
}
pm.mu.Lock()
defer pm.mu.Unlock()
delete(pm.producers, producer)
}
// GetAll returns a slice of all producer currently registered with
// the Manager. For each call it generates a new slice. The slice
// should not be cached as registration may change at any time. It is
// typically called periodically by exporter to read metrics from
// the producers.
func (pm *Manager) GetAll() []Producer {
pm.mu.Lock()
defer pm.mu.Unlock()
producers := make([]Producer, len(pm.producers))
i := 0
for producer := range pm.producers {
producers[i] = producer
i++
}
return producers
}

View File

@ -0,0 +1,28 @@
// Copyright 2019, OpenCensus Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package metricproducer
import (
"go.opencensus.io/metric/metricdata"
)
// Producer is a source of metrics.
type Producer interface {
// Read should return the current values of all metrics supported by this
// metric provider.
// The returned metrics should be unique for each combination of name and
// resource.
Read() []*metricdata.Metric
}

View File

@ -17,5 +17,5 @@ package opencensus // import "go.opencensus.io"
// Version is the current release version of OpenCensus in use.
func Version() string {
return "0.18.0"
return "0.21.0"
}

View File

@ -22,9 +22,11 @@ import (
"sync/atomic"
"time"
"go.opencensus.io/metric/metricdata"
ocstats "go.opencensus.io/stats"
"go.opencensus.io/stats/view"
"go.opencensus.io/tag"
"go.opencensus.io/trace"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/stats"
@ -51,9 +53,9 @@ type rpcData struct {
// The following variables define the default hard-coded auxiliary data used by
// both the default GRPC client and GRPC server metrics.
var (
DefaultBytesDistribution = view.Distribution(0, 1024, 2048, 4096, 16384, 65536, 262144, 1048576, 4194304, 16777216, 67108864, 268435456, 1073741824, 4294967296)
DefaultMillisecondsDistribution = view.Distribution(0, 0.01, 0.05, 0.1, 0.3, 0.6, 0.8, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, 80, 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, 2000, 5000, 10000, 20000, 50000, 100000)
DefaultMessageCountDistribution = view.Distribution(0, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536)
DefaultBytesDistribution = view.Distribution(1024, 2048, 4096, 16384, 65536, 262144, 1048576, 4194304, 16777216, 67108864, 268435456, 1073741824, 4294967296)
DefaultMillisecondsDistribution = view.Distribution(0.01, 0.05, 0.1, 0.3, 0.6, 0.8, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, 80, 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, 2000, 5000, 10000, 20000, 50000, 100000)
DefaultMessageCountDistribution = view.Distribution(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536)
)
// Server tags are applied to the context used to process each RPC, as well as
@ -141,27 +143,31 @@ func handleRPCEnd(ctx context.Context, s *stats.End) {
}
latencyMillis := float64(elapsedTime) / float64(time.Millisecond)
attachments := getSpanCtxAttachment(ctx)
if s.Client {
ocstats.RecordWithTags(ctx,
[]tag.Mutator{
ocstats.RecordWithOptions(ctx,
ocstats.WithTags(
tag.Upsert(KeyClientMethod, methodName(d.method)),
tag.Upsert(KeyClientStatus, st),
},
ClientSentBytesPerRPC.M(atomic.LoadInt64(&d.sentBytes)),
ClientSentMessagesPerRPC.M(atomic.LoadInt64(&d.sentCount)),
ClientReceivedMessagesPerRPC.M(atomic.LoadInt64(&d.recvCount)),
ClientReceivedBytesPerRPC.M(atomic.LoadInt64(&d.recvBytes)),
ClientRoundtripLatency.M(latencyMillis))
tag.Upsert(KeyClientStatus, st)),
ocstats.WithAttachments(attachments),
ocstats.WithMeasurements(
ClientSentBytesPerRPC.M(atomic.LoadInt64(&d.sentBytes)),
ClientSentMessagesPerRPC.M(atomic.LoadInt64(&d.sentCount)),
ClientReceivedMessagesPerRPC.M(atomic.LoadInt64(&d.recvCount)),
ClientReceivedBytesPerRPC.M(atomic.LoadInt64(&d.recvBytes)),
ClientRoundtripLatency.M(latencyMillis)))
} else {
ocstats.RecordWithTags(ctx,
[]tag.Mutator{
ocstats.RecordWithOptions(ctx,
ocstats.WithTags(
tag.Upsert(KeyServerStatus, st),
},
ServerSentBytesPerRPC.M(atomic.LoadInt64(&d.sentBytes)),
ServerSentMessagesPerRPC.M(atomic.LoadInt64(&d.sentCount)),
ServerReceivedMessagesPerRPC.M(atomic.LoadInt64(&d.recvCount)),
ServerReceivedBytesPerRPC.M(atomic.LoadInt64(&d.recvBytes)),
ServerLatency.M(latencyMillis))
),
ocstats.WithAttachments(attachments),
ocstats.WithMeasurements(
ServerSentBytesPerRPC.M(atomic.LoadInt64(&d.sentBytes)),
ServerSentMessagesPerRPC.M(atomic.LoadInt64(&d.sentCount)),
ServerReceivedMessagesPerRPC.M(atomic.LoadInt64(&d.recvCount)),
ServerReceivedBytesPerRPC.M(atomic.LoadInt64(&d.recvBytes)),
ServerLatency.M(latencyMillis)))
}
}
@ -206,3 +212,16 @@ func statusCodeToString(s *status.Status) string {
return "CODE_" + strconv.FormatInt(int64(c), 10)
}
}
func getSpanCtxAttachment(ctx context.Context) metricdata.Attachments {
attachments := map[string]interface{}{}
span := trace.FromContext(ctx)
if span == nil {
return attachments
}
spanCtx := span.SpanContext()
if spanCtx.IsSampled() {
attachments[metricdata.AttachmentKeySpanContext] = spanCtx
}
return attachments
}

View File

@ -34,8 +34,8 @@ type statsTransport struct {
// RoundTrip implements http.RoundTripper, delegating to Base and recording stats for the request.
func (t statsTransport) RoundTrip(req *http.Request) (*http.Response, error) {
ctx, _ := tag.New(req.Context(),
tag.Upsert(KeyClientHost, req.URL.Host),
tag.Upsert(Host, req.URL.Host),
tag.Upsert(KeyClientHost, req.Host),
tag.Upsert(Host, req.Host),
tag.Upsert(KeyClientPath, req.URL.Path),
tag.Upsert(Path, req.URL.Path),
tag.Upsert(KeyClientMethod, req.Method),
@ -61,11 +61,14 @@ func (t statsTransport) RoundTrip(req *http.Request) (*http.Response, error) {
track.end()
} else {
track.statusCode = resp.StatusCode
if req.Method != "HEAD" {
track.respContentLength = resp.ContentLength
}
if resp.Body == nil {
track.end()
} else {
track.body = resp.Body
resp.Body = track
resp.Body = wrappedBody(track, resp.Body)
}
}
return resp, err
@ -82,13 +85,14 @@ func (t statsTransport) CancelRequest(req *http.Request) {
}
type tracker struct {
ctx context.Context
respSize int64
reqSize int64
start time.Time
body io.ReadCloser
statusCode int
endOnce sync.Once
ctx context.Context
respSize int64
respContentLength int64
reqSize int64
start time.Time
body io.ReadCloser
statusCode int
endOnce sync.Once
}
var _ io.ReadCloser = (*tracker)(nil)
@ -96,9 +100,13 @@ var _ io.ReadCloser = (*tracker)(nil)
func (t *tracker) end() {
t.endOnce.Do(func() {
latencyMs := float64(time.Since(t.start)) / float64(time.Millisecond)
respSize := t.respSize
if t.respSize == 0 && t.respContentLength > 0 {
respSize = t.respContentLength
}
m := []stats.Measurement{
ClientSentBytes.M(t.reqSize),
ClientReceivedBytes.M(t.respSize),
ClientReceivedBytes.M(respSize),
ClientRoundtripLatency.M(latencyMs),
ClientLatency.M(latencyMs),
ClientResponseBytes.M(t.respSize),
@ -116,9 +124,9 @@ func (t *tracker) end() {
func (t *tracker) Read(b []byte) (int, error) {
n, err := t.body.Read(b)
t.respSize += int64(n)
switch err {
case nil:
t.respSize += int64(n)
return n, nil
case io.EOF:
t.end()

View File

@ -38,7 +38,7 @@ const (
// because there are additional fields not represented in the
// OpenCensus span context. Spans created from the incoming
// header will be the direct children of the client-side span.
// Similarly, reciever of the outgoing spans should use client-side
// Similarly, receiver of the outgoing spans should use client-side
// span created by OpenCensus as the parent.
type HTTPFormat struct{}

View File

@ -15,11 +15,21 @@
package ochttp
import (
"context"
"net/http"
"go.opencensus.io/tag"
)
// SetRoute sets the http_server_route tag to the given value.
// It's useful when an HTTP framework does not support the http.Handler interface
// and using WithRouteTag is not an option, but provides a way to hook into the request flow.
func SetRoute(ctx context.Context, route string) {
if a, ok := ctx.Value(addedTagsKey{}).(*addedTags); ok {
a.t = append(a.t, tag.Upsert(KeyServerRoute, route))
}
}
// WithRouteTag returns an http.Handler that records stats with the
// http_server_route tag set to the given value.
func WithRouteTag(handler http.Handler, route string) http.Handler {

View File

@ -118,12 +118,18 @@ func (h *Handler) startTrace(w http.ResponseWriter, r *http.Request) (*http.Requ
span.AddLink(trace.Link{
TraceID: sc.TraceID,
SpanID: sc.SpanID,
Type: trace.LinkTypeChild,
Type: trace.LinkTypeParent,
Attributes: nil,
})
}
}
span.AddAttributes(requestAttrs(r)...)
if r.Body == nil {
// TODO: Handle cases where ContentLength is not set.
} else if r.ContentLength > 0 {
span.AddMessageReceiveEvent(0, /* TODO: messageID */
int64(r.ContentLength), -1)
}
return r.WithContext(ctx), span.End
}
@ -136,7 +142,7 @@ func (h *Handler) extractSpanContext(r *http.Request) (trace.SpanContext, bool)
func (h *Handler) startStats(w http.ResponseWriter, r *http.Request) (http.ResponseWriter, func(tags *addedTags)) {
ctx, _ := tag.New(r.Context(),
tag.Upsert(Host, r.URL.Host),
tag.Upsert(Host, r.Host),
tag.Upsert(Path, r.URL.Path),
tag.Upsert(Method, r.Method))
track := &trackingResponseWriter{
@ -201,6 +207,9 @@ func (t *trackingResponseWriter) Header() http.Header {
func (t *trackingResponseWriter) Write(data []byte) (int, error) {
n, err := t.writer.Write(data)
t.respSize += int64(n)
// Add message event for request bytes sent.
span := trace.FromContext(t.ctx)
span.AddMessageSendEvent(0 /* TODO: messageID */, int64(n), -1)
return n, err
}

View File

@ -20,19 +20,31 @@ import (
"go.opencensus.io/tag"
)
// The following client HTTP measures are supported for use in custom views.
// Deprecated: client HTTP measures.
var (
// Deprecated: Use a Count aggregation over one of the other client measures to achieve the same effect.
ClientRequestCount = stats.Int64("opencensus.io/http/client/request_count", "Number of HTTP requests started", stats.UnitDimensionless)
ClientRequestCount = stats.Int64(
"opencensus.io/http/client/request_count",
"Number of HTTP requests started",
stats.UnitDimensionless)
// Deprecated: Use ClientSentBytes.
ClientRequestBytes = stats.Int64("opencensus.io/http/client/request_bytes", "HTTP request body size if set as ContentLength (uncompressed)", stats.UnitBytes)
ClientRequestBytes = stats.Int64(
"opencensus.io/http/client/request_bytes",
"HTTP request body size if set as ContentLength (uncompressed)",
stats.UnitBytes)
// Deprecated: Use ClientReceivedBytes.
ClientResponseBytes = stats.Int64("opencensus.io/http/client/response_bytes", "HTTP response body size (uncompressed)", stats.UnitBytes)
ClientResponseBytes = stats.Int64(
"opencensus.io/http/client/response_bytes",
"HTTP response body size (uncompressed)",
stats.UnitBytes)
// Deprecated: Use ClientRoundtripLatency.
ClientLatency = stats.Float64("opencensus.io/http/client/latency", "End-to-end latency", stats.UnitMilliseconds)
ClientLatency = stats.Float64(
"opencensus.io/http/client/latency",
"End-to-end latency",
stats.UnitMilliseconds)
)
// Client measures supported for use in custom views.
// The following client HTTP measures are supported for use in custom views.
var (
ClientSentBytes = stats.Int64(
"opencensus.io/http/client/sent_bytes",
@ -53,10 +65,22 @@ var (
// The following server HTTP measures are supported for use in custom views:
var (
ServerRequestCount = stats.Int64("opencensus.io/http/server/request_count", "Number of HTTP requests started", stats.UnitDimensionless)
ServerRequestBytes = stats.Int64("opencensus.io/http/server/request_bytes", "HTTP request body size if set as ContentLength (uncompressed)", stats.UnitBytes)
ServerResponseBytes = stats.Int64("opencensus.io/http/server/response_bytes", "HTTP response body size (uncompressed)", stats.UnitBytes)
ServerLatency = stats.Float64("opencensus.io/http/server/latency", "End-to-end latency", stats.UnitMilliseconds)
ServerRequestCount = stats.Int64(
"opencensus.io/http/server/request_count",
"Number of HTTP requests started",
stats.UnitDimensionless)
ServerRequestBytes = stats.Int64(
"opencensus.io/http/server/request_bytes",
"HTTP request body size if set as ContentLength (uncompressed)",
stats.UnitBytes)
ServerResponseBytes = stats.Int64(
"opencensus.io/http/server/response_bytes",
"HTTP response body size (uncompressed)",
stats.UnitBytes)
ServerLatency = stats.Float64(
"opencensus.io/http/server/latency",
"End-to-end latency",
stats.UnitMilliseconds)
)
// The following tags are applied to stats recorded by this package. Host, Path
@ -104,11 +128,11 @@ var (
// Default distributions used by views in this package.
var (
DefaultSizeDistribution = view.Distribution(0, 1024, 2048, 4096, 16384, 65536, 262144, 1048576, 4194304, 16777216, 67108864, 268435456, 1073741824, 4294967296)
DefaultLatencyDistribution = view.Distribution(0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, 80, 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, 2000, 5000, 10000, 20000, 50000, 100000)
DefaultSizeDistribution = view.Distribution(1024, 2048, 4096, 16384, 65536, 262144, 1048576, 4194304, 16777216, 67108864, 268435456, 1073741824, 4294967296)
DefaultLatencyDistribution = view.Distribution(1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, 80, 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, 2000, 5000, 10000, 20000, 50000, 100000)
)
// Package ochttp provides some convenience views.
// Package ochttp provides some convenience views for client measures.
// You still need to register these views for data to actually be collected.
var (
ClientSentBytesDistribution = &view.View{
@ -144,6 +168,7 @@ var (
}
)
// Deprecated: Old client Views.
var (
// Deprecated: No direct replacement, but see ClientCompletedCount.
ClientRequestCountView = &view.View{
@ -161,7 +186,7 @@ var (
Aggregation: DefaultSizeDistribution,
}
// Deprecated: Use ClientReceivedBytesDistribution.
// Deprecated: Use ClientReceivedBytesDistribution instead.
ClientResponseBytesView = &view.View{
Name: "opencensus.io/http/client/response_bytes",
Description: "Size distribution of HTTP response body",
@ -169,7 +194,7 @@ var (
Aggregation: DefaultSizeDistribution,
}
// Deprecated: Use ClientRoundtripLatencyDistribution.
// Deprecated: Use ClientRoundtripLatencyDistribution instead.
ClientLatencyView = &view.View{
Name: "opencensus.io/http/client/latency",
Description: "Latency distribution of HTTP requests",
@ -177,7 +202,7 @@ var (
Aggregation: DefaultLatencyDistribution,
}
// Deprecated: Use ClientCompletedCount.
// Deprecated: Use ClientCompletedCount instead.
ClientRequestCountByMethod = &view.View{
Name: "opencensus.io/http/client/request_count_by_method",
Description: "Client request count by HTTP method",
@ -186,7 +211,7 @@ var (
Aggregation: view.Count(),
}
// Deprecated: Use ClientCompletedCount.
// Deprecated: Use ClientCompletedCount instead.
ClientResponseCountByStatusCode = &view.View{
Name: "opencensus.io/http/client/response_count_by_status_code",
Description: "Client response count by status code",
@ -196,6 +221,8 @@ var (
}
)
// Package ochttp provides some convenience views for server measures.
// You still need to register these views for data to actually be collected.
var (
ServerRequestCountView = &view.View{
Name: "opencensus.io/http/server/request_count",

View File

@ -34,6 +34,7 @@ const (
HostAttribute = "http.host"
MethodAttribute = "http.method"
PathAttribute = "http.path"
URLAttribute = "http.url"
UserAgentAttribute = "http.user_agent"
StatusCodeAttribute = "http.status_code"
)
@ -93,7 +94,8 @@ func (t *traceTransport) RoundTrip(req *http.Request) (*http.Response, error) {
// span.End() will be invoked after
// a read from resp.Body returns io.EOF or when
// resp.Body.Close() is invoked.
resp.Body = &bodyTracker{rc: resp.Body, span: span}
bt := &bodyTracker{rc: resp.Body, span: span}
resp.Body = wrappedBody(bt, resp.Body)
return resp, err
}
@ -149,12 +151,21 @@ func spanNameFromURL(req *http.Request) string {
}
func requestAttrs(r *http.Request) []trace.Attribute {
return []trace.Attribute{
userAgent := r.UserAgent()
attrs := make([]trace.Attribute, 0, 5)
attrs = append(attrs,
trace.StringAttribute(PathAttribute, r.URL.Path),
trace.StringAttribute(HostAttribute, r.URL.Host),
trace.StringAttribute(URLAttribute, r.URL.String()),
trace.StringAttribute(HostAttribute, r.Host),
trace.StringAttribute(MethodAttribute, r.Method),
trace.StringAttribute(UserAgentAttribute, r.UserAgent()),
)
if userAgent != "" {
attrs = append(attrs, trace.StringAttribute(UserAgentAttribute, userAgent))
}
return attrs
}
func responseAttrs(resp *http.Response) []trace.Attribute {

44
vendor/go.opencensus.io/plugin/ochttp/wrapped_body.go generated vendored Normal file
View File

@ -0,0 +1,44 @@
// Copyright 2019, OpenCensus Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package ochttp
import (
"io"
)
// wrappedBody returns a wrapped version of the original
// Body and only implements the same combination of additional
// interfaces as the original.
func wrappedBody(wrapper io.ReadCloser, body io.ReadCloser) io.ReadCloser {
var (
wr, i0 = body.(io.Writer)
)
switch {
case !i0:
return struct {
io.ReadCloser
}{wrapper}
case i0:
return struct {
io.ReadCloser
io.Writer
}{wrapper, wr}
default:
return struct {
io.ReadCloser
}{wrapper}
}
}

164
vendor/go.opencensus.io/resource/resource.go generated vendored Normal file
View File

@ -0,0 +1,164 @@
// Copyright 2018, OpenCensus Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Package resource provides functionality for resource, which capture
// identifying information about the entities for which signals are exported.
package resource
import (
"context"
"fmt"
"os"
"regexp"
"sort"
"strconv"
"strings"
)
// Environment variables used by FromEnv to decode a resource.
const (
EnvVarType = "OC_RESOURCE_TYPE"
EnvVarLabels = "OC_RESOURCE_LABELS"
)
// Resource describes an entity about which identifying information and metadata is exposed.
// For example, a type "k8s.io/container" may hold labels describing the pod name and namespace.
type Resource struct {
Type string
Labels map[string]string
}
// EncodeLabels encodes a labels map to a string as provided via the OC_RESOURCE_LABELS environment variable.
func EncodeLabels(labels map[string]string) string {
sortedKeys := make([]string, 0, len(labels))
for k := range labels {
sortedKeys = append(sortedKeys, k)
}
sort.Strings(sortedKeys)
s := ""
for i, k := range sortedKeys {
if i > 0 {
s += ","
}
s += k + "=" + strconv.Quote(labels[k])
}
return s
}
var labelRegex = regexp.MustCompile(`^\s*([[:ascii:]]{1,256}?)=("[[:ascii:]]{0,256}?")\s*,`)
// DecodeLabels decodes a serialized label map as used in the OC_RESOURCE_LABELS variable.
// A list of labels of the form `<key1>="<value1>",<key2>="<value2>",...` is accepted.
// Domain names and paths are accepted as label keys.
// Most users will want to use FromEnv instead.
func DecodeLabels(s string) (map[string]string, error) {
m := map[string]string{}
// Ensure a trailing comma, which allows us to keep the regex simpler
s = strings.TrimRight(strings.TrimSpace(s), ",") + ","
for len(s) > 0 {
match := labelRegex.FindStringSubmatch(s)
if len(match) == 0 {
return nil, fmt.Errorf("invalid label formatting, remainder: %s", s)
}
v := match[2]
if v == "" {
v = match[3]
} else {
var err error
if v, err = strconv.Unquote(v); err != nil {
return nil, fmt.Errorf("invalid label formatting, remainder: %s, err: %s", s, err)
}
}
m[match[1]] = v
s = s[len(match[0]):]
}
return m, nil
}
// FromEnv is a detector that loads resource information from the OC_RESOURCE_TYPE
// and OC_RESOURCE_labelS environment variables.
func FromEnv(context.Context) (*Resource, error) {
res := &Resource{
Type: strings.TrimSpace(os.Getenv(EnvVarType)),
}
labels := strings.TrimSpace(os.Getenv(EnvVarLabels))
if labels == "" {
return res, nil
}
var err error
if res.Labels, err = DecodeLabels(labels); err != nil {
return nil, err
}
return res, nil
}
var _ Detector = FromEnv
// merge resource information from b into a. In case of a collision, a takes precedence.
func merge(a, b *Resource) *Resource {
if a == nil {
return b
}
if b == nil {
return a
}
res := &Resource{
Type: a.Type,
Labels: map[string]string{},
}
if res.Type == "" {
res.Type = b.Type
}
for k, v := range b.Labels {
res.Labels[k] = v
}
// Labels from resource a overwrite labels from resource b.
for k, v := range a.Labels {
res.Labels[k] = v
}
return res
}
// Detector attempts to detect resource information.
// If the detector cannot find resource information, the returned resource is nil but no
// error is returned.
// An error is only returned on unexpected failures.
type Detector func(context.Context) (*Resource, error)
// MultiDetector returns a Detector that calls all input detectors in order and
// merges each result with the previous one. In case a type of label key is already set,
// the first set value is takes precedence.
// It returns on the first error that a sub-detector encounters.
func MultiDetector(detectors ...Detector) Detector {
return func(ctx context.Context) (*Resource, error) {
return detectAll(ctx, detectors...)
}
}
// detectall calls all input detectors sequentially an merges each result with the previous one.
// It returns on the first error that a sub-detector encounters.
func detectAll(ctx context.Context, detectors ...Detector) (*Resource, error) {
var res *Resource
for _, d := range detectors {
r, err := d(ctx)
if err != nil {
return nil, err
}
res = merge(res, r)
}
return res, nil
}

View File

@ -19,7 +19,7 @@ import (
)
// DefaultRecorder will be called for each Record call.
var DefaultRecorder func(tags *tag.Map, measurement interface{}, attachments map[string]string)
var DefaultRecorder func(tags *tag.Map, measurement interface{}, attachments map[string]interface{})
// SubscriptionReporter reports when a view subscribed with a measure.
var SubscriptionReporter func(measure string)

View File

@ -68,21 +68,6 @@ func (m *measureDescriptor) subscribed() bool {
return atomic.LoadInt32(&m.subs) == 1
}
// Name returns the name of the measure.
func (m *measureDescriptor) Name() string {
return m.name
}
// Description returns the description of the measure.
func (m *measureDescriptor) Description() string {
return m.description
}
// Unit returns the unit of the measure.
func (m *measureDescriptor) Unit() string {
return m.unit
}
var (
mu sync.RWMutex
measures = make(map[string]*measureDescriptor)
@ -108,8 +93,9 @@ func registerMeasureHandle(name, desc, unit string) *measureDescriptor {
// provides methods to create measurements of their kind. For example, Int64Measure
// provides M to convert an int64 into a measurement.
type Measurement struct {
v float64
m *measureDescriptor
v float64
m Measure
desc *measureDescriptor
}
// Value returns the value of the Measurement as a float64.

View File

@ -17,13 +17,17 @@ package stats
// Float64Measure is a measure for float64 values.
type Float64Measure struct {
*measureDescriptor
desc *measureDescriptor
}
// M creates a new float64 measurement.
// Use Record to record measurements.
func (m *Float64Measure) M(v float64) Measurement {
return Measurement{m: m.measureDescriptor, v: v}
return Measurement{
m: m,
desc: m.desc,
v: v,
}
}
// Float64 creates a new measure for float64 values.
@ -34,3 +38,18 @@ func Float64(name, description, unit string) *Float64Measure {
mi := registerMeasureHandle(name, description, unit)
return &Float64Measure{mi}
}
// Name returns the name of the measure.
func (m *Float64Measure) Name() string {
return m.desc.name
}
// Description returns the description of the measure.
func (m *Float64Measure) Description() string {
return m.desc.description
}
// Unit returns the unit of the measure.
func (m *Float64Measure) Unit() string {
return m.desc.unit
}

View File

@ -17,13 +17,17 @@ package stats
// Int64Measure is a measure for int64 values.
type Int64Measure struct {
*measureDescriptor
desc *measureDescriptor
}
// M creates a new int64 measurement.
// Use Record to record measurements.
func (m *Int64Measure) M(v int64) Measurement {
return Measurement{m: m.measureDescriptor, v: float64(v)}
return Measurement{
m: m,
desc: m.desc,
v: float64(v),
}
}
// Int64 creates a new measure for int64 values.
@ -34,3 +38,18 @@ func Int64(name, description, unit string) *Int64Measure {
mi := registerMeasureHandle(name, description, unit)
return &Int64Measure{mi}
}
// Name returns the name of the measure.
func (m *Int64Measure) Name() string {
return m.desc.name
}
// Description returns the description of the measure.
func (m *Int64Measure) Description() string {
return m.desc.description
}
// Unit returns the unit of the measure.
func (m *Int64Measure) Unit() string {
return m.desc.unit
}

View File

@ -18,7 +18,7 @@ package stats
import (
"context"
"go.opencensus.io/exemplar"
"go.opencensus.io/metric/metricdata"
"go.opencensus.io/stats/internal"
"go.opencensus.io/tag"
)
@ -31,27 +31,48 @@ func init() {
}
}
type recordOptions struct {
attachments metricdata.Attachments
mutators []tag.Mutator
measurements []Measurement
}
// WithAttachments applies provided exemplar attachments.
func WithAttachments(attachments metricdata.Attachments) Options {
return func(ro *recordOptions) {
ro.attachments = attachments
}
}
// WithTags applies provided tag mutators.
func WithTags(mutators ...tag.Mutator) Options {
return func(ro *recordOptions) {
ro.mutators = mutators
}
}
// WithMeasurements applies provided measurements.
func WithMeasurements(measurements ...Measurement) Options {
return func(ro *recordOptions) {
ro.measurements = measurements
}
}
// Options apply changes to recordOptions.
type Options func(*recordOptions)
func createRecordOption(ros ...Options) *recordOptions {
o := &recordOptions{}
for _, ro := range ros {
ro(o)
}
return o
}
// Record records one or multiple measurements with the same context at once.
// If there are any tags in the context, measurements will be tagged with them.
func Record(ctx context.Context, ms ...Measurement) {
recorder := internal.DefaultRecorder
if recorder == nil {
return
}
if len(ms) == 0 {
return
}
record := false
for _, m := range ms {
if m.m.subscribed() {
record = true
break
}
}
if !record {
return
}
recorder(tag.FromContext(ctx), ms, exemplar.AttachmentsFromContext(ctx))
RecordWithOptions(ctx, WithMeasurements(ms...))
}
// RecordWithTags records one or multiple measurements at once.
@ -60,10 +81,37 @@ func Record(ctx context.Context, ms ...Measurement) {
// RecordWithTags is useful if you want to record with tag mutations but don't want
// to propagate the mutations in the context.
func RecordWithTags(ctx context.Context, mutators []tag.Mutator, ms ...Measurement) error {
ctx, err := tag.New(ctx, mutators...)
if err != nil {
return err
return RecordWithOptions(ctx, WithTags(mutators...), WithMeasurements(ms...))
}
// RecordWithOptions records measurements from the given options (if any) against context
// and tags and attachments in the options (if any).
// If there are any tags in the context, measurements will be tagged with them.
func RecordWithOptions(ctx context.Context, ros ...Options) error {
o := createRecordOption(ros...)
if len(o.measurements) == 0 {
return nil
}
Record(ctx, ms...)
recorder := internal.DefaultRecorder
if recorder == nil {
return nil
}
record := false
for _, m := range o.measurements {
if m.desc.subscribed() {
record = true
break
}
}
if !record {
return nil
}
if len(o.mutators) > 0 {
var err error
if ctx, err = tag.New(ctx, o.mutators...); err != nil {
return err
}
}
recorder(tag.FromContext(ctx), o.measurements, o.attachments)
return nil
}

View File

@ -17,8 +17,9 @@ package view
import (
"math"
"time"
"go.opencensus.io/exemplar"
"go.opencensus.io/metric/metricdata"
)
// AggregationData represents an aggregated value from a collection.
@ -26,9 +27,10 @@ import (
// Mosts users won't directly access aggregration data.
type AggregationData interface {
isAggregationData() bool
addSample(e *exemplar.Exemplar)
addSample(v float64, attachments map[string]interface{}, t time.Time)
clone() AggregationData
equal(other AggregationData) bool
toPoint(t metricdata.Type, time time.Time) metricdata.Point
}
const epsilon = 1e-9
@ -43,7 +45,7 @@ type CountData struct {
func (a *CountData) isAggregationData() bool { return true }
func (a *CountData) addSample(_ *exemplar.Exemplar) {
func (a *CountData) addSample(_ float64, _ map[string]interface{}, _ time.Time) {
a.Value = a.Value + 1
}
@ -60,6 +62,15 @@ func (a *CountData) equal(other AggregationData) bool {
return a.Value == a2.Value
}
func (a *CountData) toPoint(metricType metricdata.Type, t time.Time) metricdata.Point {
switch metricType {
case metricdata.TypeCumulativeInt64:
return metricdata.NewInt64Point(t, a.Value)
default:
panic("unsupported metricdata.Type")
}
}
// SumData is the aggregated data for the Sum aggregation.
// A sum aggregation processes data and sums up the recordings.
//
@ -70,8 +81,8 @@ type SumData struct {
func (a *SumData) isAggregationData() bool { return true }
func (a *SumData) addSample(e *exemplar.Exemplar) {
a.Value += e.Value
func (a *SumData) addSample(v float64, _ map[string]interface{}, _ time.Time) {
a.Value += v
}
func (a *SumData) clone() AggregationData {
@ -86,6 +97,17 @@ func (a *SumData) equal(other AggregationData) bool {
return math.Pow(a.Value-a2.Value, 2) < epsilon
}
func (a *SumData) toPoint(metricType metricdata.Type, t time.Time) metricdata.Point {
switch metricType {
case metricdata.TypeCumulativeInt64:
return metricdata.NewInt64Point(t, int64(a.Value))
case metricdata.TypeCumulativeFloat64:
return metricdata.NewFloat64Point(t, a.Value)
default:
panic("unsupported metricdata.Type")
}
}
// DistributionData is the aggregated data for the
// Distribution aggregation.
//
@ -102,7 +124,7 @@ type DistributionData struct {
CountPerBucket []int64 // number of occurrences per bucket
// ExemplarsPerBucket is slice the same length as CountPerBucket containing
// an exemplar for the associated bucket, or nil.
ExemplarsPerBucket []*exemplar.Exemplar
ExemplarsPerBucket []*metricdata.Exemplar
bounds []float64 // histogram distribution of the values
}
@ -110,7 +132,7 @@ func newDistributionData(bounds []float64) *DistributionData {
bucketCount := len(bounds) + 1
return &DistributionData{
CountPerBucket: make([]int64, bucketCount),
ExemplarsPerBucket: make([]*exemplar.Exemplar, bucketCount),
ExemplarsPerBucket: make([]*metricdata.Exemplar, bucketCount),
bounds: bounds,
Min: math.MaxFloat64,
Max: math.SmallestNonzeroFloat64,
@ -129,64 +151,62 @@ func (a *DistributionData) variance() float64 {
func (a *DistributionData) isAggregationData() bool { return true }
func (a *DistributionData) addSample(e *exemplar.Exemplar) {
f := e.Value
if f < a.Min {
a.Min = f
// TODO(songy23): support exemplar attachments.
func (a *DistributionData) addSample(v float64, attachments map[string]interface{}, t time.Time) {
if v < a.Min {
a.Min = v
}
if f > a.Max {
a.Max = f
if v > a.Max {
a.Max = v
}
a.Count++
a.addToBucket(e)
a.addToBucket(v, attachments, t)
if a.Count == 1 {
a.Mean = f
a.Mean = v
return
}
oldMean := a.Mean
a.Mean = a.Mean + (f-a.Mean)/float64(a.Count)
a.SumOfSquaredDev = a.SumOfSquaredDev + (f-oldMean)*(f-a.Mean)
a.Mean = a.Mean + (v-a.Mean)/float64(a.Count)
a.SumOfSquaredDev = a.SumOfSquaredDev + (v-oldMean)*(v-a.Mean)
}
func (a *DistributionData) addToBucket(e *exemplar.Exemplar) {
func (a *DistributionData) addToBucket(v float64, attachments map[string]interface{}, t time.Time) {
var count *int64
var ex **exemplar.Exemplar
for i, b := range a.bounds {
if e.Value < b {
var i int
var b float64
for i, b = range a.bounds {
if v < b {
count = &a.CountPerBucket[i]
ex = &a.ExemplarsPerBucket[i]
break
}
}
if count == nil {
count = &a.CountPerBucket[len(a.bounds)]
ex = &a.ExemplarsPerBucket[len(a.bounds)]
if count == nil { // Last bucket.
i = len(a.bounds)
count = &a.CountPerBucket[i]
}
*count++
*ex = maybeRetainExemplar(*ex, e)
if exemplar := getExemplar(v, attachments, t); exemplar != nil {
a.ExemplarsPerBucket[i] = exemplar
}
}
func maybeRetainExemplar(old, cur *exemplar.Exemplar) *exemplar.Exemplar {
if old == nil {
return cur
func getExemplar(v float64, attachments map[string]interface{}, t time.Time) *metricdata.Exemplar {
if len(attachments) == 0 {
return nil
}
// Heuristic to pick the "better" exemplar: first keep the one with a
// sampled trace attachment, if neither have a trace attachment, pick the
// one with more attachments.
_, haveTraceID := cur.Attachments[exemplar.KeyTraceID]
if haveTraceID || len(cur.Attachments) >= len(old.Attachments) {
return cur
return &metricdata.Exemplar{
Value: v,
Timestamp: t,
Attachments: attachments,
}
return old
}
func (a *DistributionData) clone() AggregationData {
c := *a
c.CountPerBucket = append([]int64(nil), a.CountPerBucket...)
c.ExemplarsPerBucket = append([]*exemplar.Exemplar(nil), a.ExemplarsPerBucket...)
c.ExemplarsPerBucket = append([]*metricdata.Exemplar(nil), a.ExemplarsPerBucket...)
return &c
}
@ -209,6 +229,33 @@ func (a *DistributionData) equal(other AggregationData) bool {
return a.Count == a2.Count && a.Min == a2.Min && a.Max == a2.Max && math.Pow(a.Mean-a2.Mean, 2) < epsilon && math.Pow(a.variance()-a2.variance(), 2) < epsilon
}
func (a *DistributionData) toPoint(metricType metricdata.Type, t time.Time) metricdata.Point {
switch metricType {
case metricdata.TypeCumulativeDistribution:
buckets := []metricdata.Bucket{}
for i := 0; i < len(a.CountPerBucket); i++ {
buckets = append(buckets, metricdata.Bucket{
Count: a.CountPerBucket[i],
Exemplar: a.ExemplarsPerBucket[i],
})
}
bucketOptions := &metricdata.BucketOptions{Bounds: a.bounds}
val := &metricdata.Distribution{
Count: a.Count,
Sum: a.Sum(),
SumOfSquaredDeviation: a.SumOfSquaredDev,
BucketOptions: bucketOptions,
Buckets: buckets,
}
return metricdata.NewDistributionPoint(t, val)
default:
// TODO: [rghetia] when we have a use case for TypeGaugeDistribution.
panic("unsupported metricdata.Type")
}
}
// LastValueData returns the last value recorded for LastValue aggregation.
type LastValueData struct {
Value float64
@ -218,8 +265,8 @@ func (l *LastValueData) isAggregationData() bool {
return true
}
func (l *LastValueData) addSample(e *exemplar.Exemplar) {
l.Value = e.Value
func (l *LastValueData) addSample(v float64, _ map[string]interface{}, _ time.Time) {
l.Value = v
}
func (l *LastValueData) clone() AggregationData {
@ -233,3 +280,14 @@ func (l *LastValueData) equal(other AggregationData) bool {
}
return l.Value == a2.Value
}
func (l *LastValueData) toPoint(metricType metricdata.Type, t time.Time) metricdata.Point {
switch metricType {
case metricdata.TypeGaugeInt64:
return metricdata.NewInt64Point(t, int64(l.Value))
case metricdata.TypeGaugeFloat64:
return metricdata.NewFloat64Point(t, l.Value)
default:
panic("unsupported metricdata.Type")
}
}

View File

@ -17,8 +17,7 @@ package view
import (
"sort"
"go.opencensus.io/exemplar"
"time"
"go.opencensus.io/internal/tagencoding"
"go.opencensus.io/tag"
@ -33,13 +32,13 @@ type collector struct {
a *Aggregation
}
func (c *collector) addSample(s string, e *exemplar.Exemplar) {
func (c *collector) addSample(s string, v float64, attachments map[string]interface{}, t time.Time) {
aggregator, ok := c.signatures[s]
if !ok {
aggregator = c.a.newData()
c.signatures[s] = aggregator
}
aggregator.addSample(e)
aggregator.addSample(v, attachments, t)
}
// collectRows returns a snapshot of the collected Row values.

View File

@ -17,16 +17,15 @@ package view
import (
"bytes"
"errors"
"fmt"
"reflect"
"sort"
"sync/atomic"
"time"
"go.opencensus.io/exemplar"
"go.opencensus.io/metric/metricdata"
"go.opencensus.io/stats"
"go.opencensus.io/stats/internal"
"go.opencensus.io/tag"
)
@ -69,6 +68,11 @@ func (v *View) same(other *View) bool {
v.Measure.Name() == other.Measure.Name()
}
// ErrNegativeBucketBounds error returned if histogram contains negative bounds.
//
// Deprecated: this should not be public.
var ErrNegativeBucketBounds = errors.New("negative bucket bounds not supported")
// canonicalize canonicalizes v by setting explicit
// defaults for Name and Description and sorting the TagKeys
func (v *View) canonicalize() error {
@ -90,20 +94,40 @@ func (v *View) canonicalize() error {
sort.Slice(v.TagKeys, func(i, j int) bool {
return v.TagKeys[i].Name() < v.TagKeys[j].Name()
})
sort.Float64s(v.Aggregation.Buckets)
for _, b := range v.Aggregation.Buckets {
if b < 0 {
return ErrNegativeBucketBounds
}
}
// drop 0 bucket silently.
v.Aggregation.Buckets = dropZeroBounds(v.Aggregation.Buckets...)
return nil
}
func dropZeroBounds(bounds ...float64) []float64 {
for i, bound := range bounds {
if bound > 0 {
return bounds[i:]
}
}
return []float64{}
}
// viewInternal is the internal representation of a View.
type viewInternal struct {
view *View // view is the canonicalized View definition associated with this view.
subscribed uint32 // 1 if someone is subscribed and data need to be exported, use atomic to access
collector *collector
view *View // view is the canonicalized View definition associated with this view.
subscribed uint32 // 1 if someone is subscribed and data need to be exported, use atomic to access
collector *collector
metricDescriptor *metricdata.Descriptor
}
func newViewInternal(v *View) (*viewInternal, error) {
return &viewInternal{
view: v,
collector: &collector{make(map[string]AggregationData), v.Aggregation},
view: v,
collector: &collector{make(map[string]AggregationData), v.Aggregation},
metricDescriptor: viewToMetricDescriptor(v),
}, nil
}
@ -129,12 +153,12 @@ func (v *viewInternal) collectedRows() []*Row {
return v.collector.collectedRows(v.view.TagKeys)
}
func (v *viewInternal) addSample(m *tag.Map, e *exemplar.Exemplar) {
func (v *viewInternal) addSample(m *tag.Map, val float64, attachments map[string]interface{}, t time.Time) {
if !v.isSubscribed() {
return
}
sig := string(encodeWithKeys(m, v.view.TagKeys))
v.collector.addSample(sig, e)
v.collector.addSample(sig, val, attachments, t)
}
// A Data is a set of rows about usage of the single measure associated
@ -174,11 +198,23 @@ func (r *Row) Equal(other *Row) bool {
return reflect.DeepEqual(r.Tags, other.Tags) && r.Data.equal(other.Data)
}
func checkViewName(name string) error {
if len(name) > internal.MaxNameLength {
return fmt.Errorf("view name cannot be larger than %v", internal.MaxNameLength)
const maxNameLength = 255
// Returns true if the given string contains only printable characters.
func isPrintable(str string) bool {
for _, r := range str {
if !(r >= ' ' && r <= '~') {
return false
}
}
if !internal.IsPrintable(name) {
return true
}
func checkViewName(name string) error {
if len(name) > maxNameLength {
return fmt.Errorf("view name cannot be larger than %v", maxNameLength)
}
if !isPrintable(name) {
return fmt.Errorf("view name needs to be an ASCII string")
}
return nil

140
vendor/go.opencensus.io/stats/view/view_to_metric.go generated vendored Normal file
View File

@ -0,0 +1,140 @@
// Copyright 2019, OpenCensus Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
package view
import (
"time"
"go.opencensus.io/metric/metricdata"
"go.opencensus.io/stats"
)
func getUnit(unit string) metricdata.Unit {
switch unit {
case "1":
return metricdata.UnitDimensionless
case "ms":
return metricdata.UnitMilliseconds
case "By":
return metricdata.UnitBytes
}
return metricdata.UnitDimensionless
}
func getType(v *View) metricdata.Type {
m := v.Measure
agg := v.Aggregation
switch agg.Type {
case AggTypeSum:
switch m.(type) {
case *stats.Int64Measure:
return metricdata.TypeCumulativeInt64
case *stats.Float64Measure:
return metricdata.TypeCumulativeFloat64
default:
panic("unexpected measure type")
}
case AggTypeDistribution:
return metricdata.TypeCumulativeDistribution
case AggTypeLastValue:
switch m.(type) {
case *stats.Int64Measure:
return metricdata.TypeGaugeInt64
case *stats.Float64Measure:
return metricdata.TypeGaugeFloat64
default:
panic("unexpected measure type")
}
case AggTypeCount:
switch m.(type) {
case *stats.Int64Measure:
return metricdata.TypeCumulativeInt64
case *stats.Float64Measure:
return metricdata.TypeCumulativeInt64
default:
panic("unexpected measure type")
}
default:
panic("unexpected aggregation type")
}
}
func getLableKeys(v *View) []metricdata.LabelKey {
labelKeys := []metricdata.LabelKey{}
for _, k := range v.TagKeys {
labelKeys = append(labelKeys, metricdata.LabelKey{Key: k.Name()})
}
return labelKeys
}
func viewToMetricDescriptor(v *View) *metricdata.Descriptor {
return &metricdata.Descriptor{
Name: v.Name,
Description: v.Description,
Unit: getUnit(v.Measure.Unit()),
Type: getType(v),
LabelKeys: getLableKeys(v),
}
}
func toLabelValues(row *Row, expectedKeys []metricdata.LabelKey) []metricdata.LabelValue {
labelValues := []metricdata.LabelValue{}
tagMap := make(map[string]string)
for _, tag := range row.Tags {
tagMap[tag.Key.Name()] = tag.Value
}
for _, key := range expectedKeys {
if val, ok := tagMap[key.Key]; ok {
labelValues = append(labelValues, metricdata.NewLabelValue(val))
} else {
labelValues = append(labelValues, metricdata.LabelValue{})
}
}
return labelValues
}
func rowToTimeseries(v *viewInternal, row *Row, now time.Time, startTime time.Time) *metricdata.TimeSeries {
return &metricdata.TimeSeries{
Points: []metricdata.Point{row.Data.toPoint(v.metricDescriptor.Type, now)},
LabelValues: toLabelValues(row, v.metricDescriptor.LabelKeys),
StartTime: startTime,
}
}
func viewToMetric(v *viewInternal, now time.Time, startTime time.Time) *metricdata.Metric {
if v.metricDescriptor.Type == metricdata.TypeGaugeInt64 ||
v.metricDescriptor.Type == metricdata.TypeGaugeFloat64 {
startTime = time.Time{}
}
rows := v.collectedRows()
if len(rows) == 0 {
return nil
}
ts := []*metricdata.TimeSeries{}
for _, row := range rows {
ts = append(ts, rowToTimeseries(v, row, now, startTime))
}
m := &metricdata.Metric{
Descriptor: *v.metricDescriptor,
TimeSeries: ts,
}
return m
}

View File

@ -17,8 +17,11 @@ package view
import (
"fmt"
"sync"
"time"
"go.opencensus.io/metric/metricdata"
"go.opencensus.io/metric/metricproducer"
"go.opencensus.io/stats"
"go.opencensus.io/stats/internal"
"go.opencensus.io/tag"
@ -43,6 +46,7 @@ type worker struct {
timer *time.Ticker
c chan command
quit, done chan bool
mu sync.RWMutex
}
var defaultWorker *worker
@ -64,11 +68,6 @@ func Find(name string) (v *View) {
// Register begins collecting data for the given views.
// Once a view is registered, it reports data to the registered exporters.
func Register(views ...*View) error {
for _, v := range views {
if err := v.canonicalize(); err != nil {
return err
}
}
req := &registerViewReq{
views: views,
err: make(chan error),
@ -107,7 +106,7 @@ func RetrieveData(viewName string) ([]*Row, error) {
return resp.rows, resp.err
}
func record(tags *tag.Map, ms interface{}, attachments map[string]string) {
func record(tags *tag.Map, ms interface{}, attachments map[string]interface{}) {
req := &recordReq{
tm: tags,
ms: ms.([]stats.Measurement),
@ -148,6 +147,9 @@ func newWorker() *worker {
}
func (w *worker) start() {
prodMgr := metricproducer.GlobalManager()
prodMgr.AddProducer(w)
for {
select {
case cmd := <-w.c:
@ -164,6 +166,9 @@ func (w *worker) start() {
}
func (w *worker) stop() {
prodMgr := metricproducer.GlobalManager()
prodMgr.DeleteProducer(w)
w.quit <- true
<-w.done
}
@ -181,6 +186,8 @@ func (w *worker) getMeasureRef(name string) *measureRef {
}
func (w *worker) tryRegisterView(v *View) (*viewInternal, error) {
w.mu.Lock()
defer w.mu.Unlock()
vi, err := newViewInternal(v)
if err != nil {
return nil, err
@ -200,6 +207,12 @@ func (w *worker) tryRegisterView(v *View) (*viewInternal, error) {
return vi, nil
}
func (w *worker) unregisterView(viewName string) {
w.mu.Lock()
defer w.mu.Unlock()
delete(w.views, viewName)
}
func (w *worker) reportView(v *viewInternal, now time.Time) {
if !v.isSubscribed() {
return
@ -223,7 +236,46 @@ func (w *worker) reportView(v *viewInternal, now time.Time) {
}
func (w *worker) reportUsage(now time.Time) {
w.mu.Lock()
defer w.mu.Unlock()
for _, v := range w.views {
w.reportView(v, now)
}
}
func (w *worker) toMetric(v *viewInternal, now time.Time) *metricdata.Metric {
if !v.isSubscribed() {
return nil
}
_, ok := w.startTimes[v]
if !ok {
w.startTimes[v] = now
}
var startTime time.Time
if v.metricDescriptor.Type == metricdata.TypeGaugeInt64 ||
v.metricDescriptor.Type == metricdata.TypeGaugeFloat64 {
startTime = time.Time{}
} else {
startTime = w.startTimes[v]
}
return viewToMetric(v, now, startTime)
}
// Read reads all view data and returns them as metrics.
// It is typically invoked by metric reader to export stats in metric format.
func (w *worker) Read() []*metricdata.Metric {
w.mu.Lock()
defer w.mu.Unlock()
now := time.Now()
metrics := make([]*metricdata.Metric, 0, len(w.views))
for _, v := range w.views {
metric := w.toMetric(v, now)
if metric != nil {
metrics = append(metrics, metric)
}
}
return metrics
}

View File

@ -21,8 +21,6 @@ import (
"strings"
"time"
"go.opencensus.io/exemplar"
"go.opencensus.io/stats"
"go.opencensus.io/stats/internal"
"go.opencensus.io/tag"
@ -58,6 +56,12 @@ type registerViewReq struct {
}
func (cmd *registerViewReq) handleCommand(w *worker) {
for _, v := range cmd.views {
if err := v.canonicalize(); err != nil {
cmd.err <- err
return
}
}
var errstr []string
for _, view := range cmd.views {
vi, err := w.tryRegisterView(view)
@ -99,7 +103,7 @@ func (cmd *unregisterFromViewReq) handleCommand(w *worker) {
// The collected data can be cleared.
vi.clearRows()
}
delete(w.views, name)
w.unregisterView(name)
}
cmd.done <- struct{}{}
}
@ -117,6 +121,8 @@ type retrieveDataResp struct {
}
func (cmd *retrieveDataReq) handleCommand(w *worker) {
w.mu.Lock()
defer w.mu.Unlock()
vi, ok := w.views[cmd.v]
if !ok {
cmd.c <- &retrieveDataResp{
@ -144,23 +150,20 @@ func (cmd *retrieveDataReq) handleCommand(w *worker) {
type recordReq struct {
tm *tag.Map
ms []stats.Measurement
attachments map[string]string
attachments map[string]interface{}
t time.Time
}
func (cmd *recordReq) handleCommand(w *worker) {
w.mu.Lock()
defer w.mu.Unlock()
for _, m := range cmd.ms {
if (m == stats.Measurement{}) { // not registered
continue
}
ref := w.getMeasureRef(m.Measure().Name())
for v := range ref.views {
e := &exemplar.Exemplar{
Value: m.Value(),
Timestamp: cmd.t,
Attachments: cmd.attachments,
}
v.addSample(cmd.tm, e)
v.addSample(cmd.tm, m.Value(), cmd.attachments, time.Now())
}
}
}

View File

@ -17,8 +17,6 @@ package tag
import (
"context"
"go.opencensus.io/exemplar"
)
// FromContext returns the tag map stored in the context.
@ -43,25 +41,3 @@ func NewContext(ctx context.Context, m *Map) context.Context {
type ctxKey struct{}
var mapCtxKey = ctxKey{}
func init() {
exemplar.RegisterAttachmentExtractor(extractTagsAttachments)
}
func extractTagsAttachments(ctx context.Context, a exemplar.Attachments) exemplar.Attachments {
m := FromContext(ctx)
if m == nil {
return a
}
if len(m.m) == 0 {
return a
}
if a == nil {
a = make(map[string]string)
}
for k, v := range m.m {
a[exemplar.KeyPrefixTag+k.Name()] = v
}
return a
}

66
vendor/go.opencensus.io/tag/map.go generated vendored
View File

@ -28,10 +28,15 @@ type Tag struct {
Value string
}
type tagContent struct {
value string
m metadatas
}
// Map is a map of tags. Use New to create a context containing
// a new Map.
type Map struct {
m map[Key]string
m map[Key]tagContent
}
// Value returns the value for the key if a value for the key exists.
@ -40,7 +45,7 @@ func (m *Map) Value(k Key) (string, bool) {
return "", false
}
v, ok := m.m[k]
return v, ok
return v.value, ok
}
func (m *Map) String() string {
@ -62,21 +67,21 @@ func (m *Map) String() string {
return buffer.String()
}
func (m *Map) insert(k Key, v string) {
func (m *Map) insert(k Key, v string, md metadatas) {
if _, ok := m.m[k]; ok {
return
}
m.m[k] = v
m.m[k] = tagContent{value: v, m: md}
}
func (m *Map) update(k Key, v string) {
func (m *Map) update(k Key, v string, md metadatas) {
if _, ok := m.m[k]; ok {
m.m[k] = v
m.m[k] = tagContent{value: v, m: md}
}
}
func (m *Map) upsert(k Key, v string) {
m.m[k] = v
func (m *Map) upsert(k Key, v string, md metadatas) {
m.m[k] = tagContent{value: v, m: md}
}
func (m *Map) delete(k Key) {
@ -84,7 +89,7 @@ func (m *Map) delete(k Key) {
}
func newMap() *Map {
return &Map{m: make(map[Key]string)}
return &Map{m: make(map[Key]tagContent)}
}
// Mutator modifies a tag map.
@ -95,13 +100,17 @@ type Mutator interface {
// Insert returns a mutator that inserts a
// value associated with k. If k already exists in the tag map,
// mutator doesn't update the value.
func Insert(k Key, v string) Mutator {
// Metadata applies metadata to the tag. It is optional.
// Metadatas are applied in the order in which it is provided.
// If more than one metadata updates the same attribute then
// the update from the last metadata prevails.
func Insert(k Key, v string, mds ...Metadata) Mutator {
return &mutator{
fn: func(m *Map) (*Map, error) {
if !checkValue(v) {
return nil, errInvalidValue
}
m.insert(k, v)
m.insert(k, v, createMetadatas(mds...))
return m, nil
},
}
@ -110,13 +119,17 @@ func Insert(k Key, v string) Mutator {
// Update returns a mutator that updates the
// value of the tag associated with k with v. If k doesn't
// exists in the tag map, the mutator doesn't insert the value.
func Update(k Key, v string) Mutator {
// Metadata applies metadata to the tag. It is optional.
// Metadatas are applied in the order in which it is provided.
// If more than one metadata updates the same attribute then
// the update from the last metadata prevails.
func Update(k Key, v string, mds ...Metadata) Mutator {
return &mutator{
fn: func(m *Map) (*Map, error) {
if !checkValue(v) {
return nil, errInvalidValue
}
m.update(k, v)
m.update(k, v, createMetadatas(mds...))
return m, nil
},
}
@ -126,18 +139,37 @@ func Update(k Key, v string) Mutator {
// value of the tag associated with k with v. It inserts the
// value if k doesn't exist already. It mutates the value
// if k already exists.
func Upsert(k Key, v string) Mutator {
// Metadata applies metadata to the tag. It is optional.
// Metadatas are applied in the order in which it is provided.
// If more than one metadata updates the same attribute then
// the update from the last metadata prevails.
func Upsert(k Key, v string, mds ...Metadata) Mutator {
return &mutator{
fn: func(m *Map) (*Map, error) {
if !checkValue(v) {
return nil, errInvalidValue
}
m.upsert(k, v)
m.upsert(k, v, createMetadatas(mds...))
return m, nil
},
}
}
func createMetadatas(mds ...Metadata) metadatas {
var metas metadatas
if len(mds) > 0 {
for _, md := range mds {
if md != nil {
md(&metas)
}
}
} else {
WithTTL(TTLUnlimitedPropagation)(&metas)
}
return metas
}
// Delete returns a mutator that deletes
// the value associated with k.
func Delete(k Key) Mutator {
@ -160,10 +192,10 @@ func New(ctx context.Context, mutator ...Mutator) (context.Context, error) {
if !checkKeyName(k.Name()) {
return ctx, fmt.Errorf("key:%q: %v", k, errInvalidKeyName)
}
if !checkValue(v) {
if !checkValue(v.value) {
return ctx, fmt.Errorf("key:%q value:%q: %v", k.Name(), v, errInvalidValue)
}
m.insert(k, v)
m.insert(k, v.value, v.m)
}
}
var err error

View File

@ -162,14 +162,19 @@ func (eg *encoderGRPC) bytes() []byte {
// Encode encodes the tag map into a []byte. It is useful to propagate
// the tag maps on wire in binary format.
func Encode(m *Map) []byte {
if m == nil {
return nil
}
eg := &encoderGRPC{
buf: make([]byte, len(m.m)),
}
eg.writeByte(byte(tagsVersionID))
for k, v := range m.m {
eg.writeByte(byte(keyTypeString))
eg.writeStringWithVarintLen(k.name)
eg.writeBytesWithVarintLen([]byte(v))
if v.m.ttl.ttl == valueTTLUnlimitedPropagation {
eg.writeByte(byte(keyTypeString))
eg.writeStringWithVarintLen(k.name)
eg.writeBytesWithVarintLen([]byte(v.value))
}
}
return eg.bytes()
}
@ -187,7 +192,7 @@ func Decode(bytes []byte) (*Map, error) {
// DecodeEach decodes the given serialized tag map, calling handler for each
// tag key and value decoded.
func DecodeEach(bytes []byte, fn func(key Key, val string)) error {
func DecodeEach(bytes []byte, fn func(key Key, val string, md metadatas)) error {
eg := &encoderGRPC{
buf: bytes,
}
@ -225,7 +230,7 @@ func DecodeEach(bytes []byte, fn func(key Key, val string)) error {
if !checkValue(val) {
return errInvalidValue
}
fn(key, val)
fn(key, val, createMetadatas(WithTTL(TTLUnlimitedPropagation)))
if err != nil {
return err
}

52
vendor/go.opencensus.io/tag/metadata.go generated vendored Normal file
View File

@ -0,0 +1,52 @@
// Copyright 2019, OpenCensus Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
package tag
const (
// valueTTLNoPropagation prevents tag from propagating.
valueTTLNoPropagation = 0
// valueTTLUnlimitedPropagation allows tag to propagate without any limits on number of hops.
valueTTLUnlimitedPropagation = -1
)
// TTL is metadata that specifies number of hops a tag can propagate.
// Details about TTL metadata is specified at https://github.com/census-instrumentation/opencensus-specs/blob/master/tags/TagMap.md#tagmetadata
type TTL struct {
ttl int
}
var (
// TTLUnlimitedPropagation is TTL metadata that allows tag to propagate without any limits on number of hops.
TTLUnlimitedPropagation = TTL{ttl: valueTTLUnlimitedPropagation}
// TTLNoPropagation is TTL metadata that prevents tag from propagating.
TTLNoPropagation = TTL{ttl: valueTTLNoPropagation}
)
type metadatas struct {
ttl TTL
}
// Metadata applies metadatas specified by the function.
type Metadata func(*metadatas)
// WithTTL applies metadata with provided ttl.
func WithTTL(ttl TTL) Metadata {
return func(m *metadatas) {
m.ttl = ttl
}
}

View File

@ -25,7 +25,7 @@ func do(ctx context.Context, f func(ctx context.Context)) {
m := FromContext(ctx)
keyvals := make([]string, 0, 2*len(m.m))
for k, v := range m.m {
keyvals = append(keyvals, k.Name(), v)
keyvals = append(keyvals, k.Name(), v.value)
}
pprof.Do(ctx, pprof.Labels(keyvals...), f)
}

View File

@ -59,6 +59,11 @@ func Int64Attribute(key string, value int64) Attribute {
return Attribute{key: key, value: value}
}
// Float64Attribute returns a float64-valued attribute.
func Float64Attribute(key string, value float64) Attribute {
return Attribute{key: key, value: value}
}
// StringAttribute returns a string-valued attribute.
func StringAttribute(key string, value string) Attribute {
return Attribute{key: key, value: value}
@ -71,8 +76,8 @@ type LinkType int32
// LinkType values.
const (
LinkTypeUnspecified LinkType = iota // The relationship of the two spans is unknown.
LinkTypeChild // The current span is a child of the linked span.
LinkTypeParent // The current span is the parent of the linked span.
LinkTypeChild // The linked span is a child of the current span.
LinkTypeParent // The linked span is the parent of the current span.
)
// Link represents a reference from one span to another span.

View File

@ -27,10 +27,36 @@ type Config struct {
// IDGenerator is for internal use only.
IDGenerator internal.IDGenerator
// MaxAnnotationEventsPerSpan is max number of annotation events per span
MaxAnnotationEventsPerSpan int
// MaxMessageEventsPerSpan is max number of message events per span
MaxMessageEventsPerSpan int
// MaxAnnotationEventsPerSpan is max number of attributes per span
MaxAttributesPerSpan int
// MaxLinksPerSpan is max number of links per span
MaxLinksPerSpan int
}
var configWriteMu sync.Mutex
const (
// DefaultMaxAnnotationEventsPerSpan is default max number of annotation events per span
DefaultMaxAnnotationEventsPerSpan = 32
// DefaultMaxMessageEventsPerSpan is default max number of message events per span
DefaultMaxMessageEventsPerSpan = 128
// DefaultMaxAttributesPerSpan is default max number of attributes per span
DefaultMaxAttributesPerSpan = 32
// DefaultMaxLinksPerSpan is default max number of links per span
DefaultMaxLinksPerSpan = 32
)
// ApplyConfig applies changes to the global tracing configuration.
//
// Fields not provided in the given config are going to be preserved.
@ -44,5 +70,17 @@ func ApplyConfig(cfg Config) {
if cfg.IDGenerator != nil {
c.IDGenerator = cfg.IDGenerator
}
if cfg.MaxAnnotationEventsPerSpan > 0 {
c.MaxAnnotationEventsPerSpan = cfg.MaxAnnotationEventsPerSpan
}
if cfg.MaxMessageEventsPerSpan > 0 {
c.MaxMessageEventsPerSpan = cfg.MaxMessageEventsPerSpan
}
if cfg.MaxAttributesPerSpan > 0 {
c.MaxAttributesPerSpan = cfg.MaxAttributesPerSpan
}
if cfg.MaxLinksPerSpan > 0 {
c.MaxLinksPerSpan = cfg.MaxLinksPerSpan
}
config.Store(&c)
}

38
vendor/go.opencensus.io/trace/evictedqueue.go generated vendored Normal file
View File

@ -0,0 +1,38 @@
// Copyright 2019, OpenCensus Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package trace
type evictedQueue struct {
queue []interface{}
capacity int
droppedCount int
}
func newEvictedQueue(capacity int) *evictedQueue {
eq := &evictedQueue{
capacity: capacity,
queue: make([]interface{}, 0),
}
return eq
}
func (eq *evictedQueue) add(value interface{}) {
if len(eq.queue) == eq.capacity {
eq.queue = eq.queue[1:]
eq.droppedCount++
}
eq.queue = append(eq.queue, value)
}

View File

@ -85,6 +85,13 @@ type SpanData struct {
Annotations []Annotation
MessageEvents []MessageEvent
Status
Links []Link
HasRemoteParent bool
Links []Link
HasRemoteParent bool
DroppedAttributeCount int
DroppedAnnotationCount int
DroppedMessageEventCount int
DroppedLinkCount int
// ChildSpanCount holds the number of child span created for this span.
ChildSpanCount int
}

View File

@ -15,6 +15,7 @@
// Package internal provides trace internals.
package internal
// IDGenerator allows custom generators for TraceId and SpanId.
type IDGenerator interface {
NewTraceID() [16]byte
NewSpanID() [8]byte

37
vendor/go.opencensus.io/trace/lrumap.go generated vendored Normal file
View File

@ -0,0 +1,37 @@
// Copyright 2019, OpenCensus Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package trace
import (
"github.com/hashicorp/golang-lru/simplelru"
)
type lruMap struct {
simpleLruMap *simplelru.LRU
droppedCount int
}
func newLruMap(size int) *lruMap {
lm := &lruMap{}
lm.simpleLruMap, _ = simplelru.NewLRU(size, nil)
return lm
}
func (lm *lruMap) add(key, value interface{}) {
evicted := lm.simpleLruMap.Add(key, value)
if evicted {
lm.droppedCount++
}
}

View File

@ -42,6 +42,20 @@ type Span struct {
data *SpanData
mu sync.Mutex // protects the contents of *data (but not the pointer value.)
spanContext SpanContext
// lruAttributes are capped at configured limit. When the capacity is reached an oldest entry
// is removed to create room for a new entry.
lruAttributes *lruMap
// annotations are stored in FIFO queue capped by configured limit.
annotations *evictedQueue
// messageEvents are stored in FIFO queue capped by configured limit.
messageEvents *evictedQueue
// links are stored in FIFO queue capped by configured limit.
links *evictedQueue
// spanStore is the spanStore this span belongs to, if any, otherwise it is nil.
*spanStore
endOnce sync.Once
@ -156,6 +170,7 @@ func StartSpan(ctx context.Context, name string, o ...StartOption) (context.Cont
var opts StartOptions
var parent SpanContext
if p := FromContext(ctx); p != nil {
p.addChild()
parent = p.spanContext
}
for _, op := range o {
@ -226,6 +241,11 @@ func startSpanInternal(name string, hasParent bool, parent SpanContext, remotePa
Name: name,
HasRemoteParent: remoteParent,
}
span.lruAttributes = newLruMap(cfg.MaxAttributesPerSpan)
span.annotations = newEvictedQueue(cfg.MaxAnnotationEventsPerSpan)
span.messageEvents = newEvictedQueue(cfg.MaxMessageEventsPerSpan)
span.links = newEvictedQueue(cfg.MaxLinksPerSpan)
if hasParent {
span.data.ParentSpanID = parent.SpanID
}
@ -276,11 +296,21 @@ func (s *Span) makeSpanData() *SpanData {
var sd SpanData
s.mu.Lock()
sd = *s.data
if s.data.Attributes != nil {
sd.Attributes = make(map[string]interface{})
for k, v := range s.data.Attributes {
sd.Attributes[k] = v
}
if s.lruAttributes.simpleLruMap.Len() > 0 {
sd.Attributes = s.lruAttributesToAttributeMap()
sd.DroppedAttributeCount = s.lruAttributes.droppedCount
}
if len(s.annotations.queue) > 0 {
sd.Annotations = s.interfaceArrayToAnnotationArray()
sd.DroppedAnnotationCount = s.annotations.droppedCount
}
if len(s.messageEvents.queue) > 0 {
sd.MessageEvents = s.interfaceArrayToMessageEventArray()
sd.DroppedMessageEventCount = s.messageEvents.droppedCount
}
if len(s.links.queue) > 0 {
sd.Links = s.interfaceArrayToLinksArray()
sd.DroppedLinkCount = s.links.droppedCount
}
s.mu.Unlock()
return &sd
@ -314,6 +344,57 @@ func (s *Span) SetStatus(status Status) {
s.mu.Unlock()
}
func (s *Span) interfaceArrayToLinksArray() []Link {
linksArr := make([]Link, 0)
for _, value := range s.links.queue {
linksArr = append(linksArr, value.(Link))
}
return linksArr
}
func (s *Span) interfaceArrayToMessageEventArray() []MessageEvent {
messageEventArr := make([]MessageEvent, 0)
for _, value := range s.messageEvents.queue {
messageEventArr = append(messageEventArr, value.(MessageEvent))
}
return messageEventArr
}
func (s *Span) interfaceArrayToAnnotationArray() []Annotation {
annotationArr := make([]Annotation, 0)
for _, value := range s.annotations.queue {
annotationArr = append(annotationArr, value.(Annotation))
}
return annotationArr
}
func (s *Span) lruAttributesToAttributeMap() map[string]interface{} {
attributes := make(map[string]interface{})
for _, key := range s.lruAttributes.simpleLruMap.Keys() {
value, ok := s.lruAttributes.simpleLruMap.Get(key)
if ok {
keyStr := key.(string)
attributes[keyStr] = value
}
}
return attributes
}
func (s *Span) copyToCappedAttributes(attributes []Attribute) {
for _, a := range attributes {
s.lruAttributes.add(a.key, a.value)
}
}
func (s *Span) addChild() {
if !s.IsRecordingEvents() {
return
}
s.mu.Lock()
s.data.ChildSpanCount++
s.mu.Unlock()
}
// AddAttributes sets attributes in the span.
//
// Existing attributes whose keys appear in the attributes parameter are overwritten.
@ -322,10 +403,7 @@ func (s *Span) AddAttributes(attributes ...Attribute) {
return
}
s.mu.Lock()
if s.data.Attributes == nil {
s.data.Attributes = make(map[string]interface{})
}
copyAttributes(s.data.Attributes, attributes)
s.copyToCappedAttributes(attributes)
s.mu.Unlock()
}
@ -345,7 +423,7 @@ func (s *Span) lazyPrintfInternal(attributes []Attribute, format string, a ...in
m = make(map[string]interface{})
copyAttributes(m, attributes)
}
s.data.Annotations = append(s.data.Annotations, Annotation{
s.annotations.add(Annotation{
Time: now,
Message: msg,
Attributes: m,
@ -361,7 +439,7 @@ func (s *Span) printStringInternal(attributes []Attribute, str string) {
a = make(map[string]interface{})
copyAttributes(a, attributes)
}
s.data.Annotations = append(s.data.Annotations, Annotation{
s.annotations.add(Annotation{
Time: now,
Message: str,
Attributes: a,
@ -398,7 +476,7 @@ func (s *Span) AddMessageSendEvent(messageID, uncompressedByteSize, compressedBy
}
now := time.Now()
s.mu.Lock()
s.data.MessageEvents = append(s.data.MessageEvents, MessageEvent{
s.messageEvents.add(MessageEvent{
Time: now,
EventType: MessageEventTypeSent,
MessageID: messageID,
@ -420,7 +498,7 @@ func (s *Span) AddMessageReceiveEvent(messageID, uncompressedByteSize, compresse
}
now := time.Now()
s.mu.Lock()
s.data.MessageEvents = append(s.data.MessageEvents, MessageEvent{
s.messageEvents.add(MessageEvent{
Time: now,
EventType: MessageEventTypeRecv,
MessageID: messageID,
@ -436,7 +514,7 @@ func (s *Span) AddLink(l Link) {
return
}
s.mu.Lock()
s.data.Links = append(s.data.Links, l)
s.links.add(l)
s.mu.Unlock()
}
@ -468,8 +546,12 @@ func init() {
gen.spanIDInc |= 1
config.Store(&Config{
DefaultSampler: ProbabilitySampler(defaultSamplingProbability),
IDGenerator: gen,
DefaultSampler: ProbabilitySampler(defaultSamplingProbability),
IDGenerator: gen,
MaxAttributesPerSpan: DefaultMaxAttributesPerSpan,
MaxAnnotationEventsPerSpan: DefaultMaxAnnotationEventsPerSpan,
MaxMessageEventsPerSpan: DefaultMaxMessageEventsPerSpan,
MaxLinksPerSpan: DefaultMaxLinksPerSpan,
})
}

View File

@ -20,12 +20,12 @@ import (
// Endpoint is Google's OAuth 2.0 endpoint.
var Endpoint = oauth2.Endpoint{
AuthURL: "https://accounts.google.com/o/oauth2/auth",
TokenURL: "https://accounts.google.com/o/oauth2/token",
TokenURL: "https://oauth2.googleapis.com/token",
AuthStyle: oauth2.AuthStyleInParams,
}
// JWTTokenURL is Google's OAuth 2.0 token URL to use with the JWT flow.
const JWTTokenURL = "https://accounts.google.com/o/oauth2/token"
const JWTTokenURL = "https://oauth2.googleapis.com/token"
// ConfigFromJSON uses a Google Developers Console client_credentials.json
// file to construct a config.

View File

@ -11,6 +11,7 @@ import (
"fmt"
"io"
"io/ioutil"
"math"
"mime"
"net/http"
"net/url"
@ -90,6 +91,9 @@ func (e *expirationTime) UnmarshalJSON(b []byte) error {
if err != nil {
return err
}
if i > math.MaxInt32 {
i = math.MaxInt32
}
*e = expirationTime(i)
return nil
}

View File

@ -188,7 +188,7 @@
]
},
"repair": {
"description": "Recreates the required App Engine features for the specified App Engine application, for example a Cloud Storage bucket or App Engine service account. Use this method if you receive an error message about a missing feature, for example, Error retrieving the App Engine service account.",
"description": "Recreates the required App Engine features for the specified App Engine application, for example a Cloud Storage bucket or App Engine service account. Use this method if you receive an error message about a missing feature, for example, Error retrieving the App Engine service account. If you have deleted your App Engine service account, this will not be able to recreate it. Instead, you should attempt to use the IAM undelete API if possible at https://cloud.google.com/iam/reference/rest/v1/projects.serviceAccounts/undelete?apix_params=%7B\"name\"%3A\"projects%2F-%2FserviceAccounts%2Funique_id\"%2C\"resource\"%3A%7B%7D%7D . If the deletion was recent, the numeric ID can be found in the Cloud Console Activity Log.",
"flatPath": "v1/apps/{appsId}:repair",
"httpMethod": "POST",
"id": "appengine.apps.repair",
@ -1572,7 +1572,7 @@
}
}
},
"revision": "20181218",
"revision": "20190411",
"rootUrl": "https://appengine.googleapis.com/",
"schemas": {
"ApiConfigHandler": {
@ -2173,6 +2173,10 @@
"splitHealthChecks": {
"description": "Boolean value indicating if split health checks should be used instead of the legacy health checks. At an app.yaml level, this means defaulting to 'readiness_check' and 'liveness_check' values instead of 'health_check' ones. Once the legacy 'health_check' behavior is deprecated, and this value is always true, this setting can be removed.",
"type": "boolean"
},
"useContainerOptimizedOs": {
"description": "If true, use Container-Optimized OS (https://cloud.google.com/container-optimized-os/) base image for VMs, rather than a base Debian image.",
"type": "boolean"
}
},
"type": "object"
@ -2711,6 +2715,10 @@
"description": "Google Compute Engine network where the virtual machines are created. Specify the short name, not the resource path.Defaults to default.",
"type": "string"
},
"sessionAffinity": {
"description": "Enable session affinity. Only applicable in the App Engine flexible environment.",
"type": "boolean"
},
"subnetworkName": {
"description": "Google Cloud Platform sub-network where the virtual machines are created. Specify the short name, not the resource path.If a subnetwork name is specified, a network name will also be required unless it is for the default network.\nIf the network that the instance is being created in is a Legacy network, then the IP address is allocated from the IPv4Range.\nIf the network that the instance is being created in is an auto Subnet Mode Network, then only network name should be specified (not the subnetwork_name) and the IP address is created from the IPCidrRange of the subnetwork that exists in that zone for that network.\nIf the network that the instance is being created in is a custom Subnet Mode Network, then the subnetwork_name must be specified and the IP address is created from the IPCidrRange of the subnetwork.If specified, the subnetwork must exist in the same region as the App Engine flexible environment application.",
"type": "string"
@ -2780,39 +2788,6 @@
},
"type": "object"
},
"OperationMetadata": {
"description": "Metadata for the given google.longrunning.Operation.",
"id": "OperationMetadata",
"properties": {
"endTime": {
"description": "Timestamp that this operation completed.@OutputOnly",
"format": "google-datetime",
"type": "string"
},
"insertTime": {
"description": "Timestamp that this operation was created.@OutputOnly",
"format": "google-datetime",
"type": "string"
},
"method": {
"description": "API method that initiated this operation. Example: google.appengine.v1beta4.Version.CreateVersion.@OutputOnly",
"type": "string"
},
"operationType": {
"description": "Type of this operation. Deprecated, use method field instead. Example: \"create_version\".@OutputOnly",
"type": "string"
},
"target": {
"description": "Name of the resource that this operation is acting on. Example: apps/myapp/modules/default.@OutputOnly",
"type": "string"
},
"user": {
"description": "User who requested this operation.@OutputOnly",
"type": "string"
}
},
"type": "object"
},
"OperationMetadataV1": {
"description": "Metadata for the given google.longrunning.Operation.",
"id": "OperationMetadataV1",
@ -2942,35 +2917,6 @@
},
"type": "object"
},
"OperationMetadataV1Beta5": {
"description": "Metadata for the given google.longrunning.Operation.",
"id": "OperationMetadataV1Beta5",
"properties": {
"endTime": {
"description": "Timestamp that this operation completed.@OutputOnly",
"format": "google-datetime",
"type": "string"
},
"insertTime": {
"description": "Timestamp that this operation was created.@OutputOnly",
"format": "google-datetime",
"type": "string"
},
"method": {
"description": "API method name that initiated this operation. Example: google.appengine.v1beta5.Version.CreateVersion.@OutputOnly",
"type": "string"
},
"target": {
"description": "Name of the resource that this operation is acting on. Example: apps/myapp/services/default.@OutputOnly",
"type": "string"
},
"user": {
"description": "User who requested this operation.@OutputOnly",
"type": "string"
}
},
"type": "object"
},
"ReadinessCheck": {
"description": "Readiness checking configuration for VM instances. Unhealthy instances are removed from traffic rotation.",
"id": "ReadinessCheck",
@ -3582,8 +3528,12 @@
"description": "Whether to deploy this version in a container on a virtual machine.",
"type": "boolean"
},
"vpcAccessConnector": {
"$ref": "VpcAccessConnector",
"description": "Enables VPC connectivity for standard apps."
},
"zones": {
"description": "The Google Compute Engine zones that are supported by this version in the App Engine flexible environment.",
"description": "The Google Compute Engine zones that are supported by this version in the App Engine flexible environment. Deprecated.",
"items": {
"type": "string"
},
@ -3612,6 +3562,17 @@
},
"type": "object"
},
"VpcAccessConnector": {
"description": "VPC access connector specification.",
"id": "VpcAccessConnector",
"properties": {
"name": {
"description": "Full Serverless VPC Access Connector name e.g. /projects/my-project/locations/us-central1/connectors/c1.",
"type": "string"
}
},
"type": "object"
},
"ZipInfo": {
"description": "The zip file information for a zip deployment.",
"id": "ZipInfo",

View File

@ -1,4 +1,4 @@
// Copyright 2018 Google Inc. All rights reserved.
// Copyright 2019 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
@ -6,13 +6,39 @@
// Package appengine provides access to the App Engine Admin API.
//
// See https://cloud.google.com/appengine/docs/admin-api/
// For product documentation, see: https://cloud.google.com/appengine/docs/admin-api/
//
// Creating a client
//
// Usage example:
//
// import "google.golang.org/api/appengine/v1"
// ...
// appengineService, err := appengine.New(oauthHttpClient)
// ctx := context.Background()
// appengineService, err := appengine.NewService(ctx)
//
// In this example, Google Application Default Credentials are used for authentication.
//
// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
//
// Other authentication options
//
// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
//
// appengineService, err := appengine.NewService(ctx, option.WithScopes(appengine.CloudPlatformReadOnlyScope))
//
// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
//
// appengineService, err := appengine.NewService(ctx, option.WithAPIKey("AIza..."))
//
// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
//
// config := &oauth2.Config{...}
// // ...
// token, err := config.Exchange(ctx, ...)
// appengineService, err := appengine.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See https://godoc.org/google.golang.org/api/option/ for details on options.
package appengine // import "google.golang.org/api/appengine/v1"
import (
@ -29,6 +55,8 @@ import (
gensupport "google.golang.org/api/gensupport"
googleapi "google.golang.org/api/googleapi"
option "google.golang.org/api/option"
htransport "google.golang.org/api/transport/http"
)
// Always reference these packages, just in case the auto-generated code
@ -62,6 +90,34 @@ const (
CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only"
)
// NewService creates a new APIService.
func NewService(ctx context.Context, opts ...option.ClientOption) (*APIService, error) {
scopesOption := option.WithScopes(
"https://www.googleapis.com/auth/appengine.admin",
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloud-platform.read-only",
)
// NOTE: prepend, so we don't override user-specified scopes.
opts = append([]option.ClientOption{scopesOption}, opts...)
client, endpoint, err := htransport.NewClient(ctx, opts...)
if err != nil {
return nil, err
}
s, err := New(client)
if err != nil {
return nil, err
}
if endpoint != "" {
s.BasePath = endpoint
}
return s, nil
}
// New creates a new APIService. It uses the provided http.Client for requests.
//
// Deprecated: please use NewService instead.
// To provide a custom HTTP client, use option.WithHTTPClient.
// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func New(client *http.Client) (*APIService, error) {
if client == nil {
return nil, errors.New("client is nil")
@ -1304,6 +1360,11 @@ type FeatureSettings struct {
// always true, this setting can be removed.
SplitHealthChecks bool `json:"splitHealthChecks,omitempty"`
// UseContainerOptimizedOs: If true, use Container-Optimized OS
// (https://cloud.google.com/container-optimized-os/) base image for
// VMs, rather than a base Debian image.
UseContainerOptimizedOs bool `json:"useContainerOptimizedOs,omitempty"`
// ForceSendFields is a list of field names (e.g. "SplitHealthChecks")
// to unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
@ -2252,6 +2313,10 @@ type Network struct {
// default.
Name string `json:"name,omitempty"`
// SessionAffinity: Enable session affinity. Only applicable in the App
// Engine flexible environment.
SessionAffinity bool `json:"sessionAffinity,omitempty"`
// SubnetworkName: Google Cloud Platform sub-network where the virtual
// machines are created. Specify the short name, not the resource
// path.If a subnetwork name is specified, a network name will also be
@ -2395,53 +2460,6 @@ func (s *Operation) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// OperationMetadata: Metadata for the given
// google.longrunning.Operation.
type OperationMetadata struct {
// EndTime: Timestamp that this operation completed.@OutputOnly
EndTime string `json:"endTime,omitempty"`
// InsertTime: Timestamp that this operation was created.@OutputOnly
InsertTime string `json:"insertTime,omitempty"`
// Method: API method that initiated this operation. Example:
// google.appengine.v1beta4.Version.CreateVersion.@OutputOnly
Method string `json:"method,omitempty"`
// OperationType: Type of this operation. Deprecated, use method field
// instead. Example: "create_version".@OutputOnly
OperationType string `json:"operationType,omitempty"`
// Target: Name of the resource that this operation is acting on.
// Example: apps/myapp/modules/default.@OutputOnly
Target string `json:"target,omitempty"`
// User: User who requested this operation.@OutputOnly
User string `json:"user,omitempty"`
// ForceSendFields is a list of field names (e.g. "EndTime") 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. "EndTime") 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 *OperationMetadata) MarshalJSON() ([]byte, error) {
type NoMethod OperationMetadata
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// OperationMetadataV1: Metadata for the given
// google.longrunning.Operation.
type OperationMetadataV1 struct {
@ -2607,49 +2625,6 @@ func (s *OperationMetadataV1Beta) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// OperationMetadataV1Beta5: Metadata for the given
// google.longrunning.Operation.
type OperationMetadataV1Beta5 struct {
// EndTime: Timestamp that this operation completed.@OutputOnly
EndTime string `json:"endTime,omitempty"`
// InsertTime: Timestamp that this operation was created.@OutputOnly
InsertTime string `json:"insertTime,omitempty"`
// Method: API method name that initiated this operation. Example:
// google.appengine.v1beta5.Version.CreateVersion.@OutputOnly
Method string `json:"method,omitempty"`
// Target: Name of the resource that this operation is acting on.
// Example: apps/myapp/services/default.@OutputOnly
Target string `json:"target,omitempty"`
// User: User who requested this operation.@OutputOnly
User string `json:"user,omitempty"`
// ForceSendFields is a list of field names (e.g. "EndTime") 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. "EndTime") 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 *OperationMetadataV1Beta5) MarshalJSON() ([]byte, error) {
type NoMethod OperationMetadataV1Beta5
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ReadinessCheck: Readiness checking configuration for VM instances.
// Unhealthy instances are removed from traffic rotation.
type ReadinessCheck struct {
@ -3562,8 +3537,11 @@ type Version struct {
// machine.
Vm bool `json:"vm,omitempty"`
// VpcAccessConnector: Enables VPC connectivity for standard apps.
VpcAccessConnector *VpcAccessConnector `json:"vpcAccessConnector,omitempty"`
// Zones: The Google Compute Engine zones that are supported by this
// version in the App Engine flexible environment.
// version in the App Engine flexible environment. Deprecated.
Zones []string `json:"zones,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
@ -3642,6 +3620,35 @@ func (s *Volume) UnmarshalJSON(data []byte) error {
return nil
}
// VpcAccessConnector: VPC access connector specification.
type VpcAccessConnector struct {
// Name: Full Serverless VPC Access Connector name e.g.
// /projects/my-project/locations/us-central1/connectors/c1.
Name string `json:"name,omitempty"`
// ForceSendFields is a list of field names (e.g. "Name") 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. "Name") 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 *VpcAccessConnector) MarshalJSON() ([]byte, error) {
type NoMethod VpcAccessConnector
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ZipInfo: The zip file information for a zip deployment.
type ZipInfo struct {
// FilesCount: An estimate of the number of files in a zip for a zip
@ -4124,7 +4131,11 @@ type AppsRepairCall struct {
// App Engine application, for example a Cloud Storage bucket or App
// Engine service account. Use this method if you receive an error
// message about a missing feature, for example, Error retrieving the
// App Engine service account.
// App Engine service account. If you have deleted your App Engine
// service account, this will not be able to recreate it. Instead, you
// should attempt to use the IAM undelete API if possible at
// https://cloud.google.com/iam/reference/rest/v1/projects.serviceAccounts/undelete?apix_params=%7B"name"%3A"projects%2F-%2FserviceAccounts%2Funique_id"%2C"resource"%3A%7B%7D%7D . If the deletion was recent, the numeric ID can be found in the Cloud Console Activity
// Log.
func (r *AppsService) Repair(appsId string, repairapplicationrequest *RepairApplicationRequest) *AppsRepairCall {
c := &AppsRepairCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.appsId = appsId
@ -4222,7 +4233,7 @@ func (c *AppsRepairCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
}
return ret, nil
// {
// "description": "Recreates the required App Engine features for the specified App Engine application, for example a Cloud Storage bucket or App Engine service account. Use this method if you receive an error message about a missing feature, for example, Error retrieving the App Engine service account.",
// "description": "Recreates the required App Engine features for the specified App Engine application, for example a Cloud Storage bucket or App Engine service account. Use this method if you receive an error message about a missing feature, for example, Error retrieving the App Engine service account. If you have deleted your App Engine service account, this will not be able to recreate it. Instead, you should attempt to use the IAM undelete API if possible at https://cloud.google.com/iam/reference/rest/v1/projects.serviceAccounts/undelete?apix_params=%7B\"name\"%3A\"projects%2F-%2FserviceAccounts%2Funique_id\"%2C\"resource\"%3A%7B%7D%7D . If the deletion was recent, the numeric ID can be found in the Cloud Console Activity Log.",
// "flatPath": "v1/apps/{appsId}:repair",
// "httpMethod": "POST",
// "id": "appengine.apps.repair",

View File

@ -32,7 +32,7 @@
"description": "A data platform for customers to create, manage, share and query data.",
"discoveryVersion": "v1",
"documentationLink": "https://cloud.google.com/bigquery/",
"etag": "\"J3WqvAcMk4eQjJXvfSI4Yr8VouA/eFeCSA4VWy7K7nrpB2R4OL12KqY\"",
"etag": "\"VPK3KBfpaEgZ16pozGOoMYfKc0U/a2nlJZeJWR_msdw4HiE_dxM8apw\"",
"icons": {
"x16": "https://www.google.com/images/icons/product/search-16.gif",
"x32": "https://www.google.com/images/icons/product/search-32.gif"
@ -998,7 +998,7 @@
}
}
},
"revision": "20181216",
"revision": "20190308",
"rootUrl": "https://www.googleapis.com/",
"schemas": {
"BigQueryModelTraining": {
@ -1097,6 +1097,98 @@
},
"type": "object"
},
"BqmlIterationResult": {
"id": "BqmlIterationResult",
"properties": {
"durationMs": {
"description": "[Output-only, Beta] Time taken to run the training iteration in milliseconds.",
"format": "int64",
"type": "string"
},
"evalLoss": {
"description": "[Output-only, Beta] Eval loss computed on the eval data at the end of the iteration. The eval loss is used for early stopping to avoid overfitting. No eval loss if eval_split_method option is specified as no_split or auto_split with input data size less than 500 rows.",
"format": "double",
"type": "number"
},
"index": {
"description": "[Output-only, Beta] Index of the ML training iteration, starting from zero for each training run.",
"format": "int32",
"type": "integer"
},
"learnRate": {
"description": "[Output-only, Beta] Learning rate used for this iteration, it varies for different training iterations if learn_rate_strategy option is not constant.",
"format": "double",
"type": "number"
},
"trainingLoss": {
"description": "[Output-only, Beta] Training loss computed on the training data at the end of the iteration. The training loss function is defined by model type.",
"format": "double",
"type": "number"
}
},
"type": "object"
},
"BqmlTrainingRun": {
"id": "BqmlTrainingRun",
"properties": {
"iterationResults": {
"description": "[Output-only, Beta] List of each iteration results.",
"items": {
"$ref": "BqmlIterationResult"
},
"type": "array"
},
"startTime": {
"description": "[Output-only, Beta] Training run start time in milliseconds since the epoch.",
"format": "date-time",
"type": "string"
},
"state": {
"description": "[Output-only, Beta] Different state applicable for a training run. IN PROGRESS: Training run is in progress. FAILED: Training run ended due to a non-retryable failure. SUCCEEDED: Training run successfully completed. CANCELLED: Training run cancelled by the user.",
"type": "string"
},
"trainingOptions": {
"description": "[Output-only, Beta] Training options used by this training run. These options are mutable for subsequent training runs. Default values are explicitly stored for options not specified in the input query of the first training run. For subsequent training runs, any option not explicitly specified in the input query will be copied from the previous training run.",
"properties": {
"earlyStop": {
"type": "boolean"
},
"l1Reg": {
"format": "double",
"type": "number"
},
"l2Reg": {
"format": "double",
"type": "number"
},
"learnRate": {
"format": "double",
"type": "number"
},
"learnRateStrategy": {
"type": "string"
},
"lineSearchInitLearnRate": {
"format": "double",
"type": "number"
},
"maxIteration": {
"format": "int64",
"type": "string"
},
"minRelProgress": {
"format": "double",
"type": "number"
},
"warmStart": {
"type": "boolean"
}
},
"type": "object"
}
},
"type": "object"
},
"Clustering": {
"id": "Clustering",
"properties": {
@ -1151,23 +1243,27 @@
"items": {
"properties": {
"domain": {
"description": "[Pick one] A domain to grant access to. Any users signed in with the domain specified will be granted the specified access. Example: \"example.com\".",
"description": "[Pick one] A domain to grant access to. Any users signed in with the domain specified will be granted the specified access. Example: \"example.com\". Maps to IAM policy member \"domain:DOMAIN\".",
"type": "string"
},
"groupByEmail": {
"description": "[Pick one] An email address of a Google Group to grant access to.",
"description": "[Pick one] An email address of a Google Group to grant access to. Maps to IAM policy member \"group:GROUP\".",
"type": "string"
},
"iamMember": {
"description": "[Pick one] Some other type of member that appears in the IAM Policy but isn't a user, group, domain, or special group.",
"type": "string"
},
"role": {
"description": "[Required] Describes the rights granted to the user specified by the other member of the access object. The following string values are supported: READER, WRITER, OWNER.",
"description": "[Required] An IAM role ID that should be granted to the user, group, or domain specified in this access entry. The following legacy mappings will be applied: OWNER roles/bigquery.dataOwner WRITER roles/bigquery.dataEditor READER roles/bigquery.dataViewer This field will accept any of the above formats, but will return only the legacy format. For example, if you set this field to \"roles/bigquery.dataOwner\", it will be returned back as \"OWNER\".",
"type": "string"
},
"specialGroup": {
"description": "[Pick one] A special group to grant access to. Possible values include: projectOwners: Owners of the enclosing project. projectReaders: Readers of the enclosing project. projectWriters: Writers of the enclosing project. allAuthenticatedUsers: All authenticated BigQuery users.",
"description": "[Pick one] A special group to grant access to. Possible values include: projectOwners: Owners of the enclosing project. projectReaders: Readers of the enclosing project. projectWriters: Writers of the enclosing project. allAuthenticatedUsers: All authenticated BigQuery users. Maps to similarly-named IAM members.",
"type": "string"
},
"userByEmail": {
"description": "[Pick one] An email address of a user to grant access to. For example: fred@example.com.",
"description": "[Pick one] An email address of a user to grant access to. For example: fred@example.com. Maps to IAM policy member \"user:EMAIL\" or \"serviceAccount:EMAIL\".",
"type": "string"
},
"view": {
@ -1332,6 +1428,13 @@
"friendlyName": {
"description": "[Optional] The friendly name for the destination table. This will only be used if the destination table is newly created. If the table already exists and a value different than the current friendly name is provided, the job will fail.",
"type": "string"
},
"labels": {
"additionalProperties": {
"type": "string"
},
"description": "[Optional] The labels associated with this table. You can use these to organize and group your tables. This will only be used if the destination table is newly created. If the table already exists and labels are different than the current labels are provided, the job will fail.",
"type": "object"
}
},
"type": "object"
@ -1562,6 +1665,10 @@
"$ref": "GoogleSheetsOptions",
"description": "[Optional] Additional options if sourceFormat is set to GOOGLE_SHEETS."
},
"hivePartitioningMode": {
"description": "[Optional, Experimental] If hive partitioning is enabled, which mode to use. Two modes are supported: - AUTO: automatically infer partition key name(s) and type(s). - STRINGS: automatic infer partition key name(s). All types are strings. Not all storage formats support hive partitioning -- requesting hive partitioning on an unsupported format will lead to an error.",
"type": "string"
},
"ignoreUnknownValues": {
"description": "[Optional] Indicates if BigQuery should allow extra values that are not represented in the table schema. If true, the extra values are ignored. If false, records with extra columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. The default value is false. The sourceFormat property determines what BigQuery treats as an extra value: CSV: Trailing columns JSON: Named values that don't match any column names Google Cloud Bigtable: This setting is ignored. Google Cloud Datastore backups: This setting is ignored. Avro: This setting is ignored.",
"type": "boolean"
@ -1683,37 +1790,6 @@
},
"type": "object"
},
"IterationResult": {
"id": "IterationResult",
"properties": {
"durationMs": {
"description": "[Output-only, Beta] Time taken to run the training iteration in milliseconds.",
"format": "int64",
"type": "string"
},
"evalLoss": {
"description": "[Output-only, Beta] Eval loss computed on the eval data at the end of the iteration. The eval loss is used for early stopping to avoid overfitting. No eval loss if eval_split_method option is specified as no_split or auto_split with input data size less than 500 rows.",
"format": "double",
"type": "number"
},
"index": {
"description": "[Output-only, Beta] Index of the ML training iteration, starting from zero for each training run.",
"format": "int32",
"type": "integer"
},
"learnRate": {
"description": "[Output-only, Beta] Learning rate used for this iteration, it varies for different training iterations if learn_rate_strategy option is not constant.",
"format": "double",
"type": "number"
},
"trainingLoss": {
"description": "[Output-only, Beta] Training loss computed on the training data at the end of the iteration. The training loss function is defined by model type.",
"format": "double",
"type": "number"
}
},
"type": "object"
},
"Job": {
"id": "Job",
"properties": {
@ -1895,6 +1971,10 @@
"description": "[Optional] The separator for fields in a CSV file. The separator can be any ISO-8859-1 single-byte character. To use a character in the range 128-255, you must encode the character as UTF8. BigQuery converts the string to ISO-8859-1 encoding, and then uses the first byte of the encoded string to split the data in its raw, binary state. BigQuery also supports the escape sequence \"\\t\" to specify a tab separator. The default value is a comma (',').",
"type": "string"
},
"hivePartitioningMode": {
"description": "[Optional, Experimental] If hive partitioning is enabled, which mode to use. Two modes are supported: - AUTO: automatically infer partition key name(s) and type(s). - STRINGS: automatic infer partition key name(s). All types are strings. Not all storage formats support hive partitioning -- requesting hive partitioning on an unsupported format will lead to an error.",
"type": "string"
},
"ignoreUnknownValues": {
"description": "[Optional] Indicates if BigQuery should allow extra values that are not represented in the table schema. If true, the extra values are ignored. If false, records with extra columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. The default value is false. The sourceFormat property determines what BigQuery treats as an extra value: CSV: Trailing columns JSON: Named values that don't match any column names",
"type": "boolean"
@ -2240,6 +2320,15 @@
"$ref": "JobStatistics3",
"description": "[Output-only] Statistics for a load job."
},
"numChildJobs": {
"description": "[Output-only] Number of child jobs executed.",
"format": "int64",
"type": "string"
},
"parentJobId": {
"description": "[Output-only] If this is a child job, the id of the parent.",
"type": "string"
},
"query": {
"$ref": "JobStatistics2",
"description": "[Output-only] Statistics for a query job."
@ -2303,6 +2392,10 @@
"description": "The DDL operation performed, possibly dependent on the pre-existence of the DDL target. Possible values (new values might be added in the future): \"CREATE\": The query created the DDL target. \"SKIP\": No-op. Example cases: the query is CREATE TABLE IF NOT EXISTS while the table already exists, or the query is DROP TABLE IF EXISTS while the table does not exist. \"REPLACE\": The query replaced the DDL target. Example case: the query is CREATE OR REPLACE TABLE, and the table already exists. \"DROP\": The query deleted the DDL target.",
"type": "string"
},
"ddlTargetRoutine": {
"$ref": "RoutineReference",
"description": "The DDL target routine. Present only for CREATE/DROP FUNCTION/PROCEDURE queries."
},
"ddlTargetTable": {
"$ref": "TableReference",
"description": "The DDL target table. Present only for CREATE/DROP TABLE/VIEW queries."
@ -2368,7 +2461,7 @@
"description": "[Output-only] The schema of the results. Present only for successful dry run of non-legacy SQL queries."
},
"statementType": {
"description": "The type of query statement, if valid. Possible values (new values might be added in the future): \"SELECT\": SELECT query. \"INSERT\": INSERT query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. \"UPDATE\": UPDATE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. \"DELETE\": DELETE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. \"MERGE\": MERGE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. \"CREATE_TABLE\": CREATE [OR REPLACE] TABLE without AS SELECT. \"CREATE_TABLE_AS_SELECT\": CREATE [OR REPLACE] TABLE ... AS SELECT ... . \"DROP_TABLE\": DROP TABLE query. \"CREATE_VIEW\": CREATE [OR REPLACE] VIEW ... AS SELECT ... . \"DROP_VIEW\": DROP VIEW query. \"ALTER_TABLE\": ALTER TABLE query. \"ALTER_VIEW\": ALTER VIEW query.",
"description": "The type of query statement, if valid. Possible values (new values might be added in the future): \"SELECT\": SELECT query. \"INSERT\": INSERT query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. \"UPDATE\": UPDATE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. \"DELETE\": DELETE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. \"MERGE\": MERGE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. \"CREATE_TABLE\": CREATE [OR REPLACE] TABLE without AS SELECT. \"CREATE_TABLE_AS_SELECT\": CREATE [OR REPLACE] TABLE ... AS SELECT ... . \"DROP_TABLE\": DROP TABLE query. \"CREATE_VIEW\": CREATE [OR REPLACE] VIEW ... AS SELECT ... . \"DROP_VIEW\": DROP VIEW query. \"CREATE_FUNCTION\": CREATE FUNCTION query. \"DROP_FUNCTION\" : DROP FUNCTION query. \"ALTER_TABLE\": ALTER TABLE query. \"ALTER_VIEW\": ALTER VIEW query.",
"type": "string"
},
"timeline": {
@ -2389,7 +2482,7 @@
"type": "string"
},
"totalBytesProcessedAccuracy": {
"description": "[Output-only] For dry-run jobs, totalBytesProcessed is an estimate and this field specifies the accuracy of the estimate. Possible values can be: UNKNOWN: accuracy of the estimate is unknown. PRECISE: estimate is precise. LOWER_BOUND: estimate is lower bound of what the query would cost. UPPER_BOUND: estiamte is upper bound of what the query would cost.",
"description": "[Output-only] For dry-run jobs, totalBytesProcessed is an estimate and this field specifies the accuracy of the estimate. Possible values can be: UNKNOWN: accuracy of the estimate is unknown. PRECISE: estimate is precise. LOWER_BOUND: estimate is lower bound of what the query would cost. UPPER_BOUND: estimate is upper bound of what the query would cost.",
"type": "string"
},
"totalPartitionsProcessed": {
@ -2453,6 +2546,11 @@
"type": "string"
},
"type": "array"
},
"inputBytes": {
"description": "[Output-only] Number of user bytes extracted into the result. This is the byte count as computed by BigQuery for billing purposes.",
"format": "int64",
"type": "string"
}
},
"type": "object"
@ -2529,7 +2627,7 @@
"trainingRuns": {
"description": "[Output-only, Beta] Information about ml training runs, each training run comprises of multiple iterations and there may be multiple training runs for the model if warm start is used or if a user decides to continue a previously cancelled query.",
"items": {
"$ref": "TrainingRun"
"$ref": "BqmlTrainingRun"
},
"type": "array"
}
@ -2867,6 +2965,24 @@
},
"type": "object"
},
"RoutineReference": {
"id": "RoutineReference",
"properties": {
"datasetId": {
"description": "[Required] The ID of the dataset containing this routine.",
"type": "string"
},
"projectId": {
"description": "[Required] The ID of the project containing this routine.",
"type": "string"
},
"routineId": {
"description": "[Required] The ID of the routine. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 256 characters.",
"type": "string"
}
},
"type": "object"
},
"Streamingbuffer": {
"id": "Streamingbuffer",
"properties": {
@ -3133,6 +3249,19 @@
"TableFieldSchema": {
"id": "TableFieldSchema",
"properties": {
"categories": {
"description": "[Optional] The categories attached to this field, used for field-level access control.",
"properties": {
"names": {
"description": "A list of category resource names. For example, \"projects/1/taxonomies/2/categories/3\". At most 5 categories are allowed.",
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"description": {
"description": "[Optional] The field description. The maximum length is 1,024 characters.",
"type": "string"
@ -3320,8 +3449,6 @@
"type": "string"
},
"requirePartitionFilter": {
"default": "false",
"description": "[Beta] [Optional] If set to true, queries over this table require a partition filter that can be used for partition elimination to be specified.",
"type": "boolean"
},
"type": {
@ -3331,67 +3458,6 @@
},
"type": "object"
},
"TrainingRun": {
"id": "TrainingRun",
"properties": {
"iterationResults": {
"description": "[Output-only, Beta] List of each iteration results.",
"items": {
"$ref": "IterationResult"
},
"type": "array"
},
"startTime": {
"description": "[Output-only, Beta] Training run start time in milliseconds since the epoch.",
"format": "date-time",
"type": "string"
},
"state": {
"description": "[Output-only, Beta] Different state applicable for a training run. IN PROGRESS: Training run is in progress. FAILED: Training run ended due to a non-retryable failure. SUCCEEDED: Training run successfully completed. CANCELLED: Training run cancelled by the user.",
"type": "string"
},
"trainingOptions": {
"description": "[Output-only, Beta] Training options used by this training run. These options are mutable for subsequent training runs. Default values are explicitly stored for options not specified in the input query of the first training run. For subsequent training runs, any option not explicitly specified in the input query will be copied from the previous training run.",
"properties": {
"earlyStop": {
"type": "boolean"
},
"l1Reg": {
"format": "double",
"type": "number"
},
"l2Reg": {
"format": "double",
"type": "number"
},
"learnRate": {
"format": "double",
"type": "number"
},
"learnRateStrategy": {
"type": "string"
},
"lineSearchInitLearnRate": {
"format": "double",
"type": "number"
},
"maxIteration": {
"format": "int64",
"type": "string"
},
"minRelProgress": {
"format": "double",
"type": "number"
},
"warmStart": {
"type": "boolean"
}
},
"type": "object"
}
},
"type": "object"
},
"UserDefinedFunctionResource": {
"id": "UserDefinedFunctionResource",
"properties": {

View File

@ -1,4 +1,4 @@
// Copyright 2018 Google Inc. All rights reserved.
// Copyright 2019 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
@ -8,13 +8,39 @@
//
// This package is DEPRECATED. Use package cloud.google.com/go/bigquery instead.
//
// See https://cloud.google.com/bigquery/
// For product documentation, see: https://cloud.google.com/bigquery/
//
// Creating a client
//
// Usage example:
//
// import "google.golang.org/api/bigquery/v2"
// ...
// bigqueryService, err := bigquery.New(oauthHttpClient)
// ctx := context.Background()
// bigqueryService, err := bigquery.NewService(ctx)
//
// In this example, Google Application Default Credentials are used for authentication.
//
// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
//
// Other authentication options
//
// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
//
// bigqueryService, err := bigquery.NewService(ctx, option.WithScopes(bigquery.DevstorageReadWriteScope))
//
// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
//
// bigqueryService, err := bigquery.NewService(ctx, option.WithAPIKey("AIza..."))
//
// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
//
// config := &oauth2.Config{...}
// // ...
// token, err := config.Exchange(ctx, ...)
// bigqueryService, err := bigquery.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See https://godoc.org/google.golang.org/api/option/ for details on options.
package bigquery // import "google.golang.org/api/bigquery/v2"
import (
@ -31,6 +57,8 @@ import (
gensupport "google.golang.org/api/gensupport"
googleapi "google.golang.org/api/googleapi"
option "google.golang.org/api/option"
htransport "google.golang.org/api/transport/http"
)
// Always reference these packages, just in case the auto-generated code
@ -76,6 +104,38 @@ const (
DevstorageReadWriteScope = "https://www.googleapis.com/auth/devstorage.read_write"
)
// NewService creates a new Service.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
scopesOption := option.WithScopes(
"https://www.googleapis.com/auth/bigquery",
"https://www.googleapis.com/auth/bigquery.insertdata",
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloud-platform.read-only",
"https://www.googleapis.com/auth/devstorage.full_control",
"https://www.googleapis.com/auth/devstorage.read_only",
"https://www.googleapis.com/auth/devstorage.read_write",
)
// NOTE: prepend, so we don't override user-specified scopes.
opts = append([]option.ClientOption{scopesOption}, opts...)
client, endpoint, err := htransport.NewClient(ctx, opts...)
if err != nil {
return nil, err
}
s, err := New(client)
if err != nil {
return nil, err
}
if endpoint != "" {
s.BasePath = endpoint
}
return s, nil
}
// New creates a new Service. It uses the provided http.Client for requests.
//
// Deprecated: please use NewService instead.
// To provide a custom HTTP client, use option.WithHTTPClient.
// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
@ -362,6 +422,190 @@ func (s *BigtableOptions) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
type BqmlIterationResult struct {
// DurationMs: [Output-only, Beta] Time taken to run the training
// iteration in milliseconds.
DurationMs int64 `json:"durationMs,omitempty,string"`
// EvalLoss: [Output-only, Beta] Eval loss computed on the eval data at
// the end of the iteration. The eval loss is used for early stopping to
// avoid overfitting. No eval loss if eval_split_method option is
// specified as no_split or auto_split with input data size less than
// 500 rows.
EvalLoss float64 `json:"evalLoss,omitempty"`
// Index: [Output-only, Beta] Index of the ML training iteration,
// starting from zero for each training run.
Index int64 `json:"index,omitempty"`
// LearnRate: [Output-only, Beta] Learning rate used for this iteration,
// it varies for different training iterations if learn_rate_strategy
// option is not constant.
LearnRate float64 `json:"learnRate,omitempty"`
// TrainingLoss: [Output-only, Beta] Training loss computed on the
// training data at the end of the iteration. The training loss function
// is defined by model type.
TrainingLoss float64 `json:"trainingLoss,omitempty"`
// ForceSendFields is a list of field names (e.g. "DurationMs") 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. "DurationMs") 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 *BqmlIterationResult) MarshalJSON() ([]byte, error) {
type NoMethod BqmlIterationResult
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
func (s *BqmlIterationResult) UnmarshalJSON(data []byte) error {
type NoMethod BqmlIterationResult
var s1 struct {
EvalLoss gensupport.JSONFloat64 `json:"evalLoss"`
LearnRate gensupport.JSONFloat64 `json:"learnRate"`
TrainingLoss gensupport.JSONFloat64 `json:"trainingLoss"`
*NoMethod
}
s1.NoMethod = (*NoMethod)(s)
if err := json.Unmarshal(data, &s1); err != nil {
return err
}
s.EvalLoss = float64(s1.EvalLoss)
s.LearnRate = float64(s1.LearnRate)
s.TrainingLoss = float64(s1.TrainingLoss)
return nil
}
type BqmlTrainingRun struct {
// IterationResults: [Output-only, Beta] List of each iteration results.
IterationResults []*BqmlIterationResult `json:"iterationResults,omitempty"`
// StartTime: [Output-only, Beta] Training run start time in
// milliseconds since the epoch.
StartTime string `json:"startTime,omitempty"`
// State: [Output-only, Beta] Different state applicable for a training
// run. IN PROGRESS: Training run is in progress. FAILED: Training run
// ended due to a non-retryable failure. SUCCEEDED: Training run
// successfully completed. CANCELLED: Training run cancelled by the
// user.
State string `json:"state,omitempty"`
// TrainingOptions: [Output-only, Beta] Training options used by this
// training run. These options are mutable for subsequent training runs.
// Default values are explicitly stored for options not specified in the
// input query of the first training run. For subsequent training runs,
// any option not explicitly specified in the input query will be copied
// from the previous training run.
TrainingOptions *BqmlTrainingRunTrainingOptions `json:"trainingOptions,omitempty"`
// ForceSendFields is a list of field names (e.g. "IterationResults") 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. "IterationResults") 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 *BqmlTrainingRun) MarshalJSON() ([]byte, error) {
type NoMethod BqmlTrainingRun
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BqmlTrainingRunTrainingOptions: [Output-only, Beta] Training options
// used by this training run. These options are mutable for subsequent
// training runs. Default values are explicitly stored for options not
// specified in the input query of the first training run. For
// subsequent training runs, any option not explicitly specified in the
// input query will be copied from the previous training run.
type BqmlTrainingRunTrainingOptions struct {
EarlyStop bool `json:"earlyStop,omitempty"`
L1Reg float64 `json:"l1Reg,omitempty"`
L2Reg float64 `json:"l2Reg,omitempty"`
LearnRate float64 `json:"learnRate,omitempty"`
LearnRateStrategy string `json:"learnRateStrategy,omitempty"`
LineSearchInitLearnRate float64 `json:"lineSearchInitLearnRate,omitempty"`
MaxIteration int64 `json:"maxIteration,omitempty,string"`
MinRelProgress float64 `json:"minRelProgress,omitempty"`
WarmStart bool `json:"warmStart,omitempty"`
// ForceSendFields is a list of field names (e.g. "EarlyStop") 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. "EarlyStop") 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 *BqmlTrainingRunTrainingOptions) MarshalJSON() ([]byte, error) {
type NoMethod BqmlTrainingRunTrainingOptions
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
func (s *BqmlTrainingRunTrainingOptions) UnmarshalJSON(data []byte) error {
type NoMethod BqmlTrainingRunTrainingOptions
var s1 struct {
L1Reg gensupport.JSONFloat64 `json:"l1Reg"`
L2Reg gensupport.JSONFloat64 `json:"l2Reg"`
LearnRate gensupport.JSONFloat64 `json:"learnRate"`
LineSearchInitLearnRate gensupport.JSONFloat64 `json:"lineSearchInitLearnRate"`
MinRelProgress gensupport.JSONFloat64 `json:"minRelProgress"`
*NoMethod
}
s1.NoMethod = (*NoMethod)(s)
if err := json.Unmarshal(data, &s1); err != nil {
return err
}
s.L1Reg = float64(s1.L1Reg)
s.L2Reg = float64(s1.L2Reg)
s.LearnRate = float64(s1.LearnRate)
s.LineSearchInitLearnRate = float64(s1.LineSearchInitLearnRate)
s.MinRelProgress = float64(s1.MinRelProgress)
return nil
}
type Clustering struct {
// Fields: [Repeated] One or more fields on which data should be
// clustered. Only top-level, non-repeated, simple-type fields are
@ -577,27 +821,36 @@ func (s *Dataset) MarshalJSON() ([]byte, error) {
type DatasetAccess struct {
// Domain: [Pick one] A domain to grant access to. Any users signed in
// with the domain specified will be granted the specified access.
// Example: "example.com".
// Example: "example.com". Maps to IAM policy member "domain:DOMAIN".
Domain string `json:"domain,omitempty"`
// GroupByEmail: [Pick one] An email address of a Google Group to grant
// access to.
// access to. Maps to IAM policy member "group:GROUP".
GroupByEmail string `json:"groupByEmail,omitempty"`
// Role: [Required] Describes the rights granted to the user specified
// by the other member of the access object. The following string values
// are supported: READER, WRITER, OWNER.
// IamMember: [Pick one] Some other type of member that appears in the
// IAM Policy but isn't a user, group, domain, or special group.
IamMember string `json:"iamMember,omitempty"`
// Role: [Required] An IAM role ID that should be granted to the user,
// group, or domain specified in this access entry. The following legacy
// mappings will be applied: OWNER roles/bigquery.dataOwner WRITER
// roles/bigquery.dataEditor READER roles/bigquery.dataViewer This
// field will accept any of the above formats, but will return only the
// legacy format. For example, if you set this field to
// "roles/bigquery.dataOwner", it will be returned back as "OWNER".
Role string `json:"role,omitempty"`
// SpecialGroup: [Pick one] A special group to grant access to. Possible
// values include: projectOwners: Owners of the enclosing project.
// projectReaders: Readers of the enclosing project. projectWriters:
// Writers of the enclosing project. allAuthenticatedUsers: All
// authenticated BigQuery users.
// authenticated BigQuery users. Maps to similarly-named IAM members.
SpecialGroup string `json:"specialGroup,omitempty"`
// UserByEmail: [Pick one] An email address of a user to grant access
// to. For example: fred@example.com.
// to. For example: fred@example.com. Maps to IAM policy member
// "user:EMAIL" or "serviceAccount:EMAIL".
UserByEmail string `json:"userByEmail,omitempty"`
// View: [Pick one] A view from a different dataset to grant access to.
@ -767,6 +1020,13 @@ type DestinationTableProperties struct {
// friendly name is provided, the job will fail.
FriendlyName string `json:"friendlyName,omitempty"`
// Labels: [Optional] The labels associated with this table. You can use
// these to organize and group your tables. This will only be used if
// the destination table is newly created. If the table already exists
// and labels are different than the current labels are provided, the
// job will fail.
Labels map[string]string `json:"labels,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,
@ -1065,6 +1325,14 @@ type ExternalDataConfiguration struct {
// set to GOOGLE_SHEETS.
GoogleSheetsOptions *GoogleSheetsOptions `json:"googleSheetsOptions,omitempty"`
// HivePartitioningMode: [Optional, Experimental] If hive partitioning
// is enabled, which mode to use. Two modes are supported: - AUTO:
// automatically infer partition key name(s) and type(s). - STRINGS:
// automatic infer partition key name(s). All types are strings. Not all
// storage formats support hive partitioning -- requesting hive
// partitioning on an unsupported format will lead to an error.
HivePartitioningMode string `json:"hivePartitioningMode,omitempty"`
// IgnoreUnknownValues: [Optional] Indicates if BigQuery should allow
// extra values that are not represented in the table schema. If true,
// the extra values are ignored. If false, records with extra columns
@ -1295,73 +1563,6 @@ func (s *GoogleSheetsOptions) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
type IterationResult struct {
// DurationMs: [Output-only, Beta] Time taken to run the training
// iteration in milliseconds.
DurationMs int64 `json:"durationMs,omitempty,string"`
// EvalLoss: [Output-only, Beta] Eval loss computed on the eval data at
// the end of the iteration. The eval loss is used for early stopping to
// avoid overfitting. No eval loss if eval_split_method option is
// specified as no_split or auto_split with input data size less than
// 500 rows.
EvalLoss float64 `json:"evalLoss,omitempty"`
// Index: [Output-only, Beta] Index of the ML training iteration,
// starting from zero for each training run.
Index int64 `json:"index,omitempty"`
// LearnRate: [Output-only, Beta] Learning rate used for this iteration,
// it varies for different training iterations if learn_rate_strategy
// option is not constant.
LearnRate float64 `json:"learnRate,omitempty"`
// TrainingLoss: [Output-only, Beta] Training loss computed on the
// training data at the end of the iteration. The training loss function
// is defined by model type.
TrainingLoss float64 `json:"trainingLoss,omitempty"`
// ForceSendFields is a list of field names (e.g. "DurationMs") 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. "DurationMs") 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 *IterationResult) MarshalJSON() ([]byte, error) {
type NoMethod IterationResult
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
func (s *IterationResult) UnmarshalJSON(data []byte) error {
type NoMethod IterationResult
var s1 struct {
EvalLoss gensupport.JSONFloat64 `json:"evalLoss"`
LearnRate gensupport.JSONFloat64 `json:"learnRate"`
TrainingLoss gensupport.JSONFloat64 `json:"trainingLoss"`
*NoMethod
}
s1.NoMethod = (*NoMethod)(s)
if err := json.Unmarshal(data, &s1); err != nil {
return err
}
s.EvalLoss = float64(s1.EvalLoss)
s.LearnRate = float64(s1.LearnRate)
s.TrainingLoss = float64(s1.TrainingLoss)
return nil
}
type Job struct {
// Configuration: [Required] Describes the job configuration.
Configuration *JobConfiguration `json:"configuration,omitempty"`
@ -1630,6 +1831,14 @@ type JobConfigurationLoad struct {
// specify a tab separator. The default value is a comma (',').
FieldDelimiter string `json:"fieldDelimiter,omitempty"`
// HivePartitioningMode: [Optional, Experimental] If hive partitioning
// is enabled, which mode to use. Two modes are supported: - AUTO:
// automatically infer partition key name(s) and type(s). - STRINGS:
// automatic infer partition key name(s). All types are strings. Not all
// storage formats support hive partitioning -- requesting hive
// partitioning on an unsupported format will lead to an error.
HivePartitioningMode string `json:"hivePartitioningMode,omitempty"`
// IgnoreUnknownValues: [Optional] Indicates if BigQuery should allow
// extra values that are not represented in the table schema. If true,
// the extra values are ignored. If false, records with extra columns
@ -2155,6 +2364,13 @@ type JobStatistics struct {
// Load: [Output-only] Statistics for a load job.
Load *JobStatistics3 `json:"load,omitempty"`
// NumChildJobs: [Output-only] Number of child jobs executed.
NumChildJobs int64 `json:"numChildJobs,omitempty,string"`
// ParentJobId: [Output-only] If this is a child job, the id of the
// parent.
ParentJobId string `json:"parentJobId,omitempty"`
// Query: [Output-only] Statistics for a query job.
Query *JobStatistics2 `json:"query,omitempty"`
@ -2267,6 +2483,10 @@ type JobStatistics2 struct {
// query deleted the DDL target.
DdlOperationPerformed string `json:"ddlOperationPerformed,omitempty"`
// DdlTargetRoutine: The DDL target routine. Present only for
// CREATE/DROP FUNCTION/PROCEDURE queries.
DdlTargetRoutine *RoutineReference `json:"ddlTargetRoutine,omitempty"`
// DdlTargetTable: The DDL target table. Present only for CREATE/DROP
// TABLE/VIEW queries.
DdlTargetTable *TableReference `json:"ddlTargetTable,omitempty"`
@ -2311,7 +2531,7 @@ type JobStatistics2 struct {
// StatementType: The type of query statement, if valid. Possible values
// (new values might be added in the future): "SELECT": SELECT query.
// "INSERT": INSERT query; see
// https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. "UPDATE": UPDATE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. "DELETE": DELETE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. "MERGE": MERGE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. "CREATE_TABLE": CREATE [OR REPLACE] TABLE without AS SELECT. "CREATE_TABLE_AS_SELECT": CREATE [OR REPLACE] TABLE ... AS SELECT ... . "DROP_TABLE": DROP TABLE query. "CREATE_VIEW": CREATE [OR REPLACE] VIEW ... AS SELECT ... . "DROP_VIEW": DROP VIEW query. "ALTER_TABLE": ALTER TABLE query. "ALTER_VIEW": ALTER VIEW
// https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. "UPDATE": UPDATE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. "DELETE": DELETE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. "MERGE": MERGE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. "CREATE_TABLE": CREATE [OR REPLACE] TABLE without AS SELECT. "CREATE_TABLE_AS_SELECT": CREATE [OR REPLACE] TABLE ... AS SELECT ... . "DROP_TABLE": DROP TABLE query. "CREATE_VIEW": CREATE [OR REPLACE] VIEW ... AS SELECT ... . "DROP_VIEW": DROP VIEW query. "CREATE_FUNCTION": CREATE FUNCTION query. "DROP_FUNCTION" : DROP FUNCTION query. "ALTER_TABLE": ALTER TABLE query. "ALTER_VIEW": ALTER VIEW
// query.
StatementType string `json:"statementType,omitempty"`
@ -2329,7 +2549,7 @@ type JobStatistics2 struct {
// accuracy of the estimate. Possible values can be: UNKNOWN: accuracy
// of the estimate is unknown. PRECISE: estimate is precise.
// LOWER_BOUND: estimate is lower bound of what the query would cost.
// UPPER_BOUND: estiamte is upper bound of what the query would cost.
// UPPER_BOUND: estimate is upper bound of what the query would cost.
TotalBytesProcessedAccuracy string `json:"totalBytesProcessedAccuracy,omitempty"`
// TotalPartitionsProcessed: [Output-only] Total number of partitions
@ -2452,6 +2672,11 @@ type JobStatistics4 struct {
// specified in the 'destinationUris' field.
DestinationUriFileCounts googleapi.Int64s `json:"destinationUriFileCounts,omitempty"`
// InputBytes: [Output-only] Number of user bytes extracted into the
// result. This is the byte count as computed by BigQuery for billing
// purposes.
InputBytes int64 `json:"inputBytes,omitempty,string"`
// ForceSendFields is a list of field names (e.g.
// "DestinationUriFileCounts") to unconditionally include in API
// requests. By default, fields with empty values are omitted from API
@ -2559,7 +2784,7 @@ type ModelDefinition struct {
// each training run comprises of multiple iterations and there may be
// multiple training runs for the model if warm start is used or if a
// user decides to continue a previously cancelled query.
TrainingRuns []*TrainingRun `json:"trainingRuns,omitempty"`
TrainingRuns []*BqmlTrainingRun `json:"trainingRuns,omitempty"`
// ForceSendFields is a list of field names (e.g. "ModelOptions") to
// unconditionally include in API requests. By default, fields with
@ -3151,6 +3376,41 @@ func (s *RangePartitioningRange) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
type RoutineReference struct {
// DatasetId: [Required] The ID of the dataset containing this routine.
DatasetId string `json:"datasetId,omitempty"`
// ProjectId: [Required] The ID of the project containing this routine.
ProjectId string `json:"projectId,omitempty"`
// RoutineId: [Required] The ID of the routine. The ID must contain only
// letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum
// length is 256 characters.
RoutineId string `json:"routineId,omitempty"`
// ForceSendFields is a list of field names (e.g. "DatasetId") 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. "DatasetId") 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 *RoutineReference) MarshalJSON() ([]byte, error) {
type NoMethod RoutineReference
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
type Streamingbuffer struct {
// EstimatedBytes: [Output-only] A lower-bound estimate of the number of
// bytes currently in the streaming buffer.
@ -3566,6 +3826,10 @@ func (s *TableDataList) MarshalJSON() ([]byte, error) {
}
type TableFieldSchema struct {
// Categories: [Optional] The categories attached to this field, used
// for field-level access control.
Categories *TableFieldSchemaCategories `json:"categories,omitempty"`
// Description: [Optional] The field description. The maximum length is
// 1,024 characters.
Description string `json:"description,omitempty"`
@ -3590,7 +3854,7 @@ type TableFieldSchema struct {
// nested schema) or STRUCT (same as RECORD).
Type string `json:"type,omitempty"`
// ForceSendFields is a list of field names (e.g. "Description") to
// ForceSendFields is a list of field names (e.g. "Categories") 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
@ -3598,10 +3862,10 @@ type TableFieldSchema struct {
// 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
// NullFields is a list of field names (e.g. "Categories") 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:"-"`
@ -3613,6 +3877,37 @@ func (s *TableFieldSchema) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// TableFieldSchemaCategories: [Optional] The categories attached to
// this field, used for field-level access control.
type TableFieldSchemaCategories struct {
// Names: A list of category resource names. For example,
// "projects/1/taxonomies/2/categories/3". At most 5 categories are
// allowed.
Names []string `json:"names,omitempty"`
// ForceSendFields is a list of field names (e.g. "Names") 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. "Names") 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 *TableFieldSchemaCategories) MarshalJSON() ([]byte, error) {
type NoMethod TableFieldSchemaCategories
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
type TableList struct {
// Etag: A hash of this page of results.
Etag string `json:"etag,omitempty"`
@ -3853,9 +4148,6 @@ type TimePartitioning struct {
// REQUIRED.
Field string `json:"field,omitempty"`
// RequirePartitionFilter: [Beta] [Optional] If set to true, queries
// over this table require a partition filter that can be used for
// partition elimination to be specified.
RequirePartitionFilter bool `json:"requirePartitionFilter,omitempty"`
// Type: [Required] The only type supported is DAY, which will generate
@ -3885,123 +4177,6 @@ func (s *TimePartitioning) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
type TrainingRun struct {
// IterationResults: [Output-only, Beta] List of each iteration results.
IterationResults []*IterationResult `json:"iterationResults,omitempty"`
// StartTime: [Output-only, Beta] Training run start time in
// milliseconds since the epoch.
StartTime string `json:"startTime,omitempty"`
// State: [Output-only, Beta] Different state applicable for a training
// run. IN PROGRESS: Training run is in progress. FAILED: Training run
// ended due to a non-retryable failure. SUCCEEDED: Training run
// successfully completed. CANCELLED: Training run cancelled by the
// user.
State string `json:"state,omitempty"`
// TrainingOptions: [Output-only, Beta] Training options used by this
// training run. These options are mutable for subsequent training runs.
// Default values are explicitly stored for options not specified in the
// input query of the first training run. For subsequent training runs,
// any option not explicitly specified in the input query will be copied
// from the previous training run.
TrainingOptions *TrainingRunTrainingOptions `json:"trainingOptions,omitempty"`
// ForceSendFields is a list of field names (e.g. "IterationResults") 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. "IterationResults") 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 *TrainingRun) MarshalJSON() ([]byte, error) {
type NoMethod TrainingRun
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// TrainingRunTrainingOptions: [Output-only, Beta] Training options used
// by this training run. These options are mutable for subsequent
// training runs. Default values are explicitly stored for options not
// specified in the input query of the first training run. For
// subsequent training runs, any option not explicitly specified in the
// input query will be copied from the previous training run.
type TrainingRunTrainingOptions struct {
EarlyStop bool `json:"earlyStop,omitempty"`
L1Reg float64 `json:"l1Reg,omitempty"`
L2Reg float64 `json:"l2Reg,omitempty"`
LearnRate float64 `json:"learnRate,omitempty"`
LearnRateStrategy string `json:"learnRateStrategy,omitempty"`
LineSearchInitLearnRate float64 `json:"lineSearchInitLearnRate,omitempty"`
MaxIteration int64 `json:"maxIteration,omitempty,string"`
MinRelProgress float64 `json:"minRelProgress,omitempty"`
WarmStart bool `json:"warmStart,omitempty"`
// ForceSendFields is a list of field names (e.g. "EarlyStop") 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. "EarlyStop") 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 *TrainingRunTrainingOptions) MarshalJSON() ([]byte, error) {
type NoMethod TrainingRunTrainingOptions
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
func (s *TrainingRunTrainingOptions) UnmarshalJSON(data []byte) error {
type NoMethod TrainingRunTrainingOptions
var s1 struct {
L1Reg gensupport.JSONFloat64 `json:"l1Reg"`
L2Reg gensupport.JSONFloat64 `json:"l2Reg"`
LearnRate gensupport.JSONFloat64 `json:"learnRate"`
LineSearchInitLearnRate gensupport.JSONFloat64 `json:"lineSearchInitLearnRate"`
MinRelProgress gensupport.JSONFloat64 `json:"minRelProgress"`
*NoMethod
}
s1.NoMethod = (*NoMethod)(s)
if err := json.Unmarshal(data, &s1); err != nil {
return err
}
s.L1Reg = float64(s1.L1Reg)
s.L2Reg = float64(s1.L2Reg)
s.LearnRate = float64(s1.LearnRate)
s.LineSearchInitLearnRate = float64(s1.LineSearchInitLearnRate)
s.MinRelProgress = float64(s1.MinRelProgress)
return nil
}
type UserDefinedFunctionResource struct {
// InlineCode: [Pick one] An inline resource that contains code for a
// user-defined function (UDF). Providing a inline code resource is
@ -5688,7 +5863,7 @@ func (c *JobsInsertCall) doRequest(alt string) (*http.Response, error) {
return nil, err
}
req.Header = reqHeaders
gensupport.SetGetBody(req, getBody)
req.GetBody = getBody
googleapi.Expand(req.URL, map[string]string{
"projectId": c.projectId,
})

View File

@ -175,7 +175,7 @@
]
},
"list": {
"description": "Lists the billing accounts that the current authenticated user has\npermission to [view](https://cloud.google.com/billing/docs/how-to/billing-access).",
"description": "Lists the billing accounts that the current authenticated user has\npermission to\n[view](https://cloud.google.com/billing/docs/how-to/billing-access).",
"flatPath": "v1/billingAccounts",
"httpMethod": "GET",
"id": "cloudbilling.billingAccounts.list",
@ -488,7 +488,7 @@
}
}
},
"revision": "20180806",
"revision": "20190416",
"rootUrl": "https://cloudbilling.googleapis.com/",
"schemas": {
"AggregationInfo": {
@ -606,10 +606,10 @@
"properties": {
"condition": {
"$ref": "Expr",
"description": "Unimplemented. The condition that is associated with this binding.\nNOTE: an unsatisfied condition will not allow user access via current\nbinding. Different bindings, including their conditions, are examined\nindependently."
"description": "The condition that is associated with this binding.\nNOTE: An unsatisfied condition will not allow user access via current\nbinding. Different bindings, including their conditions, are examined\nindependently."
},
"members": {
"description": "Specifies the identities requesting access for a Cloud Platform resource.\n`members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is\n on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone\n who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google\n account. For example, `alice@gmail.com` .\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service\n account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group.\n For example, `admins@example.com`.\n\n\n* `domain:{domain}`: A Google Apps domain name that represents all the\n users of that domain. For example, `google.com` or `example.com`.\n\n",
"description": "Specifies the identities requesting access for a Cloud Platform resource.\n`members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is\n on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone\n who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google\n account. For example, `alice@gmail.com` .\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service\n account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group.\n For example, `admins@example.com`.\n\n\n* `domain:{domain}`: The G Suite domain (primary) that represents all the\n users of that domain. For example, `google.com` or `example.com`.\n\n",
"items": {
"type": "string"
},
@ -888,6 +888,10 @@
"description": "Encapsulates a single service in Google Cloud Platform.",
"id": "Service",
"properties": {
"businessEntityName": {
"description": "The business under which the service is offered.\nEx. \"businessEntities/GCP\", \"businessEntities/Maps\"",
"type": "string"
},
"displayName": {
"description": "A human readable display name for this service.",
"type": "string"

View File

@ -1,4 +1,4 @@
// Copyright 2018 Google Inc. All rights reserved.
// Copyright 2019 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
@ -6,13 +6,35 @@
// Package cloudbilling provides access to the Cloud Billing API.
//
// See https://cloud.google.com/billing/
// For product documentation, see: https://cloud.google.com/billing/
//
// Creating a client
//
// Usage example:
//
// import "google.golang.org/api/cloudbilling/v1"
// ...
// cloudbillingService, err := cloudbilling.New(oauthHttpClient)
// ctx := context.Background()
// cloudbillingService, err := cloudbilling.NewService(ctx)
//
// In this example, Google Application Default Credentials are used for authentication.
//
// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
//
// Other authentication options
//
// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
//
// cloudbillingService, err := cloudbilling.NewService(ctx, option.WithAPIKey("AIza..."))
//
// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
//
// config := &oauth2.Config{...}
// // ...
// token, err := config.Exchange(ctx, ...)
// cloudbillingService, err := cloudbilling.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See https://godoc.org/google.golang.org/api/option/ for details on options.
package cloudbilling // import "google.golang.org/api/cloudbilling/v1"
import (
@ -29,6 +51,8 @@ import (
gensupport "google.golang.org/api/gensupport"
googleapi "google.golang.org/api/googleapi"
option "google.golang.org/api/option"
htransport "google.golang.org/api/transport/http"
)
// Always reference these packages, just in case the auto-generated code
@ -56,6 +80,32 @@ const (
CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
)
// NewService creates a new APIService.
func NewService(ctx context.Context, opts ...option.ClientOption) (*APIService, error) {
scopesOption := option.WithScopes(
"https://www.googleapis.com/auth/cloud-platform",
)
// NOTE: prepend, so we don't override user-specified scopes.
opts = append([]option.ClientOption{scopesOption}, opts...)
client, endpoint, err := htransport.NewClient(ctx, opts...)
if err != nil {
return nil, err
}
s, err := New(client)
if err != nil {
return nil, err
}
if endpoint != "" {
s.BasePath = endpoint
}
return s, nil
}
// New creates a new APIService. It uses the provided http.Client for requests.
//
// Deprecated: please use NewService instead.
// To provide a custom HTTP client, use option.WithHTTPClient.
// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func New(client *http.Client) (*APIService, error) {
if client == nil {
return nil, errors.New("client is nil")
@ -401,9 +451,8 @@ func (s *BillingAccount) MarshalJSON() ([]byte, error) {
// Binding: Associates `members` with a `role`.
type Binding struct {
// Condition: Unimplemented. The condition that is associated with this
// binding.
// NOTE: an unsatisfied condition will not allow user access via
// Condition: The condition that is associated with this binding.
// NOTE: An unsatisfied condition will not allow user access via
// current
// binding. Different bindings, including their conditions, are
// examined
@ -437,7 +486,7 @@ type Binding struct {
// For example, `admins@example.com`.
//
//
// * `domain:{domain}`: A Google Apps domain name that represents all
// * `domain:{domain}`: The G Suite domain (primary) that represents all
// the
// users of that domain. For example, `google.com` or
// `example.com`.
@ -1129,6 +1178,11 @@ func (s *ProjectBillingInfo) MarshalJSON() ([]byte, error) {
// Service: Encapsulates a single service in Google Cloud Platform.
type Service struct {
// BusinessEntityName: The business under which the service is
// offered.
// Ex. "businessEntities/GCP", "businessEntities/Maps"
BusinessEntityName string `json:"businessEntityName,omitempty"`
// DisplayName: A human readable display name for this service.
DisplayName string `json:"displayName,omitempty"`
@ -1140,20 +1194,21 @@ type Service struct {
// Example: "DA34-426B-A397"
ServiceId string `json:"serviceId,omitempty"`
// ForceSendFields is a list of field names (e.g. "DisplayName") to
// unconditionally include in API requests. By default, fields with
// ForceSendFields is a list of field names (e.g. "BusinessEntityName")
// 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. "DisplayName") 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 is a list of field names (e.g. "BusinessEntityName") 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:"-"`
}
@ -1834,8 +1889,10 @@ type BillingAccountsListCall struct {
// List: Lists the billing accounts that the current authenticated user
// has
// permission to
// [view](https://cloud.google.com/billing/docs/how-to/billing-access).
// permission
// to
// [view](https://cloud.google.com/billing/docs/how-to/billing-access)
// .
func (r *BillingAccountsService) List() *BillingAccountsListCall {
c := &BillingAccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
return c
@ -1971,7 +2028,7 @@ func (c *BillingAccountsListCall) Do(opts ...googleapi.CallOption) (*ListBilling
}
return ret, nil
// {
// "description": "Lists the billing accounts that the current authenticated user has\npermission to [view](https://cloud.google.com/billing/docs/how-to/billing-access).",
// "description": "Lists the billing accounts that the current authenticated user has\npermission to\n[view](https://cloud.google.com/billing/docs/how-to/billing-access).",
// "flatPath": "v1/billingAccounts",
// "httpMethod": "GET",
// "id": "cloudbilling.billingAccounts.list",

View File

@ -474,6 +474,17 @@
"projectId"
],
"parameters": {
"pageSize": {
"description": "Number of results to return in the list.",
"format": "int32",
"location": "query",
"type": "integer"
},
"pageToken": {
"description": "Token to provide to skip to a particular spot in the list.",
"location": "query",
"type": "string"
},
"projectId": {
"description": "ID of the project for which to list BuildTriggers.",
"location": "path",
@ -562,7 +573,7 @@
}
}
},
"revision": "20181018",
"revision": "20190323",
"rootUrl": "https://cloudbuild.googleapis.com/",
"schemas": {
"ArtifactObjects": {
@ -1011,6 +1022,10 @@
"description": "Path, from the source root, to a file whose contents is used for the\ntemplate.",
"type": "string"
},
"github": {
"$ref": "GitHubEventsConfig",
"description": "GitHubEventsConfig describes the configuration of a trigger that creates\na build whenever a GitHub event is received."
},
"id": {
"description": "Output only. Unique identifier of the trigger.",
"type": "string"
@ -1074,6 +1089,12 @@
"properties": {},
"type": "object"
},
"CheckSuiteFilter": {
"description": "A CheckSuiteFilter is a filter that indicates that we should build on all\ncheck suite events.",
"id": "CheckSuiteFilter",
"properties": {},
"type": "object"
},
"Empty": {
"description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.",
"id": "Empty",
@ -1094,6 +1115,38 @@
},
"type": "object"
},
"GitHubEventsConfig": {
"description": "GitHubEventsConfig describes the configuration of a trigger that creates a\nbuild whenever a GitHub event is received.\n\nThis message is experimental.",
"id": "GitHubEventsConfig",
"properties": {
"checkSuite": {
"$ref": "CheckSuiteFilter",
"description": "Output only. Indicates that a build was generated from a check suite\nevent."
},
"installationId": {
"description": "The installationID that emmits the GitHub event.",
"format": "int64",
"type": "string"
},
"name": {
"description": "Name of the repository.",
"type": "string"
},
"owner": {
"description": "Owner of the repository.",
"type": "string"
},
"pullRequest": {
"$ref": "PullRequestFilter",
"description": "filter to match changes in pull requests."
},
"push": {
"$ref": "PushFilter",
"description": "filter to match changes in refs like branches, tags."
}
},
"type": "object"
},
"Hash": {
"description": "Container message for hash values.",
"id": "Hash",
@ -1124,6 +1177,10 @@
"description": "Response containing existing `BuildTriggers`.",
"id": "ListBuildTriggersResponse",
"properties": {
"nextPageToken": {
"description": "Token to receive the next page of results.",
"type": "string"
},
"triggers": {
"description": "`BuildTriggers` for the project, sorted by `create_time` descending.",
"items": {
@ -1205,6 +1262,44 @@
},
"type": "object"
},
"PullRequestFilter": {
"description": "PullRequestFilter contains filter properties for matching GitHub Pull\nRequests.",
"id": "PullRequestFilter",
"properties": {
"branch": {
"description": "Regex of branches to match.\n\nThe syntax of the regular expressions accepted is the syntax accepted by\nRE2 and described at https://github.com/google/re2/wiki/Syntax",
"type": "string"
},
"commentControl": {
"description": "Whether to block builds on a \"/gcbrun\" comment from a repository owner or\ncollaborator.",
"enum": [
"COMMENTS_DISABLED",
"COMMENTS_ENABLED"
],
"enumDescriptions": [
"Do not require comments on Pull Requests before builds are triggered.",
"Enforce that repository owners or collaborators must comment on Pull\nRequests before builds are triggered."
],
"type": "string"
}
},
"type": "object"
},
"PushFilter": {
"description": "Push contains filter properties for matching GitHub git pushes.",
"id": "PushFilter",
"properties": {
"branch": {
"description": "Regexes of branches to match.\n\nThe syntax of the regular expressions accepted is the syntax accepted by\nRE2 and described at https://github.com/google/re2/wiki/Syntax",
"type": "string"
},
"tag": {
"description": "Regexes of tags to match.\n\nThe syntax of the regular expressions accepted is the syntax accepted by\nRE2 and described at https://github.com/google/re2/wiki/Syntax",
"type": "string"
}
},
"type": "object"
},
"RepoSource": {
"description": "Location of the source in a Google Cloud Source Repository.",
"id": "RepoSource",
@ -1244,6 +1339,10 @@
"description": "Path to the artifact manifest. Only populated when artifacts are uploaded.",
"type": "string"
},
"artifactTiming": {
"$ref": "TimeSpan",
"description": "Time to push all non-container artifacts."
},
"buildStepImages": {
"description": "List of build step digests, in the order corresponding to build step\nindices.",
"items": {
@ -1322,7 +1421,7 @@
"additionalProperties": {
"$ref": "FileHashes"
},
"description": "Output only. Hash(es) of the build source, which can be used to verify that\nthe originalsource integrity was maintained in the build. Note that\n`FileHashes` willonly be populated if `BuildOptions` has requested a\n`SourceProvenanceHash`.\n\nThe keys to this map are file paths used as build source and the values\ncontain the hash values for those files.\n\nIf the build source came in a single package such as a gzipped tarfile\n(`.tar.gz`), the `FileHash` will be for the single path to that file.",
"description": "Output only. Hash(es) of the build source, which can be used to verify that\nthe original source integrity was maintained in the build. Note that\n`FileHashes` will only be populated if `BuildOptions` has requested a\n`SourceProvenanceHash`.\n\nThe keys to this map are file paths used as build source and the values\ncontain the hash values for those files.\n\nIf the build source came in a single package such as a gzipped tarfile\n(`.tar.gz`), the `FileHash` will be for the single path to that file.",
"type": "object"
},
"resolvedRepoSource": {
@ -1337,7 +1436,7 @@
"type": "object"
},
"Status": {
"description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.",
"description": "The `Status` type defines a logical error model that is suitable for\ndifferent programming environments, including REST APIs and RPC APIs. It is\nused by [gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error\nmessage, and error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.",
"id": "Status",
"properties": {
"code": {

View File

@ -1,4 +1,4 @@
// Copyright 2018 Google Inc. All rights reserved.
// Copyright 2019 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
@ -6,13 +6,35 @@
// Package cloudbuild provides access to the Cloud Build API.
//
// See https://cloud.google.com/cloud-build/docs/
// For product documentation, see: https://cloud.google.com/cloud-build/docs/
//
// Creating a client
//
// Usage example:
//
// import "google.golang.org/api/cloudbuild/v1"
// ...
// cloudbuildService, err := cloudbuild.New(oauthHttpClient)
// ctx := context.Background()
// cloudbuildService, err := cloudbuild.NewService(ctx)
//
// In this example, Google Application Default Credentials are used for authentication.
//
// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
//
// Other authentication options
//
// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
//
// cloudbuildService, err := cloudbuild.NewService(ctx, option.WithAPIKey("AIza..."))
//
// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
//
// config := &oauth2.Config{...}
// // ...
// token, err := config.Exchange(ctx, ...)
// cloudbuildService, err := cloudbuild.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See https://godoc.org/google.golang.org/api/option/ for details on options.
package cloudbuild // import "google.golang.org/api/cloudbuild/v1"
import (
@ -29,6 +51,8 @@ import (
gensupport "google.golang.org/api/gensupport"
googleapi "google.golang.org/api/googleapi"
option "google.golang.org/api/option"
htransport "google.golang.org/api/transport/http"
)
// Always reference these packages, just in case the auto-generated code
@ -56,6 +80,32 @@ const (
CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
)
// NewService creates a new Service.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
scopesOption := option.WithScopes(
"https://www.googleapis.com/auth/cloud-platform",
)
// NOTE: prepend, so we don't override user-specified scopes.
opts = append([]option.ClientOption{scopesOption}, opts...)
client, endpoint, err := htransport.NewClient(ctx, opts...)
if err != nil {
return nil, err
}
s, err := New(client)
if err != nil {
return nil, err
}
if endpoint != "" {
s.BasePath = endpoint
}
return s, nil
}
// New creates a new Service. It uses the provided http.Client for requests.
//
// Deprecated: please use NewService instead.
// To provide a custom HTTP client, use option.WithHTTPClient.
// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
@ -797,6 +847,11 @@ type BuildTrigger struct {
// template.
Filename string `json:"filename,omitempty"`
// Github: GitHubEventsConfig describes the configuration of a trigger
// that creates
// a build whenever a GitHub event is received.
Github *GitHubEventsConfig `json:"github,omitempty"`
// Id: Output only. Unique identifier of the trigger.
Id string `json:"id,omitempty"`
@ -915,6 +970,12 @@ type CancelBuildRequest struct {
type CancelOperationRequest struct {
}
// CheckSuiteFilter: A CheckSuiteFilter is a filter that indicates that
// we should build on all
// check suite events.
type CheckSuiteFilter struct {
}
// 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
@ -964,6 +1025,55 @@ func (s *FileHashes) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GitHubEventsConfig: GitHubEventsConfig describes the configuration of
// a trigger that creates a
// build whenever a GitHub event is received.
//
// This message is experimental.
type GitHubEventsConfig struct {
// CheckSuite: Output only. Indicates that a build was generated from a
// check suite
// event.
CheckSuite *CheckSuiteFilter `json:"checkSuite,omitempty"`
// InstallationId: The installationID that emmits the GitHub event.
InstallationId int64 `json:"installationId,omitempty,string"`
// Name: Name of the repository.
Name string `json:"name,omitempty"`
// Owner: Owner of the repository.
Owner string `json:"owner,omitempty"`
// PullRequest: filter to match changes in pull requests.
PullRequest *PullRequestFilter `json:"pullRequest,omitempty"`
// Push: filter to match changes in refs like branches, tags.
Push *PushFilter `json:"push,omitempty"`
// ForceSendFields is a list of field names (e.g. "CheckSuite") 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. "CheckSuite") 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 *GitHubEventsConfig) MarshalJSON() ([]byte, error) {
type NoMethod GitHubEventsConfig
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Hash: Container message for hash values.
type Hash struct {
// Type: The type of hash that was performed.
@ -1003,6 +1113,9 @@ func (s *Hash) MarshalJSON() ([]byte, error) {
// ListBuildTriggersResponse: Response containing existing
// `BuildTriggers`.
type ListBuildTriggersResponse struct {
// NextPageToken: Token to receive the next page of results.
NextPageToken string `json:"nextPageToken,omitempty"`
// Triggers: `BuildTriggers` for the project, sorted by `create_time`
// descending.
Triggers []*BuildTrigger `json:"triggers,omitempty"`
@ -1011,7 +1124,7 @@ type ListBuildTriggersResponse struct {
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Triggers") to
// ForceSendFields is a list of field names (e.g. "NextPageToken") 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
@ -1019,10 +1132,10 @@ type ListBuildTriggersResponse struct {
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Triggers") 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
// NullFields is a list of field names (e.g. "NextPageToken") 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:"-"`
@ -1181,6 +1294,92 @@ func (s *Operation) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// PullRequestFilter: PullRequestFilter contains filter properties for
// matching GitHub Pull
// Requests.
type PullRequestFilter struct {
// Branch: Regex of branches to match.
//
// The syntax of the regular expressions accepted is the syntax accepted
// by
// RE2 and described at https://github.com/google/re2/wiki/Syntax
Branch string `json:"branch,omitempty"`
// CommentControl: Whether to block builds on a "/gcbrun" comment from a
// repository owner or
// collaborator.
//
// Possible values:
// "COMMENTS_DISABLED" - Do not require comments on Pull Requests
// before builds are triggered.
// "COMMENTS_ENABLED" - Enforce that repository owners or
// collaborators must comment on Pull
// Requests before builds are triggered.
CommentControl string `json:"commentControl,omitempty"`
// ForceSendFields is a list of field names (e.g. "Branch") 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. "Branch") 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 *PullRequestFilter) MarshalJSON() ([]byte, error) {
type NoMethod PullRequestFilter
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// PushFilter: Push contains filter properties for matching GitHub git
// pushes.
type PushFilter struct {
// Branch: Regexes of branches to match.
//
// The syntax of the regular expressions accepted is the syntax accepted
// by
// RE2 and described at https://github.com/google/re2/wiki/Syntax
Branch string `json:"branch,omitempty"`
// Tag: Regexes of tags to match.
//
// The syntax of the regular expressions accepted is the syntax accepted
// by
// RE2 and described at https://github.com/google/re2/wiki/Syntax
Tag string `json:"tag,omitempty"`
// ForceSendFields is a list of field names (e.g. "Branch") 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. "Branch") 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 *PushFilter) MarshalJSON() ([]byte, error) {
type NoMethod PushFilter
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// RepoSource: Location of the source in a Google Cloud Source
// Repository.
type RepoSource struct {
@ -1240,6 +1439,9 @@ type Results struct {
// artifacts are uploaded.
ArtifactManifest string `json:"artifactManifest,omitempty"`
// ArtifactTiming: Time to push all non-container artifacts.
ArtifactTiming *TimeSpan `json:"artifactTiming,omitempty"`
// BuildStepImages: List of build step digests, in the order
// corresponding to build step
// indices.
@ -1373,9 +1575,9 @@ func (s *Source) MarshalJSON() ([]byte, error) {
type SourceProvenance struct {
// FileHashes: Output only. Hash(es) of the build source, which can be
// used to verify that
// the originalsource integrity was maintained in the build. Note
// the original source integrity was maintained in the build. Note
// that
// `FileHashes` willonly be populated if `BuildOptions` has requested
// `FileHashes` will only be populated if `BuildOptions` has requested
// a
// `SourceProvenanceHash`.
//
@ -1422,20 +1624,20 @@ func (s *SourceProvenance) MarshalJSON() ([]byte, error) {
}
// 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:
// 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 needs
//
// # Overview
//
// The `Status` message contains three pieces of data: error code, error
// message,
// and error details. The error code should be an enum value
// The `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
@ -3471,6 +3673,20 @@ func (r *ProjectsTriggersService) List(projectId string) *ProjectsTriggersListCa
return c
}
// PageSize sets the optional parameter "pageSize": Number of results to
// return in the list.
func (c *ProjectsTriggersListCall) PageSize(pageSize int64) *ProjectsTriggersListCall {
c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
return c
}
// PageToken sets the optional parameter "pageToken": Token to provide
// to skip to a particular spot in the list.
func (c *ProjectsTriggersListCall) PageToken(pageToken string) *ProjectsTriggersListCall {
c.urlParams_.Set("pageToken", pageToken)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
@ -3577,6 +3793,17 @@ func (c *ProjectsTriggersListCall) Do(opts ...googleapi.CallOption) (*ListBuildT
// "projectId"
// ],
// "parameters": {
// "pageSize": {
// "description": "Number of results to return in the list.",
// "format": "int32",
// "location": "query",
// "type": "integer"
// },
// "pageToken": {
// "description": "Token to provide to skip to a particular spot in the list.",
// "location": "query",
// "type": "string"
// },
// "projectId": {
// "description": "ID of the project for which to list BuildTriggers.",
// "location": "path",
@ -3595,6 +3822,27 @@ func (c *ProjectsTriggersListCall) Do(opts ...googleapi.CallOption) (*ListBuildT
}
// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
func (c *ProjectsTriggersListCall) Pages(ctx context.Context, f func(*ListBuildTriggersResponse) error) error {
c.ctx_ = ctx
defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
for {
x, err := c.Do()
if err != nil {
return err
}
if err := f(x); err != nil {
return err
}
if x.NextPageToken == "" {
return nil
}
c.PageToken(x.NextPageToken)
}
}
// method id "cloudbuild.projects.triggers.patch":
type ProjectsTriggersPatchCall struct {

View File

@ -139,12 +139,12 @@
"parameterOrder": [],
"parameters": {
"filter": {
"description": "The standard list filter.",
"description": "Required. A filter for matching the requested operations.\u003cbr\u003e\u003cbr\u003e The supported formats of \u003cb\u003efilter\u003c/b\u003e are:\u003cbr\u003e To query for specific function: \u003ccode\u003eproject:*,location:*,function:*\u003c/code\u003e\u003cbr\u003e To query for all of the latest operations for a project: \u003ccode\u003eproject:*,latest:true\u003c/code\u003e",
"location": "query",
"type": "string"
},
"name": {
"description": "The name of the operation's parent resource.",
"description": "Must not be set.",
"location": "query",
"type": "string"
},
@ -220,7 +220,7 @@
"functions": {
"methods": {
"call": {
"description": "Synchronously invokes a deployed Cloud Function. To be used for testing\npurposes as very limited traffic is allowed. For more information on\nthe actual limits refer to [API Calls](\nhttps://cloud.google.com/functions/quotas#rate_limits).",
"description": "Synchronously invokes a deployed Cloud Function. To be used for testing\npurposes as very limited traffic is allowed. For more information on\nthe actual limits, refer to\n[Rate Limits](https://cloud.google.com/functions/quotas#rate_limits).",
"flatPath": "v1/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:call",
"httpMethod": "POST",
"id": "cloudfunctions.projects.locations.functions.call",
@ -329,7 +329,7 @@
]
},
"generateUploadUrl": {
"description": "Returns a signed URL for uploading a function source code.\nFor more information about the signed URL usage see:\nhttps://cloud.google.com/storage/docs/access-control/signed-urls.\nOnce the function source code upload is complete, the used signed\nURL should be provided in CreateFunction or UpdateFunction request\nas a reference to the function source code.\n\nWhen uploading source code to the generated signed URL, please follow\nthese restrictions:\n\n* Source file type should be a zip file.\n* Source file size should not exceed 100MB limit.\n\nWhen making a HTTP PUT request, these two headers need to be specified:\n\n* `content-type: application/zip`\n* `x-goog-content-length-range: 0,104857600`",
"description": "Returns a signed URL for uploading a function source code.\nFor more information about the signed URL usage see:\nhttps://cloud.google.com/storage/docs/access-control/signed-urls.\nOnce the function source code upload is complete, the used signed\nURL should be provided in CreateFunction or UpdateFunction request\nas a reference to the function source code.\n\nWhen uploading source code to the generated signed URL, please follow\nthese restrictions:\n\n* Source file type should be a zip file.\n* Source file size should not exceed 100MB limit.\n* No credentials should be attached - the signed URLs provide access to the\n target bucket using internal service identity; if credentials were\n attached, the identity from the credentials would be used, but that\n identity does not have permissions to upload files to the URL.\n\nWhen making a HTTP PUT request, these two headers need to be specified:\n\n* `content-type: application/zip`\n* `x-goog-content-length-range: 0,104857600`\n\nAnd this header SHOULD NOT be specified:\n\n* `Authorization: Bearer YOUR_TOKEN`",
"flatPath": "v1/projects/{projectsId}/locations/{locationsId}/functions:generateUploadUrl",
"httpMethod": "POST",
"id": "cloudfunctions.projects.locations.functions.generateUploadUrl",
@ -382,7 +382,7 @@
]
},
"getIamPolicy": {
"description": "Gets the access control policy for a resource.\nReturns an empty policy if the resource exists and does not have a policy\nset.",
"description": "Gets the IAM access control policy for a function.\nReturns an empty policy if the function exists and does not have a policy\nset.",
"flatPath": "v1/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:getIamPolicy",
"httpMethod": "GET",
"id": "cloudfunctions.projects.locations.functions.getIamPolicy",
@ -477,7 +477,7 @@
]
},
"setIamPolicy": {
"description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy.",
"description": "Sets the IAM access control policy on the specified function.\nReplaces any existing policy.",
"flatPath": "v1/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:setIamPolicy",
"httpMethod": "POST",
"id": "cloudfunctions.projects.locations.functions.setIamPolicy",
@ -505,7 +505,7 @@
]
},
"testIamPermissions": {
"description": "Returns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning.",
"description": "Tests the specified permissions against the IAM access control policy\nfor a function.\nIf the function does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.",
"flatPath": "v1/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:testIamPermissions",
"httpMethod": "POST",
"id": "cloudfunctions.projects.locations.functions.testIamPermissions",
@ -539,7 +539,7 @@
}
}
},
"revision": "20181202",
"revision": "20190406",
"rootUrl": "https://cloudfunctions.googleapis.com/",
"schemas": {
"AuditConfig": {
@ -596,10 +596,10 @@
"properties": {
"condition": {
"$ref": "Expr",
"description": "Unimplemented. The condition that is associated with this binding.\nNOTE: an unsatisfied condition will not allow user access via current\nbinding. Different bindings, including their conditions, are examined\nindependently."
"description": "The condition that is associated with this binding.\nNOTE: An unsatisfied condition will not allow user access via current\nbinding. Different bindings, including their conditions, are examined\nindependently."
},
"members": {
"description": "Specifies the identities requesting access for a Cloud Platform resource.\n`members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is\n on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone\n who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google\n account. For example, `alice@gmail.com` .\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service\n account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group.\n For example, `admins@example.com`.\n\n\n* `domain:{domain}`: A Google Apps domain name that represents all the\n users of that domain. For example, `google.com` or `example.com`.\n\n",
"description": "Specifies the identities requesting access for a Cloud Platform resource.\n`members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is\n on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone\n who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google\n account. For example, `alice@gmail.com` .\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service\n account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group.\n For example, `admins@example.com`.\n\n\n* `domain:{domain}`: The G Suite domain (primary) that represents all the\n users of that domain. For example, `google.com` or `example.com`.\n\n",
"items": {
"type": "string"
},
@ -682,7 +682,7 @@
"type": "object"
},
"maxInstances": {
"description": "The limit on the maximum number of function instances that may coexist at a\ngiven time. This feature is currently in alpha, available only for\nwhitelisted users.",
"description": "The limit on the maximum number of function instances that may coexist at a\ngiven time.",
"format": "int32",
"type": "integer"
},
@ -695,11 +695,11 @@
"type": "string"
},
"runtime": {
"description": "The runtime in which the function is going to run. If empty, defaults to\nNode.js 6.",
"description": "Required. The runtime in which the function is going to run. Choices:\n\n* `nodejs6`: Node.js 6\n* `nodejs8`: Node.js 8\n* `nodejs10`: Node.js 10\n* `python37`: Python 3.7\n* `go111`: Go 1.11",
"type": "string"
},
"serviceAccountEmail": {
"description": "Output only. The email of the function's service account.",
"description": "The email of the function's service account. If empty, defaults to\n{project_id}@appspot.gserviceaccount.com.",
"type": "string"
},
"sourceArchiveUrl": {
@ -1146,7 +1146,7 @@
"type": "object"
},
"Status": {
"description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.",
"description": "The `Status` type defines a logical error model that is suitable for\ndifferent programming environments, including REST APIs and RPC APIs. It is\nused by [gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error\nmessage, and error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.",
"id": "Status",
"properties": {
"code": {

View File

@ -1,4 +1,4 @@
// Copyright 2018 Google Inc. All rights reserved.
// Copyright 2019 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
@ -6,13 +6,35 @@
// Package cloudfunctions provides access to the Cloud Functions API.
//
// See https://cloud.google.com/functions
// For product documentation, see: https://cloud.google.com/functions
//
// Creating a client
//
// Usage example:
//
// import "google.golang.org/api/cloudfunctions/v1"
// ...
// cloudfunctionsService, err := cloudfunctions.New(oauthHttpClient)
// ctx := context.Background()
// cloudfunctionsService, err := cloudfunctions.NewService(ctx)
//
// In this example, Google Application Default Credentials are used for authentication.
//
// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
//
// Other authentication options
//
// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
//
// cloudfunctionsService, err := cloudfunctions.NewService(ctx, option.WithAPIKey("AIza..."))
//
// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
//
// config := &oauth2.Config{...}
// // ...
// token, err := config.Exchange(ctx, ...)
// cloudfunctionsService, err := cloudfunctions.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See https://godoc.org/google.golang.org/api/option/ for details on options.
package cloudfunctions // import "google.golang.org/api/cloudfunctions/v1"
import (
@ -29,6 +51,8 @@ import (
gensupport "google.golang.org/api/gensupport"
googleapi "google.golang.org/api/googleapi"
option "google.golang.org/api/option"
htransport "google.golang.org/api/transport/http"
)
// Always reference these packages, just in case the auto-generated code
@ -56,6 +80,32 @@ const (
CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
)
// NewService creates a new Service.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
scopesOption := option.WithScopes(
"https://www.googleapis.com/auth/cloud-platform",
)
// NOTE: prepend, so we don't override user-specified scopes.
opts = append([]option.ClientOption{scopesOption}, opts...)
client, endpoint, err := htransport.NewClient(ctx, opts...)
if err != nil {
return nil, err
}
s, err := New(client)
if err != nil {
return nil, err
}
if endpoint != "" {
s.BasePath = endpoint
}
return s, nil
}
// New creates a new Service. It uses the provided http.Client for requests.
//
// Deprecated: please use NewService instead.
// To provide a custom HTTP client, use option.WithHTTPClient.
// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
@ -281,9 +331,8 @@ func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
// Binding: Associates `members` with a `role`.
type Binding struct {
// Condition: Unimplemented. The condition that is associated with this
// binding.
// NOTE: an unsatisfied condition will not allow user access via
// Condition: The condition that is associated with this binding.
// NOTE: An unsatisfied condition will not allow user access via
// current
// binding. Different bindings, including their conditions, are
// examined
@ -317,7 +366,7 @@ type Binding struct {
// For example, `admins@example.com`.
//
//
// * `domain:{domain}`: A Google Apps domain name that represents all
// * `domain:{domain}`: The G Suite domain (primary) that represents all
// the
// users of that domain. For example, `google.com` or
// `example.com`.
@ -466,9 +515,7 @@ type CloudFunction struct {
// MaxInstances: The limit on the maximum number of function instances
// that may coexist at a
// given time. This feature is currently in alpha, available only
// for
// whitelisted users.
// given time.
MaxInstances int64 `json:"maxInstances,omitempty"`
// Name: A user-defined name of the function. Function names must be
@ -504,13 +551,19 @@ type CloudFunction struct {
// users.
Network string `json:"network,omitempty"`
// Runtime: The runtime in which the function is going to run. If empty,
// defaults to
// Node.js 6.
// Runtime: Required. The runtime in which the function is going to run.
// Choices:
//
// * `nodejs6`: Node.js 6
// * `nodejs8`: Node.js 8
// * `nodejs10`: Node.js 10
// * `python37`: Python 3.7
// * `go111`: Go 1.11
Runtime string `json:"runtime,omitempty"`
// ServiceAccountEmail: Output only. The email of the function's service
// account.
// ServiceAccountEmail: The email of the function's service account. If
// empty, defaults to
// {project_id}@appspot.gserviceaccount.com.
ServiceAccountEmail string `json:"serviceAccountEmail,omitempty"`
// SourceArchiveUrl: The Google Cloud Storage URL, starting with gs://,
@ -1473,20 +1526,20 @@ func (s *SourceRepository) MarshalJSON() ([]byte, error) {
}
// 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:
// 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 needs
//
// # Overview
//
// The `Status` message contains three pieces of data: error code, error
// message,
// and error details. The error code should be an enum value
// The `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
@ -1840,15 +1893,18 @@ func (r *OperationsService) List() *OperationsListCall {
return c
}
// Filter sets the optional parameter "filter": The standard list
// filter.
// Filter sets the optional parameter "filter": Required. A filter for
// matching the requested operations.<br><br> The supported formats of
// <b>filter</b> are:<br> To query for specific function:
// <code>project:*,location:*,function:*</code><br> To query for all of
// the latest operations for a project:
// <code>project:*,latest:true</code>
func (c *OperationsListCall) Filter(filter string) *OperationsListCall {
c.urlParams_.Set("filter", filter)
return c
}
// Name sets the optional parameter "name": The name of the operation's
// parent resource.
// Name sets the optional parameter "name": Must not be set.
func (c *OperationsListCall) Name(name string) *OperationsListCall {
c.urlParams_.Set("name", name)
return c
@ -1970,12 +2026,12 @@ func (c *OperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsRe
// "parameterOrder": [],
// "parameters": {
// "filter": {
// "description": "The standard list filter.",
// "description": "Required. A filter for matching the requested operations.\u003cbr\u003e\u003cbr\u003e The supported formats of \u003cb\u003efilter\u003c/b\u003e are:\u003cbr\u003e To query for specific function: \u003ccode\u003eproject:*,location:*,function:*\u003c/code\u003e\u003cbr\u003e To query for all of the latest operations for a project: \u003ccode\u003eproject:*,latest:true\u003c/code\u003e",
// "location": "query",
// "type": "string"
// },
// "name": {
// "description": "The name of the operation's parent resource.",
// "description": "Must not be set.",
// "location": "query",
// "type": "string"
// },
@ -2240,9 +2296,8 @@ type ProjectsLocationsFunctionsCallCall struct {
// testing
// purposes as very limited traffic is allowed. For more information
// on
// the actual limits refer to [API
// Calls](
// https://cloud.google.com/functions/quotas#rate_limits).
// the actual limits, refer to
// [Rate Limits](https://cloud.google.com/functions/quotas#rate_limits).
func (r *ProjectsLocationsFunctionsService) Call(name string, callfunctionrequest *CallFunctionRequest) *ProjectsLocationsFunctionsCallCall {
c := &ProjectsLocationsFunctionsCallCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
@ -2340,7 +2395,7 @@ func (c *ProjectsLocationsFunctionsCallCall) Do(opts ...googleapi.CallOption) (*
}
return ret, nil
// {
// "description": "Synchronously invokes a deployed Cloud Function. To be used for testing\npurposes as very limited traffic is allowed. For more information on\nthe actual limits refer to [API Calls](\nhttps://cloud.google.com/functions/quotas#rate_limits).",
// "description": "Synchronously invokes a deployed Cloud Function. To be used for testing\npurposes as very limited traffic is allowed. For more information on\nthe actual limits, refer to\n[Rate Limits](https://cloud.google.com/functions/quotas#rate_limits).",
// "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:call",
// "httpMethod": "POST",
// "id": "cloudfunctions.projects.locations.functions.call",
@ -2819,12 +2874,23 @@ type ProjectsLocationsFunctionsGenerateUploadUrlCall struct {
//
// * Source file type should be a zip file.
// * Source file size should not exceed 100MB limit.
// * No credentials should be attached - the signed URLs provide access
// to the
// target bucket using internal service identity; if credentials were
// attached, the identity from the credentials would be used, but
// that
// identity does not have permissions to upload files to the
// URL.
//
// When making a HTTP PUT request, these two headers need to be
// specified:
//
// * `content-type: application/zip`
// * `x-goog-content-length-range: 0,104857600`
//
// And this header SHOULD NOT be specified:
//
// * `Authorization: Bearer YOUR_TOKEN`
func (r *ProjectsLocationsFunctionsService) GenerateUploadUrl(parent string, generateuploadurlrequest *GenerateUploadUrlRequest) *ProjectsLocationsFunctionsGenerateUploadUrlCall {
c := &ProjectsLocationsFunctionsGenerateUploadUrlCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.parent = parent
@ -2922,7 +2988,7 @@ func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Do(opts ...googleapi.C
}
return ret, nil
// {
// "description": "Returns a signed URL for uploading a function source code.\nFor more information about the signed URL usage see:\nhttps://cloud.google.com/storage/docs/access-control/signed-urls.\nOnce the function source code upload is complete, the used signed\nURL should be provided in CreateFunction or UpdateFunction request\nas a reference to the function source code.\n\nWhen uploading source code to the generated signed URL, please follow\nthese restrictions:\n\n* Source file type should be a zip file.\n* Source file size should not exceed 100MB limit.\n\nWhen making a HTTP PUT request, these two headers need to be specified:\n\n* `content-type: application/zip`\n* `x-goog-content-length-range: 0,104857600`",
// "description": "Returns a signed URL for uploading a function source code.\nFor more information about the signed URL usage see:\nhttps://cloud.google.com/storage/docs/access-control/signed-urls.\nOnce the function source code upload is complete, the used signed\nURL should be provided in CreateFunction or UpdateFunction request\nas a reference to the function source code.\n\nWhen uploading source code to the generated signed URL, please follow\nthese restrictions:\n\n* Source file type should be a zip file.\n* Source file size should not exceed 100MB limit.\n* No credentials should be attached - the signed URLs provide access to the\n target bucket using internal service identity; if credentials were\n attached, the identity from the credentials would be used, but that\n identity does not have permissions to upload files to the URL.\n\nWhen making a HTTP PUT request, these two headers need to be specified:\n\n* `content-type: application/zip`\n* `x-goog-content-length-range: 0,104857600`\n\nAnd this header SHOULD NOT be specified:\n\n* `Authorization: Bearer YOUR_TOKEN`",
// "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/functions:generateUploadUrl",
// "httpMethod": "POST",
// "id": "cloudfunctions.projects.locations.functions.generateUploadUrl",
@ -3107,8 +3173,9 @@ type ProjectsLocationsFunctionsGetIamPolicyCall struct {
header_ http.Header
}
// GetIamPolicy: Gets the access control policy for a resource.
// Returns an empty policy if the resource exists and does not have a
// GetIamPolicy: Gets the IAM access control policy for a
// function.
// Returns an empty policy if the function exists and does not have a
// policy
// set.
func (r *ProjectsLocationsFunctionsService) GetIamPolicy(resource string) *ProjectsLocationsFunctionsGetIamPolicyCall {
@ -3215,7 +3282,7 @@ func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Do(opts ...googleapi.CallOp
}
return ret, nil
// {
// "description": "Gets the access control policy for a resource.\nReturns an empty policy if the resource exists and does not have a policy\nset.",
// "description": "Gets the IAM access control policy for a function.\nReturns an empty policy if the function exists and does not have a policy\nset.",
// "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:getIamPolicy",
// "httpMethod": "GET",
// "id": "cloudfunctions.projects.locations.functions.getIamPolicy",
@ -3599,9 +3666,9 @@ type ProjectsLocationsFunctionsSetIamPolicyCall struct {
header_ http.Header
}
// SetIamPolicy: Sets the access control policy on the specified
// resource. Replaces any
// existing policy.
// SetIamPolicy: Sets the IAM access control policy on the specified
// function.
// Replaces any existing policy.
func (r *ProjectsLocationsFunctionsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsFunctionsSetIamPolicyCall {
c := &ProjectsLocationsFunctionsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.resource = resource
@ -3699,7 +3766,7 @@ func (c *ProjectsLocationsFunctionsSetIamPolicyCall) Do(opts ...googleapi.CallOp
}
return ret, nil
// {
// "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy.",
// "description": "Sets the IAM access control policy on the specified function.\nReplaces any existing policy.",
// "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:setIamPolicy",
// "httpMethod": "POST",
// "id": "cloudfunctions.projects.locations.functions.setIamPolicy",
@ -3740,17 +3807,12 @@ type ProjectsLocationsFunctionsTestIamPermissionsCall struct {
header_ http.Header
}
// TestIamPermissions: Returns permissions that a caller has on the
// specified resource.
// If the resource does not exist, this will return an empty set
// TestIamPermissions: Tests the specified permissions against the IAM
// access control policy
// for a function.
// If the function does not exist, this will return an empty set
// of
// permissions, not a NOT_FOUND error.
//
// Note: This operation is designed to be used for building
// permission-aware
// UIs and command-line tools, not for authorization checking. This
// operation
// may "fail open" without warning.
func (r *ProjectsLocationsFunctionsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsFunctionsTestIamPermissionsCall {
c := &ProjectsLocationsFunctionsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.resource = resource
@ -3848,7 +3910,7 @@ func (c *ProjectsLocationsFunctionsTestIamPermissionsCall) Do(opts ...googleapi.
}
return ret, nil
// {
// "description": "Returns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning.",
// "description": "Tests the specified permissions against the IAM access control policy\nfor a function.\nIf the function does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.",
// "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:testIamPermissions",
// "httpMethod": "POST",
// "id": "cloudfunctions.projects.locations.functions.testIamPermissions",

View File

@ -1184,7 +1184,7 @@
}
}
},
"revision": "20181120",
"revision": "20190409",
"rootUrl": "https://cloudiot.googleapis.com/",
"schemas": {
"BindDeviceToGatewayRequest": {
@ -1214,10 +1214,10 @@
"properties": {
"condition": {
"$ref": "Expr",
"description": "Unimplemented. The condition that is associated with this binding.\nNOTE: an unsatisfied condition will not allow user access via current\nbinding. Different bindings, including their conditions, are examined\nindependently."
"description": "The condition that is associated with this binding.\nNOTE: An unsatisfied condition will not allow user access via current\nbinding. Different bindings, including their conditions, are examined\nindependently."
},
"members": {
"description": "Specifies the identities requesting access for a Cloud Platform resource.\n`members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is\n on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone\n who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google\n account. For example, `alice@gmail.com` .\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service\n account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group.\n For example, `admins@example.com`.\n\n\n* `domain:{domain}`: A Google Apps domain name that represents all the\n users of that domain. For example, `google.com` or `example.com`.\n\n",
"description": "Specifies the identities requesting access for a Cloud Platform resource.\n`members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is\n on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone\n who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google\n account. For example, `alice@gmail.com` .\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service\n account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group.\n For example, `admins@example.com`.\n\n\n* `domain:{domain}`: The G Suite domain (primary) that represents all the\n users of that domain. For example, `google.com` or `example.com`.\n\n",
"items": {
"type": "string"
},
@ -1806,7 +1806,7 @@
"type": "object"
},
"Status": {
"description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.",
"description": "The `Status` type defines a logical error model that is suitable for\ndifferent programming environments, including REST APIs and RPC APIs. It is\nused by [gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error\nmessage, and error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.",
"id": "Status",
"properties": {
"code": {

View File

@ -1,4 +1,4 @@
// Copyright 2018 Google Inc. All rights reserved.
// Copyright 2019 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
@ -6,13 +6,39 @@
// Package cloudiot provides access to the Cloud IoT API.
//
// See https://cloud.google.com/iot
// For product documentation, see: https://cloud.google.com/iot
//
// Creating a client
//
// Usage example:
//
// import "google.golang.org/api/cloudiot/v1"
// ...
// cloudiotService, err := cloudiot.New(oauthHttpClient)
// ctx := context.Background()
// cloudiotService, err := cloudiot.NewService(ctx)
//
// In this example, Google Application Default Credentials are used for authentication.
//
// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
//
// Other authentication options
//
// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
//
// cloudiotService, err := cloudiot.NewService(ctx, option.WithScopes(cloudiot.CloudiotScope))
//
// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
//
// cloudiotService, err := cloudiot.NewService(ctx, option.WithAPIKey("AIza..."))
//
// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
//
// config := &oauth2.Config{...}
// // ...
// token, err := config.Exchange(ctx, ...)
// cloudiotService, err := cloudiot.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See https://godoc.org/google.golang.org/api/option/ for details on options.
package cloudiot // import "google.golang.org/api/cloudiot/v1"
import (
@ -29,6 +55,8 @@ import (
gensupport "google.golang.org/api/gensupport"
googleapi "google.golang.org/api/googleapi"
option "google.golang.org/api/option"
htransport "google.golang.org/api/transport/http"
)
// Always reference these packages, just in case the auto-generated code
@ -59,6 +87,33 @@ const (
CloudiotScope = "https://www.googleapis.com/auth/cloudiot"
)
// NewService creates a new Service.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
scopesOption := option.WithScopes(
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloudiot",
)
// NOTE: prepend, so we don't override user-specified scopes.
opts = append([]option.ClientOption{scopesOption}, opts...)
client, endpoint, err := htransport.NewClient(ctx, opts...)
if err != nil {
return nil, err
}
s, err := New(client)
if err != nil {
return nil, err
}
if endpoint != "" {
s.BasePath = endpoint
}
return s, nil
}
// New creates a new Service. It uses the provided http.Client for requests.
//
// Deprecated: please use NewService instead.
// To provide a custom HTTP client, use option.WithHTTPClient.
// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
@ -246,9 +301,8 @@ type BindDeviceToGatewayResponse struct {
// Binding: Associates `members` with a `role`.
type Binding struct {
// Condition: Unimplemented. The condition that is associated with this
// binding.
// NOTE: an unsatisfied condition will not allow user access via
// Condition: The condition that is associated with this binding.
// NOTE: An unsatisfied condition will not allow user access via
// current
// binding. Different bindings, including their conditions, are
// examined
@ -282,7 +336,7 @@ type Binding struct {
// For example, `admins@example.com`.
//
//
// * `domain:{domain}`: A Google Apps domain name that represents all
// * `domain:{domain}`: The G Suite domain (primary) that represents all
// the
// users of that domain. For example, `google.com` or
// `example.com`.
@ -1572,20 +1626,20 @@ func (s *StateNotificationConfig) MarshalJSON() ([]byte, error) {
}
// 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:
// 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 needs
//
// # Overview
//
// The `Status` message contains three pieces of data: error code, error
// message,
// and error details. The error code should be an enum value
// The `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

View File

@ -4,6 +4,9 @@
"scopes": {
"https://www.googleapis.com/auth/cloud-platform": {
"description": "View and manage your data across Google Cloud Platform services"
},
"https://www.googleapis.com/auth/cloudkms": {
"description": "View and manage your keys and secrets stored in Cloud Key Management Service"
}
}
}
@ -130,7 +133,8 @@
"$ref": "Location"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloudkms"
]
},
"list": {
@ -171,7 +175,8 @@
"$ref": "ListLocationsResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloudkms"
]
}
},
@ -208,7 +213,8 @@
"$ref": "KeyRing"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloudkms"
]
},
"get": {
@ -233,7 +239,8 @@
"$ref": "KeyRing"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloudkms"
]
},
"getIamPolicy": {
@ -258,7 +265,8 @@
"$ref": "Policy"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloudkms"
]
},
"list": {
@ -294,7 +302,8 @@
"$ref": "ListKeyRingsResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloudkms"
]
},
"setIamPolicy": {
@ -322,7 +331,8 @@
"$ref": "Policy"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloudkms"
]
},
"testIamPermissions": {
@ -350,7 +360,8 @@
"$ref": "TestIamPermissionsResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloudkms"
]
}
},
@ -387,7 +398,8 @@
"$ref": "CryptoKey"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloudkms"
]
},
"decrypt": {
@ -415,7 +427,8 @@
"$ref": "DecryptResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloudkms"
]
},
"encrypt": {
@ -443,7 +456,8 @@
"$ref": "EncryptResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloudkms"
]
},
"get": {
@ -468,7 +482,8 @@
"$ref": "CryptoKey"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloudkms"
]
},
"getIamPolicy": {
@ -493,7 +508,8 @@
"$ref": "Policy"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloudkms"
]
},
"list": {
@ -538,7 +554,8 @@
"$ref": "ListCryptoKeysResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloudkms"
]
},
"patch": {
@ -572,7 +589,8 @@
"$ref": "CryptoKey"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloudkms"
]
},
"setIamPolicy": {
@ -600,7 +618,8 @@
"$ref": "Policy"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloudkms"
]
},
"testIamPermissions": {
@ -628,7 +647,8 @@
"$ref": "TestIamPermissionsResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloudkms"
]
},
"updatePrimaryVersion": {
@ -656,7 +676,8 @@
"$ref": "CryptoKey"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloudkms"
]
}
},
@ -688,7 +709,8 @@
"$ref": "AsymmetricDecryptResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloudkms"
]
},
"asymmetricSign": {
@ -716,7 +738,8 @@
"$ref": "AsymmetricSignResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloudkms"
]
},
"create": {
@ -744,7 +767,8 @@
"$ref": "CryptoKeyVersion"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloudkms"
]
},
"destroy": {
@ -772,7 +796,8 @@
"$ref": "CryptoKeyVersion"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloudkms"
]
},
"get": {
@ -797,7 +822,8 @@
"$ref": "CryptoKeyVersion"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloudkms"
]
},
"getPublicKey": {
@ -822,7 +848,8 @@
"$ref": "PublicKey"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloudkms"
]
},
"list": {
@ -867,7 +894,8 @@
"$ref": "ListCryptoKeyVersionsResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloudkms"
]
},
"patch": {
@ -901,7 +929,8 @@
"$ref": "CryptoKeyVersion"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloudkms"
]
},
"restore": {
@ -929,7 +958,8 @@
"$ref": "CryptoKeyVersion"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloudkms"
]
}
}
@ -960,7 +990,8 @@
"$ref": "Policy"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloudkms"
]
},
"setIamPolicy": {
@ -988,7 +1019,8 @@
"$ref": "Policy"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloudkms"
]
},
"testIamPermissions": {
@ -1016,7 +1048,8 @@
"$ref": "TestIamPermissionsResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloudkms"
]
}
}
@ -1028,7 +1061,7 @@
}
}
},
"revision": "20181210",
"revision": "20190321",
"rootUrl": "https://cloudkms.googleapis.com/",
"schemas": {
"AsymmetricDecryptRequest": {
@ -1132,10 +1165,10 @@
"properties": {
"condition": {
"$ref": "Expr",
"description": "Unimplemented. The condition that is associated with this binding.\nNOTE: an unsatisfied condition will not allow user access via current\nbinding. Different bindings, including their conditions, are examined\nindependently."
"description": "The condition that is associated with this binding.\nNOTE: an unsatisfied condition will not allow user access via current\nbinding. Different bindings, including their conditions, are examined\nindependently."
},
"members": {
"description": "Specifies the identities requesting access for a Cloud Platform resource.\n`members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is\n on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone\n who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google\n account. For example, `alice@gmail.com` .\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service\n account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group.\n For example, `admins@example.com`.\n\n\n* `domain:{domain}`: A Google Apps domain name that represents all the\n users of that domain. For example, `google.com` or `example.com`.\n\n",
"description": "Specifies the identities requesting access for a Cloud Platform resource.\n`members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is\n on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone\n who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google\n account. For example, `alice@gmail.com` .\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service\n account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group.\n For example, `admins@example.com`.\n\n\n* `domain:{domain}`: The G Suite domain (primary) that represents all the\n users of that domain. For example, `google.com` or `example.com`.\n\n",
"items": {
"type": "string"
},
@ -1489,7 +1522,7 @@
"type": "object"
},
"KeyOperationAttestation": {
"description": "Contains an HSM-generated attestation about a key operation.",
"description": "Contains an HSM-generated attestation about a key operation. For more\ninformation, see [Verifying attestations]\n(https://cloud.google.com/kms/docs/attest-key).",
"id": "KeyOperationAttestation",
"properties": {
"content": {
@ -1501,11 +1534,13 @@
"description": "Output only. The format of the attestation data.",
"enum": [
"ATTESTATION_FORMAT_UNSPECIFIED",
"CAVIUM_V1_COMPRESSED"
"CAVIUM_V1_COMPRESSED",
"CAVIUM_V2_COMPRESSED"
],
"enumDescriptions": [
"Not specified.",
"Cavium HSM attestation compressed with gzip. Note that this format is\ndefined by Cavium and subject to change at any time."
"Cavium HSM attestation compressed with gzip. Note that this format is\ndefined by Cavium and subject to change at any time.",
"Cavium HSM attestation V2 compressed with gzip. This is a new format\nintroduced in Cavium's version 3.2-08."
],
"type": "string"
}

View File

@ -1,4 +1,4 @@
// Copyright 2018 Google Inc. All rights reserved.
// Copyright 2019 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
@ -8,13 +8,39 @@
//
// This package is DEPRECATED. Use package cloud.google.com/go/kms/apiv1 instead.
//
// See https://cloud.google.com/kms/
// For product documentation, see: https://cloud.google.com/kms/
//
// Creating a client
//
// Usage example:
//
// import "google.golang.org/api/cloudkms/v1"
// ...
// cloudkmsService, err := cloudkms.New(oauthHttpClient)
// ctx := context.Background()
// cloudkmsService, err := cloudkms.NewService(ctx)
//
// In this example, Google Application Default Credentials are used for authentication.
//
// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
//
// Other authentication options
//
// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
//
// cloudkmsService, err := cloudkms.NewService(ctx, option.WithScopes(cloudkms.CloudkmsScope))
//
// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
//
// cloudkmsService, err := cloudkms.NewService(ctx, option.WithAPIKey("AIza..."))
//
// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
//
// config := &oauth2.Config{...}
// // ...
// token, err := config.Exchange(ctx, ...)
// cloudkmsService, err := cloudkms.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See https://godoc.org/google.golang.org/api/option/ for details on options.
package cloudkms // import "google.golang.org/api/cloudkms/v1"
import (
@ -31,6 +57,8 @@ import (
gensupport "google.golang.org/api/gensupport"
googleapi "google.golang.org/api/googleapi"
option "google.golang.org/api/option"
htransport "google.golang.org/api/transport/http"
)
// Always reference these packages, just in case the auto-generated code
@ -56,8 +84,39 @@ const basePath = "https://cloudkms.googleapis.com/"
const (
// View and manage your data across Google Cloud Platform services
CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
// View and manage your keys and secrets stored in Cloud Key Management
// Service
CloudkmsScope = "https://www.googleapis.com/auth/cloudkms"
)
// NewService creates a new Service.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
scopesOption := option.WithScopes(
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloudkms",
)
// NOTE: prepend, so we don't override user-specified scopes.
opts = append([]option.ClientOption{scopesOption}, opts...)
client, endpoint, err := htransport.NewClient(ctx, opts...)
if err != nil {
return nil, err
}
s, err := New(client)
if err != nil {
return nil, err
}
if endpoint != "" {
s.BasePath = endpoint
}
return s, nil
}
// New creates a new Service. It uses the provided http.Client for requests.
//
// Deprecated: please use NewService instead.
// To provide a custom HTTP client, use option.WithHTTPClient.
// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
@ -438,8 +497,7 @@ func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
// Binding: Associates `members` with a `role`.
type Binding struct {
// Condition: Unimplemented. The condition that is associated with this
// binding.
// Condition: The condition that is associated with this binding.
// NOTE: an unsatisfied condition will not allow user access via
// current
// binding. Different bindings, including their conditions, are
@ -474,7 +532,7 @@ type Binding struct {
// For example, `admins@example.com`.
//
//
// * `domain:{domain}`: A Google Apps domain name that represents all
// * `domain:{domain}`: The G Suite domain (primary) that represents all
// the
// users of that domain. For example, `google.com` or
// `example.com`.
@ -1105,7 +1163,10 @@ func (s *Expr) MarshalJSON() ([]byte, error) {
}
// KeyOperationAttestation: Contains an HSM-generated attestation about
// a key operation.
// a key operation. For more
// information, see [Verifying
// attestations]
// (https://cloud.google.com/kms/docs/attest-key).
type KeyOperationAttestation struct {
// Content: Output only. The attestation data provided by the HSM when
// the key
@ -1119,6 +1180,9 @@ type KeyOperationAttestation struct {
// "CAVIUM_V1_COMPRESSED" - Cavium HSM attestation compressed with
// gzip. Note that this format is
// defined by Cavium and subject to change at any time.
// "CAVIUM_V2_COMPRESSED" - Cavium HSM attestation V2 compressed with
// gzip. This is a new format
// introduced in Cavium's version 3.2-08.
Format string `json:"format,omitempty"`
// ForceSendFields is a list of field names (e.g. "Content") to
@ -1903,7 +1967,8 @@ func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location,
// "$ref": "Location"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/cloudkms"
// ]
// }
@ -2084,7 +2149,8 @@ func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocat
// "$ref": "ListLocationsResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/cloudkms"
// ]
// }
@ -2257,7 +2323,8 @@ func (c *ProjectsLocationsKeyRingsCreateCall) Do(opts ...googleapi.CallOption) (
// "$ref": "KeyRing"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/cloudkms"
// ]
// }
@ -2400,7 +2467,8 @@ func (c *ProjectsLocationsKeyRingsGetCall) Do(opts ...googleapi.CallOption) (*Ke
// "$ref": "KeyRing"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/cloudkms"
// ]
// }
@ -2546,7 +2614,8 @@ func (c *ProjectsLocationsKeyRingsGetIamPolicyCall) Do(opts ...googleapi.CallOpt
// "$ref": "Policy"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/cloudkms"
// ]
// }
@ -2721,7 +2790,8 @@ func (c *ProjectsLocationsKeyRingsListCall) Do(opts ...googleapi.CallOption) (*L
// "$ref": "ListKeyRingsResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/cloudkms"
// ]
// }
@ -2883,7 +2953,8 @@ func (c *ProjectsLocationsKeyRingsSetIamPolicyCall) Do(opts ...googleapi.CallOpt
// "$ref": "Policy"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/cloudkms"
// ]
// }
@ -3032,7 +3103,8 @@ func (c *ProjectsLocationsKeyRingsTestIamPermissionsCall) Do(opts ...googleapi.C
// "$ref": "TestIamPermissionsResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/cloudkms"
// ]
// }
@ -3188,7 +3260,8 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysCreateCall) Do(opts ...googleapi.Cal
// "$ref": "CryptoKey"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/cloudkms"
// ]
// }
@ -3329,7 +3402,8 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysDecryptCall) Do(opts ...googleapi.Ca
// "$ref": "DecryptResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/cloudkms"
// ]
// }
@ -3471,7 +3545,8 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysEncryptCall) Do(opts ...googleapi.Ca
// "$ref": "EncryptResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/cloudkms"
// ]
// }
@ -3615,7 +3690,8 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysGetCall) Do(opts ...googleapi.CallOp
// "$ref": "CryptoKey"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/cloudkms"
// ]
// }
@ -3761,7 +3837,8 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysGetIamPolicyCall) Do(opts ...googlea
// "$ref": "Policy"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/cloudkms"
// ]
// }
@ -3957,7 +4034,8 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysListCall) Do(opts ...googleapi.CallO
// "$ref": "ListCryptoKeysResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/cloudkms"
// ]
// }
@ -4130,7 +4208,8 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysPatchCall) Do(opts ...googleapi.Call
// "$ref": "CryptoKey"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/cloudkms"
// ]
// }
@ -4271,7 +4350,8 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysSetIamPolicyCall) Do(opts ...googlea
// "$ref": "Policy"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/cloudkms"
// ]
// }
@ -4420,7 +4500,8 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysTestIamPermissionsCall) Do(opts ...g
// "$ref": "TestIamPermissionsResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/cloudkms"
// ]
// }
@ -4562,7 +4643,8 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysUpdatePrimaryVersionCall) Do(opts ..
// "$ref": "CryptoKey"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/cloudkms"
// ]
// }
@ -4705,7 +4787,8 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsAsymmetricDecryptCa
// "$ref": "AsymmetricDecryptResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/cloudkms"
// ]
// }
@ -4848,7 +4931,8 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsAsymmetricSignCall)
// "$ref": "AsymmetricSignResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/cloudkms"
// ]
// }
@ -4991,7 +5075,8 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsCreateCall) Do(opts
// "$ref": "CryptoKeyVersion"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/cloudkms"
// ]
// }
@ -5142,7 +5227,8 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsDestroyCall) Do(opt
// "$ref": "CryptoKeyVersion"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/cloudkms"
// ]
// }
@ -5285,7 +5371,8 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsGetCall) Do(opts ..
// "$ref": "CryptoKeyVersion"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/cloudkms"
// ]
// }
@ -5432,7 +5519,8 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsGetPublicKeyCall) D
// "$ref": "PublicKey"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/cloudkms"
// ]
// }
@ -5628,7 +5716,8 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsListCall) Do(opts .
// "$ref": "ListCryptoKeyVersionsResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/cloudkms"
// ]
// }
@ -5808,7 +5897,8 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsPatchCall) Do(opts
// "$ref": "CryptoKeyVersion"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/cloudkms"
// ]
// }
@ -5954,7 +6044,8 @@ func (c *ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRestoreCall) Do(opt
// "$ref": "CryptoKeyVersion"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/cloudkms"
// ]
// }
@ -6100,7 +6191,8 @@ func (c *ProjectsLocationsKeyRingsImportJobsGetIamPolicyCall) Do(opts ...googlea
// "$ref": "Policy"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/cloudkms"
// ]
// }
@ -6241,7 +6333,8 @@ func (c *ProjectsLocationsKeyRingsImportJobsSetIamPolicyCall) Do(opts ...googlea
// "$ref": "Policy"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/cloudkms"
// ]
// }
@ -6390,7 +6483,8 @@ func (c *ProjectsLocationsKeyRingsImportJobsTestIamPermissionsCall) Do(opts ...g
// "$ref": "TestIamPermissionsResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/cloudkms"
// ]
// }

View File

@ -461,7 +461,7 @@
],
"parameters": {
"name": {
"description": "The resource name of the Organization to fetch, e.g. \"organizations/1234\".",
"description": "The resource name of the Organization to fetch. This is the organization's\nrelative path in the API, formatted as \"organizations/[organizationId]\".\nFor example, \"organizations/1234\".",
"location": "path",
"pattern": "^organizations/[^/]+$",
"required": true,
@ -947,7 +947,7 @@
"parameterOrder": [],
"parameters": {
"filter": {
"description": "An expression for filtering the results of the request. Filter rules are\ncase insensitive. The fields eligible for filtering are:\n\n+ `name`\n+ `id`\n+ \u003ccode\u003elabels.\u003cem\u003ekey\u003c/em\u003e\u003c/code\u003e where *key* is the name of a label\n\nSome examples of using labels as filters:\n\n|Filter|Description|\n|------|-----------|\n|name:how*|The project's name starts with \"how\".|\n|name:Howl|The project's name is `Howl` or `howl`.|\n|name:HOWL|Equivalent to above.|\n|NAME:howl|Equivalent to above.|\n|labels.color:*|The project has the label `color`.|\n|labels.color:red|The project's label `color` has the value `red`.|\n|labels.color:red\u0026nbsp;labels.size:big|The project's label `color` has the value `red` and its label `size` has the value `big`.\n\nIf you specify a filter that has both `parent.type` and `parent.id`, then\nthe `resourcemanager.projects.list` permission is checked on the parent.\nIf the user has this permission, all projects under the parent will be\nreturned after remaining filters have been applied. If the user lacks this\npermission, then all projects for which the user has the\n`resourcemanager.projects.get` permission will be returned after remaining\nfilters have been applied. If no filter is specified, the call will return\nprojects for which the user has `resourcemanager.projects.get` permissions.\n\nOptional.",
"description": "An expression for filtering the results of the request. Filter rules are\ncase insensitive. The fields eligible for filtering are:\n\n+ `name`\n+ `id`\n+ \u003ccode\u003elabels.\u003cem\u003ekey\u003c/em\u003e\u003c/code\u003e where *key* is the name of a label\n\nSome examples of using labels as filters:\n\n|Filter|Description|\n|------|-----------|\n|name:how*|The project's name starts with \"how\".|\n|name:Howl|The project's name is `Howl` or `howl`.|\n|name:HOWL|Equivalent to above.|\n|NAME:howl|Equivalent to above.|\n|labels.color:*|The project has the label `color`.|\n|labels.color:red|The project's label `color` has the value `red`.|\n|labels.color:red\u0026nbsp;labels.size:big|The project's label `color` has the\nvalue `red` and its label `size` has the value `big`.\n\nIf you specify a filter that has both `parent.type` and `parent.id`, then\nthe `resourcemanager.projects.list` permission is checked on the parent.\nIf the user has this permission, all projects under the parent will be\nreturned after remaining filters have been applied. If the user lacks this\npermission, then all projects for which the user has the\n`resourcemanager.projects.get` permission will be returned after remaining\nfilters have been applied. If no filter is specified, the call will return\nprojects for which the user has `resourcemanager.projects.get` permissions.\n\nOptional.",
"location": "query",
"type": "string"
},
@ -1170,7 +1170,7 @@
}
}
},
"revision": "20181015",
"revision": "20190417",
"rootUrl": "https://cloudresourcemanager.googleapis.com/",
"schemas": {
"Ancestor": {
@ -1238,10 +1238,10 @@
"properties": {
"condition": {
"$ref": "Expr",
"description": "Unimplemented. The condition that is associated with this binding.\nNOTE: an unsatisfied condition will not allow user access via current\nbinding. Different bindings, including their conditions, are examined\nindependently."
"description": "The condition that is associated with this binding.\nNOTE: An unsatisfied condition will not allow user access via current\nbinding. Different bindings, including their conditions, are examined\nindependently."
},
"members": {
"description": "Specifies the identities requesting access for a Cloud Platform resource.\n`members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is\n on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone\n who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google\n account. For example, `alice@gmail.com` .\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service\n account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group.\n For example, `admins@example.com`.\n\n\n* `domain:{domain}`: A Google Apps domain name that represents all the\n users of that domain. For example, `google.com` or `example.com`.\n\n",
"description": "Specifies the identities requesting access for a Cloud Platform resource.\n`members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is\n on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone\n who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google\n account. For example, `alice@gmail.com` .\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service\n account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group.\n For example, `admins@example.com`.\n\n\n* `domain:{domain}`: The G Suite domain (primary) that represents all the\n users of that domain. For example, `google.com` or `example.com`.\n\n",
"items": {
"type": "string"
},
@ -1265,7 +1265,7 @@
"id": "BooleanPolicy",
"properties": {
"enforced": {
"description": "If `true`, then the `Policy` is enforced. If `false`, then any\nconfiguration is acceptable.\n\nSuppose you have a `Constraint` `constraints/compute.disableSerialPortAccess`\nwith `constraint_default` set to `ALLOW`. A `Policy` for that\n`Constraint` exhibits the following behavior:\n - If the `Policy` at this resource has enforced set to `false`, serial\n port connection attempts will be allowed.\n - If the `Policy` at this resource has enforced set to `true`, serial\n port connection attempts will be refused.\n - If the `Policy` at this resource is `RestoreDefault`, serial port\n connection attempts will be allowed.\n - If no `Policy` is set at this resource or anywhere higher in the\n resource hierarchy, serial port connection attempts will be allowed.\n - If no `Policy` is set at this resource, but one exists higher in the\n resource hierarchy, the behavior is as if the`Policy` were set at\n this resource.\n\nThe following examples demonstrate the different possible layerings:\n\nExample 1 (nearest `Constraint` wins):\n `organizations/foo` has a `Policy` with:\n {enforced: false}\n `projects/bar` has no `Policy` set.\nThe constraint at `projects/bar` and `organizations/foo` will not be\nenforced.\n\nExample 2 (enforcement gets replaced):\n `organizations/foo` has a `Policy` with:\n {enforced: false}\n `projects/bar` has a `Policy` with:\n {enforced: true}\nThe constraint at `organizations/foo` is not enforced.\nThe constraint at `projects/bar` is enforced.\n\nExample 3 (RestoreDefault):\n `organizations/foo` has a `Policy` with:\n {enforced: true}\n `projects/bar` has a `Policy` with:\n {RestoreDefault: {}}\nThe constraint at `organizations/foo` is enforced.\nThe constraint at `projects/bar` is not enforced, because\n`constraint_default` for the `Constraint` is `ALLOW`.",
"description": "If `true`, then the `Policy` is enforced. If `false`, then any\nconfiguration is acceptable.\n\nSuppose you have a `Constraint`\n`constraints/compute.disableSerialPortAccess` with `constraint_default`\nset to `ALLOW`. A `Policy` for that `Constraint` exhibits the following\nbehavior:\n - If the `Policy` at this resource has enforced set to `false`, serial\n port connection attempts will be allowed.\n - If the `Policy` at this resource has enforced set to `true`, serial\n port connection attempts will be refused.\n - If the `Policy` at this resource is `RestoreDefault`, serial port\n connection attempts will be allowed.\n - If no `Policy` is set at this resource or anywhere higher in the\n resource hierarchy, serial port connection attempts will be allowed.\n - If no `Policy` is set at this resource, but one exists higher in the\n resource hierarchy, the behavior is as if the`Policy` were set at\n this resource.\n\nThe following examples demonstrate the different possible layerings:\n\nExample 1 (nearest `Constraint` wins):\n `organizations/foo` has a `Policy` with:\n {enforced: false}\n `projects/bar` has no `Policy` set.\nThe constraint at `projects/bar` and `organizations/foo` will not be\nenforced.\n\nExample 2 (enforcement gets replaced):\n `organizations/foo` has a `Policy` with:\n {enforced: false}\n `projects/bar` has a `Policy` with:\n {enforced: true}\nThe constraint at `organizations/foo` is not enforced.\nThe constraint at `projects/bar` is enforced.\n\nExample 3 (RestoreDefault):\n `organizations/foo` has a `Policy` with:\n {enforced: true}\n `projects/bar` has a `Policy` with:\n {RestoreDefault: {}}\nThe constraint at `organizations/foo` is enforced.\nThe constraint at `projects/bar` is not enforced, because\n`constraint_default` for the `Constraint` is `ALLOW`.",
"type": "boolean"
}
},
@ -1861,7 +1861,7 @@
"type": "string"
},
"name": {
"description": "The user-assigned display name of the Project.\nIt must be 4 to 30 characters.\nAllowed characters are: lowercase and uppercase letters, numbers,\nhyphen, single-quote, double-quote, space, and exclamation point.\n\nExample: \u003ccode\u003eMy Project\u003c/code\u003e\nRead-write.",
"description": "The optional user-assigned display name of the Project.\nWhen present it must be between 4 to 30 characters.\nAllowed characters are: lowercase and uppercase letters, numbers,\nhyphen, single-quote, double-quote, space, and exclamation point.\n\nExample: \u003ccode\u003eMy Project\u003c/code\u003e\nRead-write.",
"type": "string"
},
"parent": {
@ -1987,7 +1987,7 @@
"type": "object"
},
"Status": {
"description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.",
"description": "The `Status` type defines a logical error model that is suitable for\ndifferent programming environments, including REST APIs and RPC APIs. It is\nused by [gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error\nmessage, and error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.",
"id": "Status",
"properties": {
"code": {

View File

@ -1,4 +1,4 @@
// Copyright 2018 Google Inc. All rights reserved.
// Copyright 2019 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
@ -6,13 +6,39 @@
// Package cloudresourcemanager provides access to the Cloud Resource Manager API.
//
// See https://cloud.google.com/resource-manager
// For product documentation, see: https://cloud.google.com/resource-manager
//
// Creating a client
//
// Usage example:
//
// import "google.golang.org/api/cloudresourcemanager/v1"
// ...
// cloudresourcemanagerService, err := cloudresourcemanager.New(oauthHttpClient)
// ctx := context.Background()
// cloudresourcemanagerService, err := cloudresourcemanager.NewService(ctx)
//
// In this example, Google Application Default Credentials are used for authentication.
//
// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
//
// Other authentication options
//
// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
//
// cloudresourcemanagerService, err := cloudresourcemanager.NewService(ctx, option.WithScopes(cloudresourcemanager.CloudPlatformReadOnlyScope))
//
// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
//
// cloudresourcemanagerService, err := cloudresourcemanager.NewService(ctx, option.WithAPIKey("AIza..."))
//
// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
//
// config := &oauth2.Config{...}
// // ...
// token, err := config.Exchange(ctx, ...)
// cloudresourcemanagerService, err := cloudresourcemanager.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See https://godoc.org/google.golang.org/api/option/ for details on options.
package cloudresourcemanager // import "google.golang.org/api/cloudresourcemanager/v1"
import (
@ -29,6 +55,8 @@ import (
gensupport "google.golang.org/api/gensupport"
googleapi "google.golang.org/api/googleapi"
option "google.golang.org/api/option"
htransport "google.golang.org/api/transport/http"
)
// Always reference these packages, just in case the auto-generated code
@ -59,6 +87,33 @@ const (
CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only"
)
// NewService creates a new Service.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
scopesOption := option.WithScopes(
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloud-platform.read-only",
)
// NOTE: prepend, so we don't override user-specified scopes.
opts = append([]option.ClientOption{scopesOption}, opts...)
client, endpoint, err := htransport.NewClient(ctx, opts...)
if err != nil {
return nil, err
}
s, err := New(client)
if err != nil {
return nil, err
}
if endpoint != "" {
s.BasePath = endpoint
}
return s, nil
}
// New creates a new Service. It uses the provided http.Client for requests.
//
// Deprecated: please use NewService instead.
// To provide a custom HTTP client, use option.WithHTTPClient.
// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
@ -324,9 +379,8 @@ func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
// Binding: Associates `members` with a `role`.
type Binding struct {
// Condition: Unimplemented. The condition that is associated with this
// binding.
// NOTE: an unsatisfied condition will not allow user access via
// Condition: The condition that is associated with this binding.
// NOTE: An unsatisfied condition will not allow user access via
// current
// binding. Different bindings, including their conditions, are
// examined
@ -360,7 +414,7 @@ type Binding struct {
// For example, `admins@example.com`.
//
//
// * `domain:{domain}`: A Google Apps domain name that represents all
// * `domain:{domain}`: The G Suite domain (primary) that represents all
// the
// users of that domain. For example, `google.com` or
// `example.com`.
@ -414,11 +468,13 @@ type BooleanPolicy struct {
// any
// configuration is acceptable.
//
// Suppose you have a `Constraint`
// `constraints/compute.disableSerialPortAccess`
// with `constraint_default` set to `ALLOW`. A `Policy` for
// that
// `Constraint` exhibits the following behavior:
// Suppose you have a
// `Constraint`
// `constraints/compute.disableSerialPortAccess` with
// `constraint_default`
// set to `ALLOW`. A `Policy` for that `Constraint` exhibits the
// following
// behavior:
// - If the `Policy` at this resource has enforced set to `false`,
// serial
// port connection attempts will be allowed.
@ -1907,8 +1963,8 @@ type Project struct {
// not returned by the API.
LifecycleState string `json:"lifecycleState,omitempty"`
// Name: The user-assigned display name of the Project.
// It must be 4 to 30 characters.
// Name: The optional user-assigned display name of the Project.
// When present it must be between 4 to 30 characters.
// Allowed characters are: lowercase and uppercase letters,
// numbers,
// hyphen, single-quote, double-quote, space, and exclamation
@ -2258,20 +2314,20 @@ func (s *SetOrgPolicyRequest) MarshalJSON() ([]byte, error) {
}
// 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:
// 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 needs
//
// # Overview
//
// The `Status` message contains three pieces of data: error code, error
// message,
// and error details. The error code should be an enum value
// The `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
@ -4390,7 +4446,7 @@ func (c *OrganizationsGetCall) Do(opts ...googleapi.CallOption) (*Organization,
// ],
// "parameters": {
// "name": {
// "description": "The resource name of the Organization to fetch, e.g. \"organizations/1234\".",
// "description": "The resource name of the Organization to fetch. This is the organization's\nrelative path in the API, formatted as \"organizations/[organizationId]\".\nFor example, \"organizations/1234\".",
// "location": "path",
// "pattern": "^organizations/[^/]+$",
// "required": true,
@ -7003,7 +7059,8 @@ func (r *ProjectsService) List() *ProjectsListCall {
// |labels.color:red|The project's label `color` has the value
// `red`.|
// |labels.color:red&nbsp;labels.size:big|The project's label `color`
// has the value `red` and its label `size` has the value `big`.
// has the
// value `red` and its label `size` has the value `big`.
//
// If you specify a filter that has both `parent.type` and `parent.id`,
// then
@ -7145,7 +7202,7 @@ func (c *ProjectsListCall) Do(opts ...googleapi.CallOption) (*ListProjectsRespon
// "parameterOrder": [],
// "parameters": {
// "filter": {
// "description": "An expression for filtering the results of the request. Filter rules are\ncase insensitive. The fields eligible for filtering are:\n\n+ `name`\n+ `id`\n+ \u003ccode\u003elabels.\u003cem\u003ekey\u003c/em\u003e\u003c/code\u003e where *key* is the name of a label\n\nSome examples of using labels as filters:\n\n|Filter|Description|\n|------|-----------|\n|name:how*|The project's name starts with \"how\".|\n|name:Howl|The project's name is `Howl` or `howl`.|\n|name:HOWL|Equivalent to above.|\n|NAME:howl|Equivalent to above.|\n|labels.color:*|The project has the label `color`.|\n|labels.color:red|The project's label `color` has the value `red`.|\n|labels.color:red\u0026nbsp;labels.size:big|The project's label `color` has the value `red` and its label `size` has the value `big`.\n\nIf you specify a filter that has both `parent.type` and `parent.id`, then\nthe `resourcemanager.projects.list` permission is checked on the parent.\nIf the user has this permission, all projects under the parent will be\nreturned after remaining filters have been applied. If the user lacks this\npermission, then all projects for which the user has the\n`resourcemanager.projects.get` permission will be returned after remaining\nfilters have been applied. If no filter is specified, the call will return\nprojects for which the user has `resourcemanager.projects.get` permissions.\n\nOptional.",
// "description": "An expression for filtering the results of the request. Filter rules are\ncase insensitive. The fields eligible for filtering are:\n\n+ `name`\n+ `id`\n+ \u003ccode\u003elabels.\u003cem\u003ekey\u003c/em\u003e\u003c/code\u003e where *key* is the name of a label\n\nSome examples of using labels as filters:\n\n|Filter|Description|\n|------|-----------|\n|name:how*|The project's name starts with \"how\".|\n|name:Howl|The project's name is `Howl` or `howl`.|\n|name:HOWL|Equivalent to above.|\n|NAME:howl|Equivalent to above.|\n|labels.color:*|The project has the label `color`.|\n|labels.color:red|The project's label `color` has the value `red`.|\n|labels.color:red\u0026nbsp;labels.size:big|The project's label `color` has the\nvalue `red` and its label `size` has the value `big`.\n\nIf you specify a filter that has both `parent.type` and `parent.id`, then\nthe `resourcemanager.projects.list` permission is checked on the parent.\nIf the user has this permission, all projects under the parent will be\nreturned after remaining filters have been applied. If the user lacks this\npermission, then all projects for which the user has the\n`resourcemanager.projects.get` permission will be returned after remaining\nfilters have been applied. If no filter is specified, the call will return\nprojects for which the user has `resourcemanager.projects.get` permissions.\n\nOptional.",
// "location": "query",
// "type": "string"
// },

View File

@ -252,7 +252,7 @@
]
},
"move": {
"description": "Moves a Folder under a new resource parent.\nReturns an Operation which can be used to track the progress of the\nfolder move workflow.\nUpon success the Operation.response field will be populated with the\nmoved Folder.\nUpon failure, a FolderOperationError categorizing the failure cause will\nbe returned - if the failure occurs synchronously then the\nFolderOperationError will be returned via the Status.details field\nand if it occurs asynchronously then the FolderOperation will be returned\nvia the the Operation.error field.\nIn addition, the Operation.metadata field will be populated with a\nFolderOperation message as an aid to stateless clients.\nFolder moves will be rejected if they violate either the naming, height\nor fanout constraints described in the\nCreateFolder documentation.\nThe caller must have `resourcemanager.folders.move` permission on the\nfolder's current and proposed new parent.",
"description": "Moves a Folder under a new resource parent.\nReturns an Operation which can be used to track the progress of the\nfolder move workflow.\nUpon success the Operation.response field will be populated with the\nmoved Folder.\nUpon failure, a FolderOperationError categorizing the failure cause will\nbe returned - if the failure occurs synchronously then the\nFolderOperationError will be returned via the Status.details field\nand if it occurs asynchronously then the FolderOperation will be returned\nvia the Operation.error field.\nIn addition, the Operation.metadata field will be populated with a\nFolderOperation message as an aid to stateless clients.\nFolder moves will be rejected if they violate either the naming, height\nor fanout constraints described in the\nCreateFolder documentation.\nThe caller must have `resourcemanager.folders.move` permission on the\nfolder's current and proposed new parent.",
"flatPath": "v2/folders/{foldersId}:move",
"httpMethod": "POST",
"id": "cloudresourcemanager.folders.move",
@ -449,7 +449,7 @@
}
}
},
"revision": "20181015",
"revision": "20190403",
"rootUrl": "https://cloudresourcemanager.googleapis.com/",
"schemas": {
"AuditConfig": {
@ -506,10 +506,10 @@
"properties": {
"condition": {
"$ref": "Expr",
"description": "Unimplemented. The condition that is associated with this binding.\nNOTE: an unsatisfied condition will not allow user access via current\nbinding. Different bindings, including their conditions, are examined\nindependently."
"description": "The condition that is associated with this binding.\nNOTE: An unsatisfied condition will not allow user access via current\nbinding. Different bindings, including their conditions, are examined\nindependently."
},
"members": {
"description": "Specifies the identities requesting access for a Cloud Platform resource.\n`members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is\n on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone\n who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google\n account. For example, `alice@gmail.com` .\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service\n account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group.\n For example, `admins@example.com`.\n\n\n* `domain:{domain}`: A Google Apps domain name that represents all the\n users of that domain. For example, `google.com` or `example.com`.\n\n",
"description": "Specifies the identities requesting access for a Cloud Platform resource.\n`members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is\n on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone\n who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google\n account. For example, `alice@gmail.com` .\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service\n account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group.\n For example, `admins@example.com`.\n\n\n* `domain:{domain}`: The G Suite domain (primary) that represents all the\n users of that domain. For example, `google.com` or `example.com`.\n\n",
"items": {
"type": "string"
},
@ -786,7 +786,7 @@
"type": "string"
},
"query": {
"description": "Search criteria used to select the Folders to return.\nIf no search criteria is specified then all accessible folders will be\nreturned.\n\nQuery expressions can be used to restrict results based upon displayName,\nlifecycleState and parent, where the operators `=`, `NOT`, `AND` and `OR`\ncan be used along with the suffix wildcard symbol `*`.\n\nThe displayName field in a query expression should use escaped quotes\nfor values that include whitespace to prevent unexpected behavior.\n\nSome example queries are:\n\n|Query | Description|\n|----- | -----------|\n|displayName=Test* | Folders whose display name starts with \"Test\".|\n|lifecycleState=ACTIVE | Folders whose lifecycleState is ACTIVE.|\n|parent=folders/123 | Folders whose parent is \"folders/123\".|\n|parent=folders/123 AND lifecycleState=ACTIVE | Active folders whose parent is \"folders/123\".|\n|displayName=\\\\\"Test String\\\\\"|Folders whose display name includes both \"Test\" and \"String\".|",
"description": "Search criteria used to select the Folders to return.\nIf no search criteria is specified then all accessible folders will be\nreturned.\n\nQuery expressions can be used to restrict results based upon displayName,\nlifecycleState and parent, where the operators `=`, `NOT`, `AND` and `OR`\ncan be used along with the suffix wildcard symbol `*`.\n\nThe displayName field in a query expression should use escaped quotes\nfor values that include whitespace to prevent unexpected behavior.\n\nSome example queries are:\n\n|Query | Description|\n|----- | -----------|\n|displayName=Test* | Folders whose display name starts with \"Test\".|\n|lifecycleState=ACTIVE | Folders whose lifecycleState is ACTIVE.|\n|parent=folders/123 | Folders whose parent is \"folders/123\".|\n|parent=folders/123 AND lifecycleState=ACTIVE | Active folders whose parent\nis \"folders/123\".| |displayName=\\\\\"Test String\\\\\"|Folders whose display\nname includes both \"Test\" and \"String\".|",
"type": "string"
}
},
@ -827,7 +827,7 @@
"type": "object"
},
"Status": {
"description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.",
"description": "The `Status` type defines a logical error model that is suitable for\ndifferent programming environments, including REST APIs and RPC APIs. It is\nused by [gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error\nmessage, and error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.",
"id": "Status",
"properties": {
"code": {

View File

@ -1,4 +1,4 @@
// Copyright 2018 Google Inc. All rights reserved.
// Copyright 2019 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
@ -6,13 +6,39 @@
// Package cloudresourcemanager provides access to the Cloud Resource Manager API.
//
// See https://cloud.google.com/resource-manager
// For product documentation, see: https://cloud.google.com/resource-manager
//
// Creating a client
//
// Usage example:
//
// import "google.golang.org/api/cloudresourcemanager/v2beta1"
// ...
// cloudresourcemanagerService, err := cloudresourcemanager.New(oauthHttpClient)
// ctx := context.Background()
// cloudresourcemanagerService, err := cloudresourcemanager.NewService(ctx)
//
// In this example, Google Application Default Credentials are used for authentication.
//
// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
//
// Other authentication options
//
// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
//
// cloudresourcemanagerService, err := cloudresourcemanager.NewService(ctx, option.WithScopes(cloudresourcemanager.CloudPlatformReadOnlyScope))
//
// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
//
// cloudresourcemanagerService, err := cloudresourcemanager.NewService(ctx, option.WithAPIKey("AIza..."))
//
// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
//
// config := &oauth2.Config{...}
// // ...
// token, err := config.Exchange(ctx, ...)
// cloudresourcemanagerService, err := cloudresourcemanager.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See https://godoc.org/google.golang.org/api/option/ for details on options.
package cloudresourcemanager // import "google.golang.org/api/cloudresourcemanager/v2beta1"
import (
@ -29,6 +55,8 @@ import (
gensupport "google.golang.org/api/gensupport"
googleapi "google.golang.org/api/googleapi"
option "google.golang.org/api/option"
htransport "google.golang.org/api/transport/http"
)
// Always reference these packages, just in case the auto-generated code
@ -59,6 +87,33 @@ const (
CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only"
)
// NewService creates a new Service.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
scopesOption := option.WithScopes(
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloud-platform.read-only",
)
// NOTE: prepend, so we don't override user-specified scopes.
opts = append([]option.ClientOption{scopesOption}, opts...)
client, endpoint, err := htransport.NewClient(ctx, opts...)
if err != nil {
return nil, err
}
s, err := New(client)
if err != nil {
return nil, err
}
if endpoint != "" {
s.BasePath = endpoint
}
return s, nil
}
// New creates a new Service. It uses the provided http.Client for requests.
//
// Deprecated: please use NewService instead.
// To provide a custom HTTP client, use option.WithHTTPClient.
// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
@ -260,9 +315,8 @@ func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
// Binding: Associates `members` with a `role`.
type Binding struct {
// Condition: Unimplemented. The condition that is associated with this
// binding.
// NOTE: an unsatisfied condition will not allow user access via
// Condition: The condition that is associated with this binding.
// NOTE: An unsatisfied condition will not allow user access via
// current
// binding. Different bindings, including their conditions, are
// examined
@ -296,7 +350,7 @@ type Binding struct {
// For example, `admins@example.com`.
//
//
// * `domain:{domain}`: A Google Apps domain name that represents all
// * `domain:{domain}`: The G Suite domain (primary) that represents all
// the
// users of that domain. For example, `google.com` or
// `example.com`.
@ -898,9 +952,10 @@ type SearchFoldersRequest struct {
// |parent=folders/123 | Folders whose parent is
// "folders/123".|
// |parent=folders/123 AND lifecycleState=ACTIVE | Active folders whose
// parent is "folders/123".|
// |displayName=\\"Test String\\"|Folders whose display name includes
// both "Test" and "String".|
// parent
// is "folders/123".| |displayName=\\"Test String\\"|Folders whose
// display
// name includes both "Test" and "String".|
Query string `json:"query,omitempty"`
// ForceSendFields is a list of field names (e.g. "PageSize") to
@ -1008,20 +1063,20 @@ func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
}
// 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:
// 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 needs
//
// # Overview
//
// The `Status` message contains three pieces of data: error code, error
// message,
// and error details. The error code should be an enum value
// The `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
@ -2064,7 +2119,7 @@ type FoldersMoveCall struct {
// field
// and if it occurs asynchronously then the FolderOperation will be
// returned
// via the the Operation.error field.
// via the Operation.error field.
// In addition, the Operation.metadata field will be populated with
// a
// FolderOperation message as an aid to stateless clients.
@ -2172,7 +2227,7 @@ func (c *FoldersMoveCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
}
return ret, nil
// {
// "description": "Moves a Folder under a new resource parent.\nReturns an Operation which can be used to track the progress of the\nfolder move workflow.\nUpon success the Operation.response field will be populated with the\nmoved Folder.\nUpon failure, a FolderOperationError categorizing the failure cause will\nbe returned - if the failure occurs synchronously then the\nFolderOperationError will be returned via the Status.details field\nand if it occurs asynchronously then the FolderOperation will be returned\nvia the the Operation.error field.\nIn addition, the Operation.metadata field will be populated with a\nFolderOperation message as an aid to stateless clients.\nFolder moves will be rejected if they violate either the naming, height\nor fanout constraints described in the\nCreateFolder documentation.\nThe caller must have `resourcemanager.folders.move` permission on the\nfolder's current and proposed new parent.",
// "description": "Moves a Folder under a new resource parent.\nReturns an Operation which can be used to track the progress of the\nfolder move workflow.\nUpon success the Operation.response field will be populated with the\nmoved Folder.\nUpon failure, a FolderOperationError categorizing the failure cause will\nbe returned - if the failure occurs synchronously then the\nFolderOperationError will be returned via the Status.details field\nand if it occurs asynchronously then the FolderOperation will be returned\nvia the Operation.error field.\nIn addition, the Operation.metadata field will be populated with a\nFolderOperation message as an aid to stateless clients.\nFolder moves will be rejected if they violate either the naming, height\nor fanout constraints described in the\nCreateFolder documentation.\nThe caller must have `resourcemanager.folders.move` permission on the\nfolder's current and proposed new parent.",
// "flatPath": "v2/folders/{foldersId}:move",
// "httpMethod": "POST",
// "id": "cloudresourcemanager.folders.move",

View File

@ -260,6 +260,46 @@
}
}
},
"imageVersions": {
"methods": {
"list": {
"description": "List ImageVersions for provided location.",
"flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/imageVersions",
"httpMethod": "GET",
"id": "composer.projects.locations.imageVersions.list",
"parameterOrder": [
"parent"
],
"parameters": {
"pageSize": {
"description": "The maximum number of image_versions to return.",
"format": "int32",
"location": "query",
"type": "integer"
},
"pageToken": {
"description": "The next_page_token value returned from a previous List request, if any.",
"location": "query",
"type": "string"
},
"parent": {
"description": "List ImageVersions in the given project and location, in the form:\n\"projects/{projectId}/locations/{locationId}\"",
"location": "path",
"pattern": "^projects/[^/]+/locations/[^/]+$",
"required": true,
"type": "string"
}
},
"path": "v1beta1/{+parent}/imageVersions",
"response": {
"$ref": "ListImageVersionsResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
}
}
},
"operations": {
"methods": {
"delete": {
@ -360,7 +400,7 @@
}
}
},
"revision": "20181217",
"revision": "20190323",
"rootUrl": "https://composer.googleapis.com/",
"schemas": {
"Empty": {
@ -450,6 +490,10 @@
"format": "int32",
"type": "integer"
},
"privateEnvironmentConfig": {
"$ref": "PrivateEnvironmentConfig",
"description": "The configuration used for the Private IP Cloud Composer environment."
},
"softwareConfig": {
"$ref": "SoftwareConfig",
"description": "The configuration settings for software inside the environment."
@ -457,6 +501,55 @@
},
"type": "object"
},
"IPAllocationPolicy": {
"description": "Configuration for controlling how IPs are allocated in the\nGKE cluster.",
"id": "IPAllocationPolicy",
"properties": {
"clusterIpv4CidrBlock": {
"description": "Optional. The IP address range used to allocate IP addresses to pods in\nthe cluster.\n\nThis field is applicable only when `use_ip_aliases` is true.\n\nSet to blank to have GKE choose a range with the default size.\n\nSet to /netmask (e.g. `/14`) to have GKE choose a range with a specific\nnetmask.\n\nSet to a\n[CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)\nnotation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g.\n`10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range\nto use.\nSpecify `cluster_secondary_range_name` or `cluster_ipv4_cidr_block`\nbut not both.",
"type": "string"
},
"clusterSecondaryRangeName": {
"description": "Optional. The name of the cluster's secondary range used to allocate\nIP addresses to pods. Specify either `cluster_secondary_range_name`\nor `cluster_ipv4_cidr_block` but not both.\n\nThis field is applicable only when `use_ip_aliases` is true.",
"type": "string"
},
"servicesIpv4CidrBlock": {
"description": "Optional. The IP address range of the services IP addresses in this\ncluster.\n\nThis field is applicable only when `use_ip_aliases` is true.\n\nSet to blank to have GKE choose a range with the default size.\n\nSet to /netmask (e.g. `/14`) to have GKE choose a range with a specific\nnetmask.\n\nSet to a\n[CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)\nnotation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g.\n`10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range\nto use.\nSpecify `services_secondary_range_name` or `services_ipv4_cidr_block`\nbut not both.",
"type": "string"
},
"servicesSecondaryRangeName": {
"description": "Optional. The name of the services' secondary range used to allocate\nIP addresses to the cluster. Specify either `services_secondary_range_name`\nor `services_ipv4_cidr_block` but not both.\n\nThis field is applicable only when `use_ip_aliases` is true.",
"type": "string"
},
"useIpAliases": {
"description": "Optional. Whether or not to enable Alias IPs in the GKE cluster.\nIf `true`, a VPC-native cluster is created.",
"type": "boolean"
}
},
"type": "object"
},
"ImageVersion": {
"description": "Image Version information",
"id": "ImageVersion",
"properties": {
"imageVersionId": {
"description": "The string identifier of the ImageVersion, in the form:\n\"composer-x.y.z-airflow-a.b(.c)\"",
"type": "string"
},
"isDefault": {
"description": "Whether this is the default ImageVersion used by Composer during\nenvironment creation if no input ImageVersion is specified.",
"type": "boolean"
},
"supportedPythonVersions": {
"description": "supported python versions",
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"ListEnvironmentsResponse": {
"description": "The environments in a project and location.",
"id": "ListEnvironmentsResponse",
@ -475,6 +568,24 @@
},
"type": "object"
},
"ListImageVersionsResponse": {
"description": "The ImageVersions in a project and location.",
"id": "ListImageVersionsResponse",
"properties": {
"imageVersions": {
"description": "The list of supported ImageVersions in a location.",
"items": {
"$ref": "ImageVersion"
},
"type": "array"
},
"nextPageToken": {
"description": "The page token used to query for the next page if one exists.",
"type": "string"
}
},
"type": "object"
},
"ListOperationsResponse": {
"description": "The response message for Operations.ListOperations.",
"id": "ListOperationsResponse",
@ -502,6 +613,10 @@
"format": "int32",
"type": "integer"
},
"ipAllocationPolicy": {
"$ref": "IPAllocationPolicy",
"description": "Optional. The IPAllocationPolicy fields for the GKE cluster."
},
"location": {
"description": "Optional. The Compute Engine [zone](/compute/docs/regions-zones) in which\nto deploy the VMs used to run the Apache Airflow software, specified as a\n[relative resource name](/apis/design/resource_names#relative_resource_name).\nFor example: \"projects/{projectId}/zones/{zoneId}\".\n\nThis `location` must belong to the enclosing environment's project and\nlocation. If both this field and `nodeConfig.machineType` are specified,\n`nodeConfig.machineType` must belong to this `location`; if both are\nunspecified, the service will pick a zone in the Compute Engine region\ncorresponding to the Cloud Composer location, and propagate that choice to\nboth fields. If only one field (`location` or `nodeConfig.machineType`) is\nspecified, the location information from the specified field will be\npropagated to the unspecified field.",
"type": "string"
@ -515,7 +630,7 @@
"type": "string"
},
"oauthScopes": {
"description": "Optional. The set of Google API scopes to be made available on all\nnode VMs. Defaults to\n[\"https://www.googleapis.com/auth/cloud-platform\"] and must be included in\nthe list of specified scopes. Cannot be updated.",
"description": "Optional. The set of Google API scopes to be made available on all\nnode VMs. If `oauth_scopes` is empty, defaults to\n[\"https://www.googleapis.com/auth/cloud-platform\"]. Cannot be updated.",
"items": {
"type": "string"
},
@ -526,7 +641,7 @@
"type": "string"
},
"subnetwork": {
"description": "Optional. The Compute Engine subnetwork to be used for machine\ncommunications, specified as a\n[relative resource name](/apis/design/resource_names#relative_resource_name).\nFor example:\n\"projects/{projectId}/regions/{regionId}/subnetworks/{subnetworkId}\"\n\nIf a subnetwork is provided, `nodeConfig.network` must also be provided,\nand the subnetwork must belong to the same project as the network.\n\nFor Shared VPC, you must configure the subnetwork with secondary ranges\nnamed \u003cstrong\u003ecomposer-pods\u003c/strong\u003e and\n\u003cstrong\u003ecomposer-services\u003c/strong\u003e to support Alias IPs.",
"description": "Optional. The Compute Engine subnetwork to be used for machine\ncommunications, specified as a\n[relative resource name](/apis/design/resource_names#relative_resource_name).\nFor example:\n\"projects/{projectId}/regions/{regionId}/subnetworks/{subnetworkId}\"\n\nIf a subnetwork is provided, `nodeConfig.network` must also be provided,\nand the subnetwork must belong to the enclosing environment's project and\nlocation.",
"type": "string"
},
"tags": {
@ -633,6 +748,36 @@
},
"type": "object"
},
"PrivateClusterConfig": {
"description": "Configuration options for the private GKE cluster in a Cloud Composer\nenvironment.",
"id": "PrivateClusterConfig",
"properties": {
"enablePrivateEndpoint": {
"description": "Optional. If `true`, access to the public endpoint of the GKE cluster is\ndenied.",
"type": "boolean"
},
"masterIpv4CidrBlock": {
"description": "The IP range in CIDR notation to use for the hosted master network. This\nrange is used for assigning internal IP addresses to the cluster\nmaster or set of masters and to the internal load balancer virtual IP.\nThis range must not overlap with any other ranges in use\nwithin the cluster's network. If left blank, the default value of\n'172.16.0.0/28' is used.",
"type": "string"
}
},
"type": "object"
},
"PrivateEnvironmentConfig": {
"description": "The configuration information for configuring a Private IP Cloud Composer\nenvironment.",
"id": "PrivateEnvironmentConfig",
"properties": {
"enablePrivateEnvironment": {
"description": "Optional. If `true`, a Private IP Cloud Composer environment is created.\nIf this field is true, `use_ip_aliases` must be true.",
"type": "boolean"
},
"privateClusterConfig": {
"$ref": "PrivateClusterConfig",
"description": "Optional. Configuration for the private GKE cluster for a Private IP\nCloud Composer environment."
}
},
"type": "object"
},
"SoftwareConfig": {
"description": "Specifies the selection and configuration of software inside the environment.",
"id": "SoftwareConfig",
@ -652,7 +797,7 @@
"type": "object"
},
"imageVersion": {
"description": "The version of the software running in the environment.\nThis encapsulates both the version of Cloud Composer functionality and the\nversion of Apache Airflow. It must match the regular expression\n`composer-([0-9]+\\.[0-9]+\\.[0-9]+|latest)-airflow-[0-9]+\\.[0-9]+(\\.[0-9]+.*)?`.\nWhen used as input, the server will also check if the provided version is\nsupported and deny the request for an unsupported version.\n\nThe Cloud Composer portion of the version is a\n[semantic version](https://semver.org) or `latest`. The patch version\ncan be omitted and the current Cloud Composer patch version\nwill be selected.\nWhen `latest` is provided instead of an explicit version number,\nthe server will replace `latest` with the current Cloud Composer version\nand store that version number in the same field.\n\nThe portion of the image version that follows \u003cem\u003eairflow-\u003c/em\u003e is an official\nApache Airflow repository\n[release name](https://github.com/apache/incubator-airflow/releases).\n\nSupported values for input are:\n* `composer-latest-airflow-1.10.0`\n* `composer-latest-airflow-1.9.0`\n* `composer-latest-airflow-1.10`\n* `composer-latest-airflow-1.9`\n* `composer-1.3.0-airflow-1.10.0`\n* `composer-1.3.0-airflow-1.9.0`\n* `composer-1.3.0-airflow-1.10`\n* `composer-1.3.0-airflow-1.9`\n\nSee also [Release Notes](/composer/docs/release-notes).",
"description": "The version of the software running in the environment.\nThis encapsulates both the version of Cloud Composer functionality and the\nversion of Apache Airflow. It must match the regular expression\n`composer-([0-9]+\\.[0-9]+\\.[0-9]+|latest)-airflow-[0-9]+\\.[0-9]+(\\.[0-9]+.*)?`.\nWhen used as input, the server also checks if the provided version is\nsupported and denies the request for an unsupported version.\n\nThe Cloud Composer portion of the version is a\n[semantic version](https://semver.org) or `latest`. When the patch version\nis omitted, the current Cloud Composer patch version is selected.\nWhen `latest` is provided instead of an explicit version number,\nthe server replaces `latest` with the current Cloud Composer version\nand stores that version number in the same field.\n\nThe portion of the image version that follows \u003cem\u003eairflow-\u003c/em\u003e is an\nofficial Apache Airflow repository\n[release name](https://github.com/apache/incubator-airflow/releases).\n\nSee also [Version List](/composer/docs/concepts/versioning/composer-versions).",
"type": "string"
},
"pypiPackages": {
@ -670,7 +815,7 @@
"type": "object"
},
"Status": {
"description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.",
"description": "The `Status` type defines a logical error model that is suitable for\ndifferent programming environments, including REST APIs and RPC APIs. It is\nused by [gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error\nmessage, and error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.",
"id": "Status",
"properties": {
"code": {

View File

@ -1,4 +1,4 @@
// Copyright 2018 Google Inc. All rights reserved.
// Copyright 2019 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
@ -6,13 +6,35 @@
// Package composer provides access to the Cloud Composer API.
//
// See https://cloud.google.com/composer/
// For product documentation, see: https://cloud.google.com/composer/
//
// Creating a client
//
// Usage example:
//
// import "google.golang.org/api/composer/v1beta1"
// ...
// composerService, err := composer.New(oauthHttpClient)
// ctx := context.Background()
// composerService, err := composer.NewService(ctx)
//
// In this example, Google Application Default Credentials are used for authentication.
//
// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
//
// Other authentication options
//
// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
//
// composerService, err := composer.NewService(ctx, option.WithAPIKey("AIza..."))
//
// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
//
// config := &oauth2.Config{...}
// // ...
// token, err := config.Exchange(ctx, ...)
// composerService, err := composer.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See https://godoc.org/google.golang.org/api/option/ for details on options.
package composer // import "google.golang.org/api/composer/v1beta1"
import (
@ -29,6 +51,8 @@ import (
gensupport "google.golang.org/api/gensupport"
googleapi "google.golang.org/api/googleapi"
option "google.golang.org/api/option"
htransport "google.golang.org/api/transport/http"
)
// Always reference these packages, just in case the auto-generated code
@ -56,6 +80,32 @@ const (
CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
)
// NewService creates a new Service.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
scopesOption := option.WithScopes(
"https://www.googleapis.com/auth/cloud-platform",
)
// NOTE: prepend, so we don't override user-specified scopes.
opts = append([]option.ClientOption{scopesOption}, opts...)
client, endpoint, err := htransport.NewClient(ctx, opts...)
if err != nil {
return nil, err
}
s, err := New(client)
if err != nil {
return nil, err
}
if endpoint != "" {
s.BasePath = endpoint
}
return s, nil
}
// New creates a new Service. It uses the provided http.Client for requests.
//
// Deprecated: please use NewService instead.
// To provide a custom HTTP client, use option.WithHTTPClient.
// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
@ -95,6 +145,7 @@ type ProjectsService struct {
func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
rs := &ProjectsLocationsService{s: s}
rs.Environments = NewProjectsLocationsEnvironmentsService(s)
rs.ImageVersions = NewProjectsLocationsImageVersionsService(s)
rs.Operations = NewProjectsLocationsOperationsService(s)
return rs
}
@ -104,6 +155,8 @@ type ProjectsLocationsService struct {
Environments *ProjectsLocationsEnvironmentsService
ImageVersions *ProjectsLocationsImageVersionsService
Operations *ProjectsLocationsOperationsService
}
@ -116,6 +169,15 @@ type ProjectsLocationsEnvironmentsService struct {
s *Service
}
func NewProjectsLocationsImageVersionsService(s *Service) *ProjectsLocationsImageVersionsService {
rs := &ProjectsLocationsImageVersionsService{s: s}
return rs
}
type ProjectsLocationsImageVersionsService struct {
s *Service
}
func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService {
rs := &ProjectsLocationsOperationsService{s: s}
return rs
@ -255,6 +317,10 @@ type EnvironmentConfig struct {
// used to run this environment.
NodeCount int64 `json:"nodeCount,omitempty"`
// PrivateEnvironmentConfig: The configuration used for the Private IP
// Cloud Composer environment.
PrivateEnvironmentConfig *PrivateEnvironmentConfig `json:"privateEnvironmentConfig,omitempty"`
// SoftwareConfig: The configuration settings for software inside the
// environment.
SoftwareConfig *SoftwareConfig `json:"softwareConfig,omitempty"`
@ -282,6 +348,149 @@ func (s *EnvironmentConfig) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// IPAllocationPolicy: Configuration for controlling how IPs are
// allocated in the
// GKE cluster.
type IPAllocationPolicy struct {
// ClusterIpv4CidrBlock: Optional. The IP address range used to allocate
// IP addresses to pods in
// the cluster.
//
// This field is applicable only when `use_ip_aliases` is true.
//
// Set to blank to have GKE choose a range with the default size.
//
// Set to /netmask (e.g. `/14`) to have GKE choose a range with a
// specific
// netmask.
//
// Set to
// a
// [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
//
// 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.
// Specify `cluster_secondary_range_name` or
// `cluster_ipv4_cidr_block`
// but not both.
ClusterIpv4CidrBlock string `json:"clusterIpv4CidrBlock,omitempty"`
// ClusterSecondaryRangeName: Optional. The name of the cluster's
// secondary range used to allocate
// IP addresses to pods. Specify either
// `cluster_secondary_range_name`
// or `cluster_ipv4_cidr_block` but not both.
//
// This field is applicable only when `use_ip_aliases` is true.
ClusterSecondaryRangeName string `json:"clusterSecondaryRangeName,omitempty"`
// ServicesIpv4CidrBlock: Optional. The IP address range of the services
// IP addresses in this
// cluster.
//
// This field is applicable only when `use_ip_aliases` is true.
//
// Set to blank to have GKE choose a range with the default size.
//
// Set to /netmask (e.g. `/14`) to have GKE choose a range with a
// specific
// netmask.
//
// Set to
// a
// [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
//
// 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.
// Specify `services_secondary_range_name` or
// `services_ipv4_cidr_block`
// but not both.
ServicesIpv4CidrBlock string `json:"servicesIpv4CidrBlock,omitempty"`
// ServicesSecondaryRangeName: Optional. The name of the services'
// secondary range used to allocate
// IP addresses to the cluster. Specify either
// `services_secondary_range_name`
// or `services_ipv4_cidr_block` but not both.
//
// This field is applicable only when `use_ip_aliases` is true.
ServicesSecondaryRangeName string `json:"servicesSecondaryRangeName,omitempty"`
// UseIpAliases: Optional. Whether or not to enable Alias IPs in the GKE
// cluster.
// If `true`, a VPC-native cluster is created.
UseIpAliases bool `json:"useIpAliases,omitempty"`
// ForceSendFields is a list of field names (e.g.
// "ClusterIpv4CidrBlock") 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. "ClusterIpv4CidrBlock") 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 *IPAllocationPolicy) MarshalJSON() ([]byte, error) {
type NoMethod IPAllocationPolicy
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ImageVersion: Image Version information
type ImageVersion struct {
// ImageVersionId: The string identifier of the ImageVersion, in the
// form:
// "composer-x.y.z-airflow-a.b(.c)"
ImageVersionId string `json:"imageVersionId,omitempty"`
// IsDefault: Whether this is the default ImageVersion used by Composer
// during
// environment creation if no input ImageVersion is specified.
IsDefault bool `json:"isDefault,omitempty"`
// SupportedPythonVersions: supported python versions
SupportedPythonVersions []string `json:"supportedPythonVersions,omitempty"`
// ForceSendFields is a list of field names (e.g. "ImageVersionId") 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. "ImageVersionId") 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 *ImageVersion) MarshalJSON() ([]byte, error) {
type NoMethod ImageVersion
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ListEnvironmentsResponse: The environments in a project and location.
type ListEnvironmentsResponse struct {
// Environments: The list of environments returned by a
@ -319,6 +528,43 @@ func (s *ListEnvironmentsResponse) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ListImageVersionsResponse: The ImageVersions in a project and
// location.
type ListImageVersionsResponse struct {
// ImageVersions: The list of supported ImageVersions in a location.
ImageVersions []*ImageVersion `json:"imageVersions,omitempty"`
// NextPageToken: The page token used to query for the next page if one
// exists.
NextPageToken string `json:"nextPageToken,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "ImageVersions") 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. "ImageVersions") 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 *ListImageVersionsResponse) MarshalJSON() ([]byte, error) {
type NoMethod ListImageVersionsResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ListOperationsResponse: The response message for
// Operations.ListOperations.
type ListOperationsResponse struct {
@ -365,6 +611,10 @@ type NodeConfig struct {
// If unspecified, defaults to 100GB. Cannot be updated.
DiskSizeGb int64 `json:"diskSizeGb,omitempty"`
// IpAllocationPolicy: Optional. The IPAllocationPolicy fields for the
// GKE cluster.
IpAllocationPolicy *IPAllocationPolicy `json:"ipAllocationPolicy,omitempty"`
// Location: Optional. The Compute Engine
// [zone](/compute/docs/regions-zones) in which
// to deploy the VMs used to run the Apache Airflow software, specified
@ -441,11 +691,10 @@ type NodeConfig struct {
// OauthScopes: Optional. The set of Google API scopes to be made
// available on all
// node VMs. Defaults
// node VMs. If `oauth_scopes` is empty, defaults
// to
// ["https://www.googleapis.com/auth/cloud-platform"] and must be
// included in
// the list of specified scopes. Cannot be updated.
// ["https://www.googleapis.com/auth/cloud-platform"]. Cannot be
// updated.
OauthScopes []string `json:"oauthScopes,omitempty"`
// ServiceAccount: Optional. The Google Cloud Platform Service Account
@ -467,14 +716,9 @@ type NodeConfig struct {
//
// If a subnetwork is provided, `nodeConfig.network` must also be
// provided,
// and the subnetwork must belong to the same project as the
// network.
//
// For Shared VPC, you must configure the subnetwork with secondary
// ranges
// named <strong>composer-pods</strong>
// and the subnetwork must belong to the enclosing environment's project
// and
// <strong>composer-services</strong> to support Alias IPs.
// location.
Subnetwork string `json:"subnetwork,omitempty"`
// Tags: Optional. The list of instance tags applied to all node VMs.
@ -650,6 +894,91 @@ func (s *OperationMetadata) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// PrivateClusterConfig: Configuration options for the private GKE
// cluster in a Cloud Composer
// environment.
type PrivateClusterConfig struct {
// EnablePrivateEndpoint: Optional. If `true`, access to the public
// endpoint of the GKE cluster is
// denied.
EnablePrivateEndpoint bool `json:"enablePrivateEndpoint,omitempty"`
// MasterIpv4CidrBlock: The IP range in CIDR notation to use for the
// hosted master network. This
// range is used for assigning internal IP addresses to the
// cluster
// master or set of masters and to the internal load balancer virtual
// IP.
// This range must not overlap with any other ranges in use
// within the cluster's network. If left blank, the default value
// of
// '172.16.0.0/28' is used.
MasterIpv4CidrBlock string `json:"masterIpv4CidrBlock,omitempty"`
// ForceSendFields is a list of field names (e.g.
// "EnablePrivateEndpoint") 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. "EnablePrivateEndpoint") 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 *PrivateClusterConfig) MarshalJSON() ([]byte, error) {
type NoMethod PrivateClusterConfig
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// PrivateEnvironmentConfig: The configuration information for
// configuring a Private IP Cloud Composer
// environment.
type PrivateEnvironmentConfig struct {
// EnablePrivateEnvironment: Optional. If `true`, a Private IP Cloud
// Composer environment is created.
// If this field is true, `use_ip_aliases` must be true.
EnablePrivateEnvironment bool `json:"enablePrivateEnvironment,omitempty"`
// PrivateClusterConfig: Optional. Configuration for the private GKE
// cluster for a Private IP
// Cloud Composer environment.
PrivateClusterConfig *PrivateClusterConfig `json:"privateClusterConfig,omitempty"`
// ForceSendFields is a list of field names (e.g.
// "EnablePrivateEnvironment") 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. "EnablePrivateEnvironment")
// 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 *PrivateEnvironmentConfig) MarshalJSON() ([]byte, error) {
type NoMethod PrivateEnvironmentConfig
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SoftwareConfig: Specifies the selection and configuration of software
// inside the environment.
type SoftwareConfig struct {
@ -717,38 +1046,28 @@ type SoftwareConfig struct {
// expression
// `composer-([0-9]+\.[0-9]+\.[0-9]+|latest)-airflow-[0-9]+\.[
// 0-9]+(\.[0-9]+.*)?`.
// When used as input, the server will also check if the provided
// version is
// supported and deny the request for an unsupported version.
// When used as input, the server also checks if the provided version
// is
// supported and denies the request for an unsupported version.
//
// The Cloud Composer portion of the version is a
// [semantic version](https://semver.org) or `latest`. The patch
// [semantic version](https://semver.org) or `latest`. When the patch
// version
// can be omitted and the current Cloud Composer patch version
// will be selected.
// is omitted, the current Cloud Composer patch version is
// selected.
// When `latest` is provided instead of an explicit version number,
// the server will replace `latest` with the current Cloud Composer
// the server replaces `latest` with the current Cloud Composer
// version
// and store that version number in the same field.
// and stores that version number in the same field.
//
// The portion of the image version that follows <em>airflow-</em> is an
// official
// Apache Airflow repository
// The portion of the image version that follows <em>airflow-</em> is
// an
// official Apache Airflow repository
// [release
// name](https://github.com/apache/incubator-airflow/releases).
//
// Supporte
// d values for input are:
// * `composer-latest-airflow-1.10.0`
// * `composer-latest-airflow-1.9.0`
// * `composer-latest-airflow-1.10`
// * `composer-latest-airflow-1.9`
// * `composer-1.3.0-airflow-1.10.0`
// * `composer-1.3.0-airflow-1.9.0`
// * `composer-1.3.0-airflow-1.10`
// * `composer-1.3.0-airflow-1.9`
//
// See also [Release Notes](/composer/docs/release-notes).
// See also [Version
// List](/composer/docs/concepts/versioning/composer-versions).
ImageVersion string `json:"imageVersion,omitempty"`
// PypiPackages: Optional. Custom Python Package Index (PyPI) packages
@ -800,20 +1119,20 @@ func (s *SoftwareConfig) MarshalJSON() ([]byte, error) {
}
// 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:
// 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 needs
//
// # Overview
//
// The `Status` message contains three pieces of data: error code, error
// message,
// and error details. The error code should be an enum value
// The `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
@ -1846,6 +2165,195 @@ func (c *ProjectsLocationsEnvironmentsPatchCall) Do(opts ...googleapi.CallOption
}
// method id "composer.projects.locations.imageVersions.list":
type ProjectsLocationsImageVersionsListCall struct {
s *Service
parent string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// List: List ImageVersions for provided location.
func (r *ProjectsLocationsImageVersionsService) List(parent string) *ProjectsLocationsImageVersionsListCall {
c := &ProjectsLocationsImageVersionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.parent = parent
return c
}
// PageSize sets the optional parameter "pageSize": The maximum number
// of image_versions to return.
func (c *ProjectsLocationsImageVersionsListCall) PageSize(pageSize int64) *ProjectsLocationsImageVersionsListCall {
c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
return c
}
// PageToken sets the optional parameter "pageToken": The
// next_page_token value returned from a previous List request, if any.
func (c *ProjectsLocationsImageVersionsListCall) PageToken(pageToken string) *ProjectsLocationsImageVersionsListCall {
c.urlParams_.Set("pageToken", pageToken)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ProjectsLocationsImageVersionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsImageVersionsListCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *ProjectsLocationsImageVersionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsImageVersionsListCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *ProjectsLocationsImageVersionsListCall) Context(ctx context.Context) *ProjectsLocationsImageVersionsListCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ProjectsLocationsImageVersionsListCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsLocationsImageVersionsListCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/imageVersions")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("GET", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"parent": c.parent,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "composer.projects.locations.imageVersions.list" call.
// Exactly one of *ListImageVersionsResponse or error will be non-nil.
// Any non-2xx status code is an error. Response headers are in either
// *ListImageVersionsResponse.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 *ProjectsLocationsImageVersionsListCall) Do(opts ...googleapi.CallOption) (*ListImageVersionsResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &ListImageVersionsResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "List ImageVersions for provided location.",
// "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/imageVersions",
// "httpMethod": "GET",
// "id": "composer.projects.locations.imageVersions.list",
// "parameterOrder": [
// "parent"
// ],
// "parameters": {
// "pageSize": {
// "description": "The maximum number of image_versions to return.",
// "format": "int32",
// "location": "query",
// "type": "integer"
// },
// "pageToken": {
// "description": "The next_page_token value returned from a previous List request, if any.",
// "location": "query",
// "type": "string"
// },
// "parent": {
// "description": "List ImageVersions in the given project and location, in the form:\n\"projects/{projectId}/locations/{locationId}\"",
// "location": "path",
// "pattern": "^projects/[^/]+/locations/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1beta1/{+parent}/imageVersions",
// "response": {
// "$ref": "ListImageVersionsResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
func (c *ProjectsLocationsImageVersionsListCall) Pages(ctx context.Context, f func(*ListImageVersionsResponse) error) error {
c.ctx_ = ctx
defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
for {
x, err := c.Do()
if err != nil {
return err
}
if err := f(x); err != nil {
return err
}
if x.NextPageToken == "" {
return nil
}
c.PageToken(x.NextPageToken)
}
}
// method id "composer.projects.locations.operations.delete":
type ProjectsLocationsOperationsDeleteCall struct {

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

@ -106,10 +106,59 @@
"resources": {
"projects": {
"resources": {
"aggregated": {
"resources": {
"usableSubnetworks": {
"methods": {
"list": {
"description": "Lists subnetworks that are usable for creating clusters in a project.",
"flatPath": "v1/projects/{projectsId}/aggregated/usableSubnetworks",
"httpMethod": "GET",
"id": "container.projects.aggregated.usableSubnetworks.list",
"parameterOrder": [
"parent"
],
"parameters": {
"filter": {
"description": "Filtering currently only supports equality on the networkProjectId and must\nbe in the form: \"networkProjectId=[PROJECTID]\", where `networkProjectId`\nis the project which owns the listed subnetworks. This defaults to the\nparent project ID.",
"location": "query",
"type": "string"
},
"pageSize": {
"description": "The max number of results per page that should be returned. If the number\nof available results is larger than `page_size`, a `next_page_token` is\nreturned which can be used to get the next page of results in subsequent\nrequests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
"format": "int32",
"location": "query",
"type": "integer"
},
"pageToken": {
"description": "Specifies a page token to use. Set this to the nextPageToken returned by\nprevious list requests to get the next page of results.",
"location": "query",
"type": "string"
},
"parent": {
"description": "The parent project where subnetworks are usable.\nSpecified in the format 'projects/*'.",
"location": "path",
"pattern": "^projects/[^/]+$",
"required": true,
"type": "string"
}
},
"path": "v1/{+parent}/aggregated/usableSubnetworks",
"response": {
"$ref": "ListUsableSubnetworksResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
}
}
}
}
},
"locations": {
"methods": {
"getServerConfig": {
"description": "Returns configuration info about the Kubernetes Engine service.",
"description": "Returns configuration info about the Google Kubernetes Engine service.",
"flatPath": "v1/projects/{projectsId}/locations/{locationsId}/serverConfig",
"httpMethod": "GET",
"id": "container.projects.locations.getServerConfig",
@ -118,7 +167,7 @@
],
"parameters": {
"name": {
"description": "The name (project and location) of the server config to get\nSpecified in the format 'projects/*/locations/*'.",
"description": "The name (project and location) of the server config to get,\nspecified in the format 'projects/*/locations/*'.",
"location": "path",
"pattern": "^projects/[^/]+/locations/[^/]+$",
"required": true,
@ -176,7 +225,7 @@
]
},
"create": {
"description": "Creates a cluster, consisting of the specified number and type of Google\nCompute Engine instances.\n\nBy default, the cluster is created in the project's\n[default network](/compute/docs/networks-and-firewalls#networks).\n\nOne firewall is added for the cluster. After cluster creation,\nthe cluster creates routes for each node to allow the containers\non that node to communicate with all other instances in the\ncluster.\n\nFinally, an entry is added to the project's global metadata indicating\nwhich CIDR range is being used by the cluster.",
"description": "Creates a cluster, consisting of the specified number and type of Google\nCompute Engine instances.\n\nBy default, the cluster is created in the project's\n[default network](/compute/docs/networks-and-firewalls#networks).\n\nOne firewall is added for the cluster. After cluster creation,\nthe Kubelet creates routes for each node to allow the containers\non that node to communicate with all other instances in the\ncluster.\n\nFinally, an entry is added to the project's global metadata indicating\nwhich CIDR range the cluster is using.",
"flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters",
"httpMethod": "POST",
"id": "container.projects.locations.clusters.create",
@ -204,7 +253,7 @@
]
},
"delete": {
"description": "Deletes the cluster, including the Kubernetes endpoint and all worker\nnodes.\n\nFirewalls and routes that were configured during cluster creation\nare also deleted.\n\nOther Google Compute Engine resources that might be in use by the cluster\n(e.g. load balancer resources) will not be deleted if they weren't present\nat the initial create time.",
"description": "Deletes the cluster, including the Kubernetes endpoint and all worker\nnodes.\n\nFirewalls and routes that were configured during cluster creation\nare also deleted.\n\nOther Google Compute Engine resources that might be in use by the cluster,\nsuch as load balancer resources, are not deleted if they weren't present\nwhen the cluster was initially created.",
"flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}",
"httpMethod": "DELETE",
"id": "container.projects.locations.clusters.delete",
@ -283,6 +332,31 @@
"https://www.googleapis.com/auth/cloud-platform"
]
},
"getJwks": {
"description": "Gets the public component of the cluster signing keys in\nJSON Web Key format.\nThis API is not yet intended for general use, and is not available for all\nclusters.",
"flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/jwks",
"httpMethod": "GET",
"id": "container.projects.locations.clusters.getJwks",
"parameterOrder": [
"parent"
],
"parameters": {
"parent": {
"description": "The cluster (project, location, cluster id) to get keys for. Specified in\nthe format 'projects/*/locations/*/clusters/*'.",
"location": "path",
"pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
"required": true,
"type": "string"
}
},
"path": "v1/{+parent}/jwks",
"response": {
"$ref": "GetJSONWebKeysResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
},
"list": {
"description": "Lists all clusters owned by a project in either the specified zone or all\nzones.",
"flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters",
@ -459,7 +533,7 @@
]
},
"setMasterAuth": {
"description": "Used to set master auth materials. Currently supports :-\nChanging the admin password for a specific cluster.\nThis can be either via password generation or explicitly set the password.",
"description": "Sets master auth materials. Currently supports changing the admin password\nor a specific cluster, either via password generation or explicitly setting\nthe password.",
"flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setMasterAuth",
"httpMethod": "POST",
"id": "container.projects.locations.clusters.setMasterAuth",
@ -515,7 +589,7 @@
]
},
"setNetworkPolicy": {
"description": "Enables/Disables Network Policy for a cluster.",
"description": "Enables or disables Network Policy for a cluster.",
"flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setNetworkPolicy",
"httpMethod": "POST",
"id": "container.projects.locations.clusters.setNetworkPolicy",
@ -571,7 +645,7 @@
]
},
"startIpRotation": {
"description": "Start master IP rotation.",
"description": "Starts master IP rotation.",
"flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:startIpRotation",
"httpMethod": "POST",
"id": "container.projects.locations.clusters.startIpRotation",
@ -732,7 +806,7 @@
]
},
"get": {
"description": "Retrieves the node pool requested.",
"description": "Retrieves the requested node pool.",
"flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}",
"httpMethod": "GET",
"id": "container.projects.locations.clusters.nodePools.get",
@ -817,7 +891,7 @@
]
},
"rollback": {
"description": "Roll back the previously Aborted or Failed NodePool upgrade.\nThis will be an no-op if the last upgrade successfully completed.",
"description": "Rolls back a previously Aborted or Failed NodePool upgrade.\nThis makes no changes if the last upgrade successfully completed.",
"flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}:rollback",
"httpMethod": "POST",
"id": "container.projects.locations.clusters.nodePools.rollback",
@ -845,7 +919,7 @@
]
},
"setAutoscaling": {
"description": "Sets the autoscaling settings for a specific node pool.",
"description": "Sets the autoscaling settings for the specified node pool.",
"flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}:setAutoscaling",
"httpMethod": "POST",
"id": "container.projects.locations.clusters.nodePools.setAutoscaling",
@ -929,7 +1003,7 @@
]
},
"update": {
"description": "Updates the version and/or image type for a specific node pool.",
"description": "Updates the version and/or image type for the specified node pool.",
"flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}",
"httpMethod": "PUT",
"id": "container.projects.locations.clusters.nodePools.update",
@ -957,6 +1031,35 @@
]
}
}
},
"well-known": {
"methods": {
"getOpenid-configuration": {
"description": "Gets the OIDC discovery document for the cluster.\nSee the\n[OpenID Connect Discovery 1.0\nspecification](https://openid.net/specs/openid-connect-discovery-1_0.html)\nfor details.\nThis API is not yet intended for general use, and is not available for all\nclusters.",
"flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/.well-known/openid-configuration",
"httpMethod": "GET",
"id": "container.projects.locations.clusters.well-known.getOpenid-configuration",
"parameterOrder": [
"parent"
],
"parameters": {
"parent": {
"description": "The cluster (project, location, cluster id) to get the discovery document\nfor. Specified in the format 'projects/*/locations/*/clusters/*'.",
"location": "path",
"pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
"required": true,
"type": "string"
}
},
"path": "v1/{+parent}/.well-known/openid-configuration",
"response": {
"$ref": "GetOpenIDConfigResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
}
}
}
}
},
@ -1072,7 +1175,7 @@
"zones": {
"methods": {
"getServerconfig": {
"description": "Returns configuration info about the Kubernetes Engine service.",
"description": "Returns configuration info about the Google Kubernetes Engine service.",
"flatPath": "v1/projects/{projectId}/zones/{zone}/serverconfig",
"httpMethod": "GET",
"id": "container.projects.zones.getServerconfig",
@ -1082,7 +1185,7 @@
],
"parameters": {
"name": {
"description": "The name (project and location) of the server config to get\nSpecified in the format 'projects/*/locations/*'.",
"description": "The name (project and location) of the server config to get,\nspecified in the format 'projects/*/locations/*'.",
"location": "query",
"type": "string"
},
@ -1194,7 +1297,7 @@
]
},
"create": {
"description": "Creates a cluster, consisting of the specified number and type of Google\nCompute Engine instances.\n\nBy default, the cluster is created in the project's\n[default network](/compute/docs/networks-and-firewalls#networks).\n\nOne firewall is added for the cluster. After cluster creation,\nthe cluster creates routes for each node to allow the containers\non that node to communicate with all other instances in the\ncluster.\n\nFinally, an entry is added to the project's global metadata indicating\nwhich CIDR range is being used by the cluster.",
"description": "Creates a cluster, consisting of the specified number and type of Google\nCompute Engine instances.\n\nBy default, the cluster is created in the project's\n[default network](/compute/docs/networks-and-firewalls#networks).\n\nOne firewall is added for the cluster. After cluster creation,\nthe Kubelet creates routes for each node to allow the containers\non that node to communicate with all other instances in the\ncluster.\n\nFinally, an entry is added to the project's global metadata indicating\nwhich CIDR range the cluster is using.",
"flatPath": "v1/projects/{projectId}/zones/{zone}/clusters",
"httpMethod": "POST",
"id": "container.projects.zones.clusters.create",
@ -1228,7 +1331,7 @@
]
},
"delete": {
"description": "Deletes the cluster, including the Kubernetes endpoint and all worker\nnodes.\n\nFirewalls and routes that were configured during cluster creation\nare also deleted.\n\nOther Google Compute Engine resources that might be in use by the cluster\n(e.g. load balancer resources) will not be deleted if they weren't present\nat the initial create time.",
"description": "Deletes the cluster, including the Kubernetes endpoint and all worker\nnodes.\n\nFirewalls and routes that were configured during cluster creation\nare also deleted.\n\nOther Google Compute Engine resources that might be in use by the cluster,\nsuch as load balancer resources, are not deleted if they weren't present\nwhen the cluster was initially created.",
"flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}",
"httpMethod": "DELETE",
"id": "container.projects.zones.clusters.delete",
@ -1637,7 +1740,7 @@
]
},
"setMasterAuth": {
"description": "Used to set master auth materials. Currently supports :-\nChanging the admin password for a specific cluster.\nThis can be either via password generation or explicitly set the password.",
"description": "Sets master auth materials. Currently supports changing the admin password\nor a specific cluster, either via password generation or explicitly setting\nthe password.",
"flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMasterAuth",
"httpMethod": "POST",
"id": "container.projects.zones.clusters.setMasterAuth",
@ -1678,7 +1781,7 @@
]
},
"setNetworkPolicy": {
"description": "Enables/Disables Network Policy for a cluster.",
"description": "Enables or disables Network Policy for a cluster.",
"flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setNetworkPolicy",
"httpMethod": "POST",
"id": "container.projects.zones.clusters.setNetworkPolicy",
@ -1719,7 +1822,7 @@
]
},
"startIpRotation": {
"description": "Start master IP rotation.",
"description": "Starts master IP rotation.",
"flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:startIpRotation",
"httpMethod": "POST",
"id": "container.projects.zones.clusters.startIpRotation",
@ -1805,7 +1908,7 @@
"nodePools": {
"methods": {
"autoscaling": {
"description": "Sets the autoscaling settings for a specific node pool.",
"description": "Sets the autoscaling settings for the specified node pool.",
"flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/autoscaling",
"httpMethod": "POST",
"id": "container.projects.zones.clusters.nodePools.autoscaling",
@ -1944,7 +2047,7 @@
]
},
"get": {
"description": "Retrieves the node pool requested.",
"description": "Retrieves the requested node pool.",
"flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}",
"httpMethod": "GET",
"id": "container.projects.zones.clusters.nodePools.get",
@ -2037,7 +2140,7 @@
]
},
"rollback": {
"description": "Roll back the previously Aborted or Failed NodePool upgrade.\nThis will be an no-op if the last upgrade successfully completed.",
"description": "Rolls back a previously Aborted or Failed NodePool upgrade.\nThis makes no changes if the last upgrade successfully completed.",
"flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}:rollback",
"httpMethod": "POST",
"id": "container.projects.zones.clusters.nodePools.rollback",
@ -2181,7 +2284,7 @@
]
},
"update": {
"description": "Updates the version and/or image type for a specific node pool.",
"description": "Updates the version and/or image type for the specified node pool.",
"flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/update",
"httpMethod": "POST",
"id": "container.projects.zones.clusters.nodePools.update",
@ -2361,7 +2464,7 @@
}
}
},
"revision": "20181109",
"revision": "20190319",
"rootUrl": "https://container.googleapis.com/",
"schemas": {
"AcceleratorConfig": {
@ -2500,9 +2603,13 @@
"type": "integer"
},
"currentNodeVersion": {
"description": "[Output only] Deprecated, use\n[NodePool.version](/kubernetes-engine/docs/reference/rest/v1/projects.zones.clusters.nodePool)\ninstead. The current version of the node software components. If they are\ncurrently at multiple versions because they're in the process of being\nupgraded, this reflects the minimum version of all nodes.",
"description": "[Output only] Deprecated, use\n[NodePools.version](/kubernetes-engine/docs/reference/rest/v1/projects.zones.clusters.nodePools)\ninstead. The current version of the node software components. If they are\ncurrently at multiple versions because they're in the process of being\nupgraded, this reflects the minimum version of all nodes.",
"type": "string"
},
"defaultMaxPodsConstraint": {
"$ref": "MaxPodsConstraint",
"description": "The default constraint on the maximum number of pods that can be run\nsimultaneously on a node in the node pool of this cluster. Only honored\nif cluster created with IP Alias support."
},
"description": {
"description": "An optional description of this cluster.",
"type": "string"
@ -2511,6 +2618,10 @@
"description": "Kubernetes alpha features are enabled on this cluster. This includes alpha\nAPI groups (e.g. v1alpha1) and features that may not be production ready in\nthe kubernetes version of the master and nodes.\nThe cluster has no SLA for uptime and master/node upgrades are disabled.\nAlpha enabled clusters are automatically deleted thirty days after\ncreation.",
"type": "boolean"
},
"enableTpu": {
"description": "Enable the ability to use Cloud TPUs in this cluster.",
"type": "boolean"
},
"endpoint": {
"description": "[Output only] The IP address of this cluster's master endpoint.\nThe endpoint can be accessed from the internet at\n`https://username:password@endpoint/`.\n\nSee the `masterAuth` property of this resource for username and\npassword information.",
"type": "string"
@ -2659,6 +2770,10 @@
"description": "The name of the Google Compute Engine\n[subnetwork](/compute/docs/subnetworks) to which the\ncluster is connected.",
"type": "string"
},
"tpuIpv4CidrBlock": {
"description": "[Output only] The IP address range of the Cloud TPUs in this cluster, in\n[CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)\nnotation (e.g. `1.2.3.4/29`).",
"type": "string"
},
"zone": {
"description": "[Output only] The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field is deprecated, use location instead.",
"type": "string"
@ -2806,6 +2921,70 @@
"properties": {},
"type": "object"
},
"GetJSONWebKeysResponse": {
"description": "GetJSONWebKeysResponse is a valid JSON Web Key Set as specififed in rfc 7517",
"id": "GetJSONWebKeysResponse",
"properties": {
"keys": {
"description": "The public component of the keys used by the cluster to sign token\nrequests.",
"items": {
"$ref": "Jwk"
},
"type": "array"
}
},
"type": "object"
},
"GetOpenIDConfigResponse": {
"description": "GetOpenIDConfigResponse is an OIDC discovery document for the cluster.\nSee the OpenID Connect Discovery 1.0 specification for details.",
"id": "GetOpenIDConfigResponse",
"properties": {
"claims_supported": {
"description": "NOLINT",
"items": {
"type": "string"
},
"type": "array"
},
"grant_types": {
"description": "NOLINT",
"items": {
"type": "string"
},
"type": "array"
},
"id_token_signing_alg_values_supported": {
"description": "NOLINT",
"items": {
"type": "string"
},
"type": "array"
},
"issuer": {
"description": "NOLINT",
"type": "string"
},
"jwks_uri": {
"description": "NOLINT",
"type": "string"
},
"response_types_supported": {
"description": "NOLINT",
"items": {
"type": "string"
},
"type": "array"
},
"subject_types_supported": {
"description": "NOLINT",
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"HorizontalPodAutoscaling": {
"description": "Configuration options for the horizontal pod autoscaling feature, which\nincreases or decreases the number of replica pods a replication controller\nhas based on the resource usage of the existing pods.",
"id": "HorizontalPodAutoscaling",
@ -2872,6 +3051,10 @@
"description": "A custom subnetwork name to be used if `create_subnetwork` is true. If\nthis field is empty, then an automatic name will be chosen for the new\nsubnetwork.",
"type": "string"
},
"tpuIpv4CidrBlock": {
"description": "The IP address range of the Cloud TPUs in this cluster. If unspecified, a\nrange will be automatically chosen with the default size.\n\nThis field is only applicable when `use_ip_aliases` is true.\n\nIf unspecified, the range will use the default size.\n\nSet to /netmask (e.g. `/14`) to have a range chosen with a specific\nnetmask.\n\nSet to a\n[CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)\nnotation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g.\n`10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range\nto use.",
"type": "string"
},
"useIpAliases": {
"description": "Whether alias IPs will be used for pod IPs in the cluster.",
"type": "boolean"
@ -2879,6 +3062,49 @@
},
"type": "object"
},
"Jwk": {
"description": "Jwk is a JSON Web Key as specified in RFC 7517",
"id": "Jwk",
"properties": {
"alg": {
"description": "NOLINT",
"type": "string"
},
"crv": {
"description": "NOLINT",
"type": "string"
},
"e": {
"description": "NOLINT",
"type": "string"
},
"kid": {
"description": "NOLINT",
"type": "string"
},
"kty": {
"description": "NOLINT",
"type": "string"
},
"n": {
"description": "Fields for RSA keys.\nNOLINT",
"type": "string"
},
"use": {
"description": "NOLINT",
"type": "string"
},
"x": {
"description": "Fields for ECDSA keys.\nNOLINT",
"type": "string"
},
"y": {
"description": "NOLINT",
"type": "string"
}
},
"type": "object"
},
"KubernetesDashboard": {
"description": "Configuration for the Kubernetes Dashboard.",
"id": "KubernetesDashboard",
@ -2957,6 +3183,24 @@
},
"type": "object"
},
"ListUsableSubnetworksResponse": {
"description": "ListUsableSubnetworksResponse is the response of\nListUsableSubnetworksRequest.",
"id": "ListUsableSubnetworksResponse",
"properties": {
"nextPageToken": {
"description": "This token allows you to get the next page of results for list requests.\nIf the number of results is larger than `page_size`, use the\n`next_page_token` as a value for the query parameter `page_token` in the\nnext request. The value will become empty when there are no more pages.",
"type": "string"
},
"subnetworks": {
"description": "A list of usable subnetworks in the specified network project.",
"items": {
"$ref": "UsableSubnetwork"
},
"type": "array"
}
},
"type": "object"
},
"MaintenancePolicy": {
"description": "MaintenancePolicy defines the maintenance policy to be used for the cluster.",
"id": "MaintenancePolicy",
@ -3028,6 +3272,18 @@
},
"type": "object"
},
"MaxPodsConstraint": {
"description": "Constraints applied to pods.",
"id": "MaxPodsConstraint",
"properties": {
"maxPodsPerNode": {
"description": "Constraint enforced on the max num of pods per node.",
"format": "int64",
"type": "string"
}
},
"type": "object"
},
"NetworkConfig": {
"description": "NetworkConfig reports the relative names of network \u0026 subnetwork.",
"id": "NetworkConfig",
@ -3121,7 +3377,7 @@
"additionalProperties": {
"type": "string"
},
"description": "The metadata key/value pairs assigned to instances in the cluster.\n\nKeys must conform to the regexp [a-zA-Z0-9-_]+ and be less than 128 bytes\nin length. These are reflected as part of a URL in the metadata server.\nAdditionally, to avoid ambiguity, keys must not conflict with any other\nmetadata keys for the project or be one of the reserved keys:\n \"cluster-location\"\n \"cluster-name\"\n \"cluster-uid\"\n \"configure-sh\"\n \"enable-os-login\"\n \"gci-update-strategy\"\n \"gci-ensure-gke-docker\"\n \"instance-template\"\n \"kube-env\"\n \"startup-script\"\n \"user-data\"\n\nValues are free-form strings, and only have meaning as interpreted by\nthe image running in the instance. The only restriction placed on them is\nthat each value's size must be less than or equal to 32 KB.\n\nThe total size of all keys and values must be less than 512 KB.",
"description": "The metadata key/value pairs assigned to instances in the cluster.\n\nKeys must conform to the regexp [a-zA-Z0-9-_]+ and be less than 128 bytes\nin length. These are reflected as part of a URL in the metadata server.\nAdditionally, to avoid ambiguity, keys must not conflict with any other\nmetadata keys for the project or be one of the reserved keys:\n \"cluster-location\"\n \"cluster-name\"\n \"cluster-uid\"\n \"configure-sh\"\n \"containerd-configure-sh\"\n \"enable-os-login\"\n \"gci-update-strategy\"\n \"gci-ensure-gke-docker\"\n \"instance-template\"\n \"kube-env\"\n \"startup-script\"\n \"user-data\"\n\nValues are free-form strings, and only have meaning as interpreted by\nthe image running in the instance. The only restriction placed on them is\nthat each value's size must be less than or equal to 32 KB.\n\nThe total size of all keys and values must be less than 512 KB.",
"type": "object"
},
"minCpuPlatform": {
@ -3214,6 +3470,10 @@
"$ref": "NodeManagement",
"description": "NodeManagement configuration for this NodePool."
},
"maxPodsConstraint": {
"$ref": "MaxPodsConstraint",
"description": "The constraint on the maximum number of pods that can be run\nsimultaneously on a node in the node pool."
},
"name": {
"description": "The name of the node pool.",
"type": "string"
@ -4021,6 +4281,69 @@
}
},
"type": "object"
},
"UsableSubnetwork": {
"description": "UsableSubnetwork resource returns the subnetwork name, its associated network\nand the primary CIDR range.",
"id": "UsableSubnetwork",
"properties": {
"ipCidrRange": {
"description": "The range of internal addresses that are owned by this subnetwork.",
"type": "string"
},
"network": {
"description": "Network Name.\nExample: projects/my-project/global/networks/my-network",
"type": "string"
},
"secondaryIpRanges": {
"description": "Secondary IP ranges.",
"items": {
"$ref": "UsableSubnetworkSecondaryRange"
},
"type": "array"
},
"statusMessage": {
"description": "A human readable status message representing the reasons for cases where\nthe caller cannot use the secondary ranges under the subnet. For example if\nthe secondary_ip_ranges is empty due to a permission issue, an insufficient\npermission message will be given by status_message.",
"type": "string"
},
"subnetwork": {
"description": "Subnetwork Name.\nExample: projects/my-project/regions/us-central1/subnetworks/my-subnet",
"type": "string"
}
},
"type": "object"
},
"UsableSubnetworkSecondaryRange": {
"description": "Secondary IP range of a usable subnetwork.",
"id": "UsableSubnetworkSecondaryRange",
"properties": {
"ipCidrRange": {
"description": "The range of IP addresses belonging to this subnetwork secondary range.",
"type": "string"
},
"rangeName": {
"description": "The name associated with this subnetwork secondary range, used when adding\nan alias IP range to a VM instance.",
"type": "string"
},
"status": {
"description": "This field is to determine the status of the secondary range programmably.",
"enum": [
"UNKNOWN",
"UNUSED",
"IN_USE_SERVICE",
"IN_USE_SHAREABLE_POD",
"IN_USE_MANAGED_POD"
],
"enumDescriptions": [
"UNKNOWN is the zero value of the Status enum. It's not a valid status.",
"UNUSED denotes that this range is unclaimed by any cluster.",
"IN_USE_SERVICE denotes that this range is claimed by a cluster for\nservices. It cannot be used for other clusters.",
"IN_USE_SHAREABLE_POD denotes this range was created by the network admin\nand is currently claimed by a cluster for pods. It can only be used by\nother clusters as a pod range.",
"IN_USE_MANAGED_POD denotes this range was created by GKE and is claimed\nfor pods. It cannot be used for other clusters."
],
"type": "string"
}
},
"type": "object"
}
},
"servicePath": "",

File diff suppressed because it is too large Load Diff

View File

@ -111,7 +111,7 @@
"usableSubnetworks": {
"methods": {
"list": {
"description": "Lists subnetworks that are usable for creating clusters in a project.",
"description": "Lists subnetworks that can be used for creating clusters in a project.",
"flatPath": "v1beta1/projects/{projectsId}/aggregated/usableSubnetworks",
"httpMethod": "GET",
"id": "container.projects.aggregated.usableSubnetworks.list",
@ -158,7 +158,7 @@
"locations": {
"methods": {
"getServerConfig": {
"description": "Returns configuration info about the Kubernetes Engine service.",
"description": "Returns configuration info about the Google Kubernetes Engine service.",
"flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/serverConfig",
"httpMethod": "GET",
"id": "container.projects.locations.getServerConfig",
@ -167,7 +167,7 @@
],
"parameters": {
"name": {
"description": "The name (project and location) of the server config to get\nSpecified in the format 'projects/*/locations/*'.",
"description": "The name (project and location) of the server config to get,\nspecified in the format 'projects/*/locations/*'.",
"location": "path",
"pattern": "^projects/[^/]+/locations/[^/]+$",
"required": true,
@ -193,7 +193,7 @@
]
},
"list": {
"description": "Used to fetch locations that offer GKE.",
"description": "Fetches locations that offer Google Kubernetes Engine.",
"flatPath": "v1beta1/projects/{projectsId}/locations",
"httpMethod": "GET",
"id": "container.projects.locations.list",
@ -250,7 +250,7 @@
]
},
"create": {
"description": "Creates a cluster, consisting of the specified number and type of Google\nCompute Engine instances.\n\nBy default, the cluster is created in the project's\n[default network](/compute/docs/networks-and-firewalls#networks).\n\nOne firewall is added for the cluster. After cluster creation,\nthe cluster creates routes for each node to allow the containers\non that node to communicate with all other instances in the\ncluster.\n\nFinally, an entry is added to the project's global metadata indicating\nwhich CIDR range is being used by the cluster.",
"description": "Creates a cluster, consisting of the specified number and type of Google\nCompute Engine instances.\n\nBy default, the cluster is created in the project's\n[default network](/compute/docs/networks-and-firewalls#networks).\n\nOne firewall is added for the cluster. After cluster creation,\nthe Kubelet creates routes for each node to allow the containers\non that node to communicate with all other instances in the\ncluster.\n\nFinally, an entry is added to the project's global metadata indicating\nwhich CIDR range the cluster is using.",
"flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters",
"httpMethod": "POST",
"id": "container.projects.locations.clusters.create",
@ -278,7 +278,7 @@
]
},
"delete": {
"description": "Deletes the cluster, including the Kubernetes endpoint and all worker\nnodes.\n\nFirewalls and routes that were configured during cluster creation\nare also deleted.\n\nOther Google Compute Engine resources that might be in use by the cluster\n(e.g. load balancer resources) will not be deleted if they weren't present\nat the initial create time.",
"description": "Deletes the cluster, including the Kubernetes endpoint and all worker\nnodes.\n\nFirewalls and routes that were configured during cluster creation\nare also deleted.\n\nOther Google Compute Engine resources that might be in use by the cluster,\nsuch as load balancer resources, are not deleted if they weren't present\nwhen the cluster was initially created.",
"flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}",
"httpMethod": "DELETE",
"id": "container.projects.locations.clusters.delete",
@ -357,6 +357,31 @@
"https://www.googleapis.com/auth/cloud-platform"
]
},
"getJwks": {
"description": "Gets the public component of the cluster signing keys in\nJSON Web Key format.\nThis API is not yet intended for general use, and is not available for all\nclusters.",
"flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/jwks",
"httpMethod": "GET",
"id": "container.projects.locations.clusters.getJwks",
"parameterOrder": [
"parent"
],
"parameters": {
"parent": {
"description": "The cluster (project, location, cluster id) to get keys for. Specified in\nthe format 'projects/*/locations/*/clusters/*'.",
"location": "path",
"pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
"required": true,
"type": "string"
}
},
"path": "v1beta1/{+parent}/jwks",
"response": {
"$ref": "GetJSONWebKeysResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
},
"list": {
"description": "Lists all clusters owned by a project in either the specified zone or all\nzones.",
"flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters",
@ -533,7 +558,7 @@
]
},
"setMasterAuth": {
"description": "Used to set master auth materials. Currently supports :-\nChanging the admin password for a specific cluster.\nThis can be either via password generation or explicitly set.\nModify basic_auth.csv and reset the K8S API server.",
"description": "Sets master auth materials. Currently supports changing the admin password\nor a specific cluster, either via password generation or explicitly setting\nthe password.",
"flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setMasterAuth",
"httpMethod": "POST",
"id": "container.projects.locations.clusters.setMasterAuth",
@ -589,7 +614,7 @@
]
},
"setNetworkPolicy": {
"description": "Enables/Disables Network Policy for a cluster.",
"description": "Enables or disables Network Policy for a cluster.",
"flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setNetworkPolicy",
"httpMethod": "POST",
"id": "container.projects.locations.clusters.setNetworkPolicy",
@ -645,7 +670,7 @@
]
},
"startIpRotation": {
"description": "Start master IP rotation.",
"description": "Starts master IP rotation.",
"flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:startIpRotation",
"httpMethod": "POST",
"id": "container.projects.locations.clusters.startIpRotation",
@ -806,7 +831,7 @@
]
},
"get": {
"description": "Retrieves the node pool requested.",
"description": "Retrieves the requested node pool.",
"flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}",
"httpMethod": "GET",
"id": "container.projects.locations.clusters.nodePools.get",
@ -891,7 +916,7 @@
]
},
"rollback": {
"description": "Roll back the previously Aborted or Failed NodePool upgrade.\nThis will be an no-op if the last upgrade successfully completed.",
"description": "Rolls back a previously Aborted or Failed NodePool upgrade.\nThis makes no changes if the last upgrade successfully completed.",
"flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}:rollback",
"httpMethod": "POST",
"id": "container.projects.locations.clusters.nodePools.rollback",
@ -1031,6 +1056,35 @@
]
}
}
},
"well-known": {
"methods": {
"getOpenid-configuration": {
"description": "Gets the OIDC discovery document for the cluster.\nSee the\n[OpenID Connect Discovery 1.0\nspecification](https://openid.net/specs/openid-connect-discovery-1_0.html)\nfor details.\nThis API is not yet intended for general use, and is not available for all\nclusters.",
"flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/.well-known/openid-configuration",
"httpMethod": "GET",
"id": "container.projects.locations.clusters.well-known.getOpenid-configuration",
"parameterOrder": [
"parent"
],
"parameters": {
"parent": {
"description": "The cluster (project, location, cluster id) to get the discovery document\nfor. Specified in the format 'projects/*/locations/*/clusters/*'.",
"location": "path",
"pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
"required": true,
"type": "string"
}
},
"path": "v1beta1/{+parent}/.well-known/openid-configuration",
"response": {
"$ref": "GetOpenIDConfigResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
}
}
}
}
},
@ -1105,7 +1159,7 @@
]
},
"list": {
"description": "Lists all operations in a project in a specific zone or all zones.",
"description": "Lists all operations in a project in the specified zone or all zones.",
"flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/operations",
"httpMethod": "GET",
"id": "container.projects.locations.operations.list",
@ -1146,7 +1200,7 @@
"zones": {
"methods": {
"getServerconfig": {
"description": "Returns configuration info about the Kubernetes Engine service.",
"description": "Returns configuration info about the Google Kubernetes Engine service.",
"flatPath": "v1beta1/projects/{projectId}/zones/{zone}/serverconfig",
"httpMethod": "GET",
"id": "container.projects.zones.getServerconfig",
@ -1156,7 +1210,7 @@
],
"parameters": {
"name": {
"description": "The name (project and location) of the server config to get\nSpecified in the format 'projects/*/locations/*'.",
"description": "The name (project and location) of the server config to get,\nspecified in the format 'projects/*/locations/*'.",
"location": "query",
"type": "string"
},
@ -1268,7 +1322,7 @@
]
},
"create": {
"description": "Creates a cluster, consisting of the specified number and type of Google\nCompute Engine instances.\n\nBy default, the cluster is created in the project's\n[default network](/compute/docs/networks-and-firewalls#networks).\n\nOne firewall is added for the cluster. After cluster creation,\nthe cluster creates routes for each node to allow the containers\non that node to communicate with all other instances in the\ncluster.\n\nFinally, an entry is added to the project's global metadata indicating\nwhich CIDR range is being used by the cluster.",
"description": "Creates a cluster, consisting of the specified number and type of Google\nCompute Engine instances.\n\nBy default, the cluster is created in the project's\n[default network](/compute/docs/networks-and-firewalls#networks).\n\nOne firewall is added for the cluster. After cluster creation,\nthe Kubelet creates routes for each node to allow the containers\non that node to communicate with all other instances in the\ncluster.\n\nFinally, an entry is added to the project's global metadata indicating\nwhich CIDR range the cluster is using.",
"flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters",
"httpMethod": "POST",
"id": "container.projects.zones.clusters.create",
@ -1302,7 +1356,7 @@
]
},
"delete": {
"description": "Deletes the cluster, including the Kubernetes endpoint and all worker\nnodes.\n\nFirewalls and routes that were configured during cluster creation\nare also deleted.\n\nOther Google Compute Engine resources that might be in use by the cluster\n(e.g. load balancer resources) will not be deleted if they weren't present\nat the initial create time.",
"description": "Deletes the cluster, including the Kubernetes endpoint and all worker\nnodes.\n\nFirewalls and routes that were configured during cluster creation\nare also deleted.\n\nOther Google Compute Engine resources that might be in use by the cluster,\nsuch as load balancer resources, are not deleted if they weren't present\nwhen the cluster was initially created.",
"flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}",
"httpMethod": "DELETE",
"id": "container.projects.zones.clusters.delete",
@ -1711,7 +1765,7 @@
]
},
"setMasterAuth": {
"description": "Used to set master auth materials. Currently supports :-\nChanging the admin password for a specific cluster.\nThis can be either via password generation or explicitly set.\nModify basic_auth.csv and reset the K8S API server.",
"description": "Sets master auth materials. Currently supports changing the admin password\nor a specific cluster, either via password generation or explicitly setting\nthe password.",
"flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMasterAuth",
"httpMethod": "POST",
"id": "container.projects.zones.clusters.setMasterAuth",
@ -1752,7 +1806,7 @@
]
},
"setNetworkPolicy": {
"description": "Enables/Disables Network Policy for a cluster.",
"description": "Enables or disables Network Policy for a cluster.",
"flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setNetworkPolicy",
"httpMethod": "POST",
"id": "container.projects.zones.clusters.setNetworkPolicy",
@ -1793,7 +1847,7 @@
]
},
"startIpRotation": {
"description": "Start master IP rotation.",
"description": "Starts master IP rotation.",
"flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:startIpRotation",
"httpMethod": "POST",
"id": "container.projects.zones.clusters.startIpRotation",
@ -2018,7 +2072,7 @@
]
},
"get": {
"description": "Retrieves the node pool requested.",
"description": "Retrieves the requested node pool.",
"flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}",
"httpMethod": "GET",
"id": "container.projects.zones.clusters.nodePools.get",
@ -2111,7 +2165,7 @@
]
},
"rollback": {
"description": "Roll back the previously Aborted or Failed NodePool upgrade.\nThis will be an no-op if the last upgrade successfully completed.",
"description": "Rolls back a previously Aborted or Failed NodePool upgrade.\nThis makes no changes if the last upgrade successfully completed.",
"flatPath": "v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}:rollback",
"httpMethod": "POST",
"id": "container.projects.zones.clusters.nodePools.rollback",
@ -2393,7 +2447,7 @@
]
},
"list": {
"description": "Lists all operations in a project in a specific zone or all zones.",
"description": "Lists all operations in a project in the specified zone or all zones.",
"flatPath": "v1beta1/projects/{projectId}/zones/{zone}/operations",
"httpMethod": "GET",
"id": "container.projects.zones.operations.list",
@ -2435,7 +2489,7 @@
}
}
},
"revision": "20181113",
"revision": "20190319",
"rootUrl": "https://container.googleapis.com/",
"schemas": {
"AcceleratorConfig": {
@ -2485,6 +2539,21 @@
},
"type": "object"
},
"AuthenticatorGroupsConfig": {
"description": "Configuration for returning group information from authenticators.",
"id": "AuthenticatorGroupsConfig",
"properties": {
"enabled": {
"description": "Whether this cluster should return group membership lookups\nduring authentication using a group of security groups.",
"type": "boolean"
},
"securityGroup": {
"description": "The name of the security group-of-groups to be used. Only relevant\nif enabled = true.",
"type": "string"
}
},
"type": "object"
},
"AutoUpgradeOptions": {
"description": "AutoUpgradeOptions defines the set of options for the user to control how\nthe Auto Upgrades will proceed.",
"id": "AutoUpgradeOptions",
@ -2590,6 +2659,10 @@
"$ref": "AddonsConfig",
"description": "Configurations for the various addons available to run in the cluster."
},
"authenticatorGroupsConfig": {
"$ref": "AuthenticatorGroupsConfig",
"description": "Configuration controlling RBAC group membership information."
},
"autoscaling": {
"$ref": "ClusterAutoscaling",
"description": "Cluster-level autoscaling configuration."
@ -2626,6 +2699,10 @@
"description": "[Output only] Deprecated, use\n[NodePool.version](/kubernetes-engine/docs/reference/rest/v1beta1/projects.zones.clusters.nodePool)\ninstead. The current version of the node software components.\nIf they are currently at multiple versions because they're in the process\nof being upgraded, this reflects the minimum version of all nodes.",
"type": "string"
},
"databaseEncryption": {
"$ref": "DatabaseEncryption",
"description": "Configuration of etcd encryption."
},
"defaultMaxPodsConstraint": {
"$ref": "MaxPodsConstraint",
"description": "The default constraint on the maximum number of pods that can be run\nsimultaneously on a node in the node pool of this cluster. Only honored\nif cluster created with IP Alias support."
@ -2855,10 +2932,18 @@
"$ref": "ClusterAutoscaling",
"description": "Cluster-level autoscaling configuration."
},
"desiredDatabaseEncryption": {
"$ref": "DatabaseEncryption",
"description": "Configuration of etcd encryption."
},
"desiredImageType": {
"description": "The desired image type for the node pool.\nNOTE: Set the \"desired_node_pool\" field as well.",
"type": "string"
},
"desiredIntraNodeVisibilityConfig": {
"$ref": "IntraNodeVisibilityConfig",
"description": "The desired config of Intra-node visibility."
},
"desiredLocations": {
"description": "The desired list of Google Compute Engine\n[zones](/compute/docs/zones#available) in which the cluster's nodes\nshould be located. Changing the locations a cluster is in will result\nin nodes being either created or removed from the cluster, depending on\nwhether locations are being added or removed.\n\nThis list must always include the cluster's primary zone.",
"items": {
@ -2997,12 +3082,101 @@
},
"type": "object"
},
"DatabaseEncryption": {
"description": "Configuration of etcd encryption.",
"id": "DatabaseEncryption",
"properties": {
"keyName": {
"description": "Name of CloudKMS key to use for the encryption of secrets in etcd.\nEx. projects/my-project/locations/global/keyRings/my-ring/cryptoKeys/my-key",
"type": "string"
},
"state": {
"description": "Denotes the state of etcd encryption.",
"enum": [
"UNKNOWN",
"ENCRYPTED",
"DECRYPTED"
],
"enumDescriptions": [
"Should never be set",
"Secrets in etcd are encrypted.",
"Secrets in etcd are stored in plain text (at etcd level) - this is\nunrelated to Google Compute Engine level full disk encryption."
],
"type": "string"
}
},
"type": "object"
},
"Empty": {
"description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.",
"id": "Empty",
"properties": {},
"type": "object"
},
"GetJSONWebKeysResponse": {
"description": "GetJSONWebKeysResponse is a valid JSON Web Key Set as specififed in rfc 7517",
"id": "GetJSONWebKeysResponse",
"properties": {
"keys": {
"description": "The public component of the keys used by the cluster to sign token\nrequests.",
"items": {
"$ref": "Jwk"
},
"type": "array"
}
},
"type": "object"
},
"GetOpenIDConfigResponse": {
"description": "GetOpenIDConfigResponse is an OIDC discovery document for the cluster.\nSee the OpenID Connect Discovery 1.0 specification for details.",
"id": "GetOpenIDConfigResponse",
"properties": {
"claims_supported": {
"description": "NOLINT",
"items": {
"type": "string"
},
"type": "array"
},
"grant_types": {
"description": "NOLINT",
"items": {
"type": "string"
},
"type": "array"
},
"id_token_signing_alg_values_supported": {
"description": "NOLINT",
"items": {
"type": "string"
},
"type": "array"
},
"issuer": {
"description": "NOLINT",
"type": "string"
},
"jwks_uri": {
"description": "NOLINT",
"type": "string"
},
"response_types_supported": {
"description": "NOLINT",
"items": {
"type": "string"
},
"type": "array"
},
"subject_types_supported": {
"description": "NOLINT",
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"HorizontalPodAutoscaling": {
"description": "Configuration options for the horizontal pod autoscaling feature, which\nincreases or decreases the number of replica pods a replication controller\nhas based on the resource usage of the existing pods.",
"id": "HorizontalPodAutoscaling",
@ -3084,6 +3258,17 @@
},
"type": "object"
},
"IntraNodeVisibilityConfig": {
"description": "IntraNodeVisibilityConfig contains the desired config of the intra-node\nvisibility on this cluster.",
"id": "IntraNodeVisibilityConfig",
"properties": {
"enabled": {
"description": "Enables intra node visibility for this cluster.",
"type": "boolean"
}
},
"type": "object"
},
"IstioConfig": {
"description": "Configuration options for Istio addon.",
"id": "IstioConfig",
@ -3107,6 +3292,49 @@
},
"type": "object"
},
"Jwk": {
"description": "Jwk is a JSON Web Key as specified in RFC 7517",
"id": "Jwk",
"properties": {
"alg": {
"description": "NOLINT",
"type": "string"
},
"crv": {
"description": "NOLINT",
"type": "string"
},
"e": {
"description": "NOLINT",
"type": "string"
},
"kid": {
"description": "NOLINT",
"type": "string"
},
"kty": {
"description": "NOLINT",
"type": "string"
},
"n": {
"description": "Fields for RSA keys.\nNOLINT",
"type": "string"
},
"use": {
"description": "NOLINT",
"type": "string"
},
"x": {
"description": "Fields for ECDSA keys.\nNOLINT",
"type": "string"
},
"y": {
"description": "NOLINT",
"type": "string"
}
},
"type": "object"
},
"KubernetesDashboard": {
"description": "Configuration for the Kubernetes Dashboard.",
"id": "KubernetesDashboard",
@ -3362,6 +3590,10 @@
"description": "NetworkConfig reports the relative names of network \u0026 subnetwork.",
"id": "NetworkConfig",
"properties": {
"enableIntraNodeVisibility": {
"description": "Whether Intra-node visibility is enabled for this cluster.\nThis makes same node pod to pod traffic visible for VPC network.",
"type": "boolean"
},
"network": {
"description": "Output only. The relative name of the Google Compute Engine\nnetwork(/compute/docs/networks-and-firewalls#networks) to which\nthe cluster is connected.\nExample: projects/my-project/global/networks/my-network",
"type": "string"
@ -3451,7 +3683,7 @@
"additionalProperties": {
"type": "string"
},
"description": "The metadata key/value pairs assigned to instances in the cluster.\n\nKeys must conform to the regexp [a-zA-Z0-9-_]+ and be less than 128 bytes\nin length. These are reflected as part of a URL in the metadata server.\nAdditionally, to avoid ambiguity, keys must not conflict with any other\nmetadata keys for the project or be one of the reserved keys:\n \"cluster-location\"\n \"cluster-name\"\n \"cluster-uid\"\n \"configure-sh\"\n \"enable-oslogin\"\n \"gci-ensure-gke-docker\"\n \"gci-update-strategy\"\n \"instance-template\"\n \"kube-env\"\n \"startup-script\"\n \"user-data\"\n\nValues are free-form strings, and only have meaning as interpreted by\nthe image running in the instance. The only restriction placed on them is\nthat each value's size must be less than or equal to 32 KB.\n\nThe total size of all keys and values must be less than 512 KB.",
"description": "The metadata key/value pairs assigned to instances in the cluster.\n\nKeys must conform to the regexp [a-zA-Z0-9-_]+ and be less than 128 bytes\nin length. These are reflected as part of a URL in the metadata server.\nAdditionally, to avoid ambiguity, keys must not conflict with any other\nmetadata keys for the project or be one of the reserved keys:\n \"cluster-location\"\n \"cluster-name\"\n \"cluster-uid\"\n \"configure-sh\"\n \"containerd-configure-sh\"\n \"enable-oslogin\"\n \"gci-ensure-gke-docker\"\n \"gci-update-strategy\"\n \"instance-template\"\n \"kube-env\"\n \"startup-script\"\n \"user-data\"\n\nValues are free-form strings, and only have meaning as interpreted by\nthe image running in the instance. The only restriction placed on them is\nthat each value's size must be less than or equal to 32 KB.\n\nThe total size of all keys and values must be less than 512 KB.",
"type": "object"
},
"minCpuPlatform": {
@ -4537,16 +4769,18 @@
"id": "WorkloadMetadataConfig",
"properties": {
"nodeMetadata": {
"description": "NodeMetadata is the configuration for how to expose the node metadata to\nthe workload running on the node.",
"description": "NodeMetadata is the configuration for how to expose metadata to the\nworkloads running on the node.",
"enum": [
"UNSPECIFIED",
"SECURE",
"EXPOSE"
"EXPOSE",
"GKE_METADATA_SERVER"
],
"enumDescriptions": [
"Not set.",
"Prevent workloads not in hostNetwork from accessing certain VM metadata,\nspecifically kube-env, which contains Kubelet credentials, and the\ninstance identity token.\n\nMetadata concealment is a temporary security solution available while the\nbootstrapping process for cluster nodes is being redesigned with\nsignificant security improvements. This feature is scheduled to be\ndeprecated in the future and later removed.",
"Expose all VM metadata to pods."
"Expose all VM metadata to pods.",
"Run the GKE Metadata Server on this node. The GKE Metadata Server exposes\na metadata API to workloads that is compatible with the V1 Compute\nMetadata APIs exposed by the Compute Engine and App Engine Metadata\nServers. This feature can only be enabled if Workload Identity is enabled\nat the cluster level."
],
"type": "string"
}

File diff suppressed because it is too large Load Diff

View File

@ -168,7 +168,7 @@
"type": "string"
},
"location": {
"description": "The location that contains this job.",
"description": "The [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that\ncontains this job.",
"location": "query",
"type": "string"
},
@ -213,7 +213,7 @@
]
},
"create": {
"description": "Creates a Cloud Dataflow job.",
"description": "Creates a Cloud Dataflow job.\n\nTo create a job, we recommend using `projects.locations.jobs.create` with a\n[regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using\n`projects.jobs.create` is not recommended, as your job will always start\nin `us-central1`.",
"flatPath": "v1b3/projects/{projectId}/jobs",
"httpMethod": "POST",
"id": "dataflow.projects.jobs.create",
@ -222,7 +222,7 @@
],
"parameters": {
"location": {
"description": "The location that contains this job.",
"description": "The [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that\ncontains this job.",
"location": "query",
"type": "string"
},
@ -264,7 +264,7 @@
]
},
"get": {
"description": "Gets the state of the specified Cloud Dataflow job.",
"description": "Gets the state of the specified Cloud Dataflow job.\n\nTo get the state of a job, we recommend using `projects.locations.jobs.get`\nwith a [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using\n`projects.jobs.get` is not recommended, as you can only get the state of\njobs that are running in `us-central1`.",
"flatPath": "v1b3/projects/{projectId}/jobs/{jobId}",
"httpMethod": "GET",
"id": "dataflow.projects.jobs.get",
@ -280,7 +280,7 @@
"type": "string"
},
"location": {
"description": "The location that contains this job.",
"description": "The [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that\ncontains this job.",
"location": "query",
"type": "string"
},
@ -314,7 +314,7 @@
]
},
"getMetrics": {
"description": "Request the job status.",
"description": "Request the job status.\n\nTo request the status of a job, we recommend using\n`projects.locations.jobs.getMetrics` with a [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using\n`projects.jobs.getMetrics` is not recommended, as you can only request the\nstatus of jobs that are running in `us-central1`.",
"flatPath": "v1b3/projects/{projectId}/jobs/{jobId}/metrics",
"httpMethod": "GET",
"id": "dataflow.projects.jobs.getMetrics",
@ -330,7 +330,7 @@
"type": "string"
},
"location": {
"description": "The location which contains the job specified by job_id.",
"description": "The [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that\ncontains the job specified by job_id.",
"location": "query",
"type": "string"
},
@ -359,7 +359,7 @@
]
},
"list": {
"description": "List the jobs of a project in a given region.",
"description": "List the jobs of a project.\n\nTo list the jobs of a project in a region, we recommend using\n`projects.locations.jobs.get` with a [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). To\nlist the all jobs across all regions, use `projects.jobs.aggregated`. Using\n`projects.jobs.list` is not recommended, as you can only get the list of\njobs that are running in `us-central1`.",
"flatPath": "v1b3/projects/{projectId}/jobs",
"httpMethod": "GET",
"id": "dataflow.projects.jobs.list",
@ -379,7 +379,7 @@
"type": "string"
},
"location": {
"description": "The location that contains this job.",
"description": "The [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that\ncontains this job.",
"location": "query",
"type": "string"
},
@ -461,7 +461,7 @@
]
},
"update": {
"description": "Updates the state of an existing Cloud Dataflow job.",
"description": "Updates the state of an existing Cloud Dataflow job.\n\nTo update the state of an existing job, we recommend using\n`projects.locations.jobs.update` with a [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using\n`projects.jobs.update` is not recommended, as you can only update the state\nof jobs that are running in `us-central1`.",
"flatPath": "v1b3/projects/{projectId}/jobs/{jobId}",
"httpMethod": "PUT",
"id": "dataflow.projects.jobs.update",
@ -477,7 +477,7 @@
"type": "string"
},
"location": {
"description": "The location that contains this job.",
"description": "The [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that\ncontains this job.",
"location": "query",
"type": "string"
},
@ -585,7 +585,7 @@
"messages": {
"methods": {
"list": {
"description": "Request the job status.",
"description": "Request the job status.\n\nTo request the status of a job, we recommend using\n`projects.locations.jobs.messages.list` with a [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using\n`projects.jobs.messages.list` is not recommended, as you can only request\nthe status of jobs that are running in `us-central1`.",
"flatPath": "v1b3/projects/{projectId}/jobs/{jobId}/messages",
"httpMethod": "GET",
"id": "dataflow.projects.jobs.messages.list",
@ -607,7 +607,7 @@
"type": "string"
},
"location": {
"description": "The location which contains the job specified by job_id.",
"description": "The [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that\ncontains the job specified by job_id.",
"location": "query",
"type": "string"
},
@ -754,7 +754,7 @@
],
"parameters": {
"location": {
"description": "The location which contains the job",
"description": "The [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that\ncontains the job.",
"location": "path",
"required": true,
"type": "string"
@ -785,7 +785,7 @@
"jobs": {
"methods": {
"create": {
"description": "Creates a Cloud Dataflow job.",
"description": "Creates a Cloud Dataflow job.\n\nTo create a job, we recommend using `projects.locations.jobs.create` with a\n[regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using\n`projects.jobs.create` is not recommended, as your job will always start\nin `us-central1`.",
"flatPath": "v1b3/projects/{projectId}/locations/{location}/jobs",
"httpMethod": "POST",
"id": "dataflow.projects.locations.jobs.create",
@ -795,7 +795,7 @@
],
"parameters": {
"location": {
"description": "The location that contains this job.",
"description": "The [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that\ncontains this job.",
"location": "path",
"required": true,
"type": "string"
@ -838,7 +838,7 @@
]
},
"get": {
"description": "Gets the state of the specified Cloud Dataflow job.",
"description": "Gets the state of the specified Cloud Dataflow job.\n\nTo get the state of a job, we recommend using `projects.locations.jobs.get`\nwith a [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using\n`projects.jobs.get` is not recommended, as you can only get the state of\njobs that are running in `us-central1`.",
"flatPath": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}",
"httpMethod": "GET",
"id": "dataflow.projects.locations.jobs.get",
@ -855,7 +855,7 @@
"type": "string"
},
"location": {
"description": "The location that contains this job.",
"description": "The [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that\ncontains this job.",
"location": "path",
"required": true,
"type": "string"
@ -890,7 +890,7 @@
]
},
"getMetrics": {
"description": "Request the job status.",
"description": "Request the job status.\n\nTo request the status of a job, we recommend using\n`projects.locations.jobs.getMetrics` with a [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using\n`projects.jobs.getMetrics` is not recommended, as you can only request the\nstatus of jobs that are running in `us-central1`.",
"flatPath": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/metrics",
"httpMethod": "GET",
"id": "dataflow.projects.locations.jobs.getMetrics",
@ -907,7 +907,7 @@
"type": "string"
},
"location": {
"description": "The location which contains the job specified by job_id.",
"description": "The [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that\ncontains the job specified by job_id.",
"location": "path",
"required": true,
"type": "string"
@ -937,7 +937,7 @@
]
},
"list": {
"description": "List the jobs of a project in a given region.",
"description": "List the jobs of a project.\n\nTo list the jobs of a project in a region, we recommend using\n`projects.locations.jobs.get` with a [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). To\nlist the all jobs across all regions, use `projects.jobs.aggregated`. Using\n`projects.jobs.list` is not recommended, as you can only get the list of\njobs that are running in `us-central1`.",
"flatPath": "v1b3/projects/{projectId}/locations/{location}/jobs",
"httpMethod": "GET",
"id": "dataflow.projects.locations.jobs.list",
@ -958,7 +958,7 @@
"type": "string"
},
"location": {
"description": "The location that contains this job.",
"description": "The [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that\ncontains this job.",
"location": "path",
"required": true,
"type": "string"
@ -1048,7 +1048,7 @@
]
},
"update": {
"description": "Updates the state of an existing Cloud Dataflow job.",
"description": "Updates the state of an existing Cloud Dataflow job.\n\nTo update the state of an existing job, we recommend using\n`projects.locations.jobs.update` with a [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using\n`projects.jobs.update` is not recommended, as you can only update the state\nof jobs that are running in `us-central1`.",
"flatPath": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}",
"httpMethod": "PUT",
"id": "dataflow.projects.locations.jobs.update",
@ -1065,7 +1065,7 @@
"type": "string"
},
"location": {
"description": "The location that contains this job.",
"description": "The [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that\ncontains this job.",
"location": "path",
"required": true,
"type": "string"
@ -1113,7 +1113,7 @@
"type": "string"
},
"location": {
"description": "The location which contains the job specified by job_id.",
"description": "The [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that\ncontains the job specified by job_id.",
"location": "path",
"required": true,
"type": "string"
@ -1157,7 +1157,7 @@
"type": "string"
},
"location": {
"description": "The location which contains the job specified by job_id.",
"description": "The [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that\ncontains the job specified by job_id.",
"location": "path",
"required": true,
"type": "string"
@ -1188,7 +1188,7 @@
"messages": {
"methods": {
"list": {
"description": "Request the job status.",
"description": "Request the job status.\n\nTo request the status of a job, we recommend using\n`projects.locations.jobs.messages.list` with a [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using\n`projects.jobs.messages.list` is not recommended, as you can only request\nthe status of jobs that are running in `us-central1`.",
"flatPath": "v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/messages",
"httpMethod": "GET",
"id": "dataflow.projects.locations.jobs.messages.list",
@ -1211,7 +1211,7 @@
"type": "string"
},
"location": {
"description": "The location which contains the job specified by job_id.",
"description": "The [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that\ncontains the job specified by job_id.",
"location": "path",
"required": true,
"type": "string"
@ -1286,7 +1286,7 @@
"type": "string"
},
"location": {
"description": "The location which contains the WorkItem's job.",
"description": "The [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that\ncontains the WorkItem's job.",
"location": "path",
"required": true,
"type": "string"
@ -1330,7 +1330,7 @@
"type": "string"
},
"location": {
"description": "The location which contains the WorkItem's job.",
"description": "The [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that\ncontains the WorkItem's job.",
"location": "path",
"required": true,
"type": "string"
@ -1373,7 +1373,7 @@
],
"parameters": {
"location": {
"description": "The location to which to direct the request.",
"description": "The [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to\nwhich to direct the request.",
"location": "path",
"required": true,
"type": "string"
@ -1415,7 +1415,7 @@
"type": "string"
},
"location": {
"description": "The location to which to direct the request.",
"description": "The [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to\nwhich to direct the request.",
"location": "path",
"required": true,
"type": "string"
@ -1472,7 +1472,7 @@
"type": "string"
},
"location": {
"description": "The location to which to direct the request.",
"description": "The [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to\nwhich to direct the request.",
"location": "path",
"required": true,
"type": "string"
@ -1554,7 +1554,7 @@
"type": "string"
},
"location": {
"description": "The location to which to direct the request.",
"description": "The [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to\nwhich to direct the request.",
"location": "query",
"type": "string"
},
@ -1609,7 +1609,7 @@
"type": "string"
},
"location": {
"description": "The location to which to direct the request.",
"description": "The [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to\nwhich to direct the request.",
"location": "query",
"type": "string"
},
@ -1644,7 +1644,7 @@
}
}
},
"revision": "20181212",
"revision": "20190322",
"rootUrl": "https://dataflow.googleapis.com/",
"schemas": {
"ApproximateProgress": {
@ -2182,7 +2182,7 @@
"type": "string"
},
"location": {
"description": "The location to which to direct the request.",
"description": "The [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to\nwhich to direct the request.",
"type": "string"
},
"parameters": {
@ -2411,6 +2411,20 @@
},
"type": "array"
},
"flexResourceSchedulingGoal": {
"description": "Which Flexible Resource Scheduling mode to run in.",
"enum": [
"FLEXRS_UNSPECIFIED",
"FLEXRS_SPEED_OPTIMIZED",
"FLEXRS_COST_OPTIMIZED"
],
"enumDescriptions": [
"Run in the default mode.",
"Optimize for lower execution time.",
"Optimize for lower cost."
],
"type": "string"
},
"internalExperiments": {
"additionalProperties": {
"description": "Properties of the object. Contains field @type with type URL.",
@ -2431,6 +2445,10 @@
"description": "Identity to run virtual machines as. Defaults to the default account.",
"type": "string"
},
"serviceKmsKeyName": {
"description": "If set, contains the Cloud KMS key identifier used to encrypt data\nat rest, AKA a Customer Managed Encryption Key (CMEK).\n\nFormat:\n projects/PROJECT_ID/locations/LOCATION/keyRings/KEY_RING/cryptoKeys/KEY",
"type": "string"
},
"tempStoragePrefix": {
"description": "The prefix of the resources the system should use for temporary\nstorage. The system will append the suffix \"/temp-{JOBNAME} to\nthis resource prefix, where {JOBNAME} is the value of the\njob_name field. The resulting bucket and object prefix is used\nas the prefix of the resources used to store temporary data\nneeded during the job execution. NOTE: This will override the\nvalue in taskrunner_settings.\nThe supported resource type is:\n\nGoogle Cloud Storage:\n\n storage.googleapis.com/{bucket}/{object}\n bucket.storage.googleapis.com/{object}",
"type": "string"
@ -2579,11 +2597,11 @@
"type": "object"
},
"FailedLocation": {
"description": "Indicates which location failed to respond to a request for data.",
"description": "Indicates which [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) failed\nto respond to a request for data.",
"id": "FailedLocation",
"properties": {
"name": {
"description": "The name of the failed location.",
"description": "The name of the [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that\nfailed to respond.",
"type": "string"
}
},
@ -2654,7 +2672,7 @@
"type": "string"
},
"location": {
"description": "The location which contains the job specified by job_id.",
"description": "The [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that\ncontains the job specified by job_id.",
"type": "string"
},
"workerId": {
@ -2885,7 +2903,7 @@
"type": "object"
},
"location": {
"description": "The location that contains this job.",
"description": "The [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that\ncontains this job.",
"type": "string"
},
"name": {
@ -3063,7 +3081,7 @@
"type": "object"
},
"JobMetadata": {
"description": "Metadata available primarily for filtering jobs. Will be included in the\nListJob response and Job SUMMARY view+.",
"description": "Metadata available primarily for filtering jobs. Will be included in the\nListJob response and Job SUMMARY view.",
"id": "JobMetadata",
"properties": {
"bigTableDetails": {
@ -3116,7 +3134,7 @@
"type": "object"
},
"JobMetrics": {
"description": "JobMetrics contains a collection of metrics descibing the detailed progress\nof a Dataflow job. Metrics correspond to user-defined and system-defined\nmetrics in the job.\n\nThis resource captures only the most recent values of each metric;\ntime-series data can be queried for them (under the same metric names)\nfrom Cloud Monitoring.",
"description": "JobMetrics contains a collection of metrics describing the detailed progress\nof a Dataflow job. Metrics correspond to user-defined and system-defined\nmetrics in the job.\n\nThis resource captures only the most recent values of each metric;\ntime-series data can be queried for them (under the same metric names)\nfrom Cloud Monitoring.",
"id": "JobMetrics",
"properties": {
"metricTime": {
@ -3223,7 +3241,7 @@
"type": "string"
},
"location": {
"description": "The location which contains the WorkItem's job.",
"description": "The [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that\ncontains the WorkItem's job.",
"type": "string"
},
"requestedLeaseDuration": {
@ -3231,6 +3249,14 @@
"format": "google-duration",
"type": "string"
},
"unifiedWorkerRequest": {
"additionalProperties": {
"description": "Properties of the object. Contains field @type with type URL.",
"type": "any"
},
"description": "Untranslated bag-of-bytes WorkRequest from UnifiedWorker.",
"type": "object"
},
"workItemTypes": {
"description": "Filter for WorkItem type.",
"items": {
@ -3256,6 +3282,14 @@
"description": "Response to a request to lease WorkItems.",
"id": "LeaseWorkItemResponse",
"properties": {
"unifiedWorkerResponse": {
"additionalProperties": {
"description": "Properties of the object. Contains field @type with type URL.",
"type": "any"
},
"description": "Untranslated bag-of-bytes WorkResponse for UnifiedWorker.",
"type": "object"
},
"workItems": {
"description": "A list of the leased WorkItems.",
"items": {
@ -3296,7 +3330,7 @@
"id": "ListJobsResponse",
"properties": {
"failedLocation": {
"description": "Zero or more messages describing locations that failed to respond.",
"description": "Zero or more messages describing the [regional endpoints]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that\nfailed to respond.",
"items": {
"$ref": "FailedLocation"
},
@ -3681,7 +3715,7 @@
"type": "object"
},
"PipelineDescription": {
"description": "A descriptive representation of submitted pipeline as well as the executed\nform. This data is provided by the Dataflow service for ease of visualizing\nthe pipeline and interpretting Dataflow provided metrics.",
"description": "A descriptive representation of submitted pipeline as well as the executed\nform. This data is provided by the Dataflow service for ease of visualizing\nthe pipeline and interpreting Dataflow provided metrics.",
"id": "PipelineDescription",
"properties": {
"displayData": {
@ -3812,9 +3846,17 @@
"type": "string"
},
"location": {
"description": "The location which contains the WorkItem's job.",
"description": "The [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that\ncontains the WorkItem's job.",
"type": "string"
},
"unifiedWorkerRequest": {
"additionalProperties": {
"description": "Properties of the object. Contains field @type with type URL.",
"type": "any"
},
"description": "Untranslated bag-of-bytes WorkProgressUpdateRequest from UnifiedWorker.",
"type": "object"
},
"workItemStatuses": {
"description": "The order is unimportant, except that the order of the\nWorkItemServiceState messages in the ReportWorkItemStatusResponse\ncorresponds to the order of WorkItemStatus messages here.",
"items": {
@ -3833,6 +3875,14 @@
"description": "Response from a request to report the status of WorkItems.",
"id": "ReportWorkItemStatusResponse",
"properties": {
"unifiedWorkerResponse": {
"additionalProperties": {
"description": "Properties of the object. Contains field @type with type URL.",
"type": "any"
},
"description": "Untranslated bag-of-bytes WorkProgressUpdateResponse for UnifiedWorker.",
"type": "object"
},
"workItemServiceStates": {
"description": "A set of messages indicating the service-side state for each\nWorkItem whose status was reported, in the same order as the\nWorkItemStatus messages in the ReportWorkItemStatusRequest which\nresulting in this response.",
"items": {
@ -3939,7 +3989,7 @@
"type": "object"
},
"SdkVersion": {
"description": "The version of the SDK used to run the jobl",
"description": "The version of the SDK used to run the job.",
"id": "SdkVersion",
"properties": {
"sdkSupportStatus": {
@ -3965,7 +4015,7 @@
"type": "string"
},
"versionDisplayName": {
"description": "A readable string describing the version of the sdk.",
"description": "A readable string describing the version of the SDK.",
"type": "string"
}
},
@ -3984,7 +4034,7 @@
"type": "string"
},
"location": {
"description": "The location which contains the job specified by job_id.",
"description": "The [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that\ncontains the job specified by job_id.",
"type": "string"
},
"workerId": {
@ -4005,7 +4055,7 @@
"id": "SendWorkerMessagesRequest",
"properties": {
"location": {
"description": "The location which contains the job",
"description": "The [regional endpoint]\n(https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that\ncontains the job.",
"type": "string"
},
"workerMessages": {
@ -4521,7 +4571,7 @@
"type": "object"
},
"Status": {
"description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.",
"description": "The `Status` type defines a logical error model that is suitable for\ndifferent programming environments, including REST APIs and RPC APIs. It is\nused by [gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error\nmessage, and error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.",
"id": "Status",
"properties": {
"code": {
@ -4630,6 +4680,13 @@
"systemName": {
"description": "System defined name for this computation.",
"type": "string"
},
"transformUserNameToStateFamily": {
"additionalProperties": {
"type": "string"
},
"description": "Map from user name of stateful transforms in this stage to their state\nfamily.",
"type": "object"
}
},
"type": "object"
@ -4691,6 +4748,11 @@
"description": "A task that carries configuration information for streaming computations.",
"id": "StreamingConfigTask",
"properties": {
"maxWorkItemCommitBytes": {
"description": "Maximum size for work item commit supported windmill storage layer.",
"format": "int64",
"type": "string"
},
"streamingComputationConfigs": {
"description": "Set of computation configuration information.",
"items": {
@ -4791,7 +4853,7 @@
"id": "StructuredMessage",
"properties": {
"messageKey": {
"description": "Idenfier for this message type. Used by external systems to\ninternationalize or personalize message.",
"description": "Identifier for this message type. Used by external systems to\ninternationalize or personalize message.",
"type": "string"
},
"messageText": {

File diff suppressed because it is too large Load Diff

View File

@ -1634,7 +1634,7 @@
}
}
},
"revision": "20181207",
"revision": "20190301",
"rootUrl": "https://dataproc.googleapis.com/",
"schemas": {
"AcceleratorConfig": {
@ -1662,7 +1662,7 @@
"description": "Unimplemented. The condition that is associated with this binding. NOTE: an unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently."
},
"members": {
"description": "Specifies the identities requesting access for a Cloud Platform resource. members can have the following values:\nallUsers: A special identifier that represents anyone who is on the internet; with or without a Google account.\nallAuthenticatedUsers: A special identifier that represents anyone who is authenticated with a Google account or a service account.\nuser:{emailid}: An email address that represents a specific Google account. For example, alice@gmail.com .\nserviceAccount:{emailid}: An email address that represents a service account. For example, my-other-app@appspot.gserviceaccount.com.\ngroup:{emailid}: An email address that represents a Google group. For example, admins@example.com.\ndomain:{domain}: A Google Apps domain name that represents all the users of that domain. For example, google.com or example.com.",
"description": "Specifies the identities requesting access for a Cloud Platform resource. members can have the following values:\nallUsers: A special identifier that represents anyone who is on the internet; with or without a Google account.\nallAuthenticatedUsers: A special identifier that represents anyone who is authenticated with a Google account or a service account.\nuser:{emailid}: An email address that represents a specific Google account. For example, alice@gmail.com .\nserviceAccount:{emailid}: An email address that represents a service account. For example, my-other-app@appspot.gserviceaccount.com.\ngroup:{emailid}: An email address that represents a Google group. For example, admins@example.com.\ndomain:{domain}: The G Suite domain (primary) that represents all the users of that domain. For example, google.com or example.com.",
"items": {
"type": "string"
},
@ -1731,7 +1731,7 @@
"id": "ClusterConfig",
"properties": {
"configBucket": {
"description": "Optional. A Cloud Storage staging bucket used for sharing generated SSH keys and config. If you do not specify a staging bucket, Cloud Dataproc will determine an appropriate Cloud Storage location (US, ASIA, or EU) for your cluster's staging bucket according to the Google Compute Engine zone where your cluster is deployed, and then it will create and manage this project-level, per-location bucket for you.",
"description": "Optional. A Google Cloud Storage bucket used to stage job dependencies, config files, and job driver console output. If you do not specify a staging bucket, Cloud Dataproc will determine a Cloud Storage location (US, ASIA, or EU) for your cluster's staging bucket according to the Google Compute Engine zone where your cluster is deployed, and then create and manage this project-level, per-location bucket (see Cloud Dataproc staging bucket).",
"type": "string"
},
"encryptionConfig": {
@ -1740,7 +1740,7 @@
},
"gceClusterConfig": {
"$ref": "GceClusterConfig",
"description": "Required. The shared Compute Engine config settings for all instances in a cluster."
"description": "Optional. The shared Compute Engine config settings for all instances in a cluster."
},
"initializationActions": {
"description": "Optional. Commands to execute on each node after config is completed. By default, executables are run on master and all worker nodes. You can test a node's role metadata to run an executable on a master or worker node, as shown below using curl (you can also use wget):\nROLE=$(curl -H Metadata-Flavor:Google http://metadata/computeMetadata/v1/instance/attributes/dataproc-role)\nif [[ \"${ROLE}\" == 'Master' ]]; then\n ... master specific actions ...\nelse\n ... worker specific actions ...\nfi\n",
@ -2357,7 +2357,7 @@
"id": "JobReference",
"properties": {
"jobId": {
"description": "Optional. The job ID, which must be unique within the project. The job ID is generated by the server upon job submission or provided by the user as a means to perform retries without creating duplicate jobs. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), or hyphens (-). The maximum length is 100 characters.",
"description": "Optional. The job ID, which must be unique within the project.The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), or hyphens (-). The maximum length is 100 characters.If not specified by the caller, the job ID will be provided by the server.",
"type": "string"
},
"projectId": {
@ -2864,11 +2864,32 @@
"description": "Optional. The version of software inside the cluster. It must be one of the supported Cloud Dataproc Versions, such as \"1.2\" (including a subminor version, such as \"1.2.29\"), or the \"preview\" version. If unspecified, it defaults to the latest version.",
"type": "string"
},
"optionalComponents": {
"description": "The set of optional components to activate on the cluster.",
"enumDescriptions": [
"Unspecified component.",
"The Anaconda python distribution.",
"The Hive Web HCatalog (the REST service for accessing HCatalog).",
"The Jupyter Notebook.",
"The Zeppelin notebook."
],
"items": {
"enum": [
"COMPONENT_UNSPECIFIED",
"ANACONDA",
"HIVE_WEBHCAT",
"JUPYTER",
"ZEPPELIN"
],
"type": "string"
},
"type": "array"
},
"properties": {
"additionalProperties": {
"type": "string"
},
"description": "Optional. The properties to set on daemon config files.Property keys are specified in prefix:property format, such as core:fs.defaultFS. The following are supported prefixes and their mappings:\ncapacity-scheduler: capacity-scheduler.xml\ncore: core-site.xml\ndistcp: distcp-default.xml\nhdfs: hdfs-site.xml\nhive: hive-site.xml\nmapred: mapred-site.xml\npig: pig.properties\nspark: spark-defaults.conf\nyarn: yarn-site.xmlFor more information, see Cluster properties.",
"description": "Optional. The properties to set on daemon config files.Property keys are specified in prefix:property format, for example core:hadoop.tmp.dir. The following are supported prefixes and their mappings:\ncapacity-scheduler: capacity-scheduler.xml\ncore: core-site.xml\ndistcp: distcp-default.xml\nhdfs: hdfs-site.xml\nhive: hive-site.xml\nmapred: mapred-site.xml\npig: pig.properties\nspark: spark-defaults.conf\nyarn: yarn-site.xmlFor more information, see Cluster properties.",
"type": "object"
}
},

View File

@ -1,4 +1,4 @@
// Copyright 2018 Google Inc. All rights reserved.
// Copyright 2019 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
@ -8,13 +8,35 @@
//
// This package is DEPRECATED. Use package cloud.google.com/go/dataproc/apiv1 instead.
//
// See https://cloud.google.com/dataproc/
// For product documentation, see: https://cloud.google.com/dataproc/
//
// Creating a client
//
// Usage example:
//
// import "google.golang.org/api/dataproc/v1"
// ...
// dataprocService, err := dataproc.New(oauthHttpClient)
// ctx := context.Background()
// dataprocService, err := dataproc.NewService(ctx)
//
// In this example, Google Application Default Credentials are used for authentication.
//
// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
//
// Other authentication options
//
// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
//
// dataprocService, err := dataproc.NewService(ctx, option.WithAPIKey("AIza..."))
//
// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
//
// config := &oauth2.Config{...}
// // ...
// token, err := config.Exchange(ctx, ...)
// dataprocService, err := dataproc.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See https://godoc.org/google.golang.org/api/option/ for details on options.
package dataproc // import "google.golang.org/api/dataproc/v1"
import (
@ -31,6 +53,8 @@ import (
gensupport "google.golang.org/api/gensupport"
googleapi "google.golang.org/api/googleapi"
option "google.golang.org/api/option"
htransport "google.golang.org/api/transport/http"
)
// Always reference these packages, just in case the auto-generated code
@ -58,6 +82,32 @@ const (
CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
)
// NewService creates a new Service.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
scopesOption := option.WithScopes(
"https://www.googleapis.com/auth/cloud-platform",
)
// NOTE: prepend, so we don't override user-specified scopes.
opts = append([]option.ClientOption{scopesOption}, opts...)
client, endpoint, err := htransport.NewClient(ctx, opts...)
if err != nil {
return nil, err
}
s, err := New(client)
if err != nil {
return nil, err
}
if endpoint != "" {
s.BasePath = endpoint
}
return s, nil
}
// New creates a new Service. It uses the provided http.Client for requests.
//
// Deprecated: please use NewService instead.
// To provide a custom HTTP client, use option.WithHTTPClient.
// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
@ -242,8 +292,8 @@ type Binding struct {
// my-other-app@appspot.gserviceaccount.com.
// group:{emailid}: An email address that represents a Google group.
// For example, admins@example.com.
// domain:{domain}: A Google Apps domain name that represents all the
// users of that domain. For example, google.com or example.com.
// domain:{domain}: The G Suite domain (primary) that represents all the
// users of that domain. For example, google.com or example.com.
Members []string `json:"members,omitempty"`
// Role: Role that is assigned to members. For example, roles/viewer,
@ -345,19 +395,19 @@ func (s *Cluster) MarshalJSON() ([]byte, error) {
// ClusterConfig: The cluster config.
type ClusterConfig struct {
// ConfigBucket: Optional. A Cloud Storage staging bucket used for
// sharing generated SSH keys and config. If you do not specify a
// staging bucket, Cloud Dataproc will determine an appropriate Cloud
// Storage location (US, ASIA, or EU) for your cluster's staging bucket
// according to the Google Compute Engine zone where your cluster is
// deployed, and then it will create and manage this project-level,
// per-location bucket for you.
// ConfigBucket: Optional. A Google Cloud Storage bucket used to stage
// job dependencies, config files, and job driver console output. If you
// do not specify a staging bucket, Cloud Dataproc will determine a
// Cloud Storage location (US, ASIA, or EU) for your cluster's staging
// bucket according to the Google Compute Engine zone where your cluster
// is deployed, and then create and manage this project-level,
// per-location bucket (see Cloud Dataproc staging bucket).
ConfigBucket string `json:"configBucket,omitempty"`
// EncryptionConfig: Optional. Encryption settings for the cluster.
EncryptionConfig *EncryptionConfig `json:"encryptionConfig,omitempty"`
// GceClusterConfig: Required. The shared Compute Engine config settings
// GceClusterConfig: Optional. The shared Compute Engine config settings
// for all instances in a cluster.
GceClusterConfig *GceClusterConfig `json:"gceClusterConfig,omitempty"`
@ -1336,12 +1386,11 @@ func (s *JobPlacement) MarshalJSON() ([]byte, error) {
// JobReference: Encapsulates the full scoping used to reference a job.
type JobReference struct {
// JobId: Optional. The job ID, which must be unique within the project.
// The job ID is generated by the server upon job submission or provided
// by the user as a means to perform retries without creating duplicate
// jobs. The ID must contain only letters (a-z, A-Z), numbers (0-9),
// JobId: Optional. The job ID, which must be unique within the
// project.The ID must contain only letters (a-z, A-Z), numbers (0-9),
// underscores (_), or hyphens (-). The maximum length is 100
// characters.
// characters.If not specified by the caller, the job ID will be
// provided by the server.
JobId string `json:"jobId,omitempty"`
// ProjectId: Required. The ID of the Google Cloud Platform project that
@ -2246,10 +2295,22 @@ type SoftwareConfig struct {
// "preview" version. If unspecified, it defaults to the latest version.
ImageVersion string `json:"imageVersion,omitempty"`
// OptionalComponents: The set of optional components to activate on the
// cluster.
//
// Possible values:
// "COMPONENT_UNSPECIFIED" - Unspecified component.
// "ANACONDA" - The Anaconda python distribution.
// "HIVE_WEBHCAT" - The Hive Web HCatalog (the REST service for
// accessing HCatalog).
// "JUPYTER" - The Jupyter Notebook.
// "ZEPPELIN" - The Zeppelin notebook.
OptionalComponents []string `json:"optionalComponents,omitempty"`
// Properties: Optional. The properties to set on daemon config
// files.Property keys are specified in prefix:property format, such as
// core:fs.defaultFS. The following are supported prefixes and their
// mappings:
// files.Property keys are specified in prefix:property format, for
// example core:hadoop.tmp.dir. The following are supported prefixes and
// their mappings:
// capacity-scheduler: capacity-scheduler.xml
// core: core-site.xml
// distcp: distcp-default.xml

View File

@ -23,7 +23,7 @@
"description": "Configures and serves authoritative DNS records.",
"discoveryVersion": "v1",
"documentationLink": "https://developers.google.com/cloud-dns",
"etag": "\"J3WqvAcMk4eQjJXvfSI4Yr8VouA/EQMOijfSxjBH7q8fB_7QzVLzbgs\"",
"etag": "\"VPK3KBfpaEgZ16pozGOoMYfKc0U/lpqiZRIZVeruudGbozkBqz2t94g\"",
"icons": {
"x16": "https://www.gstatic.com/images/branding/product/1x/googleg_16dp.png",
"x32": "https://www.gstatic.com/images/branding/product/1x/googleg_32dp.png"
@ -760,11 +760,11 @@
}
}
},
"revision": "20180808",
"revision": "20190418",
"rootUrl": "https://www.googleapis.com/",
"schemas": {
"Change": {
"description": "An atomic update to a collection of ResourceRecordSets.",
"description": "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.",
"id": "Change",
"properties": {
"additions": {
@ -799,7 +799,7 @@
"type": "string"
},
"status": {
"description": "Status of the operation (output only).",
"description": "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.",
"enum": [
"done",
"pending"
@ -970,7 +970,7 @@
"type": "integer"
},
"keyType": {
"description": "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.",
"description": "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.",
"enum": [
"keySigning",
"zoneSigning"
@ -1066,6 +1066,22 @@
"type": "string"
},
"type": "array"
},
"privateVisibilityConfig": {
"$ref": "ManagedZonePrivateVisibilityConfig",
"description": "For privately visible zones, the set of Virtual Private Cloud resources that the zone is visible from."
},
"visibility": {
"description": "The zone's visibility: public zones are exposed to the Internet, while private zones are visible only to Virtual Private Cloud resources.",
"enum": [
"private",
"public"
],
"enumDescriptions": [
"",
""
],
"type": "string"
}
},
"type": "object"
@ -1139,6 +1155,39 @@
},
"type": "object"
},
"ManagedZonePrivateVisibilityConfig": {
"id": "ManagedZonePrivateVisibilityConfig",
"properties": {
"kind": {
"default": "dns#managedZonePrivateVisibilityConfig",
"description": "Identifies what kind of resource this is. Value: the fixed string \"dns#managedZonePrivateVisibilityConfig\".",
"type": "string"
},
"networks": {
"description": "The list of VPC networks that can see this zone.",
"items": {
"$ref": "ManagedZonePrivateVisibilityConfigNetwork"
},
"type": "array"
}
},
"type": "object"
},
"ManagedZonePrivateVisibilityConfigNetwork": {
"id": "ManagedZonePrivateVisibilityConfigNetwork",
"properties": {
"kind": {
"default": "dns#managedZonePrivateVisibilityConfigNetwork",
"description": "Identifies what kind of resource this is. Value: the fixed string \"dns#managedZonePrivateVisibilityConfigNetwork\".",
"type": "string"
},
"networkUrl": {
"description": "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}",
"type": "string"
}
},
"type": "object"
},
"ManagedZonesListResponse": {
"id": "ManagedZonesListResponse",
"properties": {
@ -1186,7 +1235,7 @@
"type": "string"
},
"status": {
"description": "Status of the operation. Can be one of the following: \"PENDING\" or \"DONE\" (output only).",
"description": "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.",
"enum": [
"done",
"pending"
@ -1284,6 +1333,16 @@
"format": "int32",
"type": "integer"
},
"managedZonesPerNetwork": {
"description": "Maximum allowed number of managed zones which can be attached to a network.",
"format": "int32",
"type": "integer"
},
"networksPerManagedZone": {
"description": "Maximum allowed number of networks to which a privately scoped zone can be attached.",
"format": "int32",
"type": "integer"
},
"resourceRecordsPerRrset": {
"description": "Maximum allowed number of ResourceRecords per ResourceRecordSet.",
"format": "int32",
@ -1333,7 +1392,7 @@
"type": "string"
},
"rrdatas": {
"description": "As defined in RFC 1035 (section 5) and RFC 1034 (section 3.6.1).",
"description": "As defined in RFC 1035 (section 5) and RFC 1034 (section 3.6.1) -- see examples.",
"items": {
"type": "string"
},
@ -1352,7 +1411,7 @@
"type": "integer"
},
"type": {
"description": "The identifier of a supported record type, for example, A, AAAA, MX, TXT, and so on.",
"description": "The identifier of a supported record type. See the list of Supported DNS record types.",
"type": "string"
}
},

View File

@ -1,4 +1,4 @@
// Copyright 2018 Google Inc. All rights reserved.
// Copyright 2019 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
@ -6,13 +6,39 @@
// Package dns provides access to the Google Cloud DNS API.
//
// See https://developers.google.com/cloud-dns
// For product documentation, see: https://developers.google.com/cloud-dns
//
// Creating a client
//
// Usage example:
//
// import "google.golang.org/api/dns/v1"
// ...
// dnsService, err := dns.New(oauthHttpClient)
// ctx := context.Background()
// dnsService, err := dns.NewService(ctx)
//
// In this example, Google Application Default Credentials are used for authentication.
//
// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
//
// Other authentication options
//
// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
//
// dnsService, err := dns.NewService(ctx, option.WithScopes(dns.NdevClouddnsReadwriteScope))
//
// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
//
// dnsService, err := dns.NewService(ctx, option.WithAPIKey("AIza..."))
//
// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
//
// config := &oauth2.Config{...}
// // ...
// token, err := config.Exchange(ctx, ...)
// dnsService, err := dns.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See https://godoc.org/google.golang.org/api/option/ for details on options.
package dns // import "google.golang.org/api/dns/v1"
import (
@ -29,6 +55,8 @@ import (
gensupport "google.golang.org/api/gensupport"
googleapi "google.golang.org/api/googleapi"
option "google.golang.org/api/option"
htransport "google.golang.org/api/transport/http"
)
// Always reference these packages, just in case the auto-generated code
@ -65,6 +93,35 @@ const (
NdevClouddnsReadwriteScope = "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
)
// NewService creates a new Service.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
scopesOption := option.WithScopes(
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloud-platform.read-only",
"https://www.googleapis.com/auth/ndev.clouddns.readonly",
"https://www.googleapis.com/auth/ndev.clouddns.readwrite",
)
// NOTE: prepend, so we don't override user-specified scopes.
opts = append([]option.ClientOption{scopesOption}, opts...)
client, endpoint, err := htransport.NewClient(ctx, opts...)
if err != nil {
return nil, err
}
s, err := New(client)
if err != nil {
return nil, err
}
if endpoint != "" {
s.BasePath = endpoint
}
return s, nil
}
// New creates a new Service. It uses the provided http.Client for requests.
//
// Deprecated: please use NewService instead.
// To provide a custom HTTP client, use option.WithHTTPClient.
// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
@ -158,7 +215,13 @@ type ResourceRecordSetsService struct {
s *Service
}
// Change: An atomic update to a collection of ResourceRecordSets.
// 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"`
@ -182,7 +245,9 @@ type Change struct {
// (output only). This is in RFC3339 text format.
StartTime string `json:"startTime,omitempty"`
// Status: Status of the operation (output only).
// 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"
@ -416,11 +481,12 @@ type DnsKeySpec struct {
// KeyLength: Length of the keys in bits.
KeyLength int64 `json:"keyLength,omitempty"`
// KeyType: 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.
// 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"
@ -551,6 +617,19 @@ type ManagedZone struct {
// 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"
Visibility string `json:"visibility,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
@ -677,6 +756,70 @@ func (s *ManagedZoneOperationsListResponse) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
type ManagedZonePrivateVisibilityConfig struct {
// Kind: Identifies what kind of resource this is. Value: the fixed
// 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
// 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. "Kind") 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 *ManagedZonePrivateVisibilityConfig) MarshalJSON() ([]byte, error) {
type NoMethod ManagedZonePrivateVisibilityConfig
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
type ManagedZonePrivateVisibilityConfigNetwork struct {
// Kind: Identifies what kind of resource this is. Value: the fixed
// 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
// 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. "Kind") 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 *ManagedZonePrivateVisibilityConfigNetwork) MarshalJSON() ([]byte, error) {
type NoMethod ManagedZonePrivateVisibilityConfigNetwork
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
type ManagedZonesListResponse struct {
Header *ResponseHeader `json:"header,omitempty"`
@ -752,7 +895,9 @@ type Operation struct {
StartTime string `json:"startTime,omitempty"`
// Status: Status of the operation. Can be one of the following:
// "PENDING" or "DONE" (output only).
// "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"
@ -917,6 +1062,14 @@ type Quota struct {
// 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"`
@ -977,7 +1130,7 @@ type ResourceRecordSet struct {
Name string `json:"name,omitempty"`
// Rrdatas: As defined in RFC 1035 (section 5) and RFC 1034 (section
// 3.6.1).
// 3.6.1) -- see examples.
Rrdatas []string `json:"rrdatas,omitempty"`
// SignatureRrdatas: As defined in RFC 4034 (section 3.2).
@ -987,8 +1140,8 @@ type ResourceRecordSet struct {
// resolvers.
Ttl int64 `json:"ttl,omitempty"`
// Type: The identifier of a supported record type, for example, A,
// AAAA, MX, TXT, and so on.
// 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

View File

@ -23,7 +23,7 @@
"description": "Configures and serves authoritative DNS records.",
"discoveryVersion": "v1",
"documentationLink": "https://developers.google.com/cloud-dns",
"etag": "\"J3WqvAcMk4eQjJXvfSI4Yr8VouA/tjeOYqIojF-Ch7P-2UE6XgpQAfQ\"",
"etag": "\"VPK3KBfpaEgZ16pozGOoMYfKc0U/5ETkYc51ldAG_lBus_hxlXlq9uQ\"",
"icons": {
"x16": "https://www.gstatic.com/images/branding/product/1x/googleg_16dp.png",
"x32": "https://www.gstatic.com/images/branding/product/1x/googleg_32dp.png"
@ -982,11 +982,11 @@
}
}
},
"revision": "20181115",
"revision": "20190418",
"rootUrl": "https://www.googleapis.com/",
"schemas": {
"Change": {
"description": "An atomic update to a collection of ResourceRecordSets.",
"description": "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.",
"id": "Change",
"properties": {
"additions": {
@ -1021,7 +1021,7 @@
"type": "string"
},
"status": {
"description": "Status of the operation (output only).",
"description": "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.",
"enum": [
"done",
"pending"
@ -1192,7 +1192,7 @@
"type": "integer"
},
"keyType": {
"description": "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.",
"description": "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.",
"enum": [
"keySigning",
"zoneSigning"
@ -1293,12 +1293,16 @@
},
"type": "array"
},
"peeringConfig": {
"$ref": "ManagedZonePeeringConfig",
"description": "The presence of this field indicates that DNS Peering is enabled for this zone. The value of this field contains the network to peer with."
},
"privateVisibilityConfig": {
"$ref": "ManagedZonePrivateVisibilityConfig",
"description": "For privately visible zones, the set of GCP resources that the zone is visible from."
"description": "For privately visible zones, the set of Virtual Private Cloud resources that the zone is visible from."
},
"visibility": {
"description": "The zone's visibility: public zones are exposed to the Internet, while private zones are visible only to GCP resources.",
"description": "The zone's visibility: public zones are exposed to the Internet, while private zones are visible only to Virtual Private Cloud resources.",
"enum": [
"private",
"public"
@ -1414,6 +1418,40 @@
},
"type": "object"
},
"ManagedZonePeeringConfig": {
"id": "ManagedZonePeeringConfig",
"properties": {
"kind": {
"default": "dns#managedZonePeeringConfig",
"description": "Identifies what kind of resource this is. Value: the fixed string \"dns#managedZonePeeringConfig\".",
"type": "string"
},
"targetNetwork": {
"$ref": "ManagedZonePeeringConfigTargetNetwork",
"description": "The network with which to peer."
}
},
"type": "object"
},
"ManagedZonePeeringConfigTargetNetwork": {
"id": "ManagedZonePeeringConfigTargetNetwork",
"properties": {
"deactivateTime": {
"description": "If this zone has been deactivated due to a problem with the network it targeted, the time at which it was deactivated. The zone can be deactivated if, for instance, the network it targeted was deleted. If the targeted network is still present, this will be the empty string. This is in RFC3339 text format. Output only.",
"type": "string"
},
"kind": {
"default": "dns#managedZonePeeringConfigTargetNetwork",
"description": "Identifies what kind of resource this is. Value: the fixed string \"dns#managedZonePeeringConfigTargetNetwork\".",
"type": "string"
},
"networkUrl": {
"description": "The fully qualified URL of the VPC network to forward queries to. This should be formatted like https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}",
"type": "string"
}
},
"type": "object"
},
"ManagedZonePrivateVisibilityConfig": {
"id": "ManagedZonePrivateVisibilityConfig",
"properties": {
@ -1423,7 +1461,7 @@
"type": "string"
},
"networks": {
"description": "The list of GCE private network IDs that can see this zone.",
"description": "The list of VPC networks that can see this zone.",
"items": {
"$ref": "ManagedZonePrivateVisibilityConfigNetwork"
},
@ -1441,7 +1479,7 @@
"type": "string"
},
"networkUrl": {
"description": "The fully qualified URL of the GCE private network to bind to. This should be formatted like https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}",
"description": "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}",
"type": "string"
}
},
@ -1494,7 +1532,7 @@
"type": "string"
},
"status": {
"description": "Status of the operation. Can be one of the following: \"PENDING\" or \"DONE\" (output only).",
"description": "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.",
"enum": [
"done",
"pending"
@ -1598,7 +1636,7 @@
"type": "object"
},
"Policy": {
"description": "A policy is a collection of rules applied to one or more networks that specify forwarding behavior for that network.",
"description": "A policy is a collection of DNS rules applied to one or more Virtual Private Cloud resources.",
"id": "Policy",
"properties": {
"alternativeNameServerConfig": {
@ -1613,6 +1651,10 @@
"description": "Allows networks bound to this policy to receive DNS queries sent by VMs or applications over VPN connections. When enabled, a virtual IP address will be allocated from each of the sub-networks that are bound to this policy.",
"type": "boolean"
},
"enableLogging": {
"description": "Controls whether logging is enabled for the networks bound to this policy. Defaults to no logging if not set.",
"type": "boolean"
},
"id": {
"description": "Unique identifier for the resource; defined by the server (output only).",
"format": "uint64",
@ -1679,7 +1721,7 @@
"type": "string"
},
"networkUrl": {
"description": "The fully qualified URL of the GCE private network to bind to. This should be formatted like https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}",
"description": "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}",
"type": "string"
}
},
@ -1808,7 +1850,7 @@
"type": "string"
},
"rrdatas": {
"description": "As defined in RFC 1035 (section 5) and RFC 1034 (section 3.6.1).",
"description": "As defined in RFC 1035 (section 5) and RFC 1034 (section 3.6.1) -- see examples.",
"items": {
"type": "string"
},
@ -1827,7 +1869,7 @@
"type": "integer"
},
"type": {
"description": "The identifier of a supported record type, for example, A, AAAA, MX, TXT, and so on.",
"description": "The identifier of a supported record type. See the list of Supported DNS record types.",
"type": "string"
}
},

View File

@ -1,4 +1,4 @@
// Copyright 2018 Google Inc. All rights reserved.
// Copyright 2019 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
@ -6,13 +6,39 @@
// Package dns provides access to the Google Cloud DNS API.
//
// See https://developers.google.com/cloud-dns
// For product documentation, see: https://developers.google.com/cloud-dns
//
// Creating a client
//
// Usage example:
//
// import "google.golang.org/api/dns/v1beta2"
// ...
// dnsService, err := dns.New(oauthHttpClient)
// ctx := context.Background()
// dnsService, err := dns.NewService(ctx)
//
// In this example, Google Application Default Credentials are used for authentication.
//
// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
//
// Other authentication options
//
// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
//
// dnsService, err := dns.NewService(ctx, option.WithScopes(dns.NdevClouddnsReadwriteScope))
//
// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
//
// dnsService, err := dns.NewService(ctx, option.WithAPIKey("AIza..."))
//
// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
//
// config := &oauth2.Config{...}
// // ...
// token, err := config.Exchange(ctx, ...)
// dnsService, err := dns.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See https://godoc.org/google.golang.org/api/option/ for details on options.
package dns // import "google.golang.org/api/dns/v1beta2"
import (
@ -29,6 +55,8 @@ import (
gensupport "google.golang.org/api/gensupport"
googleapi "google.golang.org/api/googleapi"
option "google.golang.org/api/option"
htransport "google.golang.org/api/transport/http"
)
// Always reference these packages, just in case the auto-generated code
@ -65,6 +93,35 @@ const (
NdevClouddnsReadwriteScope = "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
)
// NewService creates a new Service.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
scopesOption := option.WithScopes(
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloud-platform.read-only",
"https://www.googleapis.com/auth/ndev.clouddns.readonly",
"https://www.googleapis.com/auth/ndev.clouddns.readwrite",
)
// NOTE: prepend, so we don't override user-specified scopes.
opts = append([]option.ClientOption{scopesOption}, opts...)
client, endpoint, err := htransport.NewClient(ctx, opts...)
if err != nil {
return nil, err
}
s, err := New(client)
if err != nil {
return nil, err
}
if endpoint != "" {
s.BasePath = endpoint
}
return s, nil
}
// New creates a new Service. It uses the provided http.Client for requests.
//
// Deprecated: please use NewService instead.
// To provide a custom HTTP client, use option.WithHTTPClient.
// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
@ -170,7 +227,13 @@ type ResourceRecordSetsService struct {
s *Service
}
// Change: An atomic update to a collection of ResourceRecordSets.
// 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"`
@ -194,7 +257,9 @@ type Change struct {
// (output only). This is in RFC3339 text format.
StartTime string `json:"startTime,omitempty"`
// Status: Status of the operation (output only).
// 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"
@ -428,11 +493,12 @@ type DnsKeySpec struct {
// KeyLength: Length of the keys in bits.
KeyLength int64 `json:"keyLength,omitempty"`
// KeyType: 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.
// 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"
@ -568,12 +634,18 @@ type ManagedZone struct {
// servers; defined by the server (output only)
NameServers []string `json:"nameServers,omitempty"`
// PrivateVisibilityConfig: For privately visible zones, the set of GCP
// resources that the zone is visible from.
// PeeringConfig: The presence of this field indicates that DNS Peering
// is enabled for this zone. The value of this field contains the
// network to peer with.
PeeringConfig *ManagedZonePeeringConfig `json:"peeringConfig,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 GCP resources.
// Internet, while private zones are visible only to Virtual Private
// Cloud resources.
//
// Possible values:
// "private"
@ -770,12 +842,84 @@ func (s *ManagedZoneOperationsListResponse) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
type ManagedZonePeeringConfig struct {
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "dns#managedZonePeeringConfig".
Kind string `json:"kind,omitempty"`
// TargetNetwork: The network with which to peer.
TargetNetwork *ManagedZonePeeringConfigTargetNetwork `json:"targetNetwork,omitempty"`
// ForceSendFields is a list of field names (e.g. "Kind") 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. "Kind") 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 *ManagedZonePeeringConfig) MarshalJSON() ([]byte, error) {
type NoMethod ManagedZonePeeringConfig
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
type ManagedZonePeeringConfigTargetNetwork struct {
// DeactivateTime: If this zone has been deactivated due to a problem
// with the network it targeted, the time at which it was deactivated.
// The zone can be deactivated if, for instance, the network it targeted
// was deleted. If the targeted network is still present, this will be
// the empty string. This is in RFC3339 text format. Output only.
DeactivateTime string `json:"deactivateTime,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "dns#managedZonePeeringConfigTargetNetwork".
Kind string `json:"kind,omitempty"`
// NetworkUrl: The fully qualified URL of the VPC network to forward
// queries 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. "DeactivateTime") 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. "DeactivateTime") 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 *ManagedZonePeeringConfigTargetNetwork) MarshalJSON() ([]byte, error) {
type NoMethod ManagedZonePeeringConfigTargetNetwork
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
type ManagedZonePrivateVisibilityConfig struct {
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "dns#managedZonePrivateVisibilityConfig".
Kind string `json:"kind,omitempty"`
// Networks: The list of GCE private network IDs that can see this zone.
// 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
@ -806,8 +950,8 @@ type ManagedZonePrivateVisibilityConfigNetwork struct {
// string "dns#managedZonePrivateVisibilityConfigNetwork".
Kind string `json:"kind,omitempty"`
// NetworkUrl: The fully qualified URL of the GCE private network to
// bind to. This should be formatted like
// 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"`
@ -909,7 +1053,9 @@ type Operation struct {
StartTime string `json:"startTime,omitempty"`
// Status: Status of the operation. Can be one of the following:
// "PENDING" or "DONE" (output only).
// "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"
@ -1129,8 +1275,8 @@ func (s *PoliciesUpdateResponse) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Policy: A policy is a collection of rules applied to one or more
// networks that specify forwarding behavior for that network.
// Policy: A policy is a collection of DNS rules applied to one or more
// Virtual Private Cloud resources.
type Policy struct {
// AlternativeNameServerConfig: Sets an alternative name server for the
// associated networks. When specified, all DNS queries are forwarded to
@ -1149,6 +1295,10 @@ type Policy struct {
// sub-networks that are bound to this policy.
EnableInboundForwarding bool `json:"enableInboundForwarding,omitempty"`
// EnableLogging: Controls whether logging is enabled for the networks
// bound to this policy. Defaults to no logging if not set.
EnableLogging bool `json:"enableLogging,omitempty"`
// Id: Unique identifier for the resource; defined by the server (output
// only).
Id uint64 `json:"id,omitempty,string"`
@ -1263,8 +1413,8 @@ type PolicyNetwork struct {
// string "dns#policyNetwork".
Kind string `json:"kind,omitempty"`
// NetworkUrl: The fully qualified URL of the GCE private network to
// bind to. This should be formatted like
// 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"`
@ -1431,7 +1581,7 @@ type ResourceRecordSet struct {
Name string `json:"name,omitempty"`
// Rrdatas: As defined in RFC 1035 (section 5) and RFC 1034 (section
// 3.6.1).
// 3.6.1) -- see examples.
Rrdatas []string `json:"rrdatas,omitempty"`
// SignatureRrdatas: As defined in RFC 4034 (section 3.2).
@ -1441,8 +1591,8 @@ type ResourceRecordSet struct {
// resolvers.
Ttl int64 `json:"ttl,omitempty"`
// Type: The identifier of a supported record type, for example, A,
// AAAA, MX, TXT, and so on.
// 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

View File

@ -471,7 +471,7 @@
}
}
},
"revision": "20180925",
"revision": "20190416",
"rootUrl": "https://file.googleapis.com/",
"schemas": {
"CancelOperationRequest": {
@ -502,6 +502,199 @@
},
"type": "object"
},
"GoogleCloudSaasacceleratorManagementProvidersV1Instance": {
"description": "Instance represents the interface for SLM services to actuate the state\nof control plane resources.\n\nExample Instance in JSON, where\n consumer-project=snapchat,\n producer-project=cloud-sql:\n\n```json\nInstance:\n{\n \"name\":\n \"projects/snapchat/locations/us-east1/instances/prod-instance\",\n \"create_time\": {\n \"seconds\": 1526406431,\n },\n \"labels\": {\n \"env\": \"prod\",\n \"foo\": \"bar\"\n },\n \"state\": READY,\n \"software_version\": \"cloud-sql-09-28-2018\",\n \"maintenance_policy_names\": {\n \"UpdatePolicy\":\n \"projects/snapchat/locations/us-east1/maintenancePolicies/prod-update-policy\",\n }\n \"rollout_metadata\": {\n \"projects/cloud-sql/locations/global/rolloutTypes/software_update\": {\n \"release\":\n \"projects/cloud-sql/locations/global/releases/cloud-sql-09-28-2018\",\n \"rollout\":\n \"projects/cloud-sql/locations/us-east1/rollouts/cloud-sql-09-28-2018-canary\",\n }\n \"projects/cloud-sql/locations/global/rolloutTypes/instance_restart\": {\n \"release\":\n \"projects/cloud-sql/locations/global/releases/cloud-sql-09-20-repair\",\n \"rollout\":\n \"projects/cloud-sql/locations/us-east1/rollouts/cloud-sql-09-20-repair-100-percent\",\n }\n }\n \"tenant_project_id\": \"cloud-sql-test-tenant\",\n \"producer_metadata\": {\n \"cloud-sql-tier\": \"basic\",\n \"cloud-sql-instance-size\": \"1G\",\n },\n \"provisioned_resources\": [\n {\n \"resource-type\": \"compute-instance\",\n \"resource-url\":\n \"https://www.googleapis.com/compute/v1/projects/cloud-sql/zones/us-east1-b/instances/vm-1\",\n }\n ],\n}\n```",
"id": "GoogleCloudSaasacceleratorManagementProvidersV1Instance",
"properties": {
"createTime": {
"description": "Output only. Timestamp when the resource was created.",
"format": "google-datetime",
"type": "string"
},
"labels": {
"additionalProperties": {
"type": "string"
},
"description": "Optional. Resource labels to represent user provided metadata. Each label\nis a key-value pair, where both the key and the value are arbitrary strings\nprovided by the user.",
"type": "object"
},
"maintenancePolicyNames": {
"additionalProperties": {
"type": "string"
},
"description": "The MaintenancePolicies that have been attached to the instance.\nThe key must be of the type name of the oneof policy name defined in\nMaintenancePolicy, and the referenced policy must define the same policy\ntype. For complete details of MaintenancePolicy, please refer to\n//depot/google3/google/cloud/saasaccelerator/maintenancepolicy/api/v1/maintenance_policy_resources.proto",
"type": "object"
},
"name": {
"description": "Unique name of the resource. It uses the form:\n `projects/{project_id}/locations/{location_id}/instances/{instance_id}`",
"type": "string"
},
"producerMetadata": {
"additionalProperties": {
"type": "string"
},
"description": "Output only. Custom string attributes used primarily to expose\nproducer-specific information in monitoring dashboards.\nSee go/get-instance-metadata.",
"type": "object"
},
"provisionedResources": {
"description": "Output only. The list of data plane resources provisioned for this\ninstance, e.g. compute VMs. See go/get-instance-metadata.",
"items": {
"$ref": "GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource"
},
"type": "array"
},
"rolloutMetadata": {
"additionalProperties": {
"$ref": "GoogleCloudSaasacceleratorManagementProvidersV1RolloutMetadata"
},
"description": "The map between RolloutType and the corresponding RolloutMetadata.\nThis is only mutated by rollout service. For actuation implementation,\nthis information is pass-through for Rollout management. Producer shall\nnot modify by itself.\nFor update of a single entry in this map, the update field mask shall\nfollow this sementics: go/advanced-field-masks",
"type": "object"
},
"sloMetadata": {
"$ref": "GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata",
"description": "Output only. SLO metadata for instance classification in the\nStandardized dataplane SLO platform.\nSee go/cloud-ssa-standard-slo for feature description."
},
"softwareVersions": {
"additionalProperties": {
"type": "string"
},
"description": "Software versions that are used to deploy this instance. This can be\nmutated by rollout services.",
"type": "object"
},
"state": {
"description": "Output only. Current lifecycle state of the resource (e.g. if it's being\ncreated or ready to use).",
"enum": [
"STATE_UNSPECIFIED",
"CREATING",
"READY",
"UPDATING",
"REPAIRING",
"DELETING"
],
"enumDescriptions": [
"Unspecified state.",
"Instance is being created.",
"Instance has been created and is ready to use.",
"Instance is being updated.",
"Instance is unheathy and under repair.",
"Instance is being deleted."
],
"type": "string"
},
"tenantProjectId": {
"description": "Output only. ID of the associated GCP tenant project.\nSee go/get-instance-metadata.",
"type": "string"
},
"updateTime": {
"description": "Output only. Timestamp when the resource was last modified.",
"format": "google-datetime",
"type": "string"
}
},
"type": "object"
},
"GoogleCloudSaasacceleratorManagementProvidersV1NotificationMetadata": {
"description": "NotificationMetadata is the notification state for an instance.",
"id": "GoogleCloudSaasacceleratorManagementProvidersV1NotificationMetadata",
"properties": {
"rescheduled": {
"description": "Whether the instance update has been rescheduled.",
"type": "boolean"
},
"scheduledEndTime": {
"description": "The scheduled end time for the maintenance window during which update\ncan be performed on the instance.",
"format": "google-datetime",
"type": "string"
},
"scheduledStartTime": {
"description": "The scheduled start time for the maintenance window during which\nupdate can be performed on the instance.",
"format": "google-datetime",
"type": "string"
},
"targetRelease": {
"description": "The target release to be applied to the instance.",
"type": "string"
}
},
"type": "object"
},
"GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource": {
"description": "Describes provisioned dataplane resources.",
"id": "GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource",
"properties": {
"resourceType": {
"description": "Type of the resource. This can be either a GCP resource or a custom one\n(e.g. another cloud provider's VM). For GCP compute resources use singular\nform of the names listed in GCP compute API documentation\n(https://cloud.google.com/compute/docs/reference/rest/v1/), prefixed with\n'compute-', for example: 'compute-instance', 'compute-disk',\n'compute-autoscaler'.",
"type": "string"
},
"resourceUrl": {
"description": "URL identifying the resource, e.g.\n\"https://www.googleapis.com/compute/v1/projects/...)\".",
"type": "string"
}
},
"type": "object"
},
"GoogleCloudSaasacceleratorManagementProvidersV1RolloutMetadata": {
"description": "RolloutMetadata for an actuation instance. It maps to a single RolloutType.",
"id": "GoogleCloudSaasacceleratorManagementProvidersV1RolloutMetadata",
"properties": {
"notification": {
"$ref": "GoogleCloudSaasacceleratorManagementProvidersV1NotificationMetadata",
"description": "Instance level notification metadata."
},
"releaseName": {
"description": "The last Release that has been applied to the instance.",
"type": "string"
},
"rolloutName": {
"description": "The last rollout that has been applied to the instance.",
"type": "string"
}
},
"type": "object"
},
"GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion": {
"description": "A temporal SLO exclusion specification.",
"id": "GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion",
"properties": {
"exclusionDuration": {
"description": "Exclusion duration. No restrictions on the possible values.\n\nWhen an ongoing operation is taking longer than initially expected,\nan existing entry in the exclusion list can be updated by extending the\nduration. This is supported by the subsystem exporting eligibility data\nas long as such extension is committed at least 10 minutes before the\noriginal exclusion expiration - otherwise it is possible that there will\nbe \"gaps\" in the exclusion application in the exported timeseries.",
"format": "google-duration",
"type": "string"
},
"exclusionStartTime": {
"description": "Start time of the exclusion. No alignment (e.g. to a full minute) needed.",
"format": "google-datetime",
"type": "string"
},
"reason": {
"description": "Human-readable reason for the exclusion.\nThis should be a static string (e.g. \"Disruptive update in progress\")\nand should not contain dynamically generated data (e.g. instance name).\nCan be left empty.",
"type": "string"
},
"sloName": {
"description": "Name of an SLI/SLO that this exclusion applies to. Can be left empty,\nsignaling that the instance should be excluded from all SLI/SLOs defined\nin the service SLO configuration.",
"type": "string"
}
},
"type": "object"
},
"GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata": {
"description": "SloMetadata contains resources required for proper SLO classification of the\ninstance.",
"id": "GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata",
"properties": {
"exclusions": {
"description": "List of SLO exclusion windows. When multiple entries in the list match\n(matching the exclusion time-window against current time point)\nthe exclusion reason used in the first matching entry will be published.\n\nIt is not needed to include expired exclusion in this list, as only the\ncurrently applicable exclusions are taken into account by the eligibility\nexporting subsystem (the historical state of exclusions will be reflected\nin the historically produced timeseries regardless of the current state).\n\nThis field can be used to mark the instance as temporary ineligible\nfor the purpose of SLO calculation. For permanent instance SLO exclusion,\na dedicated tier name can be used that does not have targets specified\nin the service SLO configuration.",
"items": {
"$ref": "GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion"
},
"type": "array"
},
"tier": {
"description": "Name of the SLO tier the Instance belongs to. This name will be expected to\nmatch the tiers specified in the service SLO configuration.\n\nField is mandatory and must not be empty.",
"type": "string"
}
},
"type": "object"
},
"Instance": {
"description": "A Cloud Filestore instance.",
"id": "Instance",
@ -790,7 +983,7 @@
"type": "object"
},
"Status": {
"description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.",
"description": "The `Status` type defines a logical error model that is suitable for\ndifferent programming environments, including REST APIs and RPC APIs. It is\nused by [gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error\nmessage, and error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.",
"id": "Status",
"properties": {
"code": {

View File

@ -1,4 +1,4 @@
// Copyright 2018 Google Inc. All rights reserved.
// Copyright 2019 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
@ -6,13 +6,35 @@
// Package file provides access to the Cloud Filestore API.
//
// See https://cloud.google.com/filestore/
// For product documentation, see: https://cloud.google.com/filestore/
//
// Creating a client
//
// Usage example:
//
// import "google.golang.org/api/file/v1beta1"
// ...
// fileService, err := file.New(oauthHttpClient)
// ctx := context.Background()
// fileService, err := file.NewService(ctx)
//
// In this example, Google Application Default Credentials are used for authentication.
//
// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
//
// Other authentication options
//
// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
//
// fileService, err := file.NewService(ctx, option.WithAPIKey("AIza..."))
//
// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
//
// config := &oauth2.Config{...}
// // ...
// token, err := config.Exchange(ctx, ...)
// fileService, err := file.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See https://godoc.org/google.golang.org/api/option/ for details on options.
package file // import "google.golang.org/api/file/v1beta1"
import (
@ -29,6 +51,8 @@ import (
gensupport "google.golang.org/api/gensupport"
googleapi "google.golang.org/api/googleapi"
option "google.golang.org/api/option"
htransport "google.golang.org/api/transport/http"
)
// Always reference these packages, just in case the auto-generated code
@ -56,6 +80,32 @@ const (
CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
)
// NewService creates a new Service.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
scopesOption := option.WithScopes(
"https://www.googleapis.com/auth/cloud-platform",
)
// NOTE: prepend, so we don't override user-specified scopes.
opts = append([]option.ClientOption{scopesOption}, opts...)
client, endpoint, err := htransport.NewClient(ctx, opts...)
if err != nil {
return nil, err
}
s, err := New(client)
if err != nil {
return nil, err
}
if endpoint != "" {
s.BasePath = endpoint
}
return s, nil
}
// New creates a new Service. It uses the provided http.Client for requests.
//
// Deprecated: please use NewService instead.
// To provide a custom HTTP client, use option.WithHTTPClient.
// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
@ -180,6 +230,426 @@ func (s *FileShareConfig) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleCloudSaasacceleratorManagementProvidersV1Instance: Instance
// represents the interface for SLM services to actuate the state
// of control plane resources.
//
// Example Instance in JSON, where
// consumer-project=snapchat,
// producer-project=cloud-sql:
//
// ```json
// Instance:
// {
// "name":
// "projects/snapchat/locations/us-east1/instances/prod-instance",
// "create_time": {
// "seconds": 1526406431,
// },
// "labels": {
// "env": "prod",
// "foo": "bar"
// },
// "state": READY,
// "software_version": "cloud-sql-09-28-2018",
// "maintenance_policy_names": {
// "UpdatePolicy":
//
// "projects/snapchat/locations/us-east1/maintenancePolicies/prod-update-
// policy",
// }
// "rollout_metadata": {
//
// "projects/cloud-sql/locations/global/rolloutTypes/software_update":
// {
// "release":
//
// "projects/cloud-sql/locations/global/releases/cloud-sql-09-28-2018",
// "rollout":
//
// "projects/cloud-sql/locations/us-east1/rollouts/cloud-sql-09-28-2018-c
// anary",
// }
//
// "projects/cloud-sql/locations/global/rolloutTypes/instance_restart":
// {
// "release":
//
// "projects/cloud-sql/locations/global/releases/cloud-sql-09-20-repair",
//
// "rollout":
//
// "projects/cloud-sql/locations/us-east1/rollouts/cloud-sql-09-20-repair
// -100-percent",
// }
// }
// "tenant_project_id": "cloud-sql-test-tenant",
// "producer_metadata": {
// "cloud-sql-tier": "basic",
// "cloud-sql-instance-size": "1G",
// },
// "provisioned_resources": [
// {
// "resource-type": "compute-instance",
// "resource-url":
//
// "https://www.googleapis.com/compute/v1/projects/cloud-sql/zones/us-eas
// t1-b/instances/vm-1",
// }
// ],
// }
// ```
type GoogleCloudSaasacceleratorManagementProvidersV1Instance struct {
// CreateTime: Output only. Timestamp when the resource was created.
CreateTime string `json:"createTime,omitempty"`
// Labels: Optional. Resource labels to represent user provided
// metadata. Each label
// is a key-value pair, where both the key and the value are arbitrary
// strings
// provided by the user.
Labels map[string]string `json:"labels,omitempty"`
// MaintenancePolicyNames: The MaintenancePolicies that have been
// attached to the instance.
// The key must be of the type name of the oneof policy name defined
// in
// MaintenancePolicy, and the referenced policy must define the same
// policy
// type. For complete details of MaintenancePolicy, please refer
// to
// //depot/google3/google/cloud/saasaccelerator/maintenancepolicy/api/
// v1/maintenance_policy_resources.proto
MaintenancePolicyNames map[string]string `json:"maintenancePolicyNames,omitempty"`
// Name: Unique name of the resource. It uses the form:
//
// `projects/{project_id}/locations/{location_id}/instances/{instance_id}
// `
Name string `json:"name,omitempty"`
// ProducerMetadata: Output only. Custom string attributes used
// primarily to expose
// producer-specific information in monitoring dashboards.
// See go/get-instance-metadata.
ProducerMetadata map[string]string `json:"producerMetadata,omitempty"`
// ProvisionedResources: Output only. The list of data plane resources
// provisioned for this
// instance, e.g. compute VMs. See go/get-instance-metadata.
ProvisionedResources []*GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource `json:"provisionedResources,omitempty"`
// RolloutMetadata: The map between RolloutType and the corresponding
// RolloutMetadata.
// This is only mutated by rollout service. For actuation
// implementation,
// this information is pass-through for Rollout management. Producer
// shall
// not modify by itself.
// For update of a single entry in this map, the update field mask
// shall
// follow this sementics: go/advanced-field-masks
RolloutMetadata map[string]GoogleCloudSaasacceleratorManagementProvidersV1RolloutMetadata `json:"rolloutMetadata,omitempty"`
// SloMetadata: Output only. SLO metadata for instance classification in
// the
// Standardized dataplane SLO platform.
// See go/cloud-ssa-standard-slo for feature description.
SloMetadata *GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata `json:"sloMetadata,omitempty"`
// SoftwareVersions: Software versions that are used to deploy this
// instance. This can be
// mutated by rollout services.
SoftwareVersions map[string]string `json:"softwareVersions,omitempty"`
// State: Output only. Current lifecycle state of the resource (e.g. if
// it's being
// created or ready to use).
//
// Possible values:
// "STATE_UNSPECIFIED" - Unspecified state.
// "CREATING" - Instance is being created.
// "READY" - Instance has been created and is ready to use.
// "UPDATING" - Instance is being updated.
// "REPAIRING" - Instance is unheathy and under repair.
// "DELETING" - Instance is being deleted.
State string `json:"state,omitempty"`
// TenantProjectId: Output only. ID of the associated GCP tenant
// project.
// See go/get-instance-metadata.
TenantProjectId string `json:"tenantProjectId,omitempty"`
// UpdateTime: Output only. Timestamp when the resource was last
// modified.
UpdateTime string `json:"updateTime,omitempty"`
// ForceSendFields is a list of field names (e.g. "CreateTime") 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. "CreateTime") 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 *GoogleCloudSaasacceleratorManagementProvidersV1Instance) MarshalJSON() ([]byte, error) {
type NoMethod GoogleCloudSaasacceleratorManagementProvidersV1Instance
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleCloudSaasacceleratorManagementProvidersV1NotificationMetadata:
// NotificationMetadata is the notification state for an instance.
type GoogleCloudSaasacceleratorManagementProvidersV1NotificationMetadata struct {
// Rescheduled: Whether the instance update has been rescheduled.
Rescheduled bool `json:"rescheduled,omitempty"`
// ScheduledEndTime: The scheduled end time for the maintenance window
// during which update
// can be performed on the instance.
ScheduledEndTime string `json:"scheduledEndTime,omitempty"`
// ScheduledStartTime: The scheduled start time for the maintenance
// window during which
// update can be performed on the instance.
ScheduledStartTime string `json:"scheduledStartTime,omitempty"`
// TargetRelease: The target release to be applied to the instance.
TargetRelease string `json:"targetRelease,omitempty"`
// ForceSendFields is a list of field names (e.g. "Rescheduled") 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. "Rescheduled") 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 *GoogleCloudSaasacceleratorManagementProvidersV1NotificationMetadata) MarshalJSON() ([]byte, error) {
type NoMethod GoogleCloudSaasacceleratorManagementProvidersV1NotificationMetadata
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource:
// Describes provisioned dataplane resources.
type GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource struct {
// ResourceType: Type of the resource. This can be either a GCP resource
// or a custom one
// (e.g. another cloud provider's VM). For GCP compute resources use
// singular
// form of the names listed in GCP compute API
// documentation
// (https://cloud.google.com/compute/docs/reference/rest/v1
// /), prefixed with
// 'compute-', for example: 'compute-instance',
// 'compute-disk',
// 'compute-autoscaler'.
ResourceType string `json:"resourceType,omitempty"`
// ResourceUrl: URL identifying the resource,
// e.g.
// "https://www.googleapis.com/compute/v1/projects/...)".
ResourceUrl string `json:"resourceUrl,omitempty"`
// ForceSendFields is a list of field names (e.g. "ResourceType") 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. "ResourceType") 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 *GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource) MarshalJSON() ([]byte, error) {
type NoMethod GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleCloudSaasacceleratorManagementProvidersV1RolloutMetadata:
// RolloutMetadata for an actuation instance. It maps to a single
// RolloutType.
type GoogleCloudSaasacceleratorManagementProvidersV1RolloutMetadata struct {
// Notification: Instance level notification metadata.
Notification *GoogleCloudSaasacceleratorManagementProvidersV1NotificationMetadata `json:"notification,omitempty"`
// ReleaseName: The last Release that has been applied to the instance.
ReleaseName string `json:"releaseName,omitempty"`
// RolloutName: The last rollout that has been applied to the instance.
RolloutName string `json:"rolloutName,omitempty"`
// ForceSendFields is a list of field names (e.g. "Notification") 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. "Notification") 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 *GoogleCloudSaasacceleratorManagementProvidersV1RolloutMetadata) MarshalJSON() ([]byte, error) {
type NoMethod GoogleCloudSaasacceleratorManagementProvidersV1RolloutMetadata
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion: A
// temporal SLO exclusion specification.
type GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion struct {
// ExclusionDuration: Exclusion duration. No restrictions on the
// possible values.
//
// When an ongoing operation is taking longer than initially
// expected,
// an existing entry in the exclusion list can be updated by extending
// the
// duration. This is supported by the subsystem exporting eligibility
// data
// as long as such extension is committed at least 10 minutes before
// the
// original exclusion expiration - otherwise it is possible that there
// will
// be "gaps" in the exclusion application in the exported timeseries.
ExclusionDuration string `json:"exclusionDuration,omitempty"`
// ExclusionStartTime: Start time of the exclusion. No alignment (e.g.
// to a full minute) needed.
ExclusionStartTime string `json:"exclusionStartTime,omitempty"`
// Reason: Human-readable reason for the exclusion.
// This should be a static string (e.g. "Disruptive update in
// progress")
// and should not contain dynamically generated data (e.g. instance
// name).
// Can be left empty.
Reason string `json:"reason,omitempty"`
// SloName: Name of an SLI/SLO that this exclusion applies to. Can be
// left empty,
// signaling that the instance should be excluded from all SLI/SLOs
// defined
// in the service SLO configuration.
SloName string `json:"sloName,omitempty"`
// ForceSendFields is a list of field names (e.g. "ExclusionDuration")
// 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. "ExclusionDuration") 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 *GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion) MarshalJSON() ([]byte, error) {
type NoMethod GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata:
// SloMetadata contains resources required for proper SLO classification
// of the
// instance.
type GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata struct {
// Exclusions: List of SLO exclusion windows. When multiple entries in
// the list match
// (matching the exclusion time-window against current time point)
// the exclusion reason used in the first matching entry will be
// published.
//
// It is not needed to include expired exclusion in this list, as only
// the
// currently applicable exclusions are taken into account by the
// eligibility
// exporting subsystem (the historical state of exclusions will be
// reflected
// in the historically produced timeseries regardless of the current
// state).
//
// This field can be used to mark the instance as temporary
// ineligible
// for the purpose of SLO calculation. For permanent instance SLO
// exclusion,
// a dedicated tier name can be used that does not have targets
// specified
// in the service SLO configuration.
Exclusions []*GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion `json:"exclusions,omitempty"`
// Tier: Name of the SLO tier the Instance belongs to. This name will be
// expected to
// match the tiers specified in the service SLO configuration.
//
// Field is mandatory and must not be empty.
Tier string `json:"tier,omitempty"`
// ForceSendFields is a list of field names (e.g. "Exclusions") 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. "Exclusions") 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 *GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata) MarshalJSON() ([]byte, error) {
type NoMethod GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Instance: A Cloud Filestore instance.
type Instance struct {
// CreateTime: Output only.
@ -638,20 +1108,20 @@ func (s *OperationMetadata) MarshalJSON() ([]byte, error) {
}
// 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:
// 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 needs
//
// # Overview
//
// The `Status` message contains three pieces of data: error code, error
// message,
// and error details. The error code should be an enum value
// The `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

View File

@ -9,6 +9,7 @@ import (
"fmt"
"io"
"io/ioutil"
"mime"
"mime/multipart"
"net/http"
"net/textproto"
@ -115,11 +116,15 @@ type multipartReader struct {
pipeOpen bool
}
func newMultipartReader(parts []typeReader) *multipartReader {
// boundary optionally specifies the MIME boundary
func newMultipartReader(parts []typeReader, boundary string) *multipartReader {
mp := &multipartReader{pipeOpen: true}
var pw *io.PipeWriter
mp.pr, pw = io.Pipe()
mpw := multipart.NewWriter(pw)
if boundary != "" {
mpw.SetBoundary(boundary)
}
mp.ctype = "multipart/related; boundary=" + mpw.Boundary()
go func() {
for _, part := range parts {
@ -163,10 +168,15 @@ func (mp *multipartReader) Close() error {
//
// The caller must call Close on the returned ReadCloser if reads are abandoned before reaching EOF.
func CombineBodyMedia(body io.Reader, bodyContentType string, media io.Reader, mediaContentType string) (io.ReadCloser, string) {
return combineBodyMedia(body, bodyContentType, media, mediaContentType, "")
}
// combineBodyMedia is CombineBodyMedia but with an optional mimeBoundary field.
func combineBodyMedia(body io.Reader, bodyContentType string, media io.Reader, mediaContentType, mimeBoundary string) (io.ReadCloser, string) {
mp := newMultipartReader([]typeReader{
{body, bodyContentType},
{media, mediaContentType},
})
}, mimeBoundary)
return mp, mp.ctype
}
@ -284,7 +294,11 @@ func (mi *MediaInfo) UploadRequest(reqHeaders http.Header, body io.Reader) (newB
getBody = func() (io.ReadCloser, error) {
rb := ioutil.NopCloser(fb())
rm := ioutil.NopCloser(fm())
r, _ := CombineBodyMedia(rb, "application/json", rm, mi.mType)
var mimeBoundary string
if _, params, err := mime.ParseMediaType(ctype); err == nil {
mimeBoundary = params["boundary"]
}
r, _ := combineBodyMedia(rb, "application/json", rm, mi.mType, mimeBoundary)
return r, nil
}
}
@ -336,7 +350,14 @@ func (mi *MediaInfo) ResumableUpload(locURI string) *ResumableUpload {
}
}
// SetGetBody sets the GetBody field of req to f.
// SetGetBody sets the GetBody field of req to f. This was once needed
// to gracefully support Go 1.7 and earlier which didn't have that
// field.
//
// Deprecated: the code generator no longer uses this as of
// 2019-02-19. Nothing else should be calling this anyway, but we
// won't delete this immediately; it will be deleted in as early as 6
// months.
func SetGetBody(req *http.Request, f func() (io.ReadCloser, error)) {
req.GetBody = f
}

View File

@ -189,32 +189,6 @@ func (wrap MarshalStyle) JSONReader(v interface{}) (io.Reader, error) {
return buf, nil
}
// endingWithErrorReader from r until it returns an error. If the
// final error from r is io.EOF and e is non-nil, e is used instead.
type endingWithErrorReader struct {
r io.Reader
e error
}
func (er endingWithErrorReader) Read(p []byte) (n int, err error) {
n, err = er.r.Read(p)
if err == io.EOF && er.e != nil {
err = er.e
}
return
}
// countingWriter counts the number of bytes it receives to write, but
// discards them.
type countingWriter struct {
n *int64
}
func (w countingWriter) Write(p []byte) (int, error) {
*w.n += int64(len(p))
return len(p), nil
}
// ProgressUpdater is a function that is called upon every progress update of a resumable upload.
// This is the only part of a resumable upload (from googleapi) that is usable by the developer.
// The remaining usable pieces of resumable uploads is exposed in each auto-generated API.

Some files were not shown because too many files have changed in this diff Show More